king
2022-01-21 46f79b491173d284a4900d19e7aecf7509481438
src/utils/utils.js
@@ -707,14 +707,16 @@
  static getSelectQueryOptions (item) {
    let arrfield = [item.valueField, item.valueText]
    if (item.type === 'link') {
      arrfield.push(item.linkField)
    } else if (item.type === 'checkcard') {
    if (item.type === 'checkcard') {
      arrfield = item.fields.map(f => f.field)
      arrfield.push(item.cardValField)
      if (item.urlField) {
        arrfield.push(item.urlField)
      }
    }
    if (item.linkField) {
      arrfield.push(item.linkField)
    }
    if (['select', 'radio', 'link', 'checkcard'].includes(item.type) && item.linkSubField && item.linkSubField.length > 0) {
      arrfield.push(...item.linkSubField)
@@ -2040,6 +2042,75 @@
}
/**
 * @description 获取标记信息
 */
export function getMark (marks, record, style = {}) {
  let icon = null
  let color = null
  let position = null
  marks.some(mark => {
    let originVal = record[mark.field[0]] + ''
    let contrastVal = ''
    let result = false
    if (mark.field[1] === 'static') {
      contrastVal = mark.contrastValue + ''
    } else {
      contrastVal = record[mark.field[2]] + ''
    }
    if (mark.match === '=') {
      result = originVal === contrastVal
    } else if (mark.match === '!=') {
      result = originVal !== contrastVal
    } else if (mark.match === 'like') {
      result = originVal.indexOf(contrastVal) > -1
    } else if (mark.match === '>') {
      result = parseFloat(originVal) > parseFloat(contrastVal)
    } else if (mark.match === '<') {
      result = parseFloat(originVal) < parseFloat(contrastVal)
    }
    if (!result) return false
    let type = mark.signType[0]
    if (type === 'font') {
      style.color = mark.color
    } else if (type === 'background') {
      style.background = mark.color
      if (mark.fontColor) {
        style.color = mark.fontColor
      }
    } else if (type === 'underline') {
      style.textDecoration = 'underline'
      style.color = mark.color
    } else if (type === 'line-through') {
      style.textDecoration = 'line-through'
      style.color = mark.color
    } else if (type.indexOf('icon') > -1) {
      icon = mark.signType[mark.signType.length - 1]
      color = mark.color
      if (type === 'iconfront' || mark.signType[1] === 'front') {
        position = 'front'
      } else {
        position = 'back'
      }
    }
    return true
  })
  return {
    style,
    icon,
    color,
    position
  }
}
/**
 * @description 生成替换函数列表
 */
export function setGLOBFuncs () {