feat: 过滤组件绑定
This commit is contained in:
parent
f9f384d030
commit
20c0b4b68d
@ -7,6 +7,7 @@
|
|||||||
:start-placeholder="options.attrs.startPlaceholder"
|
:start-placeholder="options.attrs.startPlaceholder"
|
||||||
:end-placeholder="options.attrs.endPlaceholder"
|
:end-placeholder="options.attrs.endPlaceholder"
|
||||||
:placeholder="options.attrs.placeholder"
|
:placeholder="options.attrs.placeholder"
|
||||||
|
@change="dateChange"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -32,6 +33,22 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.options = this.element.options
|
this.options = this.element.options
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
this.setCondition()
|
||||||
|
},
|
||||||
|
setCondition() {
|
||||||
|
const param = {
|
||||||
|
component: this.element,
|
||||||
|
value: Array.isArray(this.options.value) ? this.options.value : [this.options.value],
|
||||||
|
operator: this.operator
|
||||||
|
}
|
||||||
|
this.inDraw && this.$store.dispatch('conditions/add', param)
|
||||||
|
},
|
||||||
|
dateChange(value) {
|
||||||
|
this.setCondition()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,8 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<el-input v-if="options!== null && options.attrs!==null" v-model="options.value" style="width: 260px" :placeholder="options.attrs.placeholder">
|
<el-input
|
||||||
|
v-if="options!== null && options.attrs!==null"
|
||||||
|
v-model="options.value"
|
||||||
|
style="width: 260px"
|
||||||
|
:placeholder="options.attrs.placeholder"
|
||||||
|
@keyup.enter.native="search"
|
||||||
|
>
|
||||||
|
|
||||||
<el-button slot="append" icon="el-icon-search" />
|
<el-button slot="append" icon="el-icon-search" @click="search" />
|
||||||
</el-input>
|
</el-input>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@ -23,12 +29,26 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
options: null,
|
options: null,
|
||||||
operator: 'eq',
|
operator: 'like',
|
||||||
values: null
|
values: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.options = this.element.options
|
this.options = this.element.options
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
// this.options.value && this.setCondition()
|
||||||
|
this.setCondition()
|
||||||
|
},
|
||||||
|
setCondition() {
|
||||||
|
const param = {
|
||||||
|
component: this.element,
|
||||||
|
value: [this.options.value],
|
||||||
|
operator: this.operator
|
||||||
|
}
|
||||||
|
this.inDraw && this.$store.dispatch('conditions/add', param)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class NumberSelectServiceImpl extends WidgetService {
|
|||||||
|
|
||||||
optionDatas(datas) {
|
optionDatas(datas) {
|
||||||
if (!datas) return null
|
if (!datas) return null
|
||||||
return datas.map(item => {
|
return datas.filter(item => !!item).map(item => {
|
||||||
return {
|
return {
|
||||||
id: item,
|
id: item,
|
||||||
text: item
|
text: item
|
||||||
|
|||||||
@ -9,7 +9,8 @@ const leftPanel = {
|
|||||||
const dialogPanel = {
|
const dialogPanel = {
|
||||||
options: {
|
options: {
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: '请选择'
|
placeholder: '请输入关键字',
|
||||||
|
viewIds: []
|
||||||
|
|
||||||
},
|
},
|
||||||
value: ''
|
value: ''
|
||||||
|
|||||||
@ -12,7 +12,8 @@ const dialogPanel = {
|
|||||||
type: 'daterange',
|
type: 'daterange',
|
||||||
rangeSeparator: '至',
|
rangeSeparator: '至',
|
||||||
startPlaceholder: '开始日期',
|
startPlaceholder: '开始日期',
|
||||||
endPlaceholder: '结束日期'
|
endPlaceholder: '结束日期',
|
||||||
|
viewIds: []
|
||||||
},
|
},
|
||||||
value: ''
|
value: ''
|
||||||
},
|
},
|
||||||
|
|||||||
@ -10,7 +10,8 @@ const dialogPanel = {
|
|||||||
options: {
|
options: {
|
||||||
attrs: {
|
attrs: {
|
||||||
type: 'date',
|
type: 'date',
|
||||||
placeholder: '请选择日期'
|
placeholder: '请选择日期',
|
||||||
|
viewIds: []
|
||||||
},
|
},
|
||||||
value: ''
|
value: ''
|
||||||
},
|
},
|
||||||
|
|||||||
@ -10,7 +10,8 @@ const dialogPanel = {
|
|||||||
options: {
|
options: {
|
||||||
attrs: {
|
attrs: {
|
||||||
type: 'month',
|
type: 'month',
|
||||||
placeholder: '请选择年月'
|
placeholder: '请选择年月',
|
||||||
|
viewIds: []
|
||||||
},
|
},
|
||||||
value: ''
|
value: ''
|
||||||
},
|
},
|
||||||
|
|||||||
@ -10,7 +10,8 @@ const dialogPanel = {
|
|||||||
options: {
|
options: {
|
||||||
attrs: {
|
attrs: {
|
||||||
type: 'year',
|
type: 'year',
|
||||||
placeholder: '请选择年份'
|
placeholder: '请选择年份',
|
||||||
|
viewIds: []
|
||||||
},
|
},
|
||||||
value: ''
|
value: ''
|
||||||
},
|
},
|
||||||
|
|||||||
@ -56,10 +56,10 @@ export default {
|
|||||||
],
|
],
|
||||||
'数字过滤组件': [
|
'数字过滤组件': [
|
||||||
'numberSelectWidget'
|
'numberSelectWidget'
|
||||||
],
|
|
||||||
'按钮': [
|
|
||||||
'buttonSureWidget'
|
|
||||||
]
|
]
|
||||||
|
// '按钮': [
|
||||||
|
// 'buttonSureWidget'
|
||||||
|
// ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user