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,601 @@
1
+ <template>
2
+ <div v-show="myConfig.visible" :class="classes" >
3
+ <template v-if="multiple">
4
+ <div ref="myControl" class="ivu-select-selection">
5
+ <template v-for="(item, index) in selectedMultiple" >
6
+ <div
7
+ class="ivu-tag ivu-tag-checked"
8
+ :key="'tag_'+index"
9
+ v-if="myConfig.maxTagCount === undefined || index < myConfig.maxTagCount">
10
+ <span class="ivu-tag-text" >{{ item.label}}</span>
11
+ <Icon type="ios-close" v-if="!myConfig.readOnly" @click.enter.stop="closeTag(item)"></Icon>
12
+ </div>
13
+ </template>
14
+ <Tooltip theme="light" :transfer="true">
15
+ <div class="ivu-tag ivu-tag-checked" v-if="myConfig.maxTagCount !== undefined && selectedMultiple.length > myConfig.maxTagCount">
16
+ <span class="ivu-tag-text ivu-select-max-tag">
17
+ + {{ selectedMultiple.length - myConfig.maxTagCount }}...
18
+ </span>
19
+ </div>
20
+ <template #content>
21
+ <Row type="flex">
22
+ <template v-for="(item, index) in selectedMultiple">
23
+ <Col
24
+ class="ivu-tag ivu-tag-checked"
25
+ :key="'tag_'+index"
26
+ v-if="myConfig.maxTagCount === undefined || index >= myConfig.maxTagCount">
27
+ <span class="ivu-tag-text" >{{ item.label}}</span>
28
+ <Icon type="ios-close" v-if="!myConfig.readOnly" @click.enter.stop="closeTag(item)"></Icon>
29
+ </Col>
30
+ </template>
31
+ </Row>
32
+ </template>
33
+ </Tooltip>
34
+ <Icon type="ios-search" class="ivu-select-arrow" @click.enter.stop="click"></Icon>
35
+ </div>
36
+ </template>
37
+ <template v-else>
38
+ <Input ref="myControl" v-model="text" icon="ios-search" :size="myConfig.size" type="text" :placeholder="myConfig.placeholder" :disabled="myConfig.readOnly" :readonly="!myConfig.allowInput" :clearable="myConfig.clearable" @on-click="click" @keydown.enter.stop="onEnter" @on-blur="onEnter" @on-clear="onEnter"/>
39
+ </template>
40
+ <Modal v-model="popShow" :styles="queryConfig.popStyle" :width="currentWidth" :title="modeTitle" :footer-hide="footerHide" :draggable="draggable" :closable="myConfig.closable" class="efuture-model" >
41
+ <div>
42
+ <component :is="pop" ref="popView" :config="queryConfig" :dictData="myConfig.dictData" @conditionAction="conditionAction" :isPop="true" @dbclick="dbclick"/></div>
43
+ <template #footer>
44
+ <div>
45
+ <Row type="flex" justify="end" align="middle" :gutter="0">
46
+ <Col>
47
+ <Button style="width:80px" @click="cancel" >取消</Button>
48
+ </Col>
49
+ <Col style="margin-left:20px">
50
+ <Button type="info" style="width:80px" @click="ok" >确认</Button>
51
+ </Col>
52
+ </Row>
53
+ </div>
54
+ </template>
55
+
56
+ </Modal>
57
+ </div>
58
+ </template>
59
+ <script>
60
+ import Base from '@/components/base/controlbase.vue';
61
+ export default {
62
+ name: 'poptextbox',
63
+ extends: Base,
64
+ data () {
65
+ return {
66
+ myConfig: {
67
+ isTree:false,
68
+ textName:'',
69
+ selectkey:'',
70
+ searchBefore:'',
71
+ setDataBefore:'',
72
+ closable:true,
73
+ allowInput:true,
74
+ clearCondition:true,
75
+ multiple: false,
76
+ popControl:'',
77
+ maxTagCount: 2,
78
+ dictData:{}
79
+ },
80
+ selectedMultiple:[],
81
+ queryConfig:{
82
+ popStyle:{
83
+ top:'20px'
84
+ }
85
+ },
86
+ multiple:false,
87
+ popShow:false,
88
+ footerHide:false,
89
+ text:'',
90
+ oldText:'',
91
+ oldValue:'',
92
+ data:[],
93
+ selectTreeData:[],
94
+ customRows:[],
95
+ draggable:false
96
+ };
97
+ },
98
+ props:{
99
+ fatherValue: {
100
+ type: [String,Array],
101
+ default:''
102
+ },
103
+ fatherText: {
104
+ type: [String,Array],
105
+ default:''
106
+ }
107
+ } ,
108
+ computed: {
109
+ pop () {
110
+ if (this.queryConfig.popControl) {
111
+ return this.queryConfig.popControl;
112
+ } else {
113
+ if (this.queryConfig.isTree) {
114
+ return 'TreeBox';
115
+ } else {
116
+ return 'ViewGrid';
117
+ }
118
+ }
119
+ },
120
+ classes () {
121
+ if (!this.multiple) {
122
+ return '';
123
+ } else {
124
+ if (!this.myConfig.readOnly) {
125
+ return 'vu-select ivu-select-multiple ivu-select-default';
126
+ } else {
127
+ return 'vu-select ivu-select-disabled ivu-select-multiple ivu-select-default';
128
+ }
129
+ }
130
+ },
131
+ modeTitle() {
132
+ let title = this.config.label;
133
+ if (this.queryConfig.title) {
134
+ title = this.queryConfig.title;
135
+ }
136
+ if (this.myConfig.curlTitle) {
137
+ title = this.myConfig.curlTitle
138
+ }
139
+ return title;
140
+ }
141
+ },
142
+ methods:{
143
+ conditionAction(temp) {
144
+ switch(temp.action) {
145
+ case 'condition_ok':
146
+ if (temp.rows) {
147
+ this.customRows = [];
148
+ let flag = true;
149
+ if (temp.rows.length === 0) {
150
+ this.$refs.popView.alert('请选择');
151
+ this.popShow = true;
152
+ return true;
153
+ }
154
+ if (this.queryConfig.isTree) {
155
+ let allowLastNode = this.queryConfig.allowLastNode;
156
+ if (this.config.allowLastNode !== undefined) {
157
+ allowLastNode = this.config.allowLastNode;
158
+ }
159
+ if (allowLastNode) {
160
+ temp.rows.some(el => {
161
+ if (this.$refs.popView.isChildren(el)) {
162
+ flag = false;
163
+ return true;
164
+ }
165
+ });
166
+ }
167
+ if (!flag) {
168
+ this.$refs.popView.alert('选中的节点存在非末级节点,请检查');
169
+ this.popShow = true;
170
+ } else {
171
+ if (allowLastNode === true) {
172
+ let rows = [];
173
+ temp.rows.forEach(el => {
174
+ if (!el.children || el.children.length === 0) {
175
+ rows.push(el);
176
+ }
177
+ });
178
+ this.setCommmonValue(rows);
179
+ } else {
180
+ this.setCommmonValue(temp.rows);
181
+ }
182
+ this.popShow = false;
183
+ }
184
+ } else {
185
+ this.setCommmonValue(temp.rows);
186
+ this.popShow = false;
187
+ }
188
+ }
189
+
190
+ break;
191
+ case 'condition_cancel':
192
+ this.popShow = false;
193
+ break;
194
+ }
195
+ if (!this.popShow) {
196
+ document.querySelector('body').removeAttribute("style");
197
+ }
198
+ },
199
+ overrideSearchParam (param) {
200
+ if (this.myConfig.overrideSearchParam) {
201
+ return this.myConfig.overrideSearchParam(param);
202
+ } else {
203
+ return param;
204
+ }
205
+ },
206
+ setCommmonValue(rows,isnull) {
207
+ let flag = true;
208
+ //对象转数组
209
+ if (!Array.isArray(rows)) {
210
+ let data = [];
211
+ data.push(rows);
212
+ rows = data;
213
+ }
214
+ if (this.myConfig.setDataBefore) {
215
+ if (isnull === 'Y') {
216
+ flag = this.myConfig.setDataBefore(null,this);
217
+ } else {
218
+ flag = this.myConfig.setDataBefore(rows,this);
219
+ }
220
+ }
221
+ if (flag) {
222
+ if (this.multiple) {
223
+ let value = [];
224
+ let text = [];
225
+ rows.forEach(el => {
226
+ let temp = this.getCodeName(el);
227
+ el.label = temp.name;
228
+ value.push(el[this.queryConfig.responseId]);
229
+ text.push(temp.name);
230
+ });
231
+ this.value = value;
232
+ this.text = text;
233
+ this.oldValue = this.$Method.copy(value);
234
+ this.oldText = this.$Method.copy(text);
235
+ } else {
236
+ //多选自定义设置
237
+ if (this.customRows && this.customRows.length > 0) {
238
+ rows = this.customRows;
239
+ }
240
+ let temp = this.getCodeName(rows[0]);
241
+ if (rows[0][this.queryConfig.responseId]) {
242
+ this.value = rows[0][this.queryConfig.responseId];
243
+ this.text = temp.name;
244
+ } else {
245
+ this.value ='';
246
+ this.text = '';
247
+
248
+ }
249
+ this.oldValue = this.value;
250
+ this.oldText = this.text;
251
+ }
252
+ this.setFatherValue();
253
+ } else {
254
+ if (this.multiple) {
255
+ this.value =this.$Method.copy(this.oldValue);
256
+ this.text = this.$Method.copy(this.oldText);
257
+ } else {
258
+ this.value = this.oldText;
259
+ this.text = this.oldText;
260
+ }
261
+ }
262
+ },
263
+ getCodeName(row) {
264
+ let code = row[this.queryConfig.responseCode];
265
+ let name = row[this.queryConfig.responseName];
266
+ if (this.queryConfig.showCodeWithName !== false) {
267
+ if (this.queryConfig.responseCode != this.queryConfig.responseName) {
268
+ if (code) {
269
+ if (name) {
270
+ name = '[' + code +']' + name;
271
+ } else {
272
+ name = code;
273
+ }
274
+ } else {
275
+ name = '';
276
+ }
277
+ }
278
+ } else {
279
+ if (code) {
280
+ if (!name) {
281
+ name = code;
282
+ }
283
+ } else {
284
+ name = '';
285
+ }
286
+ }
287
+ let obj = {};
288
+ obj.code = code;
289
+ obj.name = name;
290
+ return obj;
291
+ },
292
+ setFatherValue() {
293
+ let para = this.valueToFatherValue();
294
+ para.name = this.myConfig.name;
295
+ if (this.myConfig.textName !== undefined) {
296
+ para.textName = this.myConfig.textName;
297
+ }
298
+ if (!this.multiple) {
299
+ if (this.customRows && this.customRows.length > 0) {
300
+ para.customRows = this.customRows;
301
+ }
302
+ }
303
+ this.$emit('inputValue', para);
304
+ },
305
+ closeTag(item) {
306
+ let index = this.value.findIndex(el => el === item[this.queryConfig.responseId]);
307
+ let flag = true;
308
+ let that = this;
309
+ if (this.myConfig.onDelTag) {
310
+ let temp = {};
311
+ temp.delIndex = index;
312
+ temp.data = this.$Method.copy(this.value);
313
+ temp.control = that;
314
+ temp.name = this.myConfig.name;
315
+ flag = this.myConfig.onDelTag(temp);
316
+ }
317
+ if (flag) {
318
+ if (index > -1) {
319
+ this.value.splice(index, 1);
320
+ this.text.splice(index, 1);
321
+ this.selectedMultiple.splice(index,1);
322
+ this.setFatherValue();
323
+ this.oldValue = this.$Method.copy(this.value);
324
+ this.oldText = this.$Method.copy(this.text);
325
+ }
326
+ }
327
+ },
328
+ customInit () {
329
+ if (this.config.selectkey) {
330
+ Object.assign(this.queryConfig, this.getQueryConfig(this.config.selectkey));
331
+ if (!this.queryConfig.isConfig) {
332
+ this.queryConfig.resources = this.OmdUrl[this.queryConfig.resources];
333
+ }
334
+ if (this.queryConfig.draggable) {
335
+ this.draggable = this.queryConfig.draggable;
336
+ }
337
+ if (this.config.multiSelect !== undefined) {
338
+ this.queryConfig.multiSelect = this.config.multiSelect;
339
+ }
340
+
341
+ if (this.config.showAll !== undefined) {
342
+ this.queryConfig.showAll = this.config.showAll;
343
+ }
344
+ if (this.queryConfig.popControl) {
345
+ if (this.queryConfig.popControl !== 'SimpleViewGrid' && this.queryConfig.popControl !== 'SimpleTree') {
346
+ this.footerHide = true;
347
+ }
348
+ }
349
+ this.setSizeConfig(this.queryConfig);
350
+ this.queryConfig.overrideSearchParam = this.overrideSearchParam;
351
+
352
+ if (JSON.stringify(this.myConfig.dictData) === '{}') {
353
+ let obj = {};
354
+ if (this.queryConfig.items && this.queryConfig.items.length > 0) {
355
+ this.queryConfig.items.forEach(el => {
356
+ let dictkey = el.dictkey;
357
+ if (el.customDictkey) {
358
+ dictkey = el.customDictkey;
359
+ }
360
+ if (dictkey) {
361
+ obj[dictkey] = '';
362
+ }
363
+ });
364
+ }
365
+ if (JSON.stringify(obj) !== '{}') {
366
+ if (this.myConfig.getDictData) {
367
+ obj = this.myConfig.getDictData(obj);
368
+ }
369
+ this.myConfig.dictData = obj;
370
+ }
371
+ }
372
+ if (this.myConfig.sysDictData !== undefined) {
373
+ if (this.myConfig.dictData === undefined) {
374
+ this.myConfig.dictData = {};
375
+ }
376
+ this.myConfig.dictData = Object.assign({}, this.myConfig.sysDictData, this.myConfig.dictData);
377
+ }
378
+ if (this.myConfig.multiple) {
379
+ this.multiple = true;
380
+ }
381
+
382
+ if(this.queryConfig.isTree) {
383
+ this.queryConfig.showTitle = false;
384
+ }
385
+
386
+ if (this.myConfig.setQueryConfig) {
387
+ this.myConfig.setQueryConfig(this.queryConfig);
388
+ }
389
+ }
390
+
391
+ },
392
+ valueToFatherValue() {
393
+ let para= {};
394
+ if (!this.value || this.value.length === 0) {
395
+ if (this.multiple) {
396
+ this.text = [];
397
+ this.oldText = [];
398
+ } else {
399
+ this.value = '';
400
+ this.text = '';
401
+ }
402
+ } else {
403
+ para.value = this.value;
404
+ para.text = this.text;
405
+ }
406
+ return para;
407
+ },
408
+ click(){
409
+ let flag = true;
410
+ if (!this.queryConfig.isTree) {
411
+ if (this.$refs.popView.$children && this.$refs.popView.$children.length > 0) {
412
+ if (this.$refs.popView.$children[0].customClear) {
413
+ this.$refs.popView.$children[0].customClear();
414
+ }
415
+ this.$refs.popView.clearData();
416
+ }
417
+ }
418
+ if (this.myConfig.readOnly) {
419
+ return;
420
+ }
421
+ if (this.myConfig.searchBefore) {
422
+ this.$refs['popView'].clearSearchBeforeSearchParam();
423
+ flag = this.myConfig.searchBefore(this,this.$refs['popView']);
424
+ if (flag) {
425
+ if (this.searchParam !== undefined) {
426
+ this.$refs['popView'].setSearchBeforeSearchParam(this.searchParam);
427
+ }
428
+ }
429
+ }
430
+ if (flag) {
431
+ if (this.config.selectkey) {
432
+ this.popShow = true;
433
+ if (this.myConfig.clearCondition !== false) {
434
+ if (this.$refs['popView'].clearCondition) {
435
+ this.$refs['popView'].clearCondition();
436
+ }
437
+ }
438
+ if (this.queryConfig.manualLoad) {
439
+ this.$refs['popView'].refurbish();
440
+ } else {
441
+ this.$refs['popView'].setData([]);
442
+ }
443
+
444
+ }
445
+ }
446
+ },
447
+ onEnter(e) {
448
+ if (this.text === this.oldText) {
449
+ if (e && e.type ==='keydown' && e.key === 'Enter') {
450
+ if (this.$parent.enterKeyDown) {
451
+ this.$parent.enterKeyDown();
452
+ }
453
+ }
454
+ return;
455
+ }
456
+ let obj ={};
457
+ let flag = true;
458
+ let searchParam = {};
459
+ if (this.myConfig.searchBefore) {
460
+ this.$refs['popView'].clearSearchBeforeSearchParam();
461
+ obj.value = this.text;
462
+ flag = this.myConfig.searchBefore(this,obj);
463
+ }
464
+ if (flag) {
465
+ if (!this.text) {
466
+ this.value = '';
467
+ this.oldValue='';
468
+ this.oldText='';
469
+ this.text = '';
470
+ if (this.myConfig.setDataBefore) {
471
+ this.myConfig.setDataBefore(null, this);
472
+ }
473
+ this.setFatherValue();
474
+ return;
475
+ }
476
+ if (this.searchParam !== undefined) {
477
+ this.$refs['popView'].setSearchBeforeSearchParam(this.searchParam);
478
+ }
479
+ searchParam[this.queryConfig.responseCode] = this.text;
480
+ let data = this.$refs['popView'].popValueChanged(searchParam);
481
+ if (data.length === 0) {
482
+ this.alert(this.myConfig.label+':['+this.text+']不存在!');
483
+ this.text = this.oldText;
484
+ } else {
485
+ this.setCommmonValue(data[0]);
486
+ if (e && e.type ==='keydown' && e.key === 'Enter') {
487
+ if (this.$parent.enterKeyDown) {
488
+ this.$parent.enterKeyDown();
489
+ }
490
+ }
491
+ }
492
+ } else {
493
+ this.text = this.oldText;
494
+ }
495
+
496
+ },
497
+ onSelectChange() {
498
+ return this.$refs.myTreeBox.onSelectChange();
499
+ },
500
+ onCheckChange(param) {
501
+ this.selectTreeData=param;
502
+ let mktNameArray=[];
503
+ param.forEach(el => {
504
+ mktNameArray.push(el.name);
505
+ });
506
+ let mktname=mktNameArray.join(',');
507
+ this.text=mktname;
508
+ },
509
+
510
+ onToggleExpand() {
511
+ return this.$refs.myTreeBox.onToggleExpand();
512
+ },
513
+
514
+ setData(data) {
515
+ if (this.$refs.popView) {
516
+ this.$refs.popView.setData(data);
517
+ }
518
+ },
519
+ dbclick(e) {
520
+ let temp = {};
521
+ temp.action= 'condition_ok';
522
+ temp.rows = [];
523
+ temp.rows.push(e);
524
+ this.conditionAction(temp);
525
+ },
526
+ ok() {
527
+ let temp = {};
528
+ temp.action= 'condition_ok';
529
+ temp.rows = this.$refs.popView.getSelection();
530
+ this.conditionAction(temp);
531
+ },
532
+ watchCustomFatherValue () {
533
+ if (!this.value) {
534
+ if (!this.multiple) {
535
+ this.text = '';
536
+ this.OldText = '';
537
+ } else {
538
+ this.text = [];
539
+ this.OldText = [];
540
+ this.selectedMultiple = [];
541
+ }
542
+ }
543
+ },
544
+ setFocus(value) {
545
+ if (value) {
546
+ this.$refs.myControl.focus();
547
+ } else {
548
+ this.$refs.myControl.blur();
549
+ }
550
+ },
551
+ initSlectedMultiple () {
552
+ let selectedMultiple = [];
553
+ if (this.value.length > 0) {
554
+ this.value.forEach((el,index) => {
555
+ let temp = {};
556
+ temp[this.queryConfig.responseId] = el;
557
+ if (this.text && index < this.text.length) {
558
+ temp.label = this.text[index];
559
+ } else {
560
+ temp.label = el;
561
+ }
562
+ selectedMultiple.push(temp);
563
+ });
564
+ }
565
+ this.selectedMultiple = selectedMultiple;
566
+ },
567
+ cancel() {
568
+ this.popShow = false;
569
+ },
570
+ onEnter2(e) {
571
+ this.alert('1');
572
+ }
573
+ },
574
+ mounted() {
575
+ //this._setCustomWidth(this.clientWidth);
576
+ },
577
+ watch:{
578
+ fatherText: {
579
+ handler(newValue) {
580
+ this.text = newValue;
581
+ this.oldText = this.$Method.copy(newValue);
582
+ if (this.config.multiple) {
583
+ this.$nextTick(() => {
584
+ this.initSlectedMultiple();
585
+ });
586
+ }
587
+ },
588
+ immediate: true
589
+ },
590
+ popShow:{
591
+ handler(newValue) {
592
+ if (this.config.onOpenChange) {
593
+ this.config.onOpenChange(newValue);
594
+ }
595
+ },
596
+ immediate: true
597
+ }
598
+ }
599
+
600
+ };
601
+ </script>
@@ -0,0 +1,2 @@
1
+ import RadioGroupBox from './radiogroupbox.vue';
2
+ export default RadioGroupBox;
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <div v-show="myConfig.visible" style="white-space: nowrap;">
3
+ <RadioGroup ref="myControl" v-model="value" :size="myConfig.size" :style="myConfig.radioStyle" :vertical="myConfig.vertical" :type="myConfig.vtype" @on-change="_setFatherValue">
4
+ <Radio v-for="(item,index) in myConfig.data" :ref="'myControl_'+ index" :key="'radio_' + index" :label="item[myConfig.valueField]" :disabled="myConfig.readOnly" class="efuture-radiogroupbox-radio">
5
+ <span >{{item.label}}</span>
6
+ </Radio>
7
+ </RadioGroup>
8
+ </div>
9
+ </template>
10
+ <script>
11
+ import Base from '@/components/base/controlbase.vue';
12
+ export default {
13
+ name: 'radiogroupbox',
14
+ extends: Base,
15
+ data () {
16
+ return {
17
+ myConfig: {
18
+ data:[],
19
+ valueField: 'code',
20
+ textField: 'name',
21
+ codeWithName: true ,
22
+ defaultValue:'',
23
+ vertical:false,
24
+ vtype:null,
25
+ divStyle:{},
26
+ radioStyle:{}
27
+ }
28
+ };
29
+ },
30
+ methods:{
31
+ setCustomPro(obj) {
32
+ if (obj.data !== undefined && obj.data.length > 0) {
33
+ obj.data.forEach(el => {
34
+ if (this.myConfig.codeWithName) {
35
+ el.label = '['+ el[this.myConfig.valueField]+']' + el[this.myConfig.textField];
36
+ } else {
37
+ el.label =el[this.myConfig.textField];
38
+ }
39
+ });
40
+ }
41
+ return obj;
42
+ },
43
+ customInit() {
44
+ if (this.myConfig.data && this.myConfig.data.length > 0) {
45
+ this.myConfig.data.forEach(el => {
46
+ if (this.myConfig.codeWithName) {
47
+ el.label = '['+ el[this.myConfig.valueField]+']' + el[this.myConfig.textField];
48
+ } else {
49
+ if (el[this.myConfig.textField]) {
50
+ el.label =el[this.myConfig.textField];
51
+ } else {
52
+ el.label =el[this.myConfig.valueField];
53
+ }
54
+
55
+ }
56
+ });
57
+ }
58
+ },
59
+ setFocus(value) {
60
+ let index = this.myConfig.data.findIndex(el => el[this.myConfig.valueField] === this.value);
61
+ if (index === -1) {
62
+ index = 0;
63
+ }
64
+ let name = 'myControl_' + index;
65
+ if (this.$refs[name] && this.$refs[name][0]) {
66
+ if (value) {
67
+ this.$refs[name][0].$el.control.focus();
68
+ } else {
69
+ this.$refs[name][0].$el.control.blur();
70
+ }
71
+ }
72
+ }
73
+
74
+ }
75
+ };
76
+ </script>