This commit is contained in:
quantulr
2022-10-19 00:22:03 +08:00
parent 656b6ef510
commit fd5e278fa7
12 changed files with 477 additions and 139 deletions

View File

@ -35,19 +35,19 @@ export const enterpriseOptions = [
];
// 成果成熟度 技术
export const maturityOptions = [
{ key: 1, value: "正在研发" },
{ key: 2, value: "小试阶段" },
{ key: 3, value: "通过小试" },
{ key: 4, value: "中试阶段" },
{ key: 5, value: "通过中试" },
{ key: 6, value: "可规模生产" },
{ key: "1", value: "正在研发" },
{ key: "2", value: "小试阶段" },
{ key: "3", value: "通过小试" },
{ key: "4", value: "中试阶段" },
{ key: "5", value: "通过中试" },
{ key: "6", value: "可规模生产" },
];
// 成果领先型 领先标准
export const leadOptions = [
{ key: 1, value: "国内先进" },
{ key: 2, value: "国内领先" },
{ key: 3, value: "国际先进" },
{ key: 4, value: "国际领先" },
{ key: "1", value: "国内先进" },
{ key: "2", value: "国内领先" },
{ key: "3", value: "国际先进" },
{ key: "4", value: "国际领先" },
];
// 专利类型
export const patentOptions = [
@ -57,13 +57,13 @@ export const patentOptions = [
];
// 合作模式
export const cooperationOptions = [
{ key: 101, value: "技术转让" },
{ key: 102, value: "技术许可" },
{ key: 103, value: "技术入股" },
{ key: 104, value: "合作开发" },
{ key: 105, value: "融资" },
{ key: 106, value: "公司" },
{ key: 107, value: "代理加盟" },
{ key: 108, value: "市场推广" },
{ key: 109, value: "其他" },
{ key: "101", value: "技术转让" },
{ key: "102", value: "技术许可" },
{ key: "103", value: "技术入股" },
{ key: "104", value: "合作开发" },
{ key: "105", value: "融资" },
{ key: "106", value: "公司" },
{ key: "107", value: "代理加盟" },
{ key: "108", value: "市场推广" },
{ key: "109", value: "其他" },
];

View File

@ -154,5 +154,30 @@ export function download(url, params, filename) {
downloadLoadingInstance.close();
})
}
export function customDownload(url, params, filename) {
downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)", })
return service.get(url, params, {
baseURL:"",
transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob'
}).then(async (data) => {
const isLogin = await blobValidate(data);
if (isLogin) {
const blob = new Blob([data])
saveAs(blob, filename)
} else {
const resText = await data.text();
const rspObj = JSON.parse(resText);
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
ElMessage.error(errMsg);
}
downloadLoadingInstance.close();
}).catch((r) => {
console.error(r)
ElMessage.error('下载文件出现错误,请联系管理员!')
downloadLoadingInstance.close();
})
}
export default service