import {
  getMyArticalList,
  getArticalLikeList,
  getViewArticalList,
  getDownloadArticalList,
  getEditArticalList
} from '@/api/article'


export default {
  departs:[],
  preview:"http://smoa.ndjsxh.cn:8888/preview/",
  categorys: {
    laws: "法律法规",
    mechanism: "机制制度类",
    result: "基础性成果类",
    other: "其他"
  },
  owners: {
    0: '无权限',
    1: '经办人',
    2: '负责人',
    3: '分管领导'
  },
  statusMap: {
    0: '经办提交',
    1: '科长审核',
    2: '分管确认',
    3: '发布中',
    4: '管理删除'
  },
  actions:{
    "add":'新增',
    "admin":'后台编辑',
    "confirm":'确认',
    'publish':'发布',
    'delete':'删除',
    'back':'拒绝'
  },
  openMap: {
    0: '私',
    1: '公',
    2: '删'
  },
  getDepart: (id, departs)=> {
    for (let i in departs) {
      if (departs[i].departmentId == id) {
        return departs[i]
      }
    }
    return {
      departmentId: id,
      isLeader:0,
      department: ''
    }
  },
  getLeader:( departmentId, departs)=>{
    let isLeader = 0;
    for( let i in departs){
      if( departs[i].departmentId == departmentId){
        isLeader = departs[i].isLeader;
      }
    }
    return isLeader
  },
  myfiles: [
    {
      id: "5",
      value: '我负责的文件',
      label: '我负责的文件',
      listApi: getEditArticalList
    },
    {
    id: "1",
    value: '我发布的文件',
    label: '我发布的文件',
    listApi: getMyArticalList
  },
   {
    id: "2",
    value: '我收藏的文件',
    label: '我收藏的文件',
    listApi: getArticalLikeList
  }, {
    id: "3",
    value: '最近浏览的文件',
    label: '最近浏览的文件',
    listApi: getViewArticalList
  }, {
    id: "4",
    value: '最近下载的文件',
    label: '最近下载的文件',
    listApi: getDownloadArticalList
  }
  ]
}
