commonRiskModal.vue
3.11 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
<template>
<a-modal title="规则集" :width="900" :centered="false" :visible="visible" @cancel="handleCancel" :confirmLoading="confirmLoading" :footer="null" cancelText="关闭" :maskClosable="false" style="top:40px;" class="scope-link-man">
<a-card :bordered="false">
<span style="color:rgba(0,0,0,.85);margin-right:20px;">策略节点</span>
<a-select v-model="riskNode" placeholder="请选择策略节点" style="width:180px;" @change="selectUserHierarchy">
<a-select-option v-for="(item, index) in selectData" :key="index" :value="item">
{{item}}
</a-select-option>
</a-select>
</a-card>
<a-table ref="table" size="middle" bordered :columns="riskData" :dataSource="dataSource" :pagination="false" :loading="loading" :rowKey="record => record.id" @change="handleTableChange" style="margin-bottom:20px;">
<!-- 字符串超长截取省略号显示-->
<span slot="esContent" slot-scope="text">
<j-ellipsis :value="text" :length="10" />
</span>
<span slot="rule" slot-scope="text, record">
{{record.ruleName}} {{record.judge}} {{record.threshold}}
</span>
</a-table>
</a-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { deleteCollCusBankAccount } from '@/api/configApi'
export default {
name: 'commonBankAccountTable',
mixins: [JeecgListMixin],
data () {
return {
title: '',
confirmLoading: false,
visible: false,
riskNode: '',
riskData: [
{
title: '策略节点',
align: 'center',
width: '100px',
dataIndex: 'nodeName'
},
{
title: '规则',
dataIndex: 'rule',
scopedSlots: { customRender: 'rule' },
align: 'center',
width: 200,
},
{
title: '取值',
align: 'center',
dataIndex: 'ruleValue'
},
{
title: '结果',
align: 'center',
dataIndex: 'ruleResult'
},
],
model: [],
selectData: [],
disableMixinCreated: true,
dataSource: [],
}
},
created () {
},
methods: {
edit (res) {
this.selectData = []
// this.objForEach(res.rules)
// this.keyFindVal()
this.visible = true
},
close () {
this.$emit('close')
this.visible = false
},
handleCancel () {
this.close()
},
selectUserHierarchy (key) {
this.riskNode = key
this.dataSource = []
this.keyFindVal()
},
// 返回数据处理
objForEach (obj) {
this.model = []
Object.keys(obj).forEach((key) => {
this.model.push(obj[key])
this.selectData.push(key)
});
this.selectData.map(v => {
this.riskNode = this.selectData[0] // 默认选择第一个
})
},
keyFindVal () {
this.dataSource = []
// 根据key找val
this.model.map(v => {
v.map(v1 => {
if (this.riskNode == v1.nodeName) {
this.dataSource.push(v1)
}
})
})
}
}
}
</script>
<style>
</style>