Blame view

src/utils/filter.js 2.38 KB
1
/*
yuanbo committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-07-17 13:31:39
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]
  }
任超 committed
43
  // 字典
yuanbo committed
44 45 46 47 48 49
  /**
   * @description: 字典
   * @param {*} val
   * @param {*} code
   * @author: renchao
   */
任超 committed
50 51 52 53 54 55 56 57 58 59 60 61
  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
62 63 64 65 66
  /**
   * @description: filterHtml
   * @param {*} content
   * @author: renchao
   */
67 68 69
  filterHtml (content) {
    return content.replace(/<[^>]+>/g, '');
  }
yuanbo committed
70 71 72 73 74
  /**
   * @description: getDictData
   * @param {*} val
   * @author: renchao
   */
75
  getDictData (val) {
76 77
    return store.getters.dictData[val]
  }
yuanbo committed
78 79 80 81 82
  /**
   * @description: yWstatus
   * @param {*} row
   * @author: renchao
   */
83 84
  yWstatus (row) {
    let text = "";
85
    let keys = 0;
86 87 88
    // 定义策略对象
    const strategies = {
      djblzt: "正在办理",
89 90 91 92 93 94 95 96
      zjgcdyzt: "在建工程抵押",
      ycfzt: "已预查封",
      cfzt: "已查封",
      diyizt: "已地役",
      yyzt: "异议中",
      xzzt: "已限制",
      ygmmzt: "已预告买卖",
      ygdyzt: "已预告抵押",
97 98
      dyzt: "已抵押",
      sfbl: "正在补录"
99 100 101 102
    };

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

    return text;
  }
yuanbo committed
114
}