ocpview-plus 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/dist/efviewplus.min.esm.js +99954 -0
  4. package/dist/efviewplus.min.js +142 -0
  5. package/dist/locale/lang.js +1 -0
  6. package/dist/locale/zh-CN.js +1 -0
  7. package/dist/locale/zh-TW.js +1 -0
  8. package/dist/locale/zh-UG.js +1 -0
  9. package/dist/style.css +9 -0
  10. package/dist/styles/efviewplus.css +1 -0
  11. package/package.json +144 -0
  12. package/src/components/base/controlbase.vue +191 -0
  13. package/src/components/base/controlbox.vue +102 -0
  14. package/src/components/base/index.js +3 -0
  15. package/src/components/base/load.js +20 -0
  16. package/src/components/base/probase.js +220 -0
  17. package/src/components/base/size.js +78 -0
  18. package/src/components/billbox/billbox.vue +68 -0
  19. package/src/components/billbox/index.js +2 -0
  20. package/src/components/cascaderbox/cascaderbox.vue +184 -0
  21. package/src/components/cascaderbox/index.js +2 -0
  22. package/src/components/checkbox/checkbox.vue +76 -0
  23. package/src/components/checkbox/checkgroupbox.vue +104 -0
  24. package/src/components/checkbox/index.js +3 -0
  25. package/src/components/colorbox/colorbox.vue +44 -0
  26. package/src/components/colorbox/index.js +2 -0
  27. package/src/components/combobox/combobox.vue +220 -0
  28. package/src/components/combobox/index.js +2 -0
  29. package/src/components/conditionbox/conditionbase.vue +195 -0
  30. package/src/components/conditionbox/conditionbox.vue +63 -0
  31. package/src/components/conditionbox/conditionfilterbox.vue +477 -0
  32. package/src/components/conditionbox/conditionselectorbox.vue +237 -0
  33. package/src/components/conditionbox/index.js +5 -0
  34. package/src/components/conditionbox/queryconditionbox.vue +26 -0
  35. package/src/components/conditionbox/queryconditionboxbase.vue +124 -0
  36. package/src/components/conditionbox/searchconditionbox.vue +114 -0
  37. package/src/components/conditionbox/searchgrid.vue +391 -0
  38. package/src/components/datebox/datebox.vue +129 -0
  39. package/src/components/datebox/daterangebox.vue +155 -0
  40. package/src/components/datebox/index.js +3 -0
  41. package/src/components/form/baseform.vue +677 -0
  42. package/src/components/form/detailsbox.vue +487 -0
  43. package/src/components/form/formbox.vue +29 -0
  44. package/src/components/form/formcardbox.vue +268 -0
  45. package/src/components/form/formcardgroupbox.vue +252 -0
  46. package/src/components/form/formcompro.js +19 -0
  47. package/src/components/form/formdetail.vue +129 -0
  48. package/src/components/form/formdetailtwo.vue +302 -0
  49. package/src/components/form/index.js +8 -0
  50. package/src/components/form/toolanchor.js +46 -0
  51. package/src/components/form/workform.vue +168 -0
  52. package/src/components/grid/basegrid.vue +1061 -0
  53. package/src/components/grid/editgrid.vue +51 -0
  54. package/src/components/grid/editgridbase.vue +947 -0
  55. package/src/components/grid/editgridcard.vue +193 -0
  56. package/src/components/grid/expandrow.vue +137 -0
  57. package/src/components/grid/index.js +6 -0
  58. package/src/components/grid/viewgrid.vue +122 -0
  59. package/src/components/grid/viewgridbase.vue +1284 -0
  60. package/src/components/icon/common-icon.vue +53 -0
  61. package/src/components/icon/eicon.vue +29 -0
  62. package/src/components/icon/icons.vue +42 -0
  63. package/src/components/icon/index.js +2 -0
  64. package/src/components/label/index.js +3 -0
  65. package/src/components/label/showtext.vue +95 -0
  66. package/src/components/load/loadcartoon.vue +228 -0
  67. package/src/components/map/index.js +2 -0
  68. package/src/components/map/mapbox.vue +348 -0
  69. package/src/components/masterplate/appendix.vue +586 -0
  70. package/src/components/masterplate/approval.vue +803 -0
  71. package/src/components/masterplate/base.vue +985 -0
  72. package/src/components/masterplate/billasyncimport.vue +614 -0
  73. package/src/components/masterplate/billconditionbox.vue +224 -0
  74. package/src/components/masterplate/billconditionsbox.vue +427 -0
  75. package/src/components/masterplate/billdetailform.vue +990 -0
  76. package/src/components/masterplate/billimport.vue +263 -0
  77. package/src/components/masterplate/billquerygrid.vue +316 -0
  78. package/src/components/masterplate/billsinglegrid.vue +234 -0
  79. package/src/components/masterplate/birtreport.vue +185 -0
  80. package/src/components/masterplate/detailbtntoolbar.vue +311 -0
  81. package/src/components/masterplate/detailsbox.vue +386 -0
  82. package/src/components/masterplate/editgridcard.vue +222 -0
  83. package/src/components/masterplate/editgridcard2.vue +109 -0
  84. package/src/components/masterplate/formcard.vue +106 -0
  85. package/src/components/masterplate/formcardgroupbox.vue +168 -0
  86. package/src/components/masterplate/formdetailtwo.vue +356 -0
  87. package/src/components/masterplate/gridcolset.vue +227 -0
  88. package/src/components/masterplate/index.js +23 -0
  89. package/src/components/masterplate/layouttemplate.vue +33 -0
  90. package/src/components/masterplate/leftlistrightdetails.vue +474 -0
  91. package/src/components/masterplate/leftlistrightlist.vue +465 -0
  92. package/src/components/masterplate/lefttreerightdetails.vue +619 -0
  93. package/src/components/masterplate/levelreport.vue +510 -0
  94. package/src/components/masterplate/listbtntoolbar.vue +257 -0
  95. package/src/components/masterplate/listdetails.vue +769 -0
  96. package/src/components/masterplate/operlog.vue +272 -0
  97. package/src/components/masterplate/options.vue +110 -0
  98. package/src/components/masterplate/page.vue +102 -0
  99. package/src/components/masterplate/promptmessage.vue +74 -0
  100. package/src/components/masterplate/querybar.vue +490 -0
  101. package/src/components/masterplate/report.vue +357 -0
  102. package/src/components/masterplate/rowbtntoolbar.vue +126 -0
  103. package/src/components/masterplate/simpletree.vue +129 -0
  104. package/src/components/masterplate/simpleviewgrid.vue +144 -0
  105. package/src/components/mychart/bar/bar.vue +202 -0
  106. package/src/components/mychart/basechart.vue +190 -0
  107. package/src/components/mychart/complexmychart/barline.vue +154 -0
  108. package/src/components/mychart/gauge/gauge.vue +83 -0
  109. package/src/components/mychart/index.js +9 -0
  110. package/src/components/mychart/line/line.vue +202 -0
  111. package/src/components/mychart/liquidfill/liquidfill.vue +109 -0
  112. package/src/components/mychart/pie/pie.vue +96 -0
  113. package/src/components/mychart/radar/radar.vue +122 -0
  114. package/src/components/mychart/scatter/scatter.vue +76 -0
  115. package/src/components/numberbox/append.js +11 -0
  116. package/src/components/numberbox/index.js +3 -0
  117. package/src/components/numberbox/numberbox.vue +303 -0
  118. package/src/components/numberbox/numberrangebox.vue +423 -0
  119. package/src/components/picturebox/filebox.vue +365 -0
  120. package/src/components/picturebox/index.js +3 -0
  121. package/src/components/picturebox/picturebox.vue +541 -0
  122. package/src/components/picturebox/uploadbox.vue +164 -0
  123. package/src/components/poptagbox/index.js +2 -0
  124. package/src/components/poptagbox/poptagbox.vue +389 -0
  125. package/src/components/poptextbox/index.js +2 -0
  126. package/src/components/poptextbox/poptextbox.vue +601 -0
  127. package/src/components/radiobox/index.js +2 -0
  128. package/src/components/radiobox/radiogroupbox.vue +76 -0
  129. package/src/components/richtextbox/editor.vue +150 -0
  130. package/src/components/richtextbox/index.js +2 -0
  131. package/src/components/richtextbox/richtextbox.vue +448 -0
  132. package/src/components/textbox/index.js +2 -0
  133. package/src/components/textbox/textbox.vue +98 -0
  134. package/src/components/timebox/index.js +2 -0
  135. package/src/components/timebox/timebox.vue +76 -0
  136. package/src/components/toolbar/ebutton.vue +169 -0
  137. package/src/components/toolbar/index.js +3 -0
  138. package/src/components/toolbar/toolbar.vue +446 -0
  139. package/src/components/tree/basetree.vue +725 -0
  140. package/src/components/tree/index.js +3 -0
  141. package/src/components/tree/treedata.vue +51 -0
  142. package/src/components/tree/treedatabase.vue +189 -0
  143. package/src/components/upload/billimport.vue +233 -0
  144. package/src/components/upload/index.js +2 -0
  145. package/src/components/videobox/index.js +2 -0
  146. package/src/components/videobox/uploadbox.vue +148 -0
  147. package/src/components/videobox/videobox.vue +503 -0
  148. package/src/components/wrichtextbox/editor.vue +219 -0
  149. package/src/components/wrichtextbox/index.js +2 -0
  150. package/src/components/wrichtextbox/wrichtextbox.vue +63 -0
  151. package/src/index.js +215 -0
  152. package/src/locale/format.js +51 -0
  153. package/src/locale/index.js +63 -0
  154. package/src/locale/lang/zh-CN.js +123 -0
  155. package/src/locale/lang/zh-TW.js +114 -0
  156. package/src/locale/lang/zh-UG.js +115 -0
  157. package/src/locale/lang.js +15 -0
  158. package/src/method/case/case.js +1180 -0
  159. package/src/method/config/queryconfig.js +24 -0
  160. package/src/method/const/const.js +815 -0
  161. package/src/method/index.js +8 -0
  162. package/src/static/excel/exportexcel.js +627 -0
  163. package/src/static/iview/coustom.js +463 -0
  164. package/src/store/index.js +19 -0
  165. package/src/store/modules/app.js +53 -0
  166. package/src/styles/README.md +3 -0
  167. package/src/styles/common.less +75 -0
  168. package/src/styles/components/anchor.less +74 -0
  169. package/src/styles/components/approval.less +136 -0
  170. package/src/styles/components/button.less +208 -0
  171. package/src/styles/components/card.less +51 -0
  172. package/src/styles/components/content.less +38 -0
  173. package/src/styles/components/font.less +314 -0
  174. package/src/styles/components/form.less +72 -0
  175. package/src/styles/components/iconfont/fonts/iconfont.less +1376 -0
  176. package/src/styles/components/iconfont/fonts/iconfont.svg +699 -0
  177. package/src/styles/components/iconfont/fonts/iconfont.ttf +0 -0
  178. package/src/styles/components/iconfont/fonts/iconfont.woff +0 -0
  179. package/src/styles/components/iconfont/fonts/iconfont.woff2 +0 -0
  180. package/src/styles/components/index.less +16 -0
  181. package/src/styles/components/input.less +290 -0
  182. package/src/styles/components/modal.less +203 -0
  183. package/src/styles/components/page.less +340 -0
  184. package/src/styles/components/select.less +361 -0
  185. package/src/styles/components/steps.less +367 -0
  186. package/src/styles/components/table.less +544 -0
  187. package/src/styles/components/tabs.less +249 -0
  188. package/src/styles/components/upload.less +83 -0
  189. package/src/styles/custom.less +67 -0
  190. package/src/styles/index.less +6 -0
  191. package/src/styles/pack.less +6 -0
  192. package/src/utils/EfuMessenger.js +155 -0
  193. package/src/utils/assist.js +353 -0
  194. package/src/utils/index.js +1 -0
  195. package/src/utils/random_str.js +10 -0
@@ -0,0 +1,237 @@
1
+ <template>
2
+ <div>
3
+ <Row>
4
+ <Col span='20'>
5
+ <Row type="flex" justify="start" align="middle">
6
+ <Col span='24' style="padding-top:4px" >
7
+ <template v-if="!isConnector">
8
+ <FormBox ref="form" :config="form" @inputValue="formChanged"/>
9
+ </template>
10
+ <template v-else>
11
+ <FormBox ref="form" :config="formConnector" @inputValue="formChanged"/>
12
+ </template>
13
+ </Col>
14
+ </Row>
15
+ </Col>
16
+ <Col v-if='operflag' span='4'>
17
+ <Row type="flex" justify="end" align="middle" style="padding-top:8px" >
18
+ <Button size='small' type='default' icon="ios-add" style="margin-right:8px" @click="doAdd"></Button>
19
+ <Button size='small' type='default' icon="ios-remove" @click="doDel"></Button>
20
+ </Row>
21
+ </Col>
22
+ </Row>
23
+ </div>
24
+ </template>
25
+ <script>
26
+ export default {
27
+ name: 'conditionselector',
28
+ data () {
29
+ return {
30
+ form:{
31
+ lineNum:12,
32
+ labelWidth:10,
33
+ showLabel:false,
34
+ items:[{
35
+ name:'field',
36
+ type:'ComboBox',
37
+ codeWithName:false,
38
+ valueChanged:this.fieldChanged,
39
+ colNum:3,
40
+ // size:'small',
41
+ isFull:true
42
+ },{
43
+ name:'oper',
44
+ type:'ComboBox',
45
+ codeWithName:false,
46
+ clearable:false,
47
+ //size:'small',
48
+ colNum:2,
49
+ data:[{
50
+ name: '等于',
51
+ code: '=='
52
+ }],
53
+ defaultValue:'==',
54
+ isFull:true
55
+ },{
56
+ name:'value',
57
+ type:'TextBox',
58
+ //size:'small',
59
+ readOnly:true,
60
+ colNum:3,
61
+ isFull:true
62
+ }]
63
+ },
64
+ formConnector:{
65
+ lineNum:8,
66
+ labelWidth:30,
67
+ showLabel:false,
68
+ items:[{
69
+ name:'connector',
70
+ type:'ComboBox',
71
+ codeWithName:false,
72
+ //size:'small',
73
+ colNum:2,
74
+ data:[{'code':'$or','name':'或'}, {'code':'$and','name':'且'}],
75
+ defaultValue:'$and',
76
+ style:{
77
+ 'min-width':'50px'
78
+ },
79
+ clearable:false
80
+ }]
81
+ },
82
+ dataType:{}
83
+ };
84
+ },
85
+ created () {
86
+ this.init();
87
+ },
88
+ props:{
89
+ config: {
90
+ type: Object,
91
+ default () {
92
+ return {};
93
+ }
94
+ },
95
+ setOperData: {
96
+ type: Function
97
+ },
98
+ operflag:{
99
+ type:Boolean,
100
+ default:true
101
+ },
102
+ isConnector:{
103
+ type:Boolean,
104
+ default:true
105
+ },
106
+ valueData: {
107
+ type: Object,
108
+ default () {
109
+ return {};
110
+ }
111
+ }
112
+ } ,
113
+ mounted () {
114
+ if (!this.isConnector) {
115
+ if (this.valueData.field){
116
+ this.fieldChanged({value:this.valueData.field});
117
+ }
118
+ }
119
+ this.$nextTick(() => {
120
+ this.$refs.form.setData(this.valueData);
121
+ });
122
+ },
123
+ methods:{
124
+ formChanged(){
125
+ let form = this.$refs.form.getData();
126
+ this.$emit('inputValue', form);
127
+ },
128
+ init() {
129
+ if (!this.isConnector) {
130
+ this.initField();
131
+ }
132
+ },
133
+ initField () {
134
+ let fieldData = [];
135
+ if (this.config.items && this.config.items.length > 0) {
136
+ this.config.items.forEach(el => {
137
+ if (el.name && el.label) {
138
+ fieldData.push({code:el.name,name:el.label});
139
+ this.dataType[el.name] = Object.assign({},el, {name:'value'});
140
+ this.dataType[el.name].operData = this.getOperData(el);
141
+ }
142
+ });
143
+ }
144
+ this.form.items[0].data = fieldData;
145
+
146
+ },
147
+ getOperData(el) {
148
+ let tempData = [];
149
+ tempData.push({
150
+ name: '等于',
151
+ code: '=='
152
+ });
153
+ if (el.type === 'DateBox' || el.type === 'NumberBox') {
154
+ tempData.push({
155
+ name: '不小于',
156
+ code: '>='
157
+ });
158
+ tempData.push({
159
+ name: '不大于',
160
+ code: '<='
161
+ });
162
+ tempData.push({
163
+ name: '不等于',
164
+ code: '<>'
165
+ });
166
+ }
167
+ if (el.type === 'TextBox') {
168
+ tempData.push({
169
+ name: '不等于',
170
+ code: '<>'
171
+ });
172
+ tempData.push({
173
+ name: '包含',
174
+ code: 'LIKE'
175
+ });
176
+ }
177
+ if (this.setOperData) {
178
+ tempData = this.setOperData(el, tempData);
179
+ }
180
+ return tempData;
181
+ },
182
+ fieldChanged(e) {
183
+ let self = this;
184
+ let operValue = '==';
185
+ let obj = [];
186
+ let oper = {};
187
+ oper.name = 'oper';
188
+ if (e.value) {
189
+ let config = Object.assign({},this.dataType[e.value]);
190
+ oper.data = this.$Method.copy(config.operData);
191
+ oper.readOnly = false;
192
+ obj.push(oper);
193
+ config.name ='value';
194
+ config.label = '';
195
+ config.readOnly = false;
196
+ config.visible = true;
197
+ config.valueChanged = '';
198
+ obj.push(config);
199
+ if (config.operDefaultValue) {
200
+ operValue = config.operDefaultValue;
201
+ }
202
+ } else {
203
+ oper.data = [{
204
+ name: '等于',
205
+ code: '=='
206
+ }];
207
+ oper.readOnly = true;
208
+ obj.push(oper);
209
+ let valueConfig = {
210
+ name:'value',
211
+ type:'TextBox',
212
+ readOnly:true,
213
+ colNum:3,
214
+ isFull:true
215
+ };
216
+ obj.push(valueConfig);
217
+ }
218
+ self.$refs.form.updateItemsConfig(obj);
219
+ self.$nextTick(() => {
220
+ self.$refs.form.setValue('oper',operValue);
221
+ self.$refs.form.setValue('value','');
222
+ });
223
+ return true;
224
+ },
225
+ doAdd (){
226
+ let obj = {};
227
+ obj.name = 'doAdd';
228
+ this.$emit('doAction', obj);
229
+ },
230
+ doDel (){
231
+ let obj = {};
232
+ obj.name = 'doDel';
233
+ this.$emit('doAction', obj);
234
+ }
235
+ }
236
+ };
237
+ </script>
@@ -0,0 +1,5 @@
1
+ import ConditionBox from './conditionbox.vue';
2
+ import QueryConditionBoxBase from './queryconditionboxbase.vue';
3
+ import ConditionSelectorBox from './conditionselectorbox.vue';
4
+ import ConditionFilterBox from './conditionfilterbox.vue';
5
+ export {ConditionBox,QueryConditionBoxBase,ConditionSelectorBox,ConditionFilterBox};
@@ -0,0 +1,26 @@
1
+ <template>
2
+ <div v-show="showCondition" >
3
+ <Row v-if="showFormBox" type="flex" justify="start" align="middle" >
4
+ <Col span='18'>
5
+ <FormBox ref="form" :config="formConfig" :dictData="dictData"/>
6
+ </Col>
7
+ <Col span='6'>
8
+ <Row type="flex" justify="end" align="middle" >
9
+ <Col>
10
+ <Button customIcon="iconfont icon-custom-search" type="primary" style="width:80px" @click="search">查询</Button>
11
+ </COl>
12
+ <Col style="margin-left:10px">
13
+ <Button customIcon="iconfont icon-custom-reset" style="width:80px" @click="doClear">重置</Button>
14
+ </Col>
15
+ </Row>
16
+ </Col>
17
+ </Row>
18
+ </div>
19
+ </template>
20
+ <script>
21
+ import Base from './queryconditionboxbase.vue';
22
+ export default {
23
+ name: 'queryconditionbox',
24
+ extends: Base,
25
+ };
26
+ </script>
@@ -0,0 +1,124 @@
1
+ <script>
2
+ import Base from './conditionbase.vue';
3
+ export default {
4
+ name: 'queryconditionboxbase',
5
+ extends: Base,
6
+ data () {
7
+ return {
8
+ myConfig: {
9
+ },
10
+ formConfig:{
11
+ lineNum:1,
12
+ labelWidth:100,
13
+ labelPosition:'right',
14
+ items:[]
15
+ },
16
+ showFormBox:true,
17
+ showClearBtn:true,
18
+ maxLineNum:3,
19
+ };
20
+ },
21
+ methods:{
22
+ customInit() {
23
+ if (this.myConfig.formConfig !== undefined) {
24
+ Object.assign(this.formConfig, this.myConfig.formConfig);
25
+ } else {
26
+ this.initField();
27
+
28
+ this.condition.forEach(el => {
29
+ this.formConfig.items.push(this.$Method.copy(el.config));
30
+ });
31
+
32
+ if (this.myConfig.labelWidth) {
33
+ this.formConfig.labelWidth = this.myConfig.labelWidth;
34
+ }
35
+ if (this.myConfig.labelPosition) {
36
+ this.formConfig.labelPosition = this.myConfig.labelPosition;
37
+ }
38
+ if (this.myConfig.maxLineNum) {
39
+ this.maxLineNum = this.myConfig.maxLineNum;
40
+ }
41
+
42
+ if (this.modelType != 'treeSearch') {
43
+ if (this.myConfig.lineNum) {
44
+ this.formConfig.lineNum = this.myConfig.lineNum;
45
+ } else {
46
+ let num = this.formConfig.items.length;
47
+ if (num > this.maxLineNum) {
48
+ this.formConfig.lineNum = this.maxLineNum;
49
+ } else {
50
+ this.formConfig.lineNum = num;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ if (this.formConfig.items.length === 0) {
56
+ this.showFormBox = false;
57
+ } else {
58
+ this.showFormBox = true;
59
+ }
60
+ },
61
+ customClear() {
62
+ if (this.$refs.form) {
63
+ this.$refs.form.clearData();
64
+ }
65
+ },
66
+ customGetQuerySearchParam() {
67
+ let result={};
68
+ let form = this.$refs.form.getData();
69
+ if (this.myConfig.formConfig === undefined) {
70
+ for (let temp in this.dataType) {
71
+ if (form[temp]) {
72
+ if (this.dataType[temp].calculator) {
73
+ let obj = this.getConditionValue(temp,form[temp],this.dataType[temp].calculator,this.dataType[temp]);
74
+ result = Object.assign({},result,obj);
75
+ } else {
76
+ result[temp] = form[temp];
77
+ }
78
+ }
79
+ }
80
+ } else {
81
+ let obj = {};
82
+ obj['$and'] = [];
83
+ this.formConfig.items.forEach(el => {
84
+ if (form[el.name]) {
85
+ let oper = '==';
86
+ if (el.name.indexOf('name') !== -1) {
87
+ oper = 'LIKE';
88
+ }
89
+ if (el.oper) {
90
+ oper = el.oper;
91
+ }
92
+ let temp = {};
93
+ temp[el.name] = {};
94
+ if (oper === 'LIKE') {
95
+ temp[el.name][oper] = '%' + form[el.name]+'%';
96
+ } else {
97
+ temp[el.name][oper] = form[el.name];
98
+ }
99
+ obj['$and'].push(temp);
100
+ }
101
+ });
102
+ if (obj['$and'].length > 0) {
103
+ Object.assign(result, obj);
104
+ }
105
+ }
106
+ return result;
107
+ },
108
+
109
+ getValue(name) {
110
+ return this.$refs.form.getValue(name);
111
+ },
112
+
113
+ setValue(name, value) {
114
+ return this.$refs.form.setValue(name,value);
115
+ },
116
+ doClear() {
117
+ this.clear();
118
+ this.search();
119
+ }
120
+
121
+ }
122
+
123
+ };
124
+ </script>
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <div>
3
+ <Row type="flex" :gutter="8">
4
+ <Col span='4'>
5
+ <ControlBox ref="field" :config="fieldConfig" ></ControlBox>
6
+ </Col>
7
+ <Col span='6'>
8
+ <ControlBox v-if="hackReset" ref="editors" :config="editorsConfig" ></ControlBox>
9
+ </Col>
10
+ <Col>
11
+ <Button icon="ios-search" @click="search" >查询</Button>
12
+ </Col>
13
+ <Col>
14
+ <Button icon="ios-refresh" @click="clear">{{clearInfo}}</Button>
15
+ </Col>
16
+ <Col>
17
+ <Button icon="ios-search" type="primary" @click="showHighSearch">高级查询</Button>
18
+ </Col>
19
+ </Row>
20
+ <SearchGrid ref="searchgrid" :config="config" :dictData="searchDictData" :dataType="dataType" @search="search"/>
21
+ </div>
22
+ </template>
23
+ <script>
24
+ import Base from './conditionbase.vue';
25
+ import SearchGrid from './searchgrid.vue';
26
+ export default {
27
+ name: 'searchconditionbox',
28
+ extends: Base,
29
+ components:{
30
+ SearchGrid
31
+ },
32
+ data () {
33
+ return {
34
+ fieldConfig: {
35
+ name:'field',
36
+ type:'ComboBox',
37
+ codeWithName:false,
38
+ valueChanged:this.fieldChanged
39
+ },
40
+ editorsConfig:{
41
+ name:'editors',
42
+ type:'TextBox',
43
+ readOnly:true
44
+ },
45
+ searchDictData:{}
46
+ };
47
+ },
48
+ methods:{
49
+ customInit() {
50
+ this.initField();
51
+ this.fieldConfig.data = this.conditionPrior;
52
+ if (this.dictData != null) {
53
+ this.searchDictData = this.$Method.copy(this.dictData);
54
+ }
55
+ this.searchDictData.FIELD = this.condition;
56
+ },
57
+
58
+ fieldChanged(e) {
59
+ const index = this.conditionPrior.findIndex(el => el.code === e.value);
60
+ if (index > -1) {
61
+ this.editorsConfig = Object.assign({},{},this.conditionPrior[index].config);
62
+ } else {
63
+ this.editorsConfig = {
64
+ name:'editors',
65
+ type:'TextBox',
66
+ readOnly:true
67
+ };
68
+ }
69
+ this.hackReset = false;
70
+ this.$nextTick(() =>{
71
+ this.hackReset = true;
72
+ });
73
+
74
+ },
75
+ customClear () {
76
+ this.$refs.field.setValue('');
77
+ let e = {};
78
+ e.value = '';
79
+ this.fieldChanged(e);
80
+ this.$refs.searchgrid.clearCondition();
81
+ this.search();
82
+ },
83
+ customGetQuerySearchParam() {
84
+ let searchParam = {};
85
+ let obj = {};
86
+ let el = {};
87
+ el.field = this.$refs.field.getValue();
88
+ el.editors = this.$refs.editors.getValue();
89
+ el.calculator = '==';
90
+ if (el.field && el.editors) {
91
+ if (this.dataType[el.field].calculator) {
92
+ el.calculator = this.dataType[el.field].calculator;
93
+ }
94
+ obj = this.getConditionValue(el.field,el.editors,el.calculator,this.dataType[el.field]);
95
+ }
96
+ let highObj = this.$refs.searchgrid.getResultCondition();
97
+ if (highObj['$and']) {
98
+ if (obj !== {}) {
99
+ highObj['$and'].push(obj);
100
+ }
101
+ searchParam = Object.assign({},{},highObj);
102
+ } else {
103
+ searchParam = Object.assign({},obj,highObj);
104
+ }
105
+ return searchParam;
106
+ },
107
+ showHighSearch() {
108
+ this.$refs.searchgrid.show();
109
+ }
110
+
111
+ }
112
+
113
+ };
114
+ </script>