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,510 @@
1
+ <template>
2
+ <Card :padding="0" dis-hover :bordered="false" :style="'background:#fff;overflow:hidden;height:' + clientHeight +'px'">
3
+ <div ref="toolbarcard" >
4
+ <Card :padding="0" style="padding-top:14px;padding-left:16px;padding-right:16px;border-radius:0px;" :bordered="false" dis-hover>
5
+ <ListBtnToolbar ref="menutoolbar" :config="menuToolbar" :moduleMethod="moduleMethod" @doAction="doAction"/>
6
+ <Divider style="margin-top:16px;margin-bottom:0px;" />
7
+ </Card>
8
+ </div>
9
+ <div ref="formcard">
10
+ <Card v-show="showSearchPara" :bordered="false" :padding="0" style="padding-left:14px;padding-right:14px;padding-top:0px;padding-bottom:0px" dis-hover>
11
+ <Formcards ref="form" :config="myConfig.formConfig" :dictData="dictData" />
12
+ </Card>
13
+ </div>
14
+ <div ref="bread">
15
+ <Card :padding="0" dis-hover :bordered="false" style="padding-left:14px;padding-right:14px;padding-top:0px;padding-bottom:0px" >
16
+ <Breadcrumb >
17
+ <BreadcrumbItem v-for="(temp,index) in levelData" to="click" :key="index" @click="levelClick(temp)">
18
+ <span v-if="index === (levelData.length - 1)" style="text-decoration: underline;" class="efuture-leveltextname">{{temp.name}}</span>
19
+ <span v-else style="text-decoration: underline;color:#303133">{{temp.name}}</span>
20
+ </BreadcrumbItem>
21
+ </Breadcrumb>
22
+ </Card>
23
+ </div>
24
+ <Card :padding="0" :bordered="false" style="padding:14px 16px" dis-hover>
25
+ <SimpleViewGrid v-if="reset" ref="grid" :config="gridConfig" :dictData="dictData" @dbclick="dbclick" />
26
+ </Card>
27
+ </Card>
28
+ </template>
29
+
30
+ <script>
31
+ import ListBtnToolbar from './listbtntoolbar.vue';
32
+ import Formcards from './formcard.vue';
33
+ import elementResizeDetectorMaker from 'element-resize-detector';
34
+ export default {
35
+ name:'mlevelreport',
36
+ components:{ListBtnToolbar, Formcards},
37
+ data () {
38
+ return {
39
+ levelName:'level',
40
+ levelIdName:'levelid',
41
+ levelFidName:'levelfid',
42
+ levelTextName:'levelname',
43
+ levelData:[],
44
+ initLevelData:[],
45
+ myConfig:{
46
+ titleType:2,
47
+ divStyle:'padding:5px',
48
+ showMaxRow:2,
49
+ title:'查询条件',
50
+ showAsyncImportExport:false
51
+ },
52
+ menuToolbar:{},
53
+ gridToolbar:{},
54
+ frontBtn: [{
55
+ name:'searchData',text:'查询',icon:'custom-search'
56
+ },{
57
+ name:'clearData',text:'清除',icon:'custom-clean'
58
+ }],
59
+ oldLevelidSearchBefore:null,
60
+ showSearchPara:true,
61
+ reset:true,
62
+ resetGridFlag:false,
63
+ hideItems:[]
64
+ };
65
+ },
66
+ props:{
67
+ config:{
68
+ type:Object,
69
+ default:null
70
+ },
71
+ dictData:{
72
+ type:Object,
73
+ default:null
74
+ },
75
+ moduleMethod:{
76
+ type:Array,
77
+ default:() => {
78
+ return [];
79
+ }
80
+ }
81
+ },
82
+ computed:{
83
+ clientHeight () {
84
+ return this.$Store.state.app.clientHeight;
85
+ },
86
+ gridConfig () {
87
+ let num = this.levelData.length;
88
+ if (num === 0) {
89
+ return this.$Method.copy(this.myConfig.gridConfig);
90
+ } else {
91
+ if (this.levelData[num - 1].gridName) {
92
+ return this.$Method.copy(this.myConfig[this.levelData[num - 1].gridName]);
93
+ } else {
94
+ return this.$Method.copy(this.myConfig.gridConfig);
95
+ }
96
+ }
97
+ }
98
+ },
99
+ created () {
100
+ this.myConfig = Object.assign({}, this.myConfig, this.config);
101
+ if (this.myConfig.levelIdName) {
102
+ this.levelIdName = this.myConfig.levelIdName;
103
+ }
104
+ if (this.myConfig.levelFidName) {
105
+ this.levelFidName = this.myConfig.levelFidName;
106
+ }
107
+ if (this.myConfig.levelTextName) {
108
+ this.levelTextName = this.myConfig.levelTextName;
109
+ }
110
+ if (this.myConfig.levelName) {
111
+ this.levelName = this.myConfig.levelName;
112
+ }
113
+ this.initGridMyConfig('gridConfig');
114
+ this.myConfig.formConfig.titleType = this.myConfig.titleType;
115
+ if (this.myConfig.formConfig.title === undefined) {
116
+ this.myConfig.formConfig.title = this.myConfig.title;
117
+ }
118
+ if (this.myConfig.menuToolbar && this.myConfig.menuToolbar.items) {
119
+ this.menuToolbar = this.$Method.copy(this.myConfig.menuToolbar);
120
+ }
121
+ let frontBtn = []
122
+ this.frontBtn.forEach(el => {
123
+ let index = this.menuToolbar.items.findIndex(el2 => el2.name === el);
124
+ if (index === -1) {
125
+ frontBtn.push(el);
126
+ }
127
+ });
128
+ this.menuToolbar.items = frontBtn.concat(this.menuToolbar.items);
129
+ this.menuToolbar.mainButton = 'searchData';
130
+ this.menuToolbar.mainButtonText ='查询';
131
+ this.menuToolbar.ignoreModule = ['searchData','clearData'];
132
+
133
+ let index = this.myConfig.formConfig.items.findIndex(el => el.name === this.levelIdName);
134
+ if (index > -1) {
135
+ if (this.myConfig.formConfig.items[index].searchBefore) {
136
+ this.oldLevelidSearchBefore = this.myConfig.formConfig.items[index].searchBefore;
137
+ }
138
+ if (!this.myConfig.formConfig.items[index].textName) {
139
+ this.myConfig.formConfig.items[index].textName = this.levelTextName;
140
+ }
141
+ this.myConfig.formConfig.items[index].searchBefore = this.levelidSearchBefore;
142
+ }
143
+ if (this.myConfig.initLevelData !== undefined) {
144
+ this.initLevelData = this.$Method.copy(this.myConfig.initLevelData);
145
+ }
146
+ if (this.initLevelData.length > 0) {
147
+ this.levelData.push(this.$Method.copy(this.initLevelData[0]));
148
+ }
149
+ let obj = {};
150
+ this.initLevelData.forEach(el => {
151
+ if (el.gridName && el.gridName !== 'gridConfig') {
152
+ if (!obj[el.gridName]) {
153
+ obj[el.gridName] = {};
154
+ this.initGridMyConfig(el.gridName);
155
+ if (!this.resetGridFlag) {
156
+ this.resetGridFlag = true;
157
+ }
158
+ }
159
+ }
160
+ });
161
+
162
+ let lineNum = this.myConfig.formConfig.lineNum;
163
+ let culLineNum = 0;
164
+ let flag = true;
165
+ this.myConfig.formConfig.items.forEach(el => {
166
+ if (el.colNum) {
167
+ culLineNum = culLineNum + Number(el.colNum)
168
+ } else {
169
+ culLineNum++;
170
+ }
171
+ if (flag && culLineNum > Number(lineNum)* Number(this.myConfig.showMaxRow)) {
172
+ flag = false
173
+ }
174
+ if (!flag){
175
+ el.visible = false;
176
+ this.hideItems.push(el);
177
+ }
178
+ });
179
+ if (this.hideItems.length > 0) {
180
+ this.myConfig.formConfig.items.push({
181
+ type:'Divider',
182
+ orientation:'right',
183
+ hide:true,
184
+ style: 'margin:2px 0',
185
+ doHide:this.doHide,
186
+ dividerName:'hidedivider'
187
+ });
188
+ }
189
+ },
190
+ methods:{
191
+ doHide(obj) {
192
+ let items = [];
193
+ this.hideItems.forEach(el => {
194
+ let item = {};
195
+ if (el.sname) {
196
+ item.sname = el.sname;
197
+ }
198
+ if (el.name) {
199
+ item.name = el.name;
200
+ }
201
+ el.visible = obj.value;
202
+ item.visible = obj.value;
203
+ items.push(item);
204
+ });
205
+ if (this.$parent.doHide) {
206
+ items = this.$parent.doHide(items);
207
+ }
208
+ this.$refs.form.updateItemsConfig(items);
209
+ },
210
+ initGridMyConfig (name) {
211
+ this.myConfig[name].headStyle = '';
212
+ this.myConfig[name].showCondition = false;
213
+ this.myConfig[name].onSelectionChange = this.gridOnSelectionChange;
214
+ if (this.myConfig[name].resources === undefined) {
215
+ this.myConfig[name].resources = this.config.resources;
216
+ }
217
+ if (this.myConfig[name].method === undefined) {
218
+ this.myConfig[name].method = this.config.classPrefix + '.' + 'query';
219
+ }
220
+ if (this.myConfig[name].response === undefined) {
221
+ this.myConfig[name].response = this.config.response;
222
+ }
223
+ this.myConfig[name].height = 1;
224
+ this.myConfig[name].width = 1;
225
+ this.myConfig[name].adjustHeight = 0;
226
+ this.myConfig[name].adjustWidth = 0;
227
+ this.myConfig[name].pageSize='small';
228
+
229
+ if (this.myConfig[name].pageSizeNum === undefined) {
230
+ this.myConfig[name].pageSizeNum = 20;
231
+ }
232
+ this.myConfig[name].items.forEach(el => {
233
+ if (el.type !== 'CheckBox') {
234
+ if (el.tooltip === undefined) {
235
+ el.tooltip = true;
236
+ }
237
+ }
238
+ if (el.name === this.myConfig.levelTextName) {
239
+ el.cellClassName= 'efuture-leveltextname';
240
+ }
241
+ });
242
+ },
243
+ levelClick (temp) {
244
+ let last = this.levelData.length - 1;
245
+ let index = this.levelData.findIndex(el => el[this.levelIdName] === temp[this.levelIdName]);
246
+ if (last === index) {
247
+ return false;
248
+ }
249
+ if (index > -1) {
250
+ this.levelData.splice(index, last - index);
251
+ }
252
+ let curlIndex = -1;
253
+ if (this.levelData.length > 0) {
254
+ curlIndex = this.levelData.length - 1;
255
+ }
256
+
257
+ if (curlIndex > -1) {
258
+ let preLevel = this.$Method.copy(this.initLevelData[curlIndex]);
259
+ if (temp[this.levelFidName]) {
260
+ preLevel[this.levelFidName] = temp[this.levelFidName];
261
+ }
262
+ let level = {};
263
+ level.newLevel = preLevel;
264
+ level.oldLevel = curlIndex;
265
+ this.levelData.splice(curlIndex, 1, preLevel);
266
+ if (this.resetGridFlag) {
267
+ this.reset = false;
268
+ this.$nextTick(() => {
269
+ this.reset = true;
270
+ this.$nextTick(() => {
271
+ this.setGridHeight();
272
+ this.doCommonLevelChange();
273
+ this.levelClickAfter(level);
274
+ });
275
+ });
276
+ } else {
277
+ this.doCommonLevelChange();
278
+ this.levelClickAfter(level);
279
+ }
280
+ } else {
281
+ return false;
282
+ }
283
+ },
284
+ doCommonLevelChange () {
285
+ let num = this.levelData.length - 1;
286
+ this.$refs.grid.updateColPro(this.levelTextName, {label:this.initLevelData[num].name});
287
+ if (num === 0) {
288
+ this.$refs.menutoolbar.setReadOnly('clearData', false);
289
+ } else {
290
+ this.$refs.menutoolbar.setReadOnly('clearData', true);
291
+ }
292
+ let obj = [];
293
+ let tempLevelConfig = {};
294
+ this.myConfig.formConfig.items.forEach(el => {
295
+ if (el.required || el.notLevelFlag) {
296
+ let temp = {};
297
+ if (el.name) {
298
+ temp.name = el.name;
299
+ } else {
300
+ if (el.sname) {
301
+ temp.name = el.sname;
302
+ }
303
+ }
304
+ if (num === 0) {
305
+ temp.readOnly = false;
306
+ if (el.required !== undefined) {
307
+ temp.required = true;
308
+ }
309
+ } else {
310
+ temp.readOnly = true;
311
+ if (el.required !== undefined) {
312
+ temp.required = false;
313
+ }
314
+ }
315
+ obj.push(temp);
316
+ }
317
+ if (el.name === this.levelIdName) {
318
+ Object.assign(tempLevelConfig, el);
319
+ }
320
+ });
321
+ if (this.initLevelData[num].levelConfig) {
322
+ Object.assign(tempLevelConfig, this.initLevelData[num].levelConfig);
323
+ }
324
+ tempLevelConfig.label = this.initLevelData[num].name;
325
+ obj.push(tempLevelConfig);
326
+ this.$refs.form.updateItemsConfig(obj);
327
+ this.$nextTick(() => {
328
+ this.$refs.form.setValue(this.levelIdName, '');
329
+ this.$refs.form.setValue(this.levelTextName, '');
330
+ this.searchData();
331
+ });
332
+ },
333
+ levelidSearchBefore (that, obj) {
334
+ if (this.oldLevelidSearchBefore) {
335
+ let flag = this.oldLevelidSearchBefore(that, obj);
336
+ if (flag) {
337
+ if (!that.searchParam) {
338
+ that.searchParam = {};
339
+ }
340
+ Object.assign(that.searchParam, this.getLevelPara(true));
341
+ }
342
+ return flag;
343
+ } else {
344
+ if (!that.searchParam) {
345
+ that.searchParam = {};
346
+ }
347
+ Object.assign(that.searchParam, this.getLevelPara(true));
348
+ }
349
+ return true;
350
+ },
351
+ doMenuToolbar () {
352
+ if (this.$refs.menutoolbar) {
353
+ this.$refs.menutoolbar.addBtnObject(this.frontBtn, 'front');
354
+ }
355
+ },
356
+ doAction (obj) {
357
+ const method = obj.name;
358
+ if (this.$parent[method]) {
359
+ this.$parent[method](obj);
360
+ } else {
361
+ if (this[method]) {
362
+ this[method](obj);
363
+ }
364
+ }
365
+ },
366
+ clearData () {
367
+ this.$refs.form.clearData();
368
+ this.$refs.grid.clearSearchBeforeSearchParam();
369
+ this.$refs.grid.clearData();
370
+ },
371
+ searchData () {
372
+ this.$refs.form.checkValidate();
373
+ let flag = this.$refs.form.isError();
374
+ if (flag) {
375
+ this.alert('必填项不允许为空');
376
+ return false;
377
+ }
378
+ let data = this.$refs.form.getData();
379
+ let searchParam = {};
380
+ for (let pro in data) {
381
+ if (data[pro] || data[pro] === 0) {
382
+ searchParam[pro] = data[pro];
383
+ }
384
+ }
385
+ Object.assign(searchParam, this.getLevelPara());
386
+ this.$refs.grid.clearSearchBeforeSearchParam();
387
+ this.$refs.grid.setSearchBeforeSearchParam(searchParam);
388
+ this.$refs.grid.refurbish();
389
+ },
390
+ getLevelPara (flag) {
391
+ let para = {};
392
+ if (this.levelData.length > 0) {
393
+ let num = this.levelData.length - 1;
394
+ if (this.levelData[num][this.levelName]) {
395
+ para[this.levelName] = this.levelData[num][this.levelName];
396
+ }
397
+ if (this.levelData[num][this.levelFidName]) {
398
+ para[this.levelFidName] = this.levelData[num][this.levelFidName];
399
+ }
400
+ }
401
+ if (this.myConfig.customSearchParam) {
402
+ return this.myConfig.customSearchParam(this.levelData, para, flag);
403
+ } else {
404
+ return para;
405
+ }
406
+ },
407
+ exportData () {
408
+ let data = this.$refs.grid.getData();
409
+ if (data.length === 0) {
410
+ this.alert('请先查询数据');
411
+ return false;
412
+ }
413
+ if (this.myConfig.showAsyncImportExport) {
414
+ if (this.$parent.asyncExport) {
415
+ this.$parent.asyncExport(grid)
416
+ return;
417
+ }
418
+ } else {
419
+ this.$refs.grid.export();
420
+ }
421
+
422
+ },
423
+ refurbish () {
424
+ this.searchData();
425
+ },
426
+ getGrid () {
427
+ return this.$refs.grid;
428
+ },
429
+ getForm () {
430
+ return this.$refs.form;
431
+ },
432
+ setGridHeight () {
433
+ let height = this.$refs.toolbarcard.offsetHeight + this.$refs.formcard.offsetHeight+ this.$refs.bread.offsetHeight + 43;
434
+ if (this.hideItems && this.hideItems.length > 0) {
435
+ height = height + 20;
436
+ }
437
+ if (this.$refs.grid.showSummary) {
438
+ height = height + 36;
439
+ }
440
+ this.$refs.grid.setOutsideHeight(height);
441
+ },
442
+ dbclick (e) {
443
+ let name = e[this.levelTextName];
444
+ let num = this.levelData.length - 1;
445
+ let nextLevelNum = num + 1;
446
+ if (nextLevelNum >= this.initLevelData.length) {
447
+ return;
448
+ }
449
+ let curl = {};
450
+ curl[this.levelIdName] = e[this.levelIdName];
451
+ if (this.levelData[num][this.levelFidName]) {
452
+ curl[this.levelFidName] = this.levelData[num][this.levelFidName];
453
+ }
454
+ curl.name = name;
455
+ this.levelData.splice(num, 1, curl);
456
+ let nextLevel = this.$Method.copy(this.initLevelData[nextLevelNum]);
457
+ nextLevel[this.levelFidName] = curl[this.levelIdName];
458
+ this.levelData.push(nextLevel);
459
+ let level = {};
460
+ level.newLevel = nextLevelNum;
461
+ level.oldLevel = num;
462
+ if (this.resetGridFlag) {
463
+ this.reset = false;
464
+ this.$nextTick(() => {
465
+ this.reset = true;
466
+ this.$nextTick(() => {
467
+ this.setGridHeight();
468
+ this.doCommonLevelChange();
469
+ this.dbclickAfter(e, level);
470
+ });
471
+ });
472
+ } else {
473
+ this.setGridHeight();
474
+ this.doCommonLevelChange();
475
+ this.dbclickAfter(e, level);
476
+ }
477
+
478
+ },
479
+ dbclickAfter (e,level) {
480
+ let obj = {};
481
+ obj.name ='gridDbClick';
482
+ obj.rowinfo = {};
483
+ obj.rowinfo.row = e;
484
+ obj.rowinfo.gridObject = this.$refs.grid;
485
+ obj.level = level;
486
+ this.doAction(obj);
487
+ },
488
+ levelClickAfter(level) {
489
+ let obj = {};
490
+ obj.name ='levelClick';
491
+ obj.level = level;
492
+ this.doAction(obj);
493
+ },
494
+ setHideDividerValue(value) {
495
+ this.$refs.form.setHideDividerValue(value);
496
+ }
497
+ },
498
+ mounted () {
499
+ this.observer = elementResizeDetectorMaker();
500
+ if (this.$refs.formcard) {
501
+ this.observer.listenTo(this.$refs.formcard, this.setGridHeight);
502
+ }
503
+ },
504
+ beforeUnmount() {
505
+ if (this.$refs.formcard) {
506
+ this.observer.removeListener(this.$refs.formcard, this.setGridHeight);
507
+ }
508
+ }
509
+ };
510
+ </script>