生成代码模版文件新增了查看详情、详情内图片预览、文件下载 (#1516)
* 生成代码模版文件新增了查看详情、详情内图片预览、文件下载 前端工具文件主要修改了utils>format.js * 替换富文本组建路径 --------- Co-authored-by: CodeLucifer <tender_zhu@foxamil.com>
This commit is contained in:
committed by
GitHub
co-authored by
CodeLucifer
parent
33cb2ed43d
commit
197c4c46ab
@@ -26,3 +26,29 @@ export const getDictFunc = async(type) => {
|
||||
const dicts = await getDict(type)
|
||||
return dicts
|
||||
}
|
||||
|
||||
const path = import.meta.env.VITE_BASE_PATH + ':' + import.meta.env.VITE_SERVER_PORT + '/'
|
||||
export const ReturnArrImg = (arr) => {
|
||||
let imgArr = []
|
||||
if (arr instanceof Array){ // 如果是数组类型
|
||||
for (let arrKey in arr) {
|
||||
if (arr[arrKey].slice(0, 4) !== 'http'){
|
||||
imgArr.push(path + arr[arrKey])
|
||||
}else {
|
||||
imgArr.push(arr[arrKey])
|
||||
}
|
||||
}
|
||||
}else { // 如果不是数组类型
|
||||
if (arr.slice(0, 4) !== 'http'){
|
||||
imgArr.push(path + arr)
|
||||
}else {
|
||||
imgArr.push(arr)
|
||||
}
|
||||
}
|
||||
return imgArr
|
||||
}
|
||||
|
||||
export const onDownloadFile = (url) => {
|
||||
window.open(path + url)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user