Blame view

src/utils/filter.js 2.37 KB
1
/*
yuanbo committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-08-28 15:31:31
5
 */
任超 committed
6
import store from '@/store'
任超 committed
7 8
// table 内部过滤器 由于过滤器只能在模板中使用 所以 就有了 jsx内部方法过滤器
export default class filter {
yuanbo committed
9 10 11 12 13
  /**
   * @description: selected
   * @param {*} row
   * @author: renchao
   */
任超 committed
14
  selected (row) {
15
    // if (row.sfbl == 0) { // 正在办理不能申请
yuanbo committed
16
    //   return false
17 18 19 20
    // } else {
    //   return true //可选择
    // }
    return true
任超 committed
21
  }
任超 committed
22
  // 业务来源
yuanbo committed
23 24 25 26 27
  /**
   * @description: 业务来源
   * @param {*} val
   * @author: renchao
   */
任超 committed
28
  busSource (val) {
29
    let status = { 1: '办事大厅', 2: '微信小程序' }
任超 committed
30 31
    return status[val]
  }
32 33

  //申请分类(1:正常申请,2:一并申请,3:补录申请)
yuanbo committed
34 35 36 37 38
  /**
   * @description: 申请分类
   * @param {*} val
   * @author: renchao
   */
39 40 41 42
  sqfls (val) {
    let status = { 1: '正常申请', 2: '一并申请', 3: '补录申请' }
    return status[val]
  }
yuanbo committed
43 44 45 46 47 48
  /**
   * @description: 字典
   * @param {*} val
   * @param {*} code
   * @author: renchao
   */
任超 committed
49 50 51 52 53 54 55 56 57 58 59 60
  dicStatus (val, code) {
    let data = store.getters.dictData[code],
      name = '暂无'
    if (data) {
      data.map((item) => {
        if (item.dcode == val) {
          name = item.dname
        }
      })
      return name
    }
  }
yuanbo committed
61 62 63 64 65
  /**
   * @description: filterHtml
   * @param {*} content
   * @author: renchao
   */
66 67 68
  filterHtml (content) {
    return content.replace(/<[^>]+>/g, '');
  }
yuanbo committed
69 70 71 72 73
  /**
   * @description: getDictData
   * @param {*} val
   * @author: renchao
   */
74
  getDictData (val) {
75 76
    return store.getters.dictData[val]
  }
yuanbo committed
77 78 79 80 81
  /**
   * @description: yWstatus
   * @param {*} row
   * @author: renchao
   */
82 83
  yWstatus (row) {
    let text = "";
84
    let keys = 0;
85 86 87
    // 定义策略对象
    const strategies = {
      djblzt: "正在办理",
88 89 90 91 92 93 94 95
      zjgcdyzt: "在建工程抵押",
      ycfzt: "已预查封",
      cfzt: "已查封",
      diyizt: "已地役",
      yyzt: "异议中",
      xzzt: "已限制",
      ygmmzt: "已预告买卖",
      ygdyzt: "已预告抵押",
96 97
      dyzt: "已抵押",
      sfbl: "正在补录"
98 99 100 101
    };

    for (let key in row) {
      if (row[key] === 1 && strategies[key]) {
102 103 104 105 106 107
        keys++;
        if (keys == 1) {
          text += strategies[key];
        } else {
          text += ',' + strategies[key];
        }
108 109 110 111 112
      }
    }

    return text;
  }
yuanbo committed
113
}