Commit 6e96394b by 李伟康

修改样式

1 parent fb803fe2
......@@ -276,7 +276,7 @@ export default {
backgroundColor: 'rgba(68,68,68,0.80)',
textStyle: {
color: '#FFFFFF',
fontSize: '8px'
fontSize: this.setChartFontSize(8)
},
show: true,
formatter: ([value]) => {
......@@ -289,7 +289,7 @@ export default {
show: true,
interval: queryType == 0 ? 0 : 6,
color: '#606266',
fontSize: '0.8em',
fontSize: this.setChartFontSize(10),
margin: 20,
showMaxLabel: true
},
......@@ -312,6 +312,9 @@ export default {
color: '#606266'
}
},
axisLabel: {
fontSize: this.setChartFontSize(10)
},
splitNumber: 5
},
series: [
......
......@@ -39,113 +39,13 @@ const throttle = (fn, gapTime) => {
}
}
}
/**防止重复点击 */
const showLoading = (title = '加载中...', callBack, custom) => {
// Toast({
// type: 'loading',
// message: title,
// forbidClick: true,
// duration: 0
// })
// if (callBack && typeof callBack == 'function') {
// if (!custom) Toast.clear()
// callBack()
// }
}
const hideLoading = () => {
// Toast.clear()
}
/**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
const showToast = (message = '', callBack) => {
// let params = {
// message,
// forbidClick: true,
// duration: 1500
// }
// Toast(params)
// if (callBack && typeof callBack == 'function') {
// setTimeout(() => {
// callBack()
// }, 1500)
// }
}
/**触摸样式 */
const touchstart = e => {
e.target.classList.add('btn-on-leave')
}
const touchend = e => {
e.target.classList.remove('btn-on-leave')
}
const setSessionId = val => {
window.localStorage.setItem('dj_scrm_session_id', val)
}
const getSessionId = () => {
return window.localStorage.getItem('dj_scrm_session_id')
}
const clearSessionId = () => {
window.localStorage.removeItem('dj_scrm_session_id')
}
const setLocalStorage = (key, item) => {
window.localStorage.setItem(key, JSON.stringify(item))
// sessionStorage.setItem(key, JSON.stringify(item))
}
const getLocalStorage = key => {
return JSON.parse(window.localStorage.getItem(key))
// return JSON.parse(sessionStorage.getItem(key))
}
const removeLocalStorage = key => {
window.localStorage.removeItem(key)
// sessionStorage.removeItem(key)
}
const dialog = (params = {}) => {
// if (!params.confirmButtonColor) params.confirmButtonColor = '#FF7336'
// return Dialog.confirm(params)
}
/**拨打电话 */
const makePhoneCall = phoneNumber => {
window.location.href = `tel://${phoneNumber}`
}
/**是否全面屏 */
const isFullSucreen = () => {
let result = false
const rate = window.screen.height / window.screen.width
let limit = window.screen.height == window.screen.availHeight ? 1.8 : 1.65 // 临界判断值
result = rate > limit
return result
}
const jumpChildrenPage = (to, params) => {
let { name } = window.vm._route
window.vm.$router.push({ name: `${name}.${to}`, params })
}
/**拷贝 */
const setClipboardData = data => {
let transfer = document.createElement('input')
document.body.appendChild(transfer)
transfer.value = data
transfer.focus()
transfer.select()
if (document.execCommand('copy')) document.execCommand('copy')
transfer.blur()
// Toast('内容已复制')
document.body.removeChild(transfer)
}
/**接口请求时失败让用户刷新 */
const refreshPage = (message = '系统异常') => {
// return Dialog.alert({
// message,
// theme: 'round-button',
// confirmButtonText: '点击重试',
// confirmButtonColor: '#FF7336'
// })
}
const toTop = () => {
let bodySrcollTop = document.body.scrollTop
if (bodySrcollTop !== 0) {
......@@ -171,9 +71,6 @@ const getQuery = name => {
})
return name ? obj[name] : obj
}
const closeWindow = () => {
wx.closeWindow()
}
/** 三个数字加一个逗号 */
const numAddSymbol = val => {
......@@ -201,44 +98,32 @@ const getNMonth = (n, fmt = 'yyyy-MM-dd') => {
return new Date(new Date().setMonth(new Date().getMonth() + n)).format(fmt)
}
const debounce = function(func, wait = 200) {
const debounce = function (func, wait = 200) {
let timeout
return function(event) {
return function (event) {
clearTimeout(timeout)
timeout = setTimeout(() => {
func.call(this, event)
}, wait)
}
}
const setChartFontSize = fontSize => {
let clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
if (!clientWidth) return fontSize
return fontSize * clientWidth / 1440
}
const utils = {
removeLocalStorage,
setClipboardData,
jumpChildrenPage,
setLocalStorage,
getLocalStorage,
clearSessionId,
makePhoneCall,
isFullSucreen,
setSessionId,
getSessionId,
showLoading,
closeWindow,
hideLoading,
refreshPage,
touchstart,
showToast,
getParams,
getQuery,
touchend,
throttle,
decimal,
dialog,
toTop,
numAddSymbol,
getCurrentDate,
getNDate,
getNMonth,
debounce
debounce,
setChartFontSize
}
Object.keys(utils).map(key => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!