无人机管理后台前端(已迁走)
张含笑
2025-09-01 2ca94de8ede18ac07ccfd8dec7b6f6a707adde9b
src/utils/util.js
@@ -459,6 +459,16 @@
   return `${url.substring(0, lastDotIndex)}_show${url.substring(lastDotIndex)}`
}
/**
 * 获取正射路径
 * @param url
 * @returns {string}
 */
export const getzsShowImg = url => {
   if (!url) return ''
   const lastDotIndex = url.lastIndexOf('.')
   return `${url.substring(0, lastDotIndex)}_show.jpeg`
}
// key驼峰转换为下划线
export function camelToSnake (obj) {
  if (typeof obj !== 'object' || obj === null) {
@@ -477,4 +487,16 @@
    }
  }
  return newObj
}
}
// a链接直接下载
export const aLinkDownloadUtil = (url, name) => {
  let a = document.createElement('a')
  a.style.display = 'none'
  a.href = url
  a.download = name
  document.body.appendChild(a)
  a.click()
  document.body.removeChild(a)
  a = null
}