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,268 @@
1
+ <template>
2
+ <Card
3
+ :padding="0"
4
+ :bordered="myConfig.bordered"
5
+ :dis-hover="myConfig.disHover"
6
+ :class="cardClass"
7
+ >
8
+ <template #title>
9
+ <p v-if="showTitle" :style="pStyle" @click="toggle">
10
+ <span :class="titleClass" v-text="myConfig.title" />
11
+ <Icon
12
+ v-if="myConfig.hide"
13
+ class="efuture-title-icon"
14
+ :style="iconStyle"
15
+ type="ios-arrow-forward"
16
+ />
17
+ </p>
18
+ </template>
19
+ <template #extra>
20
+ <div v-if="$slots.btn">
21
+ <slot name="btn"></slot>
22
+ </div>
23
+ <div v-else>
24
+ <a
25
+ v-if="showBtn && editFlag && !btnReadOnly"
26
+ href="#"
27
+ @click.prevent="editForm"
28
+ >{{myConfig.editBtnText}}</a>
29
+ <span v-if="showBtn && editFlag && btnReadOnly">{{myConfig.editBtnText}}</span>
30
+ <a
31
+ v-if="showBtn && !editFlag && saveFlag"
32
+ style="margin-left: 10px;"
33
+ href="#"
34
+ @click.prevent="saveForm"
35
+ >{{myConfig.saveBtnText}}</a>
36
+ <a
37
+ v-if="showBtn && !editFlag"
38
+ style="margin-left: 10px;"
39
+ href="#"
40
+ @click.prevent="cancelForm"
41
+ >{{myConfig.cancelBtnText}}</a>
42
+ </div>
43
+ </template>
44
+ <div v-show="showForm" :style="myConfig.divStyle">
45
+ <Form
46
+ ref="form"
47
+ :model="form"
48
+ :rules="formRules"
49
+ :label-position="myConfig.labelPosition"
50
+ :label-width="myConfig.labelWidth"
51
+ :inline="myConfig.inline"
52
+ :id="myConfig.name"
53
+ @submit.enter.prevent
54
+ >
55
+ <Row type="flex" justify="start">
56
+ <template v-for="(item,index) in items" :key="'form_' + index">
57
+ <Col
58
+ v-if="item.status"
59
+ :span="initFormItemCol(index)"
60
+ v-show="item.visible !== false"
61
+ >
62
+ <FormItem
63
+ v-if="item.type !== 'Divider' && item.status && item.visible !== false"
64
+ :label="item.label"
65
+ :prop="item.name||item.sname"
66
+ :style="getFormItemStyle(item)"
67
+ :show-message="false"
68
+ >
69
+ <ControlBox
70
+ :ref="item.name||item.sname"
71
+ :valueData="form"
72
+ :config="item"
73
+ @inputValue="input"
74
+ @doAction="doAction"
75
+ ></ControlBox>
76
+ </FormItem>
77
+ <ControlBox v-if="item.type === 'Divider'" :ref="item.dividerName" :config="item"></ControlBox>
78
+ </Col>
79
+ </template>
80
+ </Row>
81
+ </Form>
82
+ </div>
83
+ </Card>
84
+ </template>
85
+ <script>
86
+ import Base from './baseform.vue';
87
+ export default {
88
+ name: 'FormCardBox',
89
+ extends: Base,
90
+ data() {
91
+ return {
92
+ myConfig: {
93
+ hide: true,
94
+ titleType: 1,
95
+ editBtnText: '编辑',
96
+ saveBtnText: '保存',
97
+ cancelBtnText: '放弃',
98
+ showBtn: true,
99
+ bordered: true,
100
+ disHover: false,
101
+ showSubSpecialStyle: false,
102
+ divStyle: 'padding:16px',
103
+ },
104
+ btnReadOnly: false,
105
+ showBtn: true,
106
+ showForm: true,
107
+ showTitle: true,
108
+ editFlag: false,
109
+ saveFlag: false,
110
+ cancelFlag: false,
111
+ pStyle: '',
112
+ iconStyle: '',
113
+ };
114
+ },
115
+ created() {
116
+ this.init();
117
+ },
118
+ computed: {
119
+ cardClass() {
120
+ if (this.myConfig.showSubSpecialStyle) {
121
+ return (`efuture-card-head-title-${this.myConfig.titleType}` + ' efuture-card-head-title' + ` efuture-card-extra-title-${this.myConfig.titleType}`);
122
+ } else {
123
+ if (!this.showForm) {
124
+ return ( `efuture-card-head-title-${this.myConfig.titleType}` + ' efuture-card-head-title-nobottom' + ` efuture-card-extra-title-${this.myConfig.titleType}`);
125
+ } else {
126
+ return `efuture-card-head-title-${this.myConfig.titleType}` + ` efuture-card-extra-title-${this.myConfig.titleType}`;
127
+ }
128
+ }
129
+ },
130
+ titleClass() {
131
+ return `efuture-title-font-${this.myConfig.titleType}`;
132
+ },
133
+ },
134
+ methods: {
135
+
136
+ customInit() {
137
+ if (this.myConfig.hide) {
138
+ this.pStyle = 'cursor:pointer';
139
+ this.iconStyle = 'transform: rotate(90deg)';
140
+ }
141
+ if (!this.myConfig.title) {
142
+ if (this.myConfig.titleType !== 1) {
143
+ this.showTitle = true;
144
+ } else {
145
+ this.showTitle = false;
146
+ }
147
+ }
148
+
149
+ if (this.myConfig.readOnly !== undefined) {
150
+ this.readOnly = this.myConfig.readOnly;
151
+ }
152
+ if (this.myConfig.titleType !== 1) {
153
+ if (this.config.hide === undefined) {
154
+ this.myConfig.hide = false;
155
+ }
156
+ if (this.config.bordered === undefined) {
157
+ this.myConfig.bordered = false;
158
+ }
159
+ if (this.config.disHover === undefined) {
160
+ this.myConfig.disHover = true;
161
+ }
162
+ }
163
+ this.showBtn = this.myConfig.showBtn;
164
+ if (this.myConfig.cancelBtn !== undefined) {
165
+ this.cancelFlag = this.myConfig.cancelBtn;
166
+ }
167
+ // let _this = this;
168
+ // document.addEventListener("keydown", _this.watchEnter);
169
+ },
170
+ setFormReadOnly(value) {
171
+ this.editFlag = value;
172
+ if (!this.myConfig.items || this.myConfig.items.length === 0) {
173
+ return false;
174
+ }
175
+ let self = this;
176
+ this.myConfig.items.forEach(el => {
177
+ let name = '';
178
+ if (el.name) {
179
+ name = el.name;
180
+ } else if (el.sname) {
181
+ name = el.sname;
182
+ }
183
+ if (!value) {
184
+ if (this.myConfig.cellbeginedit) {
185
+ let obj = {};
186
+ obj.name = name;
187
+ obj.form = this.$Method.copy(this.form);
188
+ obj.formObject = self;
189
+ let flag = this.myConfig.cellbeginedit(obj);
190
+ if (flag) {
191
+ this.setReadOnly(name, value);
192
+ } else {
193
+ this.setReadOnly(name, !value);
194
+ }
195
+ } else {
196
+ this.setReadOnly(name, value);
197
+ }
198
+ } else {
199
+ this.setReadOnly(name, value);
200
+ }
201
+ });
202
+ },
203
+ editForm() {
204
+ let flag = true;
205
+ if (this.myConfig.editObjectBefore) {
206
+ flag = this.myConfig.editObjectBefore(this.myConfig.name);
207
+ }
208
+ if (flag) {
209
+ this.setFormReadOnly(false);
210
+ let obj = {};
211
+ obj.name = 'editForm';
212
+ obj.formname = this.myConfig.name;
213
+ this.$emit('doAction', obj);
214
+ }
215
+ },
216
+ cancelForm() {
217
+ this.setData(this.oldForm);
218
+ this.setFormReadOnly(true);
219
+ let obj = {};
220
+ obj.name = 'cancelForm';
221
+ obj.formname = this.myConfig.name;
222
+ this.$emit('doAction', obj);
223
+ },
224
+ saveForm() {
225
+ this.checkValidate();
226
+ if (this.errorFlag) {
227
+ return false;
228
+ }
229
+ this.setFormReadOnly(true);
230
+ let obj = {};
231
+ obj.name = 'saveForm';
232
+ obj.formname = this.myConfig.name;
233
+ obj.para = this.getData();
234
+ this.$emit('doAction', obj);
235
+ },
236
+ toggle() {
237
+ if (this.myConfig.hide) {
238
+ this.showForm = !this.showForm;
239
+ this.setTitleStyle();
240
+ this.$nextTick(() => {
241
+ this.$emit('on-open-change',this.showForm);
242
+ });
243
+
244
+ }
245
+ },
246
+ setShowForm(value) {
247
+ this.showForm = value;
248
+ this.setTitleStyle();
249
+ },
250
+ setTitleStyle() {
251
+ if (this.showForm) {
252
+ this.iconStyle = 'transform: rotate(90deg)';
253
+ } else {
254
+ this.iconStyle = '';
255
+ }
256
+ },
257
+ isEdit() {
258
+ return this.editFlag;
259
+ },
260
+ setShowBtn(value) {
261
+ this.showBtn = value;
262
+ },
263
+ setBtnReadOnly(value) {
264
+ this.btnReadOnly = value;
265
+ },
266
+ },
267
+ };
268
+ </script>
@@ -0,0 +1,252 @@
1
+ <template>
2
+ <Card :padding="0" style="background:#eee;" :bordered="myConfig.bordered" :dis-hover="myConfig.disHover" :class="cardClass" >
3
+ <template v-if="showTitle" #title>
4
+ <p :style="pStyle" @click="toggle" >
5
+ <span :class="titleClass" v-text="myConfig.title" /><Icon v-if="myConfig.hide" class="efuture-title-icon" :style="iconStyle" type='ios-arrow-forward'/>
6
+ </p>
7
+ </template>
8
+ <template #extra>
9
+ <a v-if="myConfig.showBtn && editFlag" href="#" @click.prevent="editForm">{{myConfig.editBtnText}} </a>
10
+ <a v-if="myConfig.showBtn && !editFlag" style="margin-left: 10px;" href="#" @click.prevent="saveForm">{{myConfig.saveBtnText}} </a>
11
+ </template>
12
+ <div v-show="showForm" style="padding:0px">
13
+ <FormCardBox v-for="(item) in myConfig.items" :ref="item.name" :key="item.name" :config="item" :dictData="dictData" style="margin-bottom: 10px;" @doAction="doAction"/>
14
+ </div>
15
+ </Card>
16
+ </template>
17
+
18
+ <script>
19
+ import FormCardBox from './formcardbox.vue';
20
+ export default {
21
+ name:'formcardgroupbox',
22
+ components:{
23
+ FormCardBox
24
+ },
25
+ data () {
26
+ return {
27
+ myConfig:{
28
+ title:'',
29
+ titleType:1,
30
+ hide:true,
31
+ showBtn:true,
32
+ editBtnText:'编辑',
33
+ saveBtnText:'保存',
34
+ },
35
+ showForm:true,
36
+ editFlag:false,
37
+ showTitle:false,
38
+ iconStyle:'',
39
+ pStyle:''
40
+ };
41
+ },
42
+ created () {
43
+ this.init();
44
+ },
45
+ props:{
46
+ config: {
47
+ type:Object,
48
+ default:null
49
+ },
50
+ dictData: {
51
+ type: Object,
52
+ default:null
53
+ }
54
+ },
55
+ computed: {
56
+ titleClass () {
57
+ return `efuture-title-font-${this.myConfig.titleType}`;
58
+ },
59
+ cardClass() {
60
+ if (this.myConfig.showSubSpecialStyle) {
61
+ return (`efuture-card-head-title-${this.myConfig.titleType}` + ' efuture-card-head-title ' + `efuture-card-extra-title-${this.myConfig.titleType}`);
62
+ } else {
63
+ if (!this.showForm) {
64
+ return ( `efuture-card-head-title-${this.myConfig.titleType}` + ' efuture-card-head-title-nobottom ' + `efuture-card-extra-title-${this.myConfig.titleType}`);
65
+ } else {
66
+ return `efuture-card-head-title-${this.myConfig.titleType}` + ` efuture-card-extra-title-${this.myConfig.titleType}`;
67
+ }
68
+ }
69
+ }
70
+ },
71
+ methods:{
72
+ init (){
73
+ this.myConfig = Object.assign({},this.myConfig,this.config);
74
+ if (this.myConfig.items) {
75
+ this.myConfig.items.forEach((el, index) => {
76
+ if (el.showBtn === undefined) {
77
+ el.showBtn = false;
78
+ }
79
+ el.titleType = 2;
80
+ if (!el.name) {
81
+ el.name = 'form_' + index;
82
+ }
83
+ });
84
+ }
85
+ if (this.myConfig.title) {
86
+ this.showTitle = true;
87
+ }
88
+ if (this.myConfig.hide) {
89
+ this.pStyle = 'cursor:pointer;#e3e5e8';
90
+ this.iconStyle = 'transform: rotate(90deg)';
91
+ }
92
+ },
93
+ toggle () {
94
+ if (this.myConfig.hide) {
95
+ this.showForm = !this.showForm;
96
+ this.setTitleStyle();
97
+ }
98
+ },
99
+ setShowForm(value) {
100
+ this.showForm = value;
101
+ this.setTitleStyle();
102
+ },
103
+ editForm () {
104
+ this.editFlag = false;
105
+ this.myConfig.items.forEach(el => {
106
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
107
+ this.$refs[el.name][0].setFormReadOnly(false);
108
+ }
109
+ });
110
+ let obj = {};
111
+ obj.name = 'editForm';
112
+ this.$emit('doAction', obj);
113
+ },
114
+ saveForm () {
115
+ let flag = false;
116
+ this.myConfig.items.forEach(el => {
117
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
118
+ this.$refs[el.name][0].checkValidate();
119
+ if (this.$refs[el.name][0].errorFlag) {
120
+ flag = true;
121
+ }
122
+ }
123
+ });
124
+ if (!flag) {
125
+ this.editFlag = true;
126
+ this.myConfig.items.forEach(el => {
127
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
128
+ this.$refs[el.name][0].setFormReadOnly(true);
129
+ }
130
+ });
131
+ let obj = {};
132
+ obj.name = 'editForm';
133
+ obj.para = this.getData();
134
+ this.$emit('doAction', obj);
135
+ }
136
+ },
137
+ getData () {
138
+ let obj = {};
139
+ this.myConfig.items.forEach((el,index) => {
140
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
141
+ if (index === 0) {
142
+ Object.assign(obj, this.$refs[el.name][0].getData());
143
+ } else {
144
+ let data = this.$refs[el.name][0].getData();
145
+ if (el.items) {
146
+ el.items.forEach(el2 => {
147
+ if (el2.name) {
148
+ obj[el2.name] = data[el2.name];
149
+ }
150
+ if (el2.sname) {
151
+ obj[el2.sname] = data[el2.sname];
152
+ }
153
+ if (el2.ename) {
154
+ obj[el2.ename] = data[el2.ename];
155
+ }
156
+ if (el2.textName) {
157
+ obj[el2.textName] = data[el2.textName];
158
+ }
159
+ });
160
+ }
161
+ }
162
+ }
163
+ });
164
+ return obj;
165
+
166
+ },
167
+ setData (data) {
168
+ this.myConfig.items.forEach(el => {
169
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
170
+ this.$refs[el.name][0].setData(data);
171
+ }
172
+ });
173
+ },
174
+ setTitleStyle () {
175
+ if (this.showForm) {
176
+ this.iconStyle = 'transform: rotate(90deg)';
177
+ } else {
178
+ this.iconStyle = '';
179
+ }
180
+ },
181
+ isChange () {
182
+ let flag = false;
183
+ this.myConfig.items.forEach(el => {
184
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
185
+ if (!flag) {
186
+ flag = this.$refs[el.name][0].isChange();
187
+ }
188
+
189
+ }
190
+ });
191
+ return flag;
192
+ },
193
+ getForm(name) {
194
+ if (this.$refs[name] && this.$refs[name][0]) {
195
+ return this.$refs[name][0];
196
+ } else {
197
+ return null;
198
+ }
199
+ },
200
+ clearData () {
201
+ this.myConfig.items.forEach(el => {
202
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
203
+ this.$refs[el.name][0].clearData();
204
+
205
+ }
206
+ });
207
+ },
208
+ setFormReadOnly (value) {
209
+ this.myConfig.items.forEach(el => {
210
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
211
+ this.$refs[el.name][0].setFormReadOnly(value);
212
+
213
+ }
214
+ });
215
+ },
216
+ checkValidate() {
217
+ let flag = false;
218
+ this.editFlag = false;
219
+ this.myConfig.items.forEach(el => {
220
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
221
+ this.$refs[el.name][0].checkValidate();
222
+ flag = this.$refs[el.name][0].isError();
223
+ if (flag) {
224
+ this.editFlag = true;
225
+ }
226
+ }
227
+ });
228
+ },
229
+ setBtnReadOnly(value) {
230
+ this.myConfig.items.forEach(el => {
231
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
232
+ this.$refs[el.name][0].setBtnReadOnly(value);
233
+ }
234
+ });
235
+ },
236
+ doAction(obj) {
237
+ this.$emit('doAction', obj);
238
+ },
239
+ isError() {
240
+ return this.editFlag;
241
+ },
242
+ setShowBtn(value) {
243
+ this.myConfig.items.forEach(el => {
244
+ if (this.$refs[el.name] && this.$refs[el.name][0]) {
245
+ this.$refs[el.name][0].setShowBtn(value);
246
+ }
247
+ });
248
+ }
249
+ }
250
+
251
+ };
252
+ </script>
@@ -0,0 +1,19 @@
1
+ export default {
2
+ name: 'formpcompro',
3
+ data () {
4
+ return {
5
+ };
6
+ },
7
+ props:{
8
+ config: {
9
+ type:Object,
10
+ default:null
11
+ },
12
+ dictData: {
13
+ type: Object,
14
+ default:null
15
+ }
16
+ },
17
+ methods:{
18
+ }
19
+ };
@@ -0,0 +1,129 @@
1
+ <template>
2
+ <div>
3
+ <Row type="flex" justify="start" >
4
+ <Col :span="leftSpan" v-show="leftShowFlag" style="margin-top: 20px">
5
+ <Affix>
6
+ <Toolbar ref="tool" :config="toolbarConfig" :fontplacement="fontplacement" @doAction="doAction" :showback="true" :checkBtn="true"></Toolbar>
7
+ </Affix>
8
+ </Col>
9
+ <Col :span="mainSpan">
10
+ <Row type="flex" justify="start">
11
+ <Col style="margin-top: 18px;text-align:right;width:2%">
12
+ <Affix>
13
+ <Poptip v-show="!leftSpan" trigger="hover" placement="right" content="展开功能菜单栏">
14
+ <CommonIcon type="_right" :size="1" @click="doShowLeft"> </CommonIcon>
15
+ </Poptip>
16
+ <Poptip v-show="leftSpan" trigger="hover" placement="right" content="收缩功能菜单栏">
17
+ <CommonIcon type="_left" :size="1" @click="doHideLeft"> </CommonIcon>
18
+ </Poptip>
19
+ </Affix>
20
+ </Col>
21
+ <Col style="width:98%">
22
+ <Row>
23
+ <Card :id="config.name">
24
+ <template v-if="config.title !== undefined" #title>
25
+ <p v-if="config.title !== undefined">
26
+ {{config.title}}
27
+ </p>
28
+ </template>
29
+ <FormBox ref="form" :config="config" :dictData="dictData"/>
30
+ </Card>
31
+ </Row>
32
+ <Row style="margin-top: 10px">
33
+ <Collapse simple v-model="showDetail">
34
+ <Panel v-for="(detail,index) in config.detail" :key="detail.name+index" :id="detail.name" :name="detail.name" >
35
+ {{detail.title}}
36
+ <template #content>
37
+ <p>
38
+ <EditGrid :ref="detail.name" :config="detail" :dictData="dictData"> </EditGrid>
39
+ </p>
40
+ </template>
41
+ </Panel>
42
+ </Collapse>
43
+ </Row>
44
+ </Col>
45
+ </Row>
46
+ </Col>
47
+ <Col :span="rightSpan" v-show="rightShowFlag">
48
+ <Affix>
49
+ <Anchor v-if="showAnchor" :affix="false" show-ink>
50
+ <AnchorLink v-for="(item,index) in anchor" :key="'anchor_' + index" :href="item.href" :title="item.title" >
51
+ <AnchorLink style="margin-top: 20px;" v-for="(item2,index2) in item.children" :key="'anchor_child_' + index2" :href="item2.href" :title="item2.title" />
52
+ </AnchorLink>
53
+ </Anchor>
54
+ </Affix>
55
+ </Col>
56
+ </Row>
57
+ </div>
58
+ </template>
59
+ <script>
60
+ import toolAnchor from './toolanchor';
61
+ import Base from './workform.vue';
62
+ export default {
63
+ name: 'formdetail',
64
+ mixins: [toolAnchor],
65
+ extends: Base,
66
+ data (){
67
+ return {
68
+ alonePictureConfig:{
69
+ type:'PictureBox',
70
+ height:60,
71
+ width:95,
72
+ icon:'ios-cloud-upload',
73
+ iconSize:42,
74
+ iconColor:'#3399ff',
75
+ },
76
+ showAlonePicture:false,
77
+ alonePictureValue:{},
78
+ hackReset:true,
79
+ toolbarConfig:{},
80
+ fontplacement:'right',
81
+ showAnchor:false,
82
+ anchor:[],
83
+ showDetail:[]
84
+ };
85
+ },
86
+
87
+ methods:{
88
+ customInit() {
89
+ this.addAnchor(this.config.name,this.config.title);
90
+ this.showDetail = [];
91
+ if (this.config.detail) {
92
+ this.config.detail.forEach(el => {
93
+ this.addAnchor(el.name,el.title);
94
+ });
95
+ }
96
+ if (this.anchor.length > 0) {
97
+ this.showAnchor = true;
98
+ } else {
99
+ this.showAnchor = false;
100
+ }
101
+ },
102
+
103
+ reset() {
104
+ this.hackReset = false;
105
+ this.$nextTick(() => {
106
+ this.hackReset = true;
107
+ });
108
+ },
109
+ addAnchor(href,title) {
110
+ let anchor = {};
111
+ anchor.href = '#'+href;
112
+ anchor.title = title;
113
+ anchor.children = [];
114
+ if (href && title) {
115
+ this.anchor.push(anchor);
116
+ }
117
+ },
118
+ updateItemConfig(name, config) {
119
+ this.$refs.form.updateItemConfig(name, config);
120
+ },
121
+ updateItemsConfig(obj) {
122
+ this.$refs.form.updateItemsConfig(obj);
123
+ },
124
+ setRequired(name,value) {
125
+ this.$refs.form.setRequired(name, value);
126
+ }
127
+ }
128
+ };
129
+ </script>