filter.js
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-25 10:56:39
*/
import store from '@/store'
// table 内部过滤器 由于过滤器只能在模板中使用 所以 就有了 jsx内部方法过滤器
export default class filter {
/**
* @description: selected
* @param {*} row
* @author: renchao
*/
selected (row) {
// if (row.sfbl == 0) { // 正在办理不能申请
// return false
// } else {
// return true //可选择
// }
return true
}
// 业务来源
/**
* @description: 业务来源
* @param {*} val
* @author: renchao
*/
busSource (val) {
let status = { 1: '办事大厅', 2: '微信小程序' }
return status[val]
}
//申请分类(1:正常申请,2:一并申请,3:补录申请)
/**
* @description: 申请分类
* @param {*} val
* @author: renchao
*/
sqfls (val) {
let status = { 1: '正常申请', 2: '一并申请', 3: '补录申请' }
return status[val]
}
/**
* @description: 字典
* @param {*} val
* @param {*} code
* @author: renchao
*/
dicStatus (val, code) {
let data = store.getters.dictData[code],
name = '暂无'
if (data) {
data.map((item) => {
if (item.dcode == val) {
name = item.dname
}
})
return name
}
}
/**
* @description: filterHtml
* @param {*} content
* @author: renchao
*/
filterHtml (content) {
return content.replace(/<[^>]+>/g, '');
}
/**
* @description: getDictData
* @param {*} val
* @author: renchao
*/
getDictData (val) {
return store.getters.dictData[val]
}
/**
* @description: yWstatus
* @param {*} row
* @author: renchao
*/
yWstatus (row) {
let text = "";
let keys = 0;
// 定义策略对象
const strategies = {
djblzt: "正在办理",
zjgcdyzt: "在建工程抵押",
ycfzt: "已预查封",
cfzt: "已查封",
diyizt: "已地役",
yyzt: "异议中",
xzzt: "已限制",
ygmmzt: "已预告买卖",
ygdyzt: "已预告抵押",
dyzt: "已抵押",
sfbl: "正在补录"
};
for (let key in row) {
if (row[key] === 1 && strategies[key]) {
keys++;
if (keys == 1) {
text += strategies[key];
} else {
text += ',' + strategies[key];
}
}
}
return text;
}
joinItem (val) {
if (Array.isArray(val) && val.length > 0) {
return val.join()
} else {
return val
}
}
}