|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<div class="table-page-search-wrapper">
<a-form>
<a-row :gutter="12">
<a-col :md="8" :sm="8">
<a-form-item label="规则名称" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}">
<a-input placeholder="请输入规则名称" v-model="queryParam.ruleName"></a-input>
</a-form-item>
</a-col>
<a-col :md="8" :sm="8">
<a-form-item label="规则值" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}">
<a-input placeholder="请输入规则值" v-model="queryParam.ruleValue"></a-input>
</a-form-item>
</a-col>
<a-col :md="7" :sm="8">
|
|
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
</a-popconfirm>
</span>
</a-table>
</div>
</div>
<permission-data-rule-modal @ok="modalFormOk" ref="modalForm"></permission-data-rule-modal>
</a-drawer>
</template>
<script>
import {getPermissionRuleList, queryPermissionRule} from '@/api/api'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import PermissionDataRuleModal from './modules/PermissionDataRuleModal'
const columns = [
{
title: '规则名称',
dataIndex: 'ruleName',
key: 'ruleName'
},
{
title: '规则字段',
dataIndex: 'ruleColumn',
key: 'ruleColumn'
},
{
title: '规则值',
dataIndex: 'ruleValue',
key: 'ruleValue'
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: 'center'
}
]
export default {
name: 'PermissionDataRuleList',
mixins: [JeecgListMixin],
components: {
PermissionDataRuleModal
},
data() {
return {
queryParam: {},
drawerWidth: 650,
columns: columns,
permId: '',
visible: false,
form: this.$form.createForm(this),
loading: false,
url: {
list: "/sys/permission/getPermRuleListByPermId",
delete: "/sys/permission/deletePermissionRule",
},
}
},
created() {
this.resetScreenSize()
},
methods: {
loadData() {
let that = this
this.dataSource = []
var params = this.getQueryParams()//查询条件
getPermissionRuleList(params).then((res) => {
if (res.success) {
that.dataSource = res.result
}
})
},
edit(record) {
if (record.id) {
this.visible = true
this.permId = record.id
}
this.queryParam = {}
this.queryParam.permissionId = record.id
this.visible = true
this.loadData()
this.resetScreenSize()
},
addPermissionRule() {
this.$refs.modalForm.add(this.permId)
this.$refs.modalForm.title = '新增'
},
searchQuery() {
var params = this.getQueryParams();
params.permissionId = this.permId;
queryPermissionRule(params).then((res) => {
if (res.success) {
this.dataSource = res.result
}
})
},
searchReset() {
this.queryParam = {}
this.queryParam.permissionId = this.permId
this.loadData(1);
},
onClose() {
this.visible = false
},
// 根据屏幕变化,设置抽屉尺寸
resetScreenSize() {
let screenWidth = document.body.clientWidth
if (screenWidth < 500) {
this.drawerWidth = screenWidth
} else {
this.drawerWidth = 650
}
},
|