|
@@ -285,35 +285,44 @@ export default {
|
|
|
this.$set(list,'value', '')
|
|
|
}
|
|
|
},
|
|
|
+ getFieldObj(field='TX'){
|
|
|
+ var obj = {
|
|
|
+ field:field,
|
|
|
+ logical:this.logical.length>0?this.logical[0][this.logicalProps.value]:'',
|
|
|
+ operator:this.operator.length>0?this.operator[0][this.operatorProps.value]:'',
|
|
|
+ }
|
|
|
+ var a = this.filedList.find(item=>{
|
|
|
+ return item.value == field
|
|
|
+ })
|
|
|
+ if(!a){
|
|
|
+ obj.dataType = 1
|
|
|
+ obj.field='PN'
|
|
|
+ obj.placeholder='请输入公开号,例:CN102860161 OR CN1526554846'
|
|
|
+ obj.value = ''
|
|
|
+ return obj
|
|
|
+ }
|
|
|
+ obj.dataType = a.dataType
|
|
|
+ obj.placeholder = a.placeholder
|
|
|
+ if(a.dataType==2 || a.dataType==3){
|
|
|
+ this.$set(obj,'value', [])
|
|
|
+ }else{
|
|
|
+ this.$set(obj,'value', '')
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ },
|
|
|
//校验
|
|
|
rule(){
|
|
|
if(this.list.length>=1){
|
|
|
this.createSearch()
|
|
|
return false
|
|
|
}else{
|
|
|
- this.list.push({
|
|
|
- dataType:1,
|
|
|
- logical:this.logical.length>0?this.logical[0][this.logicalProps.value]:'',
|
|
|
- // field:this.field.length>0?this.field[0][this.fieldProps.value]:'',
|
|
|
- field:'PN',
|
|
|
- placeholder:'请输入公开号,例:CN102860161 OR CN1526554846',
|
|
|
- operator:this.operator.length>0?this.operator[0][this.operatorProps.value]:'',
|
|
|
- value:''
|
|
|
- })
|
|
|
+ this.list.push(this.getFieldObj())
|
|
|
// this.rule()
|
|
|
}
|
|
|
},
|
|
|
//增加
|
|
|
add(index){
|
|
|
- var obj = {
|
|
|
- dataType:1,
|
|
|
- logical:this.logical.length>0?this.logical[0][this.logicalProps.value]:'',
|
|
|
- // field:this.field.length>0?this.field[0][this.fieldProps.value]:'',
|
|
|
- field:'PN',
|
|
|
- placeholder:'请输入公开号,例:CN102860161 OR CN1526554846',
|
|
|
- operator:this.operator.length>0?this.operator[0][this.operatorProps.value]:'',
|
|
|
- value:''
|
|
|
- }
|
|
|
+ var obj = this.getFieldObj()
|
|
|
if(index || index == 0){
|
|
|
this.list.splice(index+1,0,obj)
|
|
|
return
|
|
@@ -339,15 +348,7 @@ export default {
|
|
|
//重置
|
|
|
reset(){
|
|
|
this.list = [
|
|
|
- {
|
|
|
- dataType:1,
|
|
|
- logical:this.logical.length>0?this.logical[0][this.logicalProps.value]:'',
|
|
|
- // field:this.field.length>0?this.field[0][this.fieldProps.value]:'',
|
|
|
- field:'PN',
|
|
|
- placeholder:'请输入公开号,例:CN102860161 OR CN1526554846',
|
|
|
- operator:this.operator.length>0?this.operator[0][this.operatorProps.value]:'',
|
|
|
- value:''
|
|
|
- },
|
|
|
+ this.getFieldObj(),
|
|
|
// {
|
|
|
// logical:this.logical.length>0?this.logical[0][this.logicalProps.value]:'',
|
|
|
// field:this.field.length>0?this.field[0][this.fieldProps.value]:'',
|