-
Notifications
You must be signed in to change notification settings - Fork 0
JSuperQuery
xinwu-yang edited this page Mar 1, 2023
·
1 revision
高级查询组件。
<template>
<j-super-query
ref="superQueryModal"
:fieldList="fieldList"
@handleSuperQuery="handleSuperQuery"
></j-super-query>
</template>
<script>
const superQueryFieldList = [
{
type: 'date',
value: 'birthday',
text: '生日'
},
{
type: 'string',
value: 'name',
text: '用户名'
},
{
type: 'int',
value: 'age',
dbType: 'int',
text: '年龄'
}
]
export default {
data() {
fieldList: superQueryFieldList,
superQueryFlag: false,
superQueryParams: ''
},
methods: {
// 高级查询方法
handleSuperQuery(arg) {
if (!arg) {
this.superQueryParams = ''
this.superQueryFlag = false
} else {
this.superQueryFlag = true
this.superQueryParams = JSON.stringify(arg)
}
this.loadData()
}
}
}
</script>
属性 | 说明 | 类型 | 必填 | 默认值 |
---|---|---|---|---|
fieldList | 需要查询的列集合 | array | ✔ | |
callback | 回调函数名称 | string | 'handleSuperQuery' |
{
value: '',
text: '',
type: '', // type的值可为 'date' | 'datetime' | 'int' | 'number' | 'string'
dictCode: '' // 只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
}
事件名称 | 说明 | 回调参数 |
---|---|---|
由callback确定,默认handleSuperQuery | 点击查询时回调 | function(params, matchType) |