//片段打标签操作栏的宽度
export const textAreaToolWidth = 166
//文档对比 -渲染文档结构定义
const documentFile={
  "DocId": 4,//文档id
  "Title": "文档2标题",//文档标题
  "Theme": "主题2",//文档主题
  "ClassifyName": "文档分类2",//文档所属分类
  SectionList:[//文档段落
    {
      SectionId:1,//段落id
      innerText:'标题标题',//段落纯文本
      isHasThisLabel:false,//该段落是否在当前打了标签 取决于isThisLabelArr.length
      isSelectLabel:true,//该段落是否被标签筛选选择
      isThisLabelArr:[{//该段落当前打的标签
        LabelId:1,
        LabelName:'标签1',
      }],
      isHistoryLabelArr:[{//从LabelList提取的,历史(我的)打的标签
        LabelId:2,
        LabelName:'标签2'
      }],
      isOtherLabelArr:[{//从LabelList提取的,历史(其他人)打的标签
        LabelId:3,
        LabelName:'标签3'
      }],
      LabelList:[//该段落被打的所有标签
        {
          "LabelId": 1,//标签id
          "LabelName": "标签1",//标签名称
          "IsThis": 0,//是否是当前打的标签
          "IsHistory": 1,//是否是历史打的标签
          "IsOther": 1,//是否是其他人打的标签
        },
      ],
      Ispart:0,//这项数据是否是片段 是1 否0
    },{
        SectionId:1,
        innerText:'标题',
        isHasThisLabel:false,
        isSelectLabel:false,
        isThisLabelArr:[],
        isHistoryLabelArr:[],
        isOtherLabelArr:[],
        LabelList:[],
        Ispart:1,//该项数据是片段
        startOffset:2,//片段在段落内的开始下标
        endOffset:24,//片段在段落内的结束下标
        areaRangeInfo:areaRangeInfo,//选定文字Range信息,加载完页面后才有值
    },
    {
      SectionId:2,
      innerText:'这是一段短短的段落',
      isHasThisLabel:true,
      isSelectLabel:false,
      isThisLabelArr:[],
      isHistoryLabelArr:[],
      isOtherLabelArr:[],
      LabelList:[
        {
          "LabelId": 1,
          "LabelName": "本次打的标签",
          "IsThis": 1,
          "IsHistory": 1,
          "IsOther": 1
        },
      ],
    }
  ]
}
//文档对比 -选定文字Range信息
const areaRangeInfo = {
    //$(`#${text.SectionId}`)[0].childNodes[0]
    ParentNode:Node,//选定文字所属段落,根据SectionId找到对应p标签下的文本节点
    //从range.getBoundingClientRect获取
    BoundingXRange:[321,321+308],//Range x方向的范围,[left,right]
    BoundingYRange:[447,447+16],//Range y方向的范围,[top,bottom]
    StartOffset:2,//选定文字开始下标
    EndOffset:24,//选定文字结束下标
}
//内容提取表格结构定义
const tableImgData = {
  "SaCompareId": 3,//语义分析id
  "TitleList": [//标题数组
    "文档2标题",
    "文档3标题",
    "文档4标题",
    "文档5标题"
  ],
  "ThemeList": [//主题数组
    "主题2",
    "主题3",
    "主题4",
    "主题5"
  ],
  "LabelList": [//标签数组
    {
      "SaLabelId": 1,
      "LabelName": "标签1",
      "DocList": [
        {
          "SaDocId": 3,
          "Title": "文档3标题",
          "SectionList": [
            {
              "SaDocSectionId": 9,
              "Content": "<p style=\"font-size: 16px; text-align: left;\"><strong>标题标题很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长</strong></p>"
            },
            {
              "SaDocSectionId": 13,
              "Content": "<p style=\"text-align: left; margin-top: 10px; font-size: 16px;\">这是一段新增的段落</p>"
            }
          ]
        },
        {
          "SaDocId": 4,
          "Title": "文档2标题",
          "SectionList": []
        },{
          "SaDocId":5,
          "SectionList":[]
        },
        {
          "SaDocId":6,
          "SectionList":[]
        }
      ]
    },
    {
      "SaLabelId": 3,
      "LabelName": "标签3",
      "DocList": [
        {
          "SaDocId": 3,
          "Title": "文档3标题",
          "SectionList": [
            {
              "SaDocSectionId": 9,
              "Content": "<p style=\"font-size: 16px; text-align: left;\"><strong>标题标题</strong></p>"
            }
          ]
        },
        {
          "SaDocId": 4,
          "Title": "文档2标题",
          "SectionList": [
            {
              "SaDocSectionId": 16,
              "Content": "<p>    啊哈哈哈哈嘿嘿嘿~</p>"
            }
          ]
        },{
          "SaDocId":5,
          "SectionList":[]
        },
        {
          "SaDocId":6,
          "SectionList":[]
        }
      ]
    },
    {
      "SaLabelId": 4,
      "LabelName": "标签4",
      "DocList": [
        {
          "SaDocId": 3,
          "Title": "文档3标题",
          "SectionList": [
            {
              "SaDocSectionId": 13,
              "Content": "<p style=\"text-align: left; margin-top: 10px; font-size: 16px;\">这是一段新增的段落</p>"
            }
          ]
        },
        {
          "SaDocId": 4,
          "Title": "文档2标题",
          "SectionList": []
        },{
          "SaDocId":5,
          "SectionList":[]
        },
        {
          "SaDocId":6,
          "SectionList":[]
        }
      ]
    },
    {
      "SaLabelId": 2,
      "LabelName": "标签2",
      "DocList": [
        {
          "SaDocId": 3,
          "Title": "文档3标题",
          "SectionList": []
        },
        {
          "SaDocId": 4,
          "Title": "文档2标题",
          "SectionList": [
            {
              "SaDocSectionId": 14,
              "Content": "<p><strong>标题标题</strong></p>"
            }
          ]
        },{
          "SaDocId":5,
          "SectionList":[]
        },
        {
          "SaDocId":6,
          "SectionList":[]
        }
      ]
    }
  ]
}
export const defaultLabel = {
  SaLabelId:1,
  LabelName:'暂无关键词',
  DocList:[{
    SaDocId:1,
    SectionList:[{
      SaDocSectionId:1,
      innerText:'暂无内容'
    }]
  }]
}
//标签管理 table column
export const tagPageColumnList = [
  {
    label:'标签名称',
    key:'LabelName'
  },
  {
    label:'内容数量',
    key:'UserNum'
  },
  {
    label:'创建时间',
    key:'CreateTime'
  }
]

//富文本编辑器设置
export const froalaConfig = {
  toolbarButtons: [
    "bold",
    "italic",
    "underline",
    "strikeThrough",
    "fontSize",
    "align",
    "undo",
    "redo",
  ],
  /* heightMin:600, */
  editorClass: 'document-fr-custom-class',
  fontSizeDefaultSelection: "16",
  quickInsertEnabled: false,
  theme: "dark", //主题
  placeholderText:'请输入文章内容',
  language: "zh_cn",
  //格式化粘贴的文字 不判断是否来自word
  wordPasteKeepFormatting:false,
  pastePlain:true,
  wordPasteModal:false,
  pasteDeniedTags:['ol','li']
}

//icon map 方便管理
export const toolIcon={
  'search':require('@/assets/img/document_m/search.png'),
  'eye':require('@/assets/img/document_m/eye.png'),
  'document':require('@/assets/img/document_m/document.png'),
  'save':require('@/assets/img/document_m/save.png'),
  'save-other':require('@/assets/img/document_m/save-other.png'),
}

//新建/编辑 语义分析的操作栏
export const toolBtnArr = [
 /*  {
    text:'全部标签',
    icon:'eye',
    type:'selectLabel'
  }, */
  {
    text:'选择对比文档',
    icon:'document',
    type:'selectFile'
  },
  {
    text:'保存',
    icon:'save',
    type:'saveFile'
  },
  {
    text:'另存为',
    icon:'save-other',
    type:'saveOther'
  },
]

//新建/编辑 语义分析控制弹窗展示map
export const dialogMap = {
  'search':'isSearchBoxShow',
  'selectLabel':'isSelectLabelShow',
  'selectFile':'isSelectFileShow',
  'saveFile':'isSaveFileShow',
  'saveOther':'isSaveFileShow',
  'addSectionLabel':'isAddSectionLabelShow'
}
