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,619 @@
1
+ <template>
2
+ <div :style="'background:#fff;overflow: hidden;height:' + clientHeight +'px'">
3
+ <div ref="head">
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 class="efuture-demo-split" :style="'height:' + clientHeight2 +'px;'">
10
+ <Split v-model="myConfig.splitNum">
11
+ <template #left>
12
+ <div class="efuture-demo-split-pane" style="padding:14px 16px;">
13
+ <Card :padding="0" :bordered="false" dis-hover >
14
+ <p style="margin-bottom:10px;">
15
+ <span class="efuture-title-verticalline" /> <span style="font-size: 14px;font-weight:bold" v-text="myConfig.gridtitle" />
16
+ </p>
17
+ <div ref="para">
18
+ <Row v-if="showCondition">
19
+ <ControlBox ref="condition" style="width: 100%;margin-top:10xp;margin-bottom:10px" :config="conditionConfig" ></ControlBox>
20
+ </Row>
21
+ <Row>
22
+ <Input :placeholder="searchPlaceholder" v-model="searchValue" search style="width: 100%;margin-top:10xp;margin-bottom:10px" @on-search="search" @on-enter="search"/>
23
+ </Row>
24
+ </div>
25
+ <TreeBox v-show="showTree" ref="tree" :config="myConfig.treeConfig" @onSelectChange="selectChange" />
26
+ <SimpleViewGrid v-show="!showTree" ref="grid" :config="myConfig.gridConfig" :dictData="dictData" @rowclick="gridClick"/>
27
+ </Card>
28
+ </div>
29
+ </template>
30
+ <template #right>
31
+ <div class="efuture-demo-split-pane" style="padding:14px 0px;">
32
+ <Card :padding="0" :bordered="false" dis-hover >
33
+ <BillDetailForm ref="form" :config="myConfig.detailConfig" :dictData="dictData" />
34
+ </Card>
35
+ </div>
36
+ </template>
37
+ </Split>
38
+ </div>
39
+ </div>
40
+ </template>
41
+
42
+ <script>
43
+ import ListBtnToolbar from './listbtntoolbar.vue';
44
+ import BillDetailForm from '@/components/masterplate/billdetailform.vue';
45
+ import elementResizeDetectorMaker from 'element-resize-detector';
46
+ export default {
47
+ name:'mlefttreerightdetails',
48
+ components:{ListBtnToolbar, BillDetailForm},
49
+ data () {
50
+ return {
51
+ myConfig:{
52
+ gridtitle:'列表',
53
+ billKey:'ph_key',
54
+ splitNum:0.25,
55
+ resources:'',
56
+ className:'',
57
+ formTitle:'详情',
58
+ adjustHeight:200,
59
+ treeConfig:{},
60
+ gridConfig:{},
61
+ },
62
+ conditionConfig:{},
63
+
64
+ rootNode:{},
65
+ levelData:[],
66
+ menuToolbar:{
67
+ enablePermissions:true
68
+ },
69
+ searchPlaceholder:'请输入编码或名称',
70
+ showTree:true,
71
+ ph_key:'',
72
+ treeSeletedNode:[],
73
+ searchValue:'',
74
+ headHeight:63,
75
+ conditionValue:''
76
+ };
77
+ },
78
+ props:{
79
+ config: {
80
+ type:Object,
81
+ default:null
82
+ },
83
+ dictData: {
84
+ type: Object,
85
+ default:null
86
+ },
87
+ moduleMethod:{
88
+ type:Array,
89
+ default: () => {
90
+ return [];
91
+ }
92
+ }
93
+ },
94
+ computed: {
95
+ clientHeight () {
96
+ return this.$Store.state.app.clientHeight;
97
+ },
98
+ clientHeight2() {
99
+ return this.$Store.state.app.clientHeight - this.headHeight;
100
+ }
101
+ },
102
+ created () {
103
+ this.myConfig = Object.assign({},this.myConfig, this.config);
104
+ this.myConfig.gridConfig.onSelectionChange = this.gridOnSelectionChange;
105
+ this.myConfig.gridConfig.overrideData = this.gridOverrideData;
106
+ this.myConfig.gridConfig.showCondition = false;
107
+ this.myConfig.gridConfig.resources = this.myConfig.resources;
108
+ this.myConfig.gridConfig.method = this.myConfig.classPrefix + '.search';
109
+ this.myConfig.gridConfig.response = this.myConfig.response;
110
+ this.myConfig.gridConfig.tableSize ='small';
111
+ this.myConfig.gridConfig.showBorder = false;
112
+ this.myConfig.gridConfig.pageShowSizer = false;
113
+ this.myConfig.gridConfig.generalOrientation = true;
114
+ this.myConfig.gridConfig.height = 1;
115
+ this.myConfig.gridConfig.adjustHeight = 0;
116
+ if (this.myConfig.gridConfig.title !== undefined) {
117
+ this.myConfig.gridtitle = this.myConfig.gridConfig.title;
118
+ }
119
+
120
+ this.myConfig.gridConfig.multiSelect = false;
121
+ if (this.myConfig.treeConfig.items) {
122
+ this.myConfig.gridConfig.items = this.$Method.copy(this.myConfig.treeConfig.items);
123
+ }
124
+ if (this.myConfig.treeConfig.treeCondition) {
125
+ this.conditionConfig = Object.assign({},this.conditionConfig,this.myConfig.treeConfig.treeCondition);
126
+ if (this.conditionConfig.dictkey) {
127
+ if (!this.conditionConfig.data) {
128
+ this.conditionConfig.data = this.$Method.copy(this.dictData[this.conditionConfig.dictkey]);
129
+ }
130
+ }
131
+ this.conditionConfig.valueChanged = this.conditionValueChanged;
132
+ this.showCondition = true;
133
+ }
134
+
135
+ if (this.myConfig.treeConfig.searchParam) {
136
+ this.myConfig.gridConfig.searchParam = {};
137
+ Object.assign(this.myConfig.gridConfig.searchParam, this.myConfig.treeConfig.searchParam);
138
+ }
139
+
140
+
141
+ // 处理树
142
+ this.myConfig.treeConfig.resources = this.myConfig.resources;
143
+ if (!this.myConfig.treeConfig.method) {
144
+ this.myConfig.treeConfig.method = this.myConfig.classPrefix + '.search';
145
+ }
146
+ if (!this.myConfig.treeConfig.response) {
147
+ this.myConfig.treeConfig.response = this.myConfig.response;
148
+ }
149
+ this.myConfig.treeConfig.showCondition = false;
150
+ this.myConfig.treeConfig.showTitle = false;
151
+ this.myConfig.treeConfig.bordered = false;
152
+ this.myConfig.treeConfig.disHover = true;
153
+ this.myConfig.treeConfig.height = 1;
154
+ this.myConfig.treeConfig.adjustHeight = 0;
155
+ this.myConfig.treeConfig.selectedRoot = true;
156
+ if (this.myConfig.treeConfig.showCodeWithName === undefined) {
157
+ this.myConfig.treeConfig.showCodeWithName = true;
158
+ }
159
+ if(this.myConfig.treeConfig.setTreeNodeIcon !== undefined) {
160
+ this.setCustomTreeNodeIcon = this.myConfig.treeConfig.setTreeNodeIcon;
161
+ }
162
+ this.myConfig.treeConfig.setTreeNodeIcon = this.setTreeNodeIcon;
163
+
164
+ // 处理按钮
165
+ if (this.myConfig.menuToolbar !== undefined) {
166
+ this.menuToolbar = Object.assign({}, this.menuToolbar, this.myConfig.menuToolbar);
167
+ }
168
+ this.menuToolbar.mainButton = 'editData';
169
+ this.menuToolbar.mainButtonText = '修改';
170
+ this.myConfig.detailConfig.modetype = '2';
171
+ this.myConfig.detailConfig.billKey = this.myConfig.billKey;
172
+ this.myConfig.detailConfig.showAnchorLink = false;
173
+ this.myConfig.detailConfig.response = this.myConfig.response;
174
+ this.myConfig.detailConfig.adjustHeight = 0;
175
+ this.myConfig.detailConfig.resources = this.myConfig.resources;
176
+ },
177
+ methods:{
178
+ selectChange (e) {
179
+ let obj = {};
180
+ let self = this;
181
+ obj.onOk = () => {
182
+ if (e && e.length > 0) {
183
+ self.$refs.menutoolbar.setAllReadOnly(true);
184
+ self.treeSeletedNode = self.$Method.copy(e);
185
+ self.initForm(e[0]);
186
+ } else {
187
+ self.doCanCel();
188
+ this.$refs.menutoolbar.setAllReadOnly(true);
189
+ if (this.treeSeletedNode.length > 0) {
190
+ this.initForm(this.treeSeletedNode[0]);
191
+ }
192
+ }
193
+ };
194
+ obj.onCancel = () => {
195
+ self.doCanCel();
196
+ };
197
+ this.checkData(obj);
198
+ },
199
+ search () {
200
+ let obj = this.getSearchParam();
201
+ this.treeSeletedNode = [];
202
+ if (!this.searchValue) {
203
+ this.showTree = true;
204
+ } else {
205
+ obj['$or'] = [];
206
+ let code = {};
207
+ code[this.myConfig.treeConfig.responseCode] = {'LIKE':'%' + this.searchValue + '%'};
208
+ obj['$or'].push(code);
209
+ let name = {};
210
+ code[this.myConfig.treeConfig.responseName] = {'LIKE':'%' + this.searchValue + '%'};
211
+ obj['$or'].push(name);
212
+ this.$refs.grid.clearSearchBeforeSearchParam();
213
+ this.$refs.grid.setSearchBeforeSearchParam(obj);
214
+ this.$refs.grid.refurbish();
215
+ this.showTree = false;
216
+ }
217
+ },
218
+ getSearchParam () {
219
+ let searchParam = this.$Method.copy(this.myConfig.treeConfig.searchParam);
220
+ if (!searchParam) {
221
+ searchParam = {};
222
+ }
223
+ return searchParam;
224
+ },
225
+ refurbish () {
226
+ this.treeSeletedNode = [];
227
+ this.initTree();
228
+ },
229
+ gridOnSelectionChange(rows) {
230
+ let obj = {};
231
+ obj.name = 'gridOnSelectionChange';
232
+ obj.para = rows;
233
+ this.$emit('doAction', obj);
234
+ },
235
+ gridOverrideData (data) {
236
+ if (data && data.length > 0) {
237
+ let self = this;
238
+ this.$nextTick(() => {
239
+ let index = 0;
240
+ if (self.treeSeletedNode.length > 0) {
241
+ let culIndex = data.findIndex(el => el[self.myConfig.billKey]=== self.treeSeletedNode[0][self.myConfig.billKey]);
242
+ if (culIndex > -1) {
243
+ index = culIndex;
244
+ }
245
+ }
246
+ self.$refs.grid.setRowHighlight(index,true);
247
+ self.ph_key = data[index].ph_key;
248
+ self.initForm(data[index]);
249
+ self.$refs.form.setReadOnly(true);
250
+ self.$refs.menutoolbar.setAllReadOnly(false);
251
+ self.$refs.menutoolbar.setReadOnly('saveData', true);
252
+ });
253
+ } else {
254
+ this.$refs.form.clearData();
255
+ this.$refs.form.setReadOnly(true);
256
+ this.$refs.menutoolbar.setAllReadOnly(true);
257
+ }
258
+
259
+ return data;
260
+ },
261
+ gridClick(e) {
262
+ let obj = {};
263
+ let self = this;
264
+ obj.onOk = () => {
265
+ self.treeSeletedNode = [e];
266
+ self.initForm(e);
267
+ };
268
+ obj.onCancel = () => {
269
+ self.doCanCel();
270
+ };
271
+ this.checkData(obj);
272
+ },
273
+ doCanCel () {
274
+ this.$nextTick(() => {
275
+ if (this.showTree) {
276
+ this.$refs.tree.setData(this.treeSeletedNode);
277
+ } else {
278
+ this.$refs.grid.setAllRowHighlight(false);
279
+ let data = self.$refs.grid.getData();
280
+ let index = data.findIndex(el => el[self.myConfig.billKey] === self.treeSeletedNode[0][self.myConfig.billKey]);
281
+ if (index > -1) {
282
+ this.$refs.grid.setRowHighlight(index, true);
283
+ } else {
284
+ this.$refs.grid.clearCurrentRow();
285
+ }
286
+ }
287
+ });
288
+
289
+ },
290
+ getForm() {
291
+ return this.$refs.form;
292
+ },
293
+ getGrid() {
294
+ return this.$refs.grid;
295
+ },
296
+ getTree() {
297
+ return this.$refs.tree;
298
+ },
299
+ getMenuToolbar() {
300
+ return this.$refs.menutoolbar;
301
+ },
302
+ quickChagne () {
303
+ this.search();
304
+ },
305
+ initTree(flag) {
306
+ this.$refs.tree.refurbish();
307
+ this.$nextTick(() => {
308
+ if (this.treeSeletedNode.length > 0) {
309
+ this.$refs.tree.setData(this.treeSeletedNode);
310
+ }
311
+ if (!flag) {
312
+ this.initForm(this.treeSeletedNode[0]);
313
+ }
314
+ });
315
+ },
316
+ updateTree(data,flag) {
317
+ this.$refs.tree.updaeNode(data,'U');
318
+ },
319
+ initForm (para) {
320
+ this.$refs.form.clearData();
321
+ let data = {};
322
+ this.$refs.menutoolbar.setAllReadOnly(true);
323
+ if (!para) {
324
+ return;
325
+ }
326
+ let rootNode = this.$refs.tree.getRootNode();
327
+ if (para[this.myConfig.treeConfig.idField] === rootNode[this.myConfig.treeConfig.idField]) {
328
+ data = this.$Method.copy(rootNode);
329
+ this.$refs.menutoolbar.setReadOnly(['addChildData'], false);
330
+ } else {
331
+ data = this.getFormData(para);
332
+ if (this.$refs.tree.isChildren(para)) {
333
+ this.$refs.menutoolbar.setReadOnly(['editData','addSelfData','addChildData'], false);
334
+ } else {
335
+ this.$refs.menutoolbar.setReadOnly(['editData','addSelfData','addChildData','delData'], false);
336
+ }
337
+ }
338
+ if (this.$parent.setBillData) {
339
+ data = this.$parent.setBillData(data);
340
+ }
341
+ this.$refs.form.setData(data);
342
+ this.$nextTick(() => {
343
+ this.$refs.form.setReadOnly(true);
344
+ });
345
+ if (this.$parent.initFormAfter) {
346
+ this.$parent.initFormAfter(data);
347
+ }
348
+ },
349
+ getFormData (para) {
350
+ if (this.$parent.getFormData) {
351
+ return this.$parent.getFormData(para);
352
+ } else {
353
+ let result = {};
354
+ let self = this;
355
+ let tmp = {};
356
+ if (!para[this.myConfig.billKey]) {
357
+ tmp[this.myConfig.billKey] = this.ph_key;
358
+ } else {
359
+ tmp[this.myConfig.billKey] = para[this.myConfig.billKey];
360
+ }
361
+ self.synchroPost(self.myConfig.resources,self.myConfig.classPrefix+'.get', tmp, function (data) {
362
+ result = data[self.config.response];
363
+ });
364
+ return result;
365
+ }
366
+ },
367
+ doAction(obj) {
368
+ const method = obj.name;
369
+ const methodBefore = method + 'Before';
370
+ const methodAfter = method + 'After';
371
+ if (obj.name === 'addSelfData' || obj.name === 'addChildData' || obj.name === 'editData' ) {
372
+ let flag = true;
373
+ let temp = {};
374
+ if (this.$parent[methodBefore]) {
375
+ flag = this.$parent[methodBefore](temp);
376
+ }
377
+ if (flag) {
378
+ if (obj.name === 'addSelfData' || obj.name === 'addChildData') {
379
+ this.$refs.form.setReadOnly(false);
380
+ this.$refs.form.clearData();
381
+ this.$refs.form.setData(temp);
382
+ this.$refs.menutoolbar.setAllReadOnly(true);
383
+ this.$refs.menutoolbar.setReadOnly('saveData', false);
384
+ }
385
+ if (obj.name === 'editData') {
386
+ if (this.treeSeletedNode.length === 0) {
387
+ this.alert('请先选择节点');
388
+ return false;
389
+ }
390
+
391
+ let obj = this.$refs.tree.getRootNode();
392
+ if (obj[this.myConfig.treeConfig.responseCode] === this.treeSeletedNode[0][this.myConfig.treeConfig.responseCode]) {
393
+ this.alert('当前节点不允许修改');
394
+ return false;
395
+ }
396
+
397
+ this.$refs.form.setReadOnly(false);
398
+
399
+ this.$refs.menutoolbar.setReadOnly('editData', true);
400
+ this.$refs.menutoolbar.setReadOnly('saveData', false);
401
+ }
402
+
403
+ if (this.$parent[methodAfter]) {
404
+ this.$parent[methodAfter]();
405
+ }
406
+ }
407
+ } else {
408
+ if (obj.name === 'saveData') {
409
+ let flag = this.$refs.form.checkValidate();
410
+ if (flag) {
411
+ this.alert('必填项不允许为空');
412
+ return false;
413
+ }
414
+ flag = this.$refs.form.isEdit();
415
+ if (flag) {
416
+ this.alert('存在数据未确认');
417
+ return false;
418
+ }
419
+ let data = this.$refs.form.getChangeData();
420
+ obj.para = [];
421
+ obj.para.push(data);
422
+
423
+ }
424
+ if (obj.name === 'delData') {
425
+ let tempData = this.$refs.form.getData();
426
+ tempData.flag = 'D';
427
+ obj.para = tempData;
428
+ }
429
+ obj.onOk = this.onOk;
430
+ let flag = true;
431
+ if (this.$parent[methodBefore]) {
432
+ flag = this.$parent[methodBefore](obj);
433
+ }
434
+ if (!flag) {
435
+ return;
436
+ }
437
+ if (obj.name === 'delData') {
438
+ let text = '保存';
439
+ if (obj.name === 'delData') {
440
+ text = '删除';
441
+ }
442
+ let self = this;
443
+ self.$Modal.confirm({
444
+ title:'确认',
445
+ content:'是否确认'+text+'数据?',
446
+ onOk:() => {
447
+ self.$emit('doAction', obj);
448
+ }
449
+ });
450
+ } else {
451
+ this.$emit('doAction', obj);
452
+ }
453
+ }
454
+ },
455
+ onOk (action, data) {
456
+ if (action.name === 'saveData') {
457
+ this.$refs.menutoolbar.setAllReadOnly(true);
458
+ this.initForm(data[0]);
459
+ this.$refs.form.setReadOnly(true);
460
+ let temp = this.$refs.form.getData();
461
+ this.treeSeletedNode =[temp];
462
+ //this.initTree(true);
463
+ this.$refs.tree.updateNode(temp,'U');
464
+ if (!this.showTree) {
465
+ this.$refs.grid.refurbish();
466
+ }
467
+ this.$refs.menutoolbar.setReadOnly(['addSelfData','addChildData','editData'], false);
468
+ }
469
+ if (action.name === 'delData') {
470
+ this.$refs.tree.updateNode(this.treeSeletedNode[0],'D');
471
+ this.treeSeletedNode = [];
472
+ this.$refs.form.setReadOnly(true);
473
+ this.$refs.form.clearData();
474
+ if (!this.showTree) {
475
+ this.$refs.grid.refurbish();
476
+ }
477
+ this.$refs.menutoolbar.setReadOnly(['addSelfData','addChildData','editData'], false);
478
+ }
479
+ },
480
+ checkData (obj) {
481
+ let tempflag = false;
482
+ tempflag = this.$refs.form.isEdit();
483
+ if (tempflag) {
484
+ let self = this;
485
+ self.$Modal.confirm({
486
+ title:'确认',
487
+ content:'数据存在数据未确认,是否放弃?',
488
+ onOk:() => {
489
+ this.checkChangeData(obj);
490
+ },
491
+ onCancel:() => {
492
+ if (obj.onCancel) {
493
+ obj.onCancel();
494
+ }
495
+ }
496
+ });
497
+ } else {
498
+ this.checkChangeData(obj);
499
+ }
500
+ },
501
+ checkChangeData(obj) {
502
+ let flag = false;
503
+ flag = this.$refs.form.isChange();
504
+ if (flag) {
505
+ let self = this;
506
+ self.$Modal.confirm({
507
+ title:'确认',
508
+ content:'数据有修改未保存,是否放弃修改?',
509
+ onOk:() => {
510
+ if (obj.onOk) {
511
+ obj.onOk();
512
+ }
513
+ },
514
+ onCancel:() => {
515
+ if (obj.onCancel) {
516
+ obj.onCancel();
517
+ }
518
+ }
519
+ });
520
+ } else {
521
+ if (obj.onOk) {
522
+ obj.onOk();
523
+ }
524
+ }
525
+ },
526
+ setTreeAndGridAndFormHeight() {
527
+ let height = this.$refs.head.offsetHeight + this.$refs.para.offsetHeight + 62;
528
+ this.$refs.tree.setOutsideHeight(height);
529
+ this.$refs.grid.setOutsideHeight(height);
530
+ let height2 = this.$refs.head.offsetHeight;
531
+ this.$refs.form.setOutsideHeight(height2);
532
+ },
533
+ setTreeNodeIcon(params,obj) {
534
+ if (params.node && params.node.children && params.node.children.length > 0) {
535
+ if (params.data.expand) {
536
+ obj.type = '_custom-wenjianzhankai';
537
+ } else {
538
+ obj.type = '_custom-wenjianshouqi';
539
+ }
540
+ } else {
541
+ obj.type = '_custom-yemian';
542
+ }
543
+ if (this.setCustomTreeNodeIcon){
544
+ obj = this.setCustomTreeNodeIcon(params,obj)
545
+ }
546
+ return obj;
547
+ },
548
+ getSelectedNode() {
549
+ let obj = {};
550
+ if (this.treeSeletedNode.length > 0) {
551
+ obj = this.$Method.copy(this.treeSeletedNode[0]);
552
+ }
553
+ return obj;
554
+ },
555
+ getChangeData() {
556
+ return this.$refs.form.getChangeData();
557
+ },
558
+ setDetailVisible(name,value) {
559
+ this.$refs.form.setVisible(name, value);
560
+ },
561
+ getTreeCondition() {
562
+ return this.$refs.condition;
563
+ },
564
+ conditionValueChanged(e) {
565
+ this.$nextTick(() => {
566
+ let tmp = {};
567
+ let self = this;
568
+ tmp.onOk = () => {
569
+ let para = {};
570
+ let value = self.$refs.condition.getValue();
571
+ if (value) {
572
+ para[self.conditionConfig.name] = value;
573
+ }
574
+ self.searchValue = '';
575
+ self.showTree = true;
576
+ self.treeSeletedNode = [];
577
+ self.$refs.form.clearData();
578
+ self.$refs.menutoolbar.setAllReadOnly(true);
579
+ self.$refs.form.setReadOnly(true);
580
+ self.$refs.tree.refurbish(para);
581
+ self.conditionValue = value;
582
+ };
583
+ tmp.onCancel = () => {
584
+ self.$refs.condition.setValue(self.conditionValue);
585
+ }
586
+ self.checkData(tmp);
587
+ });
588
+ return true;
589
+ }
590
+ },
591
+ mounted () {
592
+ this.observer = elementResizeDetectorMaker();
593
+ if (this.$refs.head) {
594
+ this.observer.listenTo(this.$refs.head, this.setTreeAndGridAndFormHeight);
595
+ }
596
+ if (this.$refs.para) {
597
+ this.observer.listenTo(this.$refs.para, this.setTreeAndGridAndFormHeight);
598
+ }
599
+ this.headHeight = this.$refs.head.offsetHeight;
600
+ this.$nextTick(() => {
601
+ this.$refs.form.setReadOnly(true);
602
+ this.$refs.menutoolbar.setAllReadOnly(false);
603
+ this.refurbish();
604
+ });
605
+ },
606
+ beforeUnmount() {
607
+ if (this.$refs.head) {
608
+ this.observer.removeListener(this.$refs.head, this.setTreeAndGridAndFormHeight);
609
+ }
610
+ if (this.$refs.para) {
611
+ this.observer.removeListener(this.$refs.para, this.setTreeAndGridAndFormHeight);
612
+ }
613
+ }
614
+ };
615
+ </script>
616
+
617
+ <style>
618
+
619
+ </style>