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
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
| <template>
| <div style="padding: 0 10px">
| <div style="text-align: center;margin-bottom: 10px">
| <avue-radio v-model="radioForm" :dic="radioDic" style="margin: 0 20px 0 0;display: inline-block"></avue-radio>
| <el-button plain size="mini" type="primary" @click="clearValue">清空值</el-button>
| <el-button plain size="mini" type="primary" @click="delAll">删除全部条件</el-button>
| </div>
| <div v-if="radioForm==0" @drop="drop" @dragover.prevent style="height: 220px;text-align: center;">
| <div v-for="condition in conditionList" class="el-input--small" style="margin-bottom: 5px;">
| <span style="width: 150px;display: inline-block;text-align: right" :title="condition.clause">{{condition.clause}}</span>
| <avue-select v-model="condition.operator" type="tree" :dic="operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
| <avue-input v-model="condition.ordinaryValue" placeholder="" style="width: 300px;margin-right: 5px;"></avue-input>
| <el-button plain size="mini" type="primary" @click="delAll">选择查询模板</el-button>
| </div>
| </div>
| <div v-else style="height: 220px;text-align: left">
| <avue-tree style="height: 220px" :data="treeData" :option="treeOption"></avue-tree>
| </div>
| <div style="text-align: right;margin-top: 10px;">
| <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="addHandler">增加逻辑</el-button>
| <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="del">修改条件</el-button>
| <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="del">删除</el-button>
| <el-button plain size="mini" type="primary" @click="del">查询</el-button>
| <el-button plain size="mini" type="primary" @click="del">取消</el-button>
| </div>
| </div>
| </template>
|
| <script>
| export default {
| name: "formQueryDialog",
| props: {
| queryCondition: {
| type: Array,
| default: []
| },
| queryTree: {
| type: Object,
| default: {}
| },
| },
| data() {
| return {
| radioForm: 0,
| radioDic: [{
| label: '普通',
| value: 0
| }, {
| label: '高级',
| value: 1
| }],
| conditionList:this.queryCondition,
| treeOption:{
| defaultExpandAll:true,
| menu: false,
| addBtn: false,
| filter:false,
| },
| treeData:this.queryTree,
| //VTInteger、VTDouble、VTLong
| operatorIntDic:[{
| label:'=',
| value:'='
| },{
| label:'!=',
| value:'!='
| },{
| label:'包含',
| value:'包含'
| },{
| label:'in',
| value:'in'
| },{
| label:'not in',
| value:'not in'
| },{
| label:'>=',
| value:'>='
| },{
| label:'>',
| value:'>'
| },{
| label:'<=',
| value:'<='
| },{
| label:'<',
| value:'<'
| }],
| //VTDateTime、VTDate、VTTime
| operatorTimeDic:[{
| label:'=',
| value:'='
| },{
| label:'!=',
| value:'!='
| },{
| label:'in',
| value:'in'
| },{
| label:'not in',
| value:'not in'
| },{
| label:'>=',
| value:'>='
| },{
| label:'<=',
| value:'<='
| }],
| //其它
| operatorDic:[{
| label:'=',
| value:'='
| },{
| label:'!=',
| value:'!='
| },{
| label:'包含',
| value:'包含'
| },{
| label:'in',
| value:'in'
| },{
| label:'not in',
| value:'not in'
| }]
| }
| },
| methods:{
| // 拖拽到时
| drop(event) {
| // 使用 getData 方法获取数据
| const data = JSON.parse(event.dataTransfer.getData('item'));
| const params = {
| clause: data.value,
| operator: '=',
| ordinaryValue: ''
| }
| this.conditionList.push(params)
| }
| }
| }
| </script>
|
| <style scoped>
| ::v-deep .el-input--small .el-input__inner{
| height: 28px;
| line-height: 28px;
| }
| </style>
|
|