1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00

add global function for icons (#522)

This commit is contained in:
elsiosanchez 2020-06-19 09:51:02 -04:00 committed by GitHub
parent ed083ba3d5
commit 6dd649e020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 0 deletions

View File

@ -2,6 +2,7 @@
export {
zeroPad,
tagStatus,
iconStatus,
calculationValue,
clearVariables
} from '@/utils/ADempiere/valueUtils.js'

View File

@ -13,6 +13,14 @@ export function isEmptyValue(value) {
return isEmptyValue(value)
}
export function extractPagingToken(token) {
let onlyToken = token.slice(0, -2)
if (onlyToken.substr(-1, 1) === '-') {
onlyToken = onlyToken.slice(0, -1)
}
return onlyToken
}
export function typeValue(value) {
if (typeof value === 'undefined' || value == null) {
return value
@ -337,6 +345,43 @@ export function tagStatus(tag) {
}
return type
}
/**
* add a tab depending on the status of the document
* @param {string} tag, document status key
*/
export function iconStatus(iconElment) {
let icon
switch (iconElment) {
case 'A':
icon = 'el-icon-wallet'
break
case 'M':
icon = 'el-icon-wallet'
break
case 'K':
icon = 'el-icon-postcard'
break
case 'X':
icon = 'el-icon-money'
break
case 'Z':
icon = 'el-icon-coin'
break
case 'T':
icon = 'el-icon-bank-card'
break
case 'P':
icon = 'el-icon-mobile'
break
case 'C':
icon = 'el-icon-bank-card'
break
case 'D':
icon = 'el-icon-bank-card'
break
}
return icon
}
let partialValue = ''
export function calculationValue(value, event) {