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,1061 @@
1
+ <script>
2
+ import { deepCopy } from '../../utils/assist';
3
+ import size from '@/components/base/size';
4
+ import { resolveComponent } from 'vue';
5
+ export default {
6
+ mixins: [size],
7
+ data () {
8
+ return {
9
+ globalConfig:{
10
+ cellbeginedit:'',
11
+ showHeader: true,
12
+ showIndex: true,
13
+ showStripe:false,
14
+ showBorder: true,
15
+ showCheckBox: false,
16
+ showCondition:false,
17
+ checkByHighlight:true,
18
+ readOnly: false,
19
+ showPage: true,
20
+ tableSize:'default',
21
+ pageSize:null,
22
+ pageShowElevator:true,
23
+ pageShowTotal:true,
24
+ pageShowSizer:true,
25
+ height: null,
26
+ manualLoad: true,
27
+ multiSelect: false,
28
+ operFixedFlag:true,
29
+ gridType:'viewGrid',
30
+ dynamicHeight:false,
31
+ generalOrientation:false,
32
+ showSummary:false,
33
+ showSumGroup:false,
34
+ sumText:'合计',
35
+ pageSizeNum:'',
36
+ adjustHeight:0,
37
+ items:[],
38
+ pageConfig: {
39
+ page_no: 1,
40
+ page_size: 100,
41
+ total_results: 0,
42
+ pageSizeList: [20, 50, 100, 200, 500, 1000]
43
+ },
44
+ moduleMethod:[],
45
+ headClassName:''
46
+ },
47
+ tempData:[],
48
+ data:[],
49
+ addData:[],
50
+ delData:[],
51
+ columns:[],
52
+ checkInfo:[],
53
+ checkAddInfo:[],
54
+ expand:{},
55
+ dictkey:'',
56
+ currentDictData:{},
57
+ editRowIndex:'',
58
+ editRowFlag:true,
59
+ loading:false,
60
+ conditionSearchParam:{},
61
+ showRowAction:false,
62
+ modulecode:'',
63
+ myToolConfig:{},
64
+ showMoreBtn:false ,
65
+ initData:[],
66
+ showDelRow:false,
67
+ showCondition:true,
68
+ delRowAction:[{
69
+ iconcls: 'row',
70
+ name: 'delRow',
71
+ text: '删除',
72
+ type:'text'
73
+ }],
74
+ operFixedFlag:true,
75
+ editIndex: -1,
76
+ editKey:'',
77
+ newRow:{},
78
+ summaryColumn:[],
79
+ total_summary:{},
80
+ extraHeight:0,
81
+ outsideHeight:0,
82
+ tableColumns:[],
83
+ soltTableColumns:[],
84
+ sumGroupNum:0,
85
+ culPage:1
86
+ };
87
+ },
88
+ props: {
89
+ config: {
90
+ type: Object,
91
+ default: () => {
92
+ return {};
93
+ }
94
+ },
95
+ dictData: {
96
+ type: Object,
97
+ default:null
98
+ },
99
+ toolConfig: {
100
+ type: Object,
101
+ default: () => {
102
+ return {};
103
+ }
104
+ },
105
+ isPop:{
106
+ type: Boolean,
107
+ default: false
108
+ }
109
+ },
110
+ created () {
111
+ this.init();
112
+ this.modulecode = this.$Method.getUrlParam('modulecode');
113
+ if (!this.modulecode) {
114
+ this.modulecode = this.$Method.getUrlParam('billmoduleid');
115
+ }
116
+ },
117
+ computed:{
118
+ makeTableColumns() {
119
+ return this.initColumn();
120
+ },
121
+ tableHeight() {
122
+ if (!this.myConfig.dynamicHeight) {
123
+ let currentHeight = this.currentHeight;
124
+ if (this.extraHeight) {
125
+ currentHeight = currentHeight - Number(this.extraHeight);
126
+ }
127
+ if (this.outsideHeight) {
128
+ currentHeight = currentHeight - Number(this.outsideHeight);
129
+ }
130
+ if (this.myConfig.showSummary) {
131
+ currentHeight = currentHeight - 50;
132
+ }
133
+ return currentHeight;
134
+ } else {
135
+ return null;
136
+ }
137
+ },
138
+ tableMaxHeight() {
139
+ if (this.myConfig.dynamicHeight) {
140
+ let currentHeight = this.currentHeight - this.extraHeight - this.outsideHeight;
141
+ if (this.myConfig.showSummary) {
142
+ currentHeight = currentHeight - 50;
143
+ }
144
+ return currentHeight;
145
+ } else {
146
+ return null;
147
+ }
148
+ }
149
+
150
+ },
151
+ methods: {
152
+ init() {
153
+ this.myConfig = Object.assign({},this.globalConfig,this.myConfig);
154
+
155
+ if (this.config) {
156
+ let config = this.$Method.copy(this.config);
157
+ for (let temp in config) {
158
+ if (temp === 'pageConfig') {
159
+ for (let temp2 in config[temp]) {
160
+ this.myConfig.pageConfig[temp2] = config[temp][temp2];
161
+ }
162
+ } else {
163
+ this.myConfig[temp] = config[temp];
164
+ }
165
+ }
166
+ }
167
+ if (this.dictData) {
168
+ this.currentDictData = this.dictData;
169
+ } else {
170
+ this.currentDictData = [];
171
+ }
172
+ if (this.myConfig.showDelRow !== undefined) {
173
+ this.showDelRow = this.myConfig.showDelRow;
174
+ }
175
+
176
+ if (this.myConfig.showCondition !== undefined) {
177
+ this.showCondition = this.myConfig.showCondition;
178
+ }
179
+ this.myToolConfig = this.$Method.copy(this.toolConfig);
180
+
181
+ // 非弹框模式
182
+ if (!this.isPop) {
183
+ // 判断是否显示更多 按钮
184
+ let num = 0;
185
+ if (this.myToolConfig.items) {
186
+ this.myToolConfig.items.forEach(el => {
187
+ if (el.iconcls === 'row') {
188
+ num++;
189
+ }
190
+ });
191
+ }
192
+ if (num > 2) {
193
+ this.showMoreBtn = true;
194
+ } else {
195
+ this.showMoreBtn = false;
196
+ }
197
+ // 是否开启行编辑栏
198
+ if (num > 0) {
199
+ this.showRowAction = true;
200
+ } else {
201
+ this.showRowAction = false;
202
+ }
203
+ // 开启行编辑栏时checkbox显示
204
+ if (this.showRowAction) {
205
+ if (!this.myConfig.showCheckBox) {
206
+ if (this.myConfig.multiSelect) {
207
+ this.myConfig.showCheckBox = true;
208
+ }
209
+ }
210
+ }
211
+ }
212
+
213
+ this.operFixedFlag = this.myConfig.operFixedFlag;
214
+ if (this.myConfig.items && this.myConfig.items.length > 0) {
215
+ this.myConfig.items.some(el => {
216
+ if (el.resizable === true) {
217
+ this.myConfig.showBorder = true;
218
+ return true;
219
+ }
220
+ });
221
+ }
222
+ this.setSizeConfig(this.myConfig);
223
+ if (this.customInit) {
224
+ this.customInit();
225
+ }
226
+ },
227
+ initCheckColumn(columns) {
228
+ if (this.myConfig.showCheckBox) {
229
+ let check = {};
230
+ check.type = 'selection';
231
+ check.align = 'center';
232
+ check.key ='selection';
233
+ check.width = 40;
234
+ check.multiSelect = this.myConfig.multiSelect;
235
+ columns.push(check);
236
+ }
237
+ },
238
+ isToolBar(obj) {
239
+ let flag = false;
240
+ if (this.myToolConfig && this.myToolConfig.items) {
241
+ this.myToolConfig.items.some(el => {
242
+ if (el.iconcls === obj) {
243
+ flag = true;
244
+ return true;
245
+ }
246
+ });
247
+ }
248
+ return flag;
249
+ } ,
250
+ initIndexColumn(columns) {
251
+ if (this.myConfig.showIndex) {
252
+ if (this.myConfig.showSumGroup) {
253
+ let indexConfig = {
254
+ label: '行号',
255
+ name: 'sumindex',
256
+ type: 'TextBox',
257
+ align: 'center',
258
+ width: 45
259
+ };
260
+ if (this.myConfig.items[0].name !== 'sumindex') {
261
+ this.myConfig.items.splice(0, 0, indexConfig);
262
+ }
263
+ } else {
264
+ let index = {};
265
+ index.type = 'index';
266
+ index.key = 'index';
267
+ index.width = 45;
268
+ index.title = '行号';
269
+ index.align = 'center';
270
+ if (this.myConfig.headClassName !== undefined) {
271
+ index.className = this.myConfig.headClassName;
272
+ }
273
+ index.indexMethod = this.indexRender;
274
+ if (this.myConfig.indexConfig !== undefined) {
275
+ Object.assign(index, this.myConfig.indexConfig);
276
+ }
277
+ columns.push(index);
278
+ }
279
+ }
280
+ },
281
+ initOperColumn(columns) {
282
+ if (this.showRowAction || this.showDelRow) {
283
+ let action ={};
284
+ action.title = '操作';
285
+ if (this.myConfig.headClassName !== undefined) {
286
+ action.className = this.myConfig.headClassName;
287
+ }
288
+ action.key = 'action';
289
+ action.render = this.actionRender;
290
+ if (this.operFixedFlag) {
291
+ action.fixed ='right';
292
+ }
293
+ action.width = 120;
294
+ if (this.myToolConfig.items.length === 1) {
295
+ action.width = 80;
296
+ }
297
+ action.align = 'center';
298
+ if (this.customInitOperColumn) {
299
+ this.customInitOperColumn(action, columns);
300
+ } else {
301
+ columns.push(action);
302
+ }
303
+ }
304
+ },
305
+ onColumnWidthResize(newWidth, oldWidth, column) {
306
+ let temp = {};
307
+ temp.newWidth = newWidth;
308
+ temp.oldWidth = oldWidth;
309
+ temp.column = column;
310
+ this.$emit('onColumnWidthResize',temp);
311
+ },
312
+ initExpandColumn(items) {
313
+ this.expand.items=[];
314
+ let columns =[];
315
+ for (let i = 0; i < items.length; i++) {
316
+ if (items[i].isExpand === true) {
317
+ this.expand.items.push(items[i]);
318
+ } else {
319
+ columns.push(items[i]);
320
+ }
321
+ }
322
+ if (this.expand.items.length > 0) {
323
+ let expand = {
324
+ type: 'expand',
325
+ width: 50,
326
+ render:this.expandRendel
327
+ };
328
+ const index = columns.findIndex(item => item.type === 'index');
329
+ if (index > -1 ) {
330
+ columns.splice(index+1, 0, expand);
331
+ } else {
332
+ const checkindex = columns.findIndex(item => item.type === 'selection');
333
+ if (checkindex > -1) {
334
+ columns.splice(checkindex+1, 0, expand);
335
+ } else {
336
+ columns.splice(0, 0, expand);
337
+ }
338
+ }
339
+ items = columns;
340
+ }
341
+
342
+ },
343
+ initColumn() {
344
+ let newRow = {};
345
+ let summaryColumn = [];
346
+ let columns = [];
347
+ if (!this.myConfig.items || this.myConfig.items.length === 0) {
348
+ return columns;
349
+ }
350
+ this.initCheckColumn(columns);
351
+ this.initOperColumn(columns);
352
+ this.initIndexColumn(columns);
353
+ const length = this.myConfig.items.length;
354
+ for (let i = 0; i < length; i++) {
355
+ if (this.myConfig.items[i].visible !== false) {
356
+ //this.setColumn(i);
357
+ // 添加复杂列项的支持
358
+ this.initCommonColumn(this.myConfig.items[i],columns,summaryColumn,newRow);
359
+ } else {
360
+ if (this.myConfig.items[i].defaultValue !== undefined) {
361
+ if (this.myConfig.items[i].name) {
362
+ newRow[this.myConfig.items[i].name] = this.myConfig.items[i].defaultValue;
363
+ }
364
+ if (this.myConfig.items[i].sname) {
365
+ newRow[this.myConfig.items[i].sname] = this.myConfig.items[i].defaultValue;
366
+ }
367
+ if (this.myConfig.items[i].ename) {
368
+ newRow[this.myConfig.items[i].ename] = this.myConfig.items[i].defaultValue;
369
+ }
370
+ }
371
+ }
372
+ }
373
+ this.initExpandColumn(columns);
374
+ let obj = {};
375
+ obj.columns = columns;
376
+ obj.newRow = newRow;
377
+ obj.summaryColumn = summaryColumn;
378
+ return obj;
379
+ },
380
+ initCommonColumn (obj,list,summaryColumn,newRow) {
381
+ let column = this.$Method.copy(obj);
382
+ if (!column.contentAlign) {
383
+ column.contentAlign = column.align;
384
+ }
385
+ column.title = column.label;
386
+ if (!column.headClassName) {
387
+ if (this.myConfig.headClassName !== undefined) {
388
+ column.className = this.myConfig.headClassName;
389
+ }
390
+ } else {
391
+ column.className = column.headClassName;
392
+ }
393
+
394
+ if (obj.children && obj.children.length > 0) {
395
+ column.children = [];
396
+ for (let i=0;i<obj.children.length; i++) {
397
+ this.initCommonColumn(obj.children[i],column.children,summaryColumn,newRow);
398
+ }
399
+ list.push(column);
400
+ } else {
401
+ column = this.initColumnConfig(column,summaryColumn,newRow);
402
+ list.push(column);
403
+ }
404
+ },
405
+ initColumnConfig(column,summaryColumn,newRow) {
406
+ let type = '';
407
+ if (column.type) {
408
+ type = column.type.toLowerCase();
409
+ }
410
+ column.key = column.name;
411
+ if (Number(column.width)) {
412
+ column.width = Number(column.width);
413
+ } else {
414
+ delete column.width;
415
+ }
416
+
417
+ this.setColumnPro(column,type,summaryColumn,newRow);
418
+
419
+ if (type !== 'render') {
420
+ if (column.render === undefined) {
421
+ if (this.setCustomColumn) {
422
+ this.setCustomColumn(column);
423
+ }
424
+ }
425
+ }
426
+
427
+ // 处理check
428
+ if (type === 'checkbox' || type === 'picturebox' || type === 'videobox') {
429
+ column.render = this.commonRendel;
430
+ if (type === 'picturebox') {
431
+ if (column.height === undefined) {
432
+ column.height = 40;
433
+ }
434
+ column.isGrid = true;
435
+ }
436
+ if (type === 'videobox') {
437
+ if (column.height === undefined) {
438
+ column.height = 60;
439
+ }
440
+ }
441
+ if (this.myConfig.readOnly) {
442
+ column.readOnly = true;
443
+ } else {
444
+ if (column.readOnly !== true) {
445
+ column.readOnly = false;
446
+ }
447
+ }
448
+
449
+ }
450
+ if (column.required) {
451
+ if (!column.className) {
452
+ column.className = 'efuture-grid-head-required';
453
+ }
454
+ }
455
+
456
+ // 事件绑定
457
+ if (column.valueChanged) {
458
+ column.valueChanged = this.valueChanged;
459
+ }
460
+ if (column.searchBefore) {
461
+ column.searchBefore = this.searchBefore;
462
+ }
463
+ if (column.setDataBefore) {
464
+ column.setDataBefore = this.setDataBefore;
465
+ }
466
+ if (column.onLinkTo) {
467
+ column.onLinkTo = this.onLinkTo;
468
+ }
469
+ if (type === 'timepicbox' || type === 'datebox' || type === 'daterangebox' || type === 'colorbox' || type === 'combobox') {
470
+ column.transfer = true;
471
+ }
472
+ return column;
473
+ },
474
+ setColumn(i) {
475
+ let column = this.$Method.copy(this.myConfig.items[i]);
476
+
477
+ column.title = column.label;
478
+ let type = '';
479
+ if (column.type) {
480
+ type = column.type.toLowerCase();
481
+ }
482
+ if (!type) {
483
+ return;
484
+ }
485
+
486
+ column.key = column.name;
487
+ if (Number(column.width)) {
488
+ column.width = Number(column.width);
489
+ } else {
490
+ delete column.width;
491
+ }
492
+
493
+ this.setColumnPro(column,type);
494
+
495
+ if (type !== 'render') {
496
+ if (column.render === undefined) {
497
+ if (this.setCustomColumn) {
498
+ this.setCustomColumn(column);
499
+ }
500
+ }
501
+ }
502
+
503
+ // 处理check
504
+ if (type === 'checkbox' || type === 'picturebox' || type === 'videobox') {
505
+ column.render = this.commonRendel;
506
+ if (type === 'picturebox') {
507
+ if (column.height === undefined) {
508
+ column.height = 40;
509
+ }
510
+ }
511
+ if (type === 'videobox') {
512
+ if (column.height === undefined) {
513
+ column.height = 60;
514
+ }
515
+ }
516
+ if (this.myConfig.readOnly) {
517
+ column.readOnly = true;
518
+ } else {
519
+ column.readOnly = false;
520
+ }
521
+
522
+ }
523
+ if (column.required) {
524
+ if (!column.className) {
525
+ column.className = 'efuture-grid-head-required';
526
+ }
527
+ }
528
+
529
+ if (!column.contentAlign) {
530
+ if (!column.align) {
531
+ column.contentAlign = column.align;
532
+ }
533
+
534
+ }
535
+ // 事件绑定
536
+ if (this.myConfig.items[i].valueChanged) {
537
+ column.valueChanged = this.valueChanged;
538
+ }
539
+ if (this.myConfig.items[i].searchBefore) {
540
+ column.searchBefore = this.searchBefore;
541
+ }
542
+
543
+ if (this.myConfig.items[i].setDataBefore) {
544
+ column.setDataBefore = this.setDataBefore;
545
+ }
546
+ if (this.myConfig.items[i].onLinkTo) {
547
+ column.onLinkTo = this.onLinkTo;
548
+ }
549
+ if (column.formatValue === undefined) {
550
+ if (this.myConfig.formatValue !== undefined) {
551
+ column.formatValue = this.myConfig.formatValue;
552
+ }
553
+ }
554
+ this.columns.push(column);
555
+ },
556
+ setColumnPro(column, type, summaryColumn, newRow) {
557
+ column.place = 'grid';
558
+ if (column.sortable === true) {
559
+ column.sortable = 'custom';
560
+ }
561
+ if (type === 'numberbox') {
562
+ if (!column.contentAlign) {
563
+ column.contentAlign = 'right';
564
+ }
565
+ if (!column.align) {
566
+ column.align = 'right';
567
+ }
568
+ if (column.summary && summaryColumn !== undefined) {
569
+ summaryColumn.push(column.name);
570
+ }
571
+ } else if (type === 'datebox' || type === 'checkbox' || type === 'picturebox' || type === 'videobox') {
572
+ if (this.myConfig.generalOrientation && type === 'datebox') {
573
+ if (!column.contentAlign) {
574
+ column.contentAlign = 'left';
575
+ }
576
+ if (!column.align) {
577
+ column.align = 'left';
578
+ }
579
+ } else {
580
+ if (!column.contentAlign) {
581
+ column.contentAlign = 'center';
582
+ }
583
+ if (!column.align) {
584
+ column.align = 'center';
585
+ }
586
+ }
587
+
588
+ } else {
589
+ if (!column.contentAlign) {
590
+ column.contentAlign = 'left';
591
+ }
592
+ if (!column.align) {
593
+ column.align = 'left';
594
+ }
595
+ }
596
+ if (type === 'combobox') {
597
+ if (column.data === undefined) {
598
+ let dictkey = column.dictkey;
599
+ if (column.customDictkey) {
600
+ dictkey = column.customDictkey;
601
+ }
602
+ column.data = this.currentDictData[dictkey];
603
+ }
604
+ }
605
+
606
+ // 处理默认值
607
+ if (column.defaultValue !== undefined) {
608
+ newRow[column.name] = column.defaultValue;
609
+ } else {
610
+ if (type === 'numberbox' || type === 'numberrangebox') {
611
+ let min = '';
612
+ if (column.min !== undefined) {
613
+ min = column.min;
614
+ }
615
+ if (column.smin !== undefined) {
616
+ min = column.smin;
617
+ }
618
+ if (column.smin === undefined && column.emin !== undefined) {
619
+ min = column.emin;
620
+ }
621
+ column.defaultValue = min;
622
+ if (newRow !== undefined) {
623
+ newRow[column.name] = min;
624
+ if(column.boundaryValue === false) {
625
+ newRow[column.name] = '';
626
+ column.defaultValue = '';
627
+ }
628
+ }
629
+
630
+ } else {
631
+ if (newRow !== undefined) {
632
+ if (column.type === 'poptagbox') {
633
+ newRow[column.name] = [];
634
+ } else {
635
+ newRow[column.name] = '';
636
+ }
637
+ }
638
+ }
639
+ }
640
+ },
641
+ expandRendel(h, params) {
642
+ return h('div', [
643
+ h(resolveComponent('ExpandRow'), {
644
+ config: this.expand,
645
+ valueData:params.row,
646
+ vstyle:'margin-right: 120px',
647
+ showRowAction:false,
648
+ onInputValue:(val) => {
649
+ this.editIndex = params.index;
650
+ this.input(val);
651
+ //this.editValueChanged(params,val);
652
+ }
653
+ })
654
+ ]);
655
+ },
656
+ indexRender (row,_index) {
657
+ let index = _index + 1;
658
+ if (this.myConfig.showPage) {
659
+ index = index + (this.myConfig.pageConfig.page_no - 1) * this.myConfig.pageConfig.page_size;
660
+ }
661
+ if (this.myConfig.indexMethod) {
662
+ return this.myConfig.indexMethod(row, index);
663
+ } else {
664
+ return index;
665
+ }
666
+ },
667
+ actionRender (h, params) {
668
+ return h('div', [
669
+ h(resolveComponent('Toolbar'), {
670
+ config:this.myToolConfig,
671
+ tooltype:'row',
672
+ moduleMethod:this.globalConfig.moduleMethod,
673
+ row:params.row,
674
+ onDoAction:(val) => {
675
+ val.rowinfo = params;
676
+ if (val.name === 'editRowForm') {
677
+ if (this.initRowForm) {
678
+ this.initRowForm(val);
679
+ }
680
+ } else if (val.name === 'delRow') {
681
+ if (this.delRow) {
682
+ this.delRow(params.index);
683
+ }
684
+ } else {
685
+ this.$emit('doAction',val);
686
+ }
687
+ }
688
+ })
689
+ ]);
690
+ },
691
+ remove (index) {
692
+ let _index = this.data.findIndex(item => item._customIndex === index);
693
+ if (_index === -1) {
694
+ _index = index;
695
+ }
696
+ if (_index > -1) {
697
+ if (this.data[_index].flag === undefined || this.data[_index].flag === 'U') {
698
+ this.data[_index].flag = 'D';
699
+ const row = this.$Method.copy(this.data[_index]);
700
+ this.delData.push(row);
701
+ }
702
+ this.data.splice(_index, 1);
703
+ }
704
+ if (this.customRemove) {
705
+ this.customRemove(_index);
706
+ }
707
+ },
708
+ setEdit(index) {
709
+ if (this.editRowIndex === index) {
710
+ this.editRowIndex = null;
711
+ } else {
712
+ this.editRowIndex = index;
713
+ }
714
+ },
715
+ dbclick (e) {
716
+ this.$emit('dbclick', e);
717
+ },
718
+ click (e) {
719
+ this.$emit('rowclick', e);
720
+ this.$emit('click', e);
721
+ },
722
+ setData(data) {
723
+ this.data = [];
724
+ this.data = data;
725
+ this.initData = this.$Method.copy(this.data);
726
+ this.delData = [];
727
+ this.checkInfo = [];
728
+ if (this.cancelCellEditing) {
729
+ this.cancelCellEditing();
730
+ }
731
+ },
732
+ getData() {
733
+ return this.$Method.copy(this.data);
734
+ },
735
+ clearData() {
736
+ this.editIndex = -1;
737
+ this.editKey = '';
738
+ this.data = [];
739
+ this.delData = [];
740
+ this.initData = [];
741
+ this.checkInfo = [];
742
+ this.addData = [];
743
+ this.checkAddInfo = [];
744
+ this.conditionSearchParam = {};
745
+ this.myConfig.pageConfig.page_no = 1;
746
+ this.myConfig.pageConfig.total_results = 0;
747
+ this.columnWidth = {};
748
+ if (this.customClearData) {
749
+ this.customClearData();
750
+ }
751
+ },
752
+ updataRow(index, para) {
753
+ let row = Object.assign({}, this.data[index], para);
754
+ this.data.splice(index,1,row);
755
+ this.tempData.splice(index,1,row);
756
+ },
757
+ getModuleMethod() {
758
+ this.modulecode = this.$Method.getUrlParam('modulecode');
759
+ if (!this.modulecode) {
760
+ this.modulecode = this.$Method.getUrlParam('billmoduleid');
761
+ }
762
+ this.token = this.$Method.getUrlParam('token');
763
+ if (this.modulecode && this.token) {
764
+ let btnList = this.getUserModuleMethod();
765
+ if (btnList) {
766
+ this.globalConfig.moduleMethod = btnList.modulemethod;
767
+ }
768
+ }
769
+ },
770
+ getSelection() {
771
+ return this.$refs.table.getSelection();
772
+ },
773
+ input(obj) {
774
+ let index = this.editIndex;
775
+ if (index === -1) {
776
+ if (obj.editIndex !== undefined) {
777
+ index = obj.editIndex;
778
+ } else {
779
+ return;
780
+ }
781
+ }
782
+ let tempRow = {};
783
+ if (obj.value !== undefined) {
784
+ tempRow[obj.name] = obj.value;
785
+ }
786
+ if (obj.text !== undefined) {
787
+ tempRow[obj.textName] = obj.text;
788
+ }
789
+ if (obj.svalue !== undefined) {
790
+ tempRow[obj.sname] = obj.svalue;
791
+ }
792
+ if (obj.evalue !== undefined) {
793
+ tempRow[obj.ename] = obj.evalue;
794
+ }
795
+
796
+ if (this.data[index].flag === undefined) {
797
+ tempRow.flag = 'U';
798
+ }
799
+
800
+ if (obj.customRows && obj.customRows.length > 0){
801
+ let self = this;
802
+ // 处理更新行
803
+ obj.customRows.forEach(el => {
804
+ if (el.changeIndex !== undefined) {
805
+ let newRow = Object.assign({},self.data[el.changeIndex],el);
806
+ if (self.data[el.changeIndex].flag === undefined) {
807
+ newRow.flag = 'U';
808
+ }
809
+ self.data.splice(el.changeIndex,1,newRow);
810
+ }
811
+ });
812
+ // 处理新增行
813
+ obj.customRows.forEach(el => {
814
+ if (el.changeIndex === undefined) {
815
+ let newRow = Object.assign({},{},el);
816
+ newRow.flag = 'I';
817
+ self.data.push(newRow);
818
+ }
819
+ });
820
+ } else {
821
+ let newRow = Object.assign({},this.data[index],tempRow);
822
+ this.$nextTick(() => {
823
+ this.data.splice(index,1,newRow);
824
+ });
825
+
826
+ }
827
+
828
+ },
829
+ updateColPro(name, pro) {
830
+ const index = this.myConfig.items.findIndex(item => name === item.name);
831
+ if (index > -1) {
832
+ let item = Object.assign({},this.myConfig.items[index],pro);
833
+ this.myConfig.items.splice(index,1,item);
834
+ }
835
+ },
836
+ setRowCheck(index , flag) {
837
+ // 单选
838
+ if (!this.myConfig.multiSelect) {
839
+ let data = this.$Method.copy(this.data);
840
+ data.forEach((el,_index) =>{
841
+ if (_index === index) {
842
+ if (this.myConfig.onSetRowCheckBefore) {
843
+ if (this.myConfig.onSetRowCheckBefore(index,flag)) {
844
+ el._checked = flag;
845
+ if (this.myConfig.checkByHighlight) {
846
+ el._highlight = flag;
847
+ }
848
+ }
849
+ } else {
850
+ el._checked = flag;
851
+ if (this.myConfig.checkByHighlight) {
852
+ el._highlight = flag;
853
+ }
854
+ }
855
+ } else {
856
+ el._checked = false;
857
+ el._highlight = false;
858
+ }
859
+ });
860
+ this.$nextTick(() => {
861
+ this.data = data;
862
+ });
863
+ // 多选
864
+ } else {
865
+ if (index > -1) {
866
+ let newRow = Object.assign({},this.data[index],{});
867
+ newRow._checked = flag;
868
+ if (this.myConfig.checkByHighlight) {
869
+ newRow._highlight = flag;
870
+ }
871
+ if (this.myConfig.onSetRowCheckBefore) {
872
+ if (this.myConfig.onSetRowCheckBefore(index,flag)) {
873
+ this.$nextTick(() => {
874
+ this.data.splice(index,1,newRow);
875
+ this.tempData.splice(index,1,newRow);
876
+ });
877
+ }
878
+ } else {
879
+ this.$nextTick(() => {
880
+ this.data.splice(index,1,newRow);
881
+ this.tempData.splice(index,1,newRow);
882
+ });
883
+ }
884
+ }
885
+ }
886
+ },
887
+ setAllRowCheck(flag) {
888
+ let data = this.$Method.copy(this.data);
889
+ data.forEach(el =>{
890
+ el._checked = flag;
891
+ if (this.myConfig.checkByHighlight) {
892
+ el._highlight = flag;
893
+ }
894
+ });
895
+ this.$nextTick(() => {
896
+ this.data = data;
897
+ });
898
+ },
899
+ setRowDisabled(index , flag) {
900
+ if (index > -1) {
901
+ let newRow = Object.assign({},this.data[index],{});
902
+ newRow._disabled = flag;
903
+ this.$nextTick(() => {
904
+ this.data.splice(index,1,newRow);
905
+ this.tempData.splice(index,1,newRow);
906
+ });
907
+ }
908
+ },
909
+ setAllRowDisabled(flag) {
910
+ let data = this.$Method.copy(this.data);
911
+ data.forEach(el =>{
912
+ el._disabled = flag;
913
+ });
914
+ this.$nextTick(() => {
915
+ this.data = data;
916
+ });
917
+ },
918
+ setRowHighlight(index , flag) {
919
+ if (index > -1) {
920
+ let newRow = Object.assign({},this.data[index],{});
921
+ newRow._highlight = flag;
922
+ this.$nextTick(() => {
923
+ this.data.splice(index,1,newRow);
924
+ this.tempData.splice(index,1,newRow);
925
+ });
926
+ }
927
+ },
928
+ setAllRowHighlight(flag) {
929
+ let data = this.$Method.copy(this.data);
930
+ data.forEach(el =>{
931
+ el._highlight = flag;
932
+ });
933
+ this.$nextTick(() => {
934
+ this.data = data;
935
+ });
936
+ },
937
+ commonRendel(h, params) {
938
+ return h('div', [
939
+ h(resolveComponent('ControlBox'), {
940
+ config: params.column,
941
+ valueData:params.row,
942
+ readOnly:params.row.flag === 'D'? true:false,
943
+ autofocus:this.editIndex === params.index && this.editKey === params.column.key?true:false,
944
+ onInputValue:(val) => {
945
+ this.editIndex = params.index;
946
+ this.editKey = params.column.key;
947
+ this.input(val);
948
+ },
949
+ onDoAction:(val) =>{
950
+ this.doAction(val);
951
+ }
952
+ })
953
+ ]);
954
+ },
955
+
956
+ setExtraHeight () {
957
+ let height = 0;
958
+ if (this.$refs.head) {
959
+ height = this.$refs.head.offsetHeight;
960
+ }
961
+ if (this.$refs.page) {
962
+ height = height + this.$refs.page.offsetHeight;
963
+ }
964
+ this.extraHeight = height;
965
+ },
966
+ setOutsideHeight(value) {
967
+ this.outsideHeight = value;
968
+ },
969
+ getSoltTableColumns(config,list) {
970
+ if (config) {
971
+ if (config instanceof Array) {
972
+ config.forEach(el => {
973
+ this.getSoltTableColumns(el, list);
974
+ })
975
+ } else {
976
+ if (config.children && config.children.length > 0) {
977
+ config.children.forEach(el => {
978
+ this.getSoltTableColumns(el, list);
979
+ })
980
+ } else {
981
+ let temp = Object.assign({},config);
982
+ if (temp.key !=='action' && temp.key !== 'actionbtn') {
983
+ list.push(temp);
984
+ }
985
+ }
986
+ }
987
+ }
988
+ },
989
+ findColumnConfig(name,config) {
990
+ if (name) {
991
+ if (config instanceof Array) {
992
+ let flag = false;
993
+ let tmpConfig = {};
994
+ config.some(el => {
995
+ let tmp = this.findColumnConfig(name,el);
996
+ if (!!tmp) {
997
+ flag = true;
998
+ tmpConfig = tmp;
999
+ return true;
1000
+ }
1001
+ });
1002
+ if (flag) {
1003
+ return tmpConfig;
1004
+ } else {
1005
+ return false;
1006
+ }
1007
+ } else {
1008
+ if (config.children && config.children.length > 0) {
1009
+ let flag = false;
1010
+ let tmpConfig = {};
1011
+ config.children.some(el => {
1012
+ let tmp = this.findColumnConfig(name, el);
1013
+ if (!!tmp) {
1014
+ flag = true;
1015
+ tmpConfig = tmp;
1016
+ return true;
1017
+ }
1018
+ });
1019
+ if (flag) {
1020
+ return tmpConfig;
1021
+ } else {
1022
+ return false;
1023
+ }
1024
+ } else {
1025
+ if(name === config.name) {
1026
+ return config;
1027
+ } else {
1028
+ return false;
1029
+ }
1030
+ }
1031
+ }
1032
+ }
1033
+ },
1034
+ openHelp () {
1035
+ window.open(this.curHelpUrl);
1036
+ },
1037
+ initScrollLeft() {
1038
+ if (this.$refs.table && this.$refs.table.$refs.body ) {
1039
+ this.$refs.table.$refs.body.scrollLeft = 0;
1040
+ }
1041
+ },
1042
+ },
1043
+ watch:{
1044
+ data(val){
1045
+ this.tempData = deepCopy(val);
1046
+ },
1047
+ makeTableColumns(val) {
1048
+ this.total_summary = {};
1049
+ this.newRow = deepCopy(val.newRow);
1050
+ this.summaryColumn = deepCopy(val.summaryColumn);
1051
+ this.tableColumns = deepCopy(val.columns);
1052
+ let soltTableColumns = [];
1053
+ this.getSoltTableColumns(val.columns, soltTableColumns);
1054
+ this.soltTableColumns = soltTableColumns;
1055
+ }
1056
+ },
1057
+ mounted () {
1058
+
1059
+ }
1060
+ };
1061
+ </script>