| | |
| | | export const getOccupationName = (id) => { |
| | | const { occupationItems } = useOptionItemsStore() |
| | | const obj = occupationItems.find(ele => ele.id == id) |
| | | |
| | | |
| | | return obj?.occupationJob || '' |
| | | } |
| | | |
| | |
| | | const { occupationItems } = useOptionItemsStore() |
| | | const occupation = occupationItems.find(ele => ele.code == occupationCode) |
| | | if (!occupation) return '' |
| | | |
| | | |
| | | const job = occupation.jobs?.find(ele => ele.jobCode == jobCode) |
| | | if (!job) return '' |
| | | |
| | |
| | | link.href = url.includes('http') ? url : $qxueyou.qxyRes + url ; |
| | | link.download = filename || '文件'; |
| | | link.style.display = 'none'; |
| | | |
| | | |
| | | // 添加到文档并触发点击 |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | |
| | | |
| | | export const uploadByBase64 = async function(base64, fileName, fileType = 'png') { |
| | | if (!base64) return null |
| | | |
| | | |
| | | let blob = getBlobByBase64(base64, fileType) |
| | | if (!blob) return null |
| | | |
| | |
| | | } |
| | | } |
| | | xhr.onerror = (evt) => { // 上传失败回调 |
| | | store.commit("snack/error", "上传失败!") |
| | | // store.commit("snack/error", "上传失败!") |
| | | console.log(JSON.stringify(evt.target)) |
| | | resolve(false) |
| | | } |
| | |
| | | |
| | | export const getFileUrlType = (url = '') => { |
| | | if (!url) return false; |
| | | |
| | | const suffix = url.split('.').pop().toLowerCase() |
| | | |
| | | const suffix = url.split('.').pop().toLowerCase() |
| | | const imageExtensions = [ |
| | | 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', |
| | | 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', |
| | | 'svg', 'tiff', 'tif', 'ico', 'jfif', 'pjpeg', 'pjp', |
| | | 'apng', 'avif', 'heic', 'heif' |
| | | ]; |