/* api */
import { downLoadFileByPath } from '@/api/common/uploadCenter'
import { download } from '@/assets/js/utils'// 常用方法
export const commonMixins = {
  data() {
    return {
      // 公告类型
      bulletinTypeMethod: [
        { typecode: '01', typename: '采购公告' },
        { typecode: '02', typename: '二次公告' },
        { typecode: '03', typename: '二次新公告' },
        { typecode: '22', typename: '延期公告' },
        { typecode: '05', typename: '候选人公示(结果公示)' },
        { typecode: '06', typename: '结果公告' },
        { typecode: '08', typename: '废标公告' },
        { typecode: '09', typename: '标评报告' },
        { typecode: '10', typename: '询价公告' },
        { typecode: '11', typename: '变更公告' },
        { typecode: '12', typename: '竞价公告' },
        { typecode: '13', typename: '  竞价结果公告' },
        { typecode: '14', typename: '  澄清公告' },
        { typecode: '15', typename: '  采购公告' },
        { typecode: '90', typename: '  答疑公告' }
      ]
    }
  },
  methods: {

    // 下载文件
    getFile(items) {
      var params = {
        realpath: items.realpath,
        attachmenttitle: items.attachmenttitle,
        extend: items.extend
      }
      downLoadFileByPath(params).then(res => {
        download(res, items.attachmenttitle + '.' + items.extend)
      })
    }
  }
}
