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,357 @@
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 :padding="0" dis-hover :bordered="false" style="padding-left:14px;padding-right:14px;padding-top:0px;padding-bottom:0px">
11
+ <Formcards ref="form" :config="myConfig.formConfig" :dictData="dictData"/>
12
+ </Card>
13
+ </div>
14
+ <Tabs v-if="myConfig.tabFlag" class="tabmode" v-model='curTab' @on-click="tabClick">
15
+ <TabPane v-for="(item,index) in myConfig.tabConfig" :label="item.title" style="background:#fff" :name="item.code" :key="index">
16
+ <SimpleViewGrid :ref="item.code" :config="myConfig[item.gridName]" :dictData="dictData" @dbclick="dbclick" />
17
+ </TabPane>
18
+ </Tabs>
19
+ <Card v-else :padding="0" style="padding:14px 16px;" :bordered="false" dis-hover>
20
+ <SimpleViewGrid ref="grid" :config="myConfig.gridConfig" :dictData="dictData" @dbclick="dbclick" />
21
+ </Card>
22
+ </Card>
23
+ </template>
24
+
25
+ <script>
26
+ import ListBtnToolbar from './listbtntoolbar.vue';
27
+ import Formcards from './formcard.vue';
28
+ import elementResizeDetectorMaker from 'element-resize-detector';
29
+ export default {
30
+ name:'mreport',
31
+ components:{ListBtnToolbar,Formcards},
32
+ data () {
33
+ return {
34
+ myConfig:{
35
+ titleType:2,
36
+ divStyle:'padding:5px',
37
+ title:'查询条件',
38
+ showMaxRow:2,
39
+ tabFlag:false,
40
+ showAsyncImportExport:false,
41
+ tabConfig:[]
42
+ },
43
+ curTab:'',
44
+ menuToolbar:{},
45
+ gridToolbar:{},
46
+ hideItems:[],
47
+ frontBtn: [{
48
+ name:'searchData',text:'查询',icon:'custom-search'
49
+ },{
50
+ name:'clearData',text:'清除',icon:'custom-clean'
51
+ }]
52
+ };
53
+ },
54
+ props:{
55
+ config: {
56
+ type:Object,
57
+ default:null
58
+ },
59
+ dictData: {
60
+ type: Object,
61
+ default:null
62
+ },
63
+ moduleMethod:{
64
+ type:Array,
65
+ default: () => {
66
+ return [];
67
+ }
68
+ }
69
+ },
70
+ computed: {
71
+ clientHeight () {
72
+ return this.$Store.state.app.clientHeight;
73
+ }
74
+ },
75
+ created () {
76
+ this.myConfig = Object.assign({},this.myConfig, this.config);
77
+ if (this.myConfig.tabFlag) {
78
+ this.myConfig.tabConfig.forEach((el,index) => {
79
+ if (index === 0) {
80
+ this.curTab = el.code;
81
+ }
82
+ this.initGridConfig(el.gridName);
83
+ });
84
+ } else {
85
+ this.initGridConfig('gridConfig');
86
+ }
87
+ this.myConfig.formConfig.titleType = this.myConfig.titleType;
88
+ if (this.myConfig.formConfig.title === undefined) {
89
+ this.myConfig.formConfig.title = this.myConfig.title;
90
+ }
91
+ if (this.myConfig.menuToolbar && this.myConfig.menuToolbar.items) {
92
+ this.menuToolbar = this.$Method.copy(this.myConfig.menuToolbar);
93
+ }
94
+ let frontBtn = []
95
+ this.frontBtn.forEach(el => {
96
+ let index = this.menuToolbar.items.findIndex(el2 => el2.name === el);
97
+ if (index === -1) {
98
+ frontBtn.push(el);
99
+ }
100
+ });
101
+ this.menuToolbar.items = frontBtn.concat(this.menuToolbar.items);
102
+ this.menuToolbar.mainButton = 'searchData';
103
+ this.menuToolbar.mainButtonText ='查询';
104
+ this.menuToolbar.ignoreModule = ['searchData','clearData'];
105
+ let lineNum = this.myConfig.formConfig.lineNum;
106
+ let culLineNum = 0;
107
+ let flag = true;
108
+
109
+ this.myConfig.formConfig.items.forEach(el => {
110
+ if (el.colNum) {
111
+ culLineNum = culLineNum + Number(el.colNum)
112
+ } else {
113
+ culLineNum++;
114
+ }
115
+ if (flag && culLineNum > Number(lineNum)* Number(this.myConfig.showMaxRow)) {
116
+ flag = false
117
+ }
118
+ if (!flag){
119
+ el.visible = false;
120
+ this.hideItems.push(el);
121
+ }
122
+ });
123
+ if (this.hideItems.length > 0) {
124
+ this.myConfig.formConfig.items.push({
125
+ type:'Divider',
126
+ orientation:'right',
127
+ hide:true,
128
+ style: 'margin:2px 0',
129
+ dividerName:'hidedivider',
130
+ doHide:this.doHide
131
+ });
132
+ }
133
+ },
134
+ methods: {
135
+ doAction (obj) {
136
+ const method = obj.name;
137
+ if (this.$parent[method]) {
138
+ this.$parent[method](obj);
139
+ } else {
140
+ if (this[method]) {
141
+ this[method](obj);
142
+ }
143
+ }
144
+ },
145
+ dbclick (e) {
146
+ let obj = {};
147
+ obj.name ='gridDbClick';
148
+ obj.rowinfo = {};
149
+ obj.rowinfo.row = e;
150
+ if (this.myConfig.tabFlag) {
151
+ obj.rowinfo.gridObject = this.$refs[this.curTab][0];
152
+ } else {
153
+ obj.rowinfo.gridObject = this.$refs.grid;
154
+ }
155
+
156
+ this.doAction(obj);
157
+ },
158
+ initGridConfig(name) {
159
+ if (!this.myConfig[name]) {
160
+ return;
161
+ }
162
+ this.myConfig[name].headStyle='';
163
+ this.myConfig[name].showCondition = false;
164
+ this.myConfig[name].onSelectionChange = this.gridOnSelectionChange;
165
+ if (this.myConfig[name].resources === undefined) {
166
+ this.myConfig[name].resources =this.config.resources;
167
+ }
168
+ if (this.myConfig[name].method === undefined) {
169
+ this.myConfig[name].method = this.config.classPrefix + '.' +'query';
170
+ }
171
+ if (this.myConfig[name].response === undefined) {
172
+ this.myConfig[name].response = this.config.response;
173
+ }
174
+ this.myConfig[name].height = 1;
175
+ this.myConfig[name].width = 1;
176
+ this.myConfig[name].adjustHeight = 0;
177
+ this.myConfig[name].adjustWidth = 0;
178
+ this.myConfig[name].pageSize='small';
179
+
180
+ if (this.myConfig[name].pageSizeNum === undefined) {
181
+ this.myConfig[name].pageSizeNum = 20;
182
+ }
183
+ this.myConfig[name].items.forEach(el => {
184
+ if (el.type !== 'CheckBox') {
185
+ if (el.tooltip === undefined) {
186
+ el.tooltip = true;
187
+ }
188
+ }
189
+ });
190
+ },
191
+ tabClick(e) {
192
+ if (this.$parent.tabClick) {
193
+ this.$parent.tabClick(e);
194
+ }
195
+ },
196
+ clearData () {
197
+ this.$refs.form.clearData();
198
+ this.$refs.grid.clearSearchBeforeSearchParam();
199
+ this.$refs.grid.clearData();
200
+ },
201
+ doHide(obj) {
202
+ let items = [];
203
+ this.hideItems.forEach(el => {
204
+ let item = {};
205
+ if (el.sname) {
206
+ item.sname = el.sname;
207
+ }
208
+ if (el.name) {
209
+ item.name = el.name;
210
+ }
211
+ el.visible = obj.value;
212
+ item.visible = obj.value;
213
+ items.push(item);
214
+ });
215
+ this.$refs.form.updateItemsConfig(items);
216
+ },
217
+ searchData() {
218
+ this.$refs.form.checkValidate();
219
+ let flag = this.$refs.form.isError();
220
+ if (flag) {
221
+ this.alert('必填项不允许为空');
222
+ return false;
223
+ }
224
+ if (this.$parent.searchCheck) {
225
+ let tmpFlag = true;
226
+ tmpFlag = this.$parent.searchCheck();
227
+ if (!tmpFlag) {
228
+ return false;
229
+ }
230
+ }
231
+
232
+ let data = this.$refs.form.getData();
233
+ let searchParam = {};
234
+ for (let pro in data) {
235
+ if (data[pro] || data[pro] === 0) {
236
+ searchParam[pro] = data[pro];
237
+ }
238
+ }
239
+ if (this.myConfig.overrideSearchParam) {
240
+ searchParam = this.myConfig.overrideSearchParam(searchParam);
241
+ }
242
+ if (this.myConfig.tabFlag) {
243
+ let gridName = this.myConfig.tabConfig[0].code;
244
+ if (this.$refs[gridName] && this.$refs[gridName][0]) {
245
+ this.$refs[gridName][0].clearSearchBeforeSearchParam();
246
+ this.$refs[gridName][0].setSearchBeforeSearchParam(searchParam);
247
+ this.$refs[gridName][0].refurbish();
248
+ this.curTab = gridName;
249
+ }
250
+ } else {
251
+ this.$refs.grid.clearSearchBeforeSearchParam();
252
+ this.$refs.grid.setSearchBeforeSearchParam(searchParam);
253
+ this.$refs.grid.refurbish();
254
+ }
255
+
256
+ },
257
+ exportData() {
258
+ if (this.myConfig.tabFlag) {
259
+ if (this.$refs[this.curTab] && this.$refs[this.curTab][0]) {
260
+ let grid = this.$refs[this.curTab][0];
261
+ this.commonExport(grid);
262
+ }
263
+ } else {
264
+ this.commonExport(this.$refs.grid);
265
+ }
266
+ },
267
+ setTab(name) {
268
+ this.curTab = name;
269
+ },
270
+ commonExport(grid) {
271
+ let data = grid.getData();
272
+ if (data.length === 0) {
273
+ this.alert('请先查询数据');
274
+ return false;
275
+ }
276
+ if (grid.config.dynamicColumnFlag) {
277
+ grid.dynamicExportExcel();
278
+ } else {
279
+ if (this.myConfig.showAsyncImportExport) {
280
+ if (this.$parent.asyncExport) {
281
+ this.$parent.asyncExport(grid)
282
+ return;
283
+ }
284
+ } else {
285
+ if (this.myConfig.defaultExport) {
286
+ let _param = grid.getSearchParam();
287
+ let moduleCode = this.getModulecode();
288
+ if (moduleCode) {
289
+ _param.moduleCode = moduleCode;
290
+ } else {
291
+ this.alert('模块号不能为空');
292
+ return;
293
+ }
294
+ _param.exporttype = 'excel';
295
+ let _baseUrl = grid.config.resources.replace('rest', 'exportReport');
296
+ let _self = this;
297
+ this.doExportReport(_baseUrl, grid.config.method, _param, _self);
298
+ } else {
299
+ grid.export();
300
+ }
301
+ }
302
+ }
303
+
304
+
305
+ },
306
+ refurbish () {
307
+ this.searchData();
308
+ },
309
+ getGrid (name) {
310
+ if (this.myConfig.tabFlag) {
311
+ if (this.$refs[name] && this.$refs[name][0]) {
312
+ return this.$refs[name][0];
313
+ }
314
+ } else {
315
+ return this.$refs.grid;
316
+ }
317
+ },
318
+ getForm () {
319
+ return this.$refs.form;
320
+ },
321
+ setGridHeight() {
322
+ let height = this.$refs.toolbarcard.offsetHeight + this.$refs.formcard.offsetHeight + 43;
323
+ if (this.hideItems && this.hideItems.length > 0) {
324
+ height = height + 20;
325
+ }
326
+ if (this.myConfig.tabFlag) {
327
+ height = height + 60;
328
+ this.myConfig.tabConfig.forEach(el => {
329
+ if (this.$refs[el.code] && this.$refs[el.code][0]) {
330
+ this.$refs[el.code][0].setOutsideHeight(height);
331
+ }
332
+ })
333
+ } else {
334
+ if (this.$refs.grid.showSummary) {
335
+ height = height + 36;
336
+ }
337
+ this.$refs.grid.setOutsideHeight(height);
338
+ }
339
+ },
340
+ setHideDividerValue(value) {
341
+ this.$refs.form.setHideDividerValue(value);
342
+ }
343
+ },
344
+ mounted () {
345
+ this.observer = elementResizeDetectorMaker();
346
+ if (this.$refs.formcard) {
347
+ this.observer.listenTo(this.$refs.formcard, this.setGridHeight);
348
+ }
349
+ },
350
+ beforeUnmount() {
351
+ if (this.$refs.formcard) {
352
+ this.observer.removeListener(this.$refs.formcard, this.setGridHeight);
353
+ }
354
+ }
355
+ };
356
+ </script>
357
+
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <Row type="flex" :gutter="0" :justify="justify" align="middle">
3
+ <template v-for="(item,index) in btnItems" :key="'btn_' + index">
4
+ <Col v-if="!moreFlag || index < showIndex">
5
+ <Button type="text" :icon="item.icon" size="small" :custom-icon="item.customIcon" :disabled="!!item.readOnly" @click="action(item.name)"><span :style="fontStyle">{{item.text}}</span></Button>
6
+ </Col>
7
+ <Col v-if="index < showIndex">
8
+ <Divider type="vertical" style=" margin:0 10px 0 10px;height:12px;"/>
9
+ </Col>
10
+ </template>
11
+ <Col v-if="moreFlag">
12
+ <Dropdown size="small" :transfer="transferFlag" >
13
+ <Button type="text"><span style="color:#AF292E;">更多</span></Button>
14
+ <template #list>
15
+ <DropdownMenu>
16
+ <DropdownItem>
17
+ <template v-for="(item,index) in btnItems" :key="'btn_' + index">
18
+ <Button v-if="index > showIndex" type="text" size="small" :icon="item.icon" :custom-icon="item.customIcon" :disabled="!!item.readOnly" @click="action(item.name)" ><span :style="fontStyle">{{item.text}}</span></Button>
19
+ </template>
20
+ </DropdownItem>
21
+ </DropdownMenu>
22
+ </template>
23
+ </Dropdown>
24
+ </Col>
25
+ </Row>
26
+ </template>
27
+
28
+ <script>
29
+ export default {
30
+ name:'mrowbtntoolbar',
31
+ data () {
32
+ return {
33
+ myConfig:{
34
+ size:'default',
35
+ items:[]
36
+ },
37
+ moreFlag:false,
38
+ transferFlag:true,
39
+ btnItems:[],
40
+ showNum:3,
41
+ showIndex:3,
42
+ colSpan:24,
43
+ justify:'center',
44
+ fontStyle:'color:#AF292E'
45
+ };
46
+ },
47
+ props:{
48
+ config: {
49
+ type:Object,
50
+ default:null
51
+ },
52
+ rowIndex: {
53
+ type:[String,Number],
54
+ default:null
55
+ },
56
+ rowData: {
57
+ type:Object,
58
+ default:null
59
+ }
60
+ },
61
+ created () {
62
+ this.init();
63
+ },
64
+ methods: {
65
+ init () {
66
+ this.myConfig = Object.assign({},this.myConfig, this.config);
67
+ // 处理按钮
68
+ if (this.myConfig.items && this.myConfig.items.length > 0) {
69
+ this.btnItems = this.myConfig.items;
70
+ }
71
+
72
+ if (this.myConfig.fontStyle !== undefined) {
73
+ this.fontStyle = this.myConfig.fontStyle;
74
+ }
75
+
76
+ if (this.myConfig.justify) {
77
+ this.justify = this.myConfig.justify;
78
+ }
79
+
80
+ if (this.myConfig.showNum) {
81
+ this.showNum = this.myConfig.showNum;
82
+ }
83
+
84
+ this.btnItems.forEach(el => {
85
+ if (el.icon && el.icon.startsWith('custom')) {
86
+ el.customIcon='iconfont icon-' + el.icon;
87
+ el.icon = null;
88
+ }
89
+ });
90
+ if(this.btnItems.length === 2) {
91
+ this.colSpan = 12;
92
+ }
93
+ if(this.btnItems.length === 3) {
94
+ this.colSpan = 8;
95
+ }
96
+ this.showIndex = this.btnItems.length -1;
97
+
98
+ if (this.btnItems.length > this.showNum){
99
+ this.moreFlag = true;
100
+ this.showIndex--;
101
+ this.colSpan = 8;
102
+ }
103
+ },
104
+ action(name) {
105
+ let obj = {};
106
+ obj.name = name;
107
+ obj.rowinfo ={};
108
+ obj.rowinfo.index = this.rowIndex;
109
+ obj.rowinfo.row = this.rowIndex;
110
+ this.$emit('doAction', obj);
111
+ },
112
+ },
113
+ watch: {
114
+ config: {
115
+ handler(data) {
116
+ this.$nextTick(() =>{
117
+ this.init();
118
+ })
119
+ },
120
+ deep: true,
121
+ immediate: true
122
+ },
123
+ }
124
+
125
+ };
126
+ </script>
@@ -0,0 +1,129 @@
1
+ <template>
2
+ <Card :padding="0" :bordered="myConfig.bordered" dis-hover style="width:100%;overflow-x:hidden;padding:14px;16px;">
3
+ <div v-if="showCondition" ref="conditiondiv">
4
+ <Input ref="condition" :placeholder="searchPlaceholder" v-model="searchValue" search style="width: 100%;margin-top:10xp;margin-bottom:10px" @on-search="search" @on-enter="search"/>
5
+ </div>
6
+ <div class="customLayout" :style="style">
7
+ <Tree ref="tree" v-show="showTree" :data="treeData" :class="myConfig.className" :show-checkbox="myConfig.showCheckBox" @on-select-change="onSelectChange" @on-check-change="onCheckChange" @on-toggle-expand="onToggleExpand" :load-data="loadData"/>
8
+ <SimpleViewGrid v-show="!showTree" v-if="gridReset" ref="grid" :config="gridConfig" :dictData="dictData" @dbclick="dbclick"/>
9
+ </div>
10
+ </Card>
11
+ </template>
12
+ <script>
13
+ import Base from '@/components/tree/treedatabase.vue';
14
+ import elementResizeDetectorMaker from 'element-resize-detector';
15
+ export default {
16
+ name:'mtreedata',
17
+ extends: Base,
18
+ data () {
19
+ return {
20
+ searchPlaceholder:'请输入编码或名称',
21
+ searchValue:'',
22
+ gridReset:true
23
+ }
24
+ },
25
+ created () {
26
+ this.init();
27
+ if (!this.gridConfig) {
28
+ this.gridConfig = {};
29
+ }
30
+ if (this.myConfig.multiSelect !== undefined) {
31
+ this.gridConfig.multiSelect = this.myConfig.multiSelect;
32
+ if (this.gridConfig.multiSelect) {
33
+ this.gridConfig.showCheckBox = true;
34
+ }
35
+ } else {
36
+ this.gridConfig.multiSelect = false;
37
+ }
38
+ if (this.myConfig.items) {
39
+ this.gridConfig.items = this.$Method.copy(this.myConfig.items);
40
+ } else {
41
+ if (!this.gridConfig.items) {
42
+ this.gridConfig.items = [];
43
+ }
44
+ let code = {
45
+ label:'编码',
46
+ name:this.myConfig.responseCode,
47
+ type:'TextBox',
48
+ }
49
+ let name = {
50
+ label:'名称',
51
+ name:this.myConfig.responseName,
52
+ type:'TextBox',
53
+ }
54
+ this.gridConfig.items.push(code);
55
+ this.gridConfig.items.push(name);
56
+ }
57
+ },
58
+ methods: {
59
+ search () {
60
+ if (!this.searchValue) {
61
+ this.refurbish();
62
+ this.showTree = true;
63
+ } else {
64
+ let data = this.$Method.copy(this.data);
65
+ let tmp = [];
66
+ let flag = true;
67
+ if (this.asyncLoad) {
68
+ let para = {};
69
+ if (this.myConfig.searchValueName) {
70
+ para[this.myConfig.searchValueName] = this.searchValue;
71
+ }
72
+ data = this.getAsyncNode(para);
73
+ if (this.myConfig.searchValueName) {
74
+ tmp = data;
75
+ flag = false;
76
+ }
77
+ }
78
+ if (flag) {
79
+ data.forEach(el => {
80
+ if(el[this.myConfig.responseCode].indexOf(this.searchValue) > -1 || el[this.myConfig.responseName].indexOf(this.searchValue) > -1) {
81
+ tmp.push(el);
82
+ }
83
+ });
84
+ }
85
+ this.gridReset = false;
86
+ this.$nextTick(() => {
87
+ this.gridReset = true;
88
+ this.$nextTick(() => {
89
+ this.$refs.grid.setData(tmp);
90
+ this.showTree = false;
91
+ });
92
+ });
93
+
94
+ }
95
+ },
96
+ setTreeNodeIcon(params,obj) {
97
+ if (params.node.children.length > 0) {
98
+ if (params.data.expand) {
99
+ obj.type = '_custom-wenjianzhankai';
100
+ } else {
101
+ obj.type = '_custom-wenjianshouqi';
102
+ }
103
+ } else {
104
+ obj.type = '_custom-yemian';
105
+ }
106
+ return obj;
107
+ }
108
+ },
109
+ mounted () {
110
+ this.observer = elementResizeDetectorMaker();
111
+ if (this.showCondition && this.$refs.conditiondiv) {
112
+ this.observer.listenTo(this.$refs.conditiondiv, this.setExtraHeight);
113
+ }
114
+ },
115
+ beforeUnmount() {
116
+ if (this.showCondition && this.$refs.conditiondiv) {
117
+ this.observer.removeListener(this.$refs.conditiondiv, this.setExtraHeight);
118
+ }
119
+ }
120
+ };
121
+ </script>
122
+
123
+ <style>
124
+ .customLayout{
125
+ OVERFLOW-Y: auto;
126
+ /*background: url('./images/bg.jpg') no-repeat 4px 5px;*/
127
+ }
128
+ </style>
129
+