doway-coms 2.2.18 → 2.2.21
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.
- package/.browserslistrc +2 -2
- package/README.md +28 -28
- package/package.json +53 -53
- package/packages/AuditsList/index.js +7 -7
- package/packages/AuditsList/src/index.vue +262 -262
- package/packages/BaseButton/index.js +7 -7
- package/packages/BaseButton/src/index.vue +241 -241
- package/packages/BaseCheckbox/index.js +7 -7
- package/packages/BaseCheckbox/src/index.vue +134 -134
- package/packages/BaseDate/index.js +7 -7
- package/packages/BaseDate/src/index.vue +197 -197
- package/packages/BaseDateWeek/index.js +7 -7
- package/packages/BaseDateWeek/src/index.vue +163 -163
- package/packages/BaseDatetime/index.js +7 -7
- package/packages/BaseDatetime/src/index.vue +196 -196
- package/packages/BaseForm/index.js +7 -7
- package/packages/BaseForm/src/index.vue +728 -728
- package/packages/BaseGantt/index.js +9 -9
- package/packages/BaseGantt/src/index.vue +608 -608
- package/packages/BaseGrid/index.js +9 -9
- package/packages/BaseGrid/src/SeqSetting.vue +278 -278
- package/packages/BaseGrid/src/index.vue +3580 -3580
- package/packages/BaseGridAdjust/index.js +9 -9
- package/packages/BaseGridAdjust/src/index.vue +482 -482
- package/packages/BaseInput/index.js +7 -7
- package/packages/BaseInput/src/index.vue +164 -164
- package/packages/BaseIntervalInput/index.js +7 -7
- package/packages/BaseIntervalInput/src/index.vue +310 -310
- package/packages/BaseKanbanEmpty/index.js +7 -7
- package/packages/BaseKanbanEmpty/src/index.vue +176 -176
- package/packages/BaseNumberInput/index.js +7 -7
- package/packages/BaseNumberInput/src/index.vue +293 -293
- package/packages/BasePagination/index.js +7 -7
- package/packages/BasePagination/src/index.vue +91 -91
- package/packages/BasePictureCard/index.js +7 -7
- package/packages/BasePictureCard/src/index.vue +580 -580
- package/packages/BasePrintPreview/index.js +7 -7
- package/packages/BasePrintPreview/src/index.vue +129 -129
- package/packages/BasePulldown/index.js +7 -7
- package/packages/BasePulldown/src/index.vue +1265 -1265
- package/packages/BaseSearch/index.js +7 -7
- package/packages/BaseSearch/src/index.vue +935 -935
- package/packages/BaseSelect/index.js +7 -7
- package/packages/BaseSelect/src/index.vue +155 -155
- package/packages/BaseSelectMulti/index.js +7 -7
- package/packages/BaseSelectMulti/src/index.vue +148 -148
- package/packages/BaseTextArea/index.js +7 -7
- package/packages/BaseTextArea/src/index.vue +178 -178
- package/packages/BaseTime/index.js +7 -7
- package/packages/BaseTime/src/index.vue +166 -166
- package/packages/BaseTool/index.js +7 -7
- package/packages/BaseTool/src/index.vue +349 -349
- package/packages/BaseToolStatus/index.js +7 -7
- package/packages/BaseToolStatus/src/index.vue +388 -388
- package/packages/BaseTreeSelect/index.js +8 -8
- package/packages/BaseTreeSelect/src/index.vue +437 -416
- package/packages/LeaveAMessage/index.js +7 -7
- package/packages/LeaveAMessage/src/index.vue +597 -597
- package/packages/index.js +191 -191
- package/packages/styles/default.css +78 -78
- package/packages/styles/default.less +84 -84
- package/packages/utils/api.js +107 -107
- package/packages/utils/auth.js +38 -38
- package/packages/utils/common.js +610 -610
- package/packages/utils/dom.js +181 -181
- package/packages/utils/enum.js +86 -86
- package/packages/utils/filters.js +472 -472
- package/packages/utils/gridFormat.js +66 -66
- package/packages/utils/msg.js +84 -84
- package/packages/utils/patchFiles.js +44 -44
- package/packages/utils/request.js +178 -178
- package/packages/utils/store.js +305 -303
- package/vue.config.js +59 -59
|
@@ -1,728 +1,728 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="d-form-items">
|
|
3
|
-
<!-- <div @click="hiddenDetail = !hiddenDetail">展开</div> -->
|
|
4
|
-
<div
|
|
5
|
-
class="d-form-item"
|
|
6
|
-
v-for="col in internalComputedHiddenCols"
|
|
7
|
-
:key="col.field"
|
|
8
|
-
v-show="hiddenDetail ? colIndex === 0 : true"
|
|
9
|
-
>
|
|
10
|
-
<!-- 文本框输入控件 -->
|
|
11
|
-
<BaseInput
|
|
12
|
-
v-if="
|
|
13
|
-
col.controlType === 'text' &&
|
|
14
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
15
|
-
"
|
|
16
|
-
:label="col.title"
|
|
17
|
-
v-model="row[col.field]"
|
|
18
|
-
:edit="col.edit"
|
|
19
|
-
:tooltip="col.tooltip"
|
|
20
|
-
:rules="col.rules"
|
|
21
|
-
@change="
|
|
22
|
-
() => {
|
|
23
|
-
inputChange(col)
|
|
24
|
-
}
|
|
25
|
-
"
|
|
26
|
-
@blur="
|
|
27
|
-
() => {
|
|
28
|
-
blurChange(col)
|
|
29
|
-
}
|
|
30
|
-
"
|
|
31
|
-
/>
|
|
32
|
-
<!-- 按钮弹出框输入控件 -->
|
|
33
|
-
<!-- isButtonShow字段是额外添加字段,用于控制区分输入框控件 -->
|
|
34
|
-
<BaseButton
|
|
35
|
-
v-if="col.isButtonShow == true"
|
|
36
|
-
v-model="row[col.field]"
|
|
37
|
-
:colInfo="col"
|
|
38
|
-
:row="row"
|
|
39
|
-
:formRow="formRow"
|
|
40
|
-
@preSearch="preSearch"
|
|
41
|
-
@handleOk="
|
|
42
|
-
(value) => {
|
|
43
|
-
buttonHandleOk(col, value)
|
|
44
|
-
}
|
|
45
|
-
"
|
|
46
|
-
/>
|
|
47
|
-
<!-- 文本框输入控件 -->
|
|
48
|
-
<BaseTextArea
|
|
49
|
-
v-if="
|
|
50
|
-
col.controlType === 'textarea' &&
|
|
51
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
52
|
-
"
|
|
53
|
-
:label="col.title"
|
|
54
|
-
v-model="row[col.field]"
|
|
55
|
-
:edit="col.edit"
|
|
56
|
-
:tooltip="col.tooltip"
|
|
57
|
-
:rules="col.rules"
|
|
58
|
-
@change="
|
|
59
|
-
() => {
|
|
60
|
-
inputChange(col)
|
|
61
|
-
}
|
|
62
|
-
"
|
|
63
|
-
/>
|
|
64
|
-
<!-- 数字输入 -->
|
|
65
|
-
<BaseNumberInput
|
|
66
|
-
v-if="
|
|
67
|
-
col.controlType === 'number' &&
|
|
68
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
69
|
-
"
|
|
70
|
-
:label="col.title"
|
|
71
|
-
v-model="row[col.field]"
|
|
72
|
-
:edit="col.edit"
|
|
73
|
-
:rules="col.rules"
|
|
74
|
-
:min="col.min"
|
|
75
|
-
:tooltip="col.tooltip"
|
|
76
|
-
:max="col.max"
|
|
77
|
-
:precision="col.precision"
|
|
78
|
-
:percent="col.percent"
|
|
79
|
-
:doFormat="col.doFormat"
|
|
80
|
-
@change="
|
|
81
|
-
() => {
|
|
82
|
-
numberChange(col)
|
|
83
|
-
}
|
|
84
|
-
"
|
|
85
|
-
@blur="
|
|
86
|
-
() => {
|
|
87
|
-
blurChange(col)
|
|
88
|
-
}
|
|
89
|
-
"
|
|
90
|
-
/>
|
|
91
|
-
<BaseIntervalInput
|
|
92
|
-
v-if="
|
|
93
|
-
col.controlType === 'interval' &&
|
|
94
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
95
|
-
"
|
|
96
|
-
:label="col.title"
|
|
97
|
-
v-model="row[col.field]"
|
|
98
|
-
:edit="col.edit"
|
|
99
|
-
:rules="col.rules"
|
|
100
|
-
:tooltip="col.tooltip"
|
|
101
|
-
:displayType="col.displayType"
|
|
102
|
-
:valueType="col.valueType"
|
|
103
|
-
@change="
|
|
104
|
-
() => {
|
|
105
|
-
numberChange(col)
|
|
106
|
-
}
|
|
107
|
-
"
|
|
108
|
-
/>
|
|
109
|
-
<!-- 日期选择控件 -->
|
|
110
|
-
<BaseDate
|
|
111
|
-
v-if="
|
|
112
|
-
col.controlType === 'date' &&
|
|
113
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
114
|
-
"
|
|
115
|
-
:label="col.title"
|
|
116
|
-
v-model="row[col.field]"
|
|
117
|
-
:edit="col.edit"
|
|
118
|
-
:tooltip="col.tooltip"
|
|
119
|
-
:pastDate="col.pastDate"
|
|
120
|
-
:rules="col.rules"
|
|
121
|
-
:disabledDateValue="col.disabledDateValue"
|
|
122
|
-
@change="
|
|
123
|
-
() => {
|
|
124
|
-
inputChange(col)
|
|
125
|
-
}
|
|
126
|
-
"
|
|
127
|
-
/>
|
|
128
|
-
<!-- 日期时间控件 -->
|
|
129
|
-
<BaseDatetime
|
|
130
|
-
v-if="
|
|
131
|
-
col.controlType === 'datetime' &&
|
|
132
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
133
|
-
"
|
|
134
|
-
:label="col.title"
|
|
135
|
-
v-model="row[col.field]"
|
|
136
|
-
:pastDate="col.pastDate"
|
|
137
|
-
:tooltip="col.tooltip"
|
|
138
|
-
:edit="col.edit"
|
|
139
|
-
:rules="col.rules"
|
|
140
|
-
:disabledDateValue="col.disabledDateValue"
|
|
141
|
-
@change="
|
|
142
|
-
() => {
|
|
143
|
-
inputChange(col)
|
|
144
|
-
}
|
|
145
|
-
"
|
|
146
|
-
/>
|
|
147
|
-
<!-- 单选框 -->
|
|
148
|
-
<BaseCheckbox
|
|
149
|
-
v-if="
|
|
150
|
-
col.controlType === 'checkbox' &&
|
|
151
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
152
|
-
"
|
|
153
|
-
:label="col.title"
|
|
154
|
-
v-model="row[col.field]"
|
|
155
|
-
:edit="col.edit"
|
|
156
|
-
:tooltip="col.tooltip"
|
|
157
|
-
:rules="col.rules"
|
|
158
|
-
@change="
|
|
159
|
-
(rowInfo) => {
|
|
160
|
-
checkboxChange(col)
|
|
161
|
-
}
|
|
162
|
-
"
|
|
163
|
-
/>
|
|
164
|
-
<BaseTime
|
|
165
|
-
v-if="
|
|
166
|
-
col.controlType === 'time' &&
|
|
167
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
168
|
-
"
|
|
169
|
-
:label="col.title"
|
|
170
|
-
v-model="row[col.field]"
|
|
171
|
-
:tooltip="col.tooltip"
|
|
172
|
-
:edit="col.edit"
|
|
173
|
-
:rules="col.rules"
|
|
174
|
-
@change="
|
|
175
|
-
() => {
|
|
176
|
-
inputChange(col)
|
|
177
|
-
}
|
|
178
|
-
"
|
|
179
|
-
/>
|
|
180
|
-
<BaseDateWeek
|
|
181
|
-
v-if="
|
|
182
|
-
col.controlType === 'dateweek' &&
|
|
183
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
184
|
-
"
|
|
185
|
-
:label="col.title"
|
|
186
|
-
v-model="row[col.field]"
|
|
187
|
-
:edit="col.edit"
|
|
188
|
-
:tooltip="col.tooltip"
|
|
189
|
-
:rules="col.rules"
|
|
190
|
-
@change="
|
|
191
|
-
() => {
|
|
192
|
-
inputChange(col)
|
|
193
|
-
}
|
|
194
|
-
"
|
|
195
|
-
/>
|
|
196
|
-
<BaseDateMonth
|
|
197
|
-
v-if="
|
|
198
|
-
col.controlType === 'datemonth' &&
|
|
199
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
200
|
-
"
|
|
201
|
-
:label="col.title"
|
|
202
|
-
v-model="row[col.field]"
|
|
203
|
-
:edit="col.edit"
|
|
204
|
-
:tooltip="col.tooltip"
|
|
205
|
-
:rules="col.rules"
|
|
206
|
-
@change="
|
|
207
|
-
() => {
|
|
208
|
-
inputChange(col)
|
|
209
|
-
}
|
|
210
|
-
"
|
|
211
|
-
/>
|
|
212
|
-
<BaseSelect
|
|
213
|
-
v-if="
|
|
214
|
-
col.controlType === 'select' &&
|
|
215
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
216
|
-
"
|
|
217
|
-
:label="col.title"
|
|
218
|
-
v-model="row[col.field]"
|
|
219
|
-
:edit="col.edit"
|
|
220
|
-
:rules="col.rules"
|
|
221
|
-
:tooltip="col.tooltip"
|
|
222
|
-
:dataSource="col.dataSource"
|
|
223
|
-
@change="
|
|
224
|
-
(rowInfo) => {
|
|
225
|
-
selectChange(col)
|
|
226
|
-
}
|
|
227
|
-
"
|
|
228
|
-
/>
|
|
229
|
-
<BaseSelectMulti
|
|
230
|
-
v-if="
|
|
231
|
-
col.controlType === 'dropmulti' &&
|
|
232
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
233
|
-
"
|
|
234
|
-
:label="col.title"
|
|
235
|
-
v-model="row[col.field]"
|
|
236
|
-
:edit="col.edit"
|
|
237
|
-
:tooltip="col.tooltip"
|
|
238
|
-
:rules="col.rules"
|
|
239
|
-
@change="
|
|
240
|
-
(rowInfo) => {
|
|
241
|
-
selectMultiChange(col)
|
|
242
|
-
}
|
|
243
|
-
"
|
|
244
|
-
:dataSource="col.dataSource"
|
|
245
|
-
/>
|
|
246
|
-
<BasePulldown
|
|
247
|
-
v-if="
|
|
248
|
-
col.controlType === 'pulldown' &&
|
|
249
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
250
|
-
"
|
|
251
|
-
:formRow="formRow"
|
|
252
|
-
:isOld="isOld"
|
|
253
|
-
:edit="col.edit"
|
|
254
|
-
:defaultExpression="col.defaultExpression"
|
|
255
|
-
:row="row"
|
|
256
|
-
:api="col.api"
|
|
257
|
-
:tooltip="col.tooltip"
|
|
258
|
-
:optBtns="col.optBtns"
|
|
259
|
-
:popupAddName="col.popupAddName"
|
|
260
|
-
:popupAddPath="col.popupAddPath"
|
|
261
|
-
@pulldownBtnClick="pulldownBtnClick"
|
|
262
|
-
:label="col.title"
|
|
263
|
-
:rules="col.rules"
|
|
264
|
-
:route="col.route"
|
|
265
|
-
v-model="row[col.field]"
|
|
266
|
-
:field="col.field"
|
|
267
|
-
:columns="col.columns"
|
|
268
|
-
:pageSize="col.pageSize"
|
|
269
|
-
:immediate="col.immediate"
|
|
270
|
-
:allowAutoClear="col.allowAutoClear"
|
|
271
|
-
@preSearch="preSearch"
|
|
272
|
-
@selectChanged="
|
|
273
|
-
(rowInfo) => {
|
|
274
|
-
pullDownChange(col, rowInfo)
|
|
275
|
-
}
|
|
276
|
-
"
|
|
277
|
-
/>
|
|
278
|
-
<BaseTreeSelect
|
|
279
|
-
v-if="
|
|
280
|
-
col.controlType === 'treeSelect' &&
|
|
281
|
-
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
282
|
-
"
|
|
283
|
-
:formRow="formRow"
|
|
284
|
-
:api="col.api"
|
|
285
|
-
:tooltip="col.tooltip"
|
|
286
|
-
:row="row"
|
|
287
|
-
:edit="col.edit"
|
|
288
|
-
:label="col.title"
|
|
289
|
-
:rules="col.rules"
|
|
290
|
-
:route="col.route"
|
|
291
|
-
:field="col.field"
|
|
292
|
-
:columns="col.columns"
|
|
293
|
-
@preSearch="preSearch"
|
|
294
|
-
:replaceFields="col.replaceFields"
|
|
295
|
-
:treeWidth="col.treeWidth"
|
|
296
|
-
:width="col.width"
|
|
297
|
-
:linkedField="col.linkedField"
|
|
298
|
-
:showSearch="col.showSearch"
|
|
299
|
-
:allowClear="col.allowClear"
|
|
300
|
-
:placeholder="col.placeholder"
|
|
301
|
-
:linkedTitle="col.linkedTitle"
|
|
302
|
-
:method="col.method"
|
|
303
|
-
v-model="row[col.field]"
|
|
304
|
-
@change="
|
|
305
|
-
() => {
|
|
306
|
-
inputChange(col)
|
|
307
|
-
}
|
|
308
|
-
"
|
|
309
|
-
/>
|
|
310
|
-
</div>
|
|
311
|
-
<div class="d-form-item-ghost"></div>
|
|
312
|
-
<div class="d-form-item-ghost"></div>
|
|
313
|
-
<div class="d-form-item-ghost"></div>
|
|
314
|
-
<div class="d-form-item-ghost"></div>
|
|
315
|
-
</div>
|
|
316
|
-
</template>
|
|
317
|
-
|
|
318
|
-
<script>
|
|
319
|
-
import { sysFormState, sysRowState } from '../../utils/enum'
|
|
320
|
-
import BaseInput from '../../BaseInput/index'
|
|
321
|
-
import BaseCheckbox from '../../BaseCheckbox/index'
|
|
322
|
-
import BaseDate from '../../BaseDate/index'
|
|
323
|
-
import BaseDatetime from '../../BaseDatetime/index'
|
|
324
|
-
import BaseDateWeek from '../../BaseDateWeek/index'
|
|
325
|
-
import BaseTextArea from '../../BaseTextArea/index'
|
|
326
|
-
import BaseButton from '../../BaseButton/index'
|
|
327
|
-
import BaseSelect from '../../BaseSelect/index'
|
|
328
|
-
import BaseSelectMulti from '../../BaseSelectMulti/index'
|
|
329
|
-
import BaseTime from '../../BaseTime/index'
|
|
330
|
-
import BasePulldown from '../../BasePulldown/index'
|
|
331
|
-
import BaseIntervalInput from '../../BaseIntervalInput/index'
|
|
332
|
-
import BaseNumberInput from '../../BaseNumberInput/index'
|
|
333
|
-
import BaseTreeSelect from '../../BaseTreeSelect'
|
|
334
|
-
|
|
335
|
-
import moment from 'moment'
|
|
336
|
-
import BaseDateMonth from '../../BaseDateMonth'
|
|
337
|
-
export default {
|
|
338
|
-
components: {
|
|
339
|
-
BaseInput,
|
|
340
|
-
BaseCheckbox,
|
|
341
|
-
BaseDate,
|
|
342
|
-
BaseDatetime,
|
|
343
|
-
BaseDateWeek,
|
|
344
|
-
BaseDateMonth,
|
|
345
|
-
BaseTextArea,
|
|
346
|
-
BaseButton,
|
|
347
|
-
BaseSelect,
|
|
348
|
-
BaseSelectMulti,
|
|
349
|
-
BaseTime,
|
|
350
|
-
BasePulldown,
|
|
351
|
-
BaseIntervalInput,
|
|
352
|
-
BaseNumberInput,
|
|
353
|
-
BaseTreeSelect,
|
|
354
|
-
},
|
|
355
|
-
name: 'BaseForm',
|
|
356
|
-
props: {
|
|
357
|
-
updateDatas: {
|
|
358
|
-
// 更新的数据
|
|
359
|
-
type: Object,
|
|
360
|
-
default: function () {
|
|
361
|
-
return {}
|
|
362
|
-
},
|
|
363
|
-
},
|
|
364
|
-
showLoading: {
|
|
365
|
-
// 是否显示加载信息
|
|
366
|
-
type: Boolean,
|
|
367
|
-
default: false,
|
|
368
|
-
},
|
|
369
|
-
isOld: {
|
|
370
|
-
// 是否老系统
|
|
371
|
-
type: Boolean,
|
|
372
|
-
default: false,
|
|
373
|
-
},
|
|
374
|
-
valueState: {
|
|
375
|
-
type: Object,
|
|
376
|
-
default: function () {
|
|
377
|
-
return {}
|
|
378
|
-
},
|
|
379
|
-
},
|
|
380
|
-
formState: {
|
|
381
|
-
type: String,
|
|
382
|
-
default: sysFormState.view,
|
|
383
|
-
},
|
|
384
|
-
formRow: {
|
|
385
|
-
// 当前页面数据集
|
|
386
|
-
type: Object,
|
|
387
|
-
default: () => {
|
|
388
|
-
return {}
|
|
389
|
-
},
|
|
390
|
-
},
|
|
391
|
-
row: {
|
|
392
|
-
// 当前行,如果是表单的话当前行和当前页面数据集是一样的
|
|
393
|
-
type: Object,
|
|
394
|
-
default: () => {
|
|
395
|
-
return {}
|
|
396
|
-
},
|
|
397
|
-
},
|
|
398
|
-
columns: {
|
|
399
|
-
// 表格列信息
|
|
400
|
-
type: Array,
|
|
401
|
-
default: function () {
|
|
402
|
-
return []
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
dataName: {
|
|
406
|
-
type: String,
|
|
407
|
-
default: function () {
|
|
408
|
-
return ''
|
|
409
|
-
},
|
|
410
|
-
},
|
|
411
|
-
},
|
|
412
|
-
computed: {
|
|
413
|
-
internalComputedHiddenCols: function () {
|
|
414
|
-
let vm = this
|
|
415
|
-
return this.columns.filter((item) => {
|
|
416
|
-
// if (item.isTitle === true) {
|
|
417
|
-
// // vm.titleCol = item
|
|
418
|
-
// return false
|
|
419
|
-
// }
|
|
420
|
-
// if (item.controlType === controlType.image) {
|
|
421
|
-
// vm.logoCol = item
|
|
422
|
-
// return false
|
|
423
|
-
// }
|
|
424
|
-
return item.visible === true
|
|
425
|
-
})
|
|
426
|
-
},
|
|
427
|
-
},
|
|
428
|
-
filters: {},
|
|
429
|
-
data() {
|
|
430
|
-
return {
|
|
431
|
-
hiddenDetail: false,
|
|
432
|
-
moment,
|
|
433
|
-
editFormName: '',
|
|
434
|
-
internalEdit: false,
|
|
435
|
-
internalCols: [],
|
|
436
|
-
internalValueState: {},
|
|
437
|
-
internalFormState: sysFormState.view,
|
|
438
|
-
rules: {},
|
|
439
|
-
titleCols: [],
|
|
440
|
-
logoCol: null,
|
|
441
|
-
isShowEditForm: false,
|
|
442
|
-
ref: '',
|
|
443
|
-
}
|
|
444
|
-
},
|
|
445
|
-
watch: {
|
|
446
|
-
// row: {
|
|
447
|
-
// handler: function (newVal) {
|
|
448
|
-
// },
|
|
449
|
-
// deep: true
|
|
450
|
-
// },
|
|
451
|
-
// cols: {
|
|
452
|
-
// handler: function (newVal) {
|
|
453
|
-
// this.internalCols = newVal
|
|
454
|
-
// },
|
|
455
|
-
// deep: true
|
|
456
|
-
// },
|
|
457
|
-
// valueState: { // 表单值状态,更新,还是插入
|
|
458
|
-
// handler: function (newVal) {
|
|
459
|
-
// this.internalValueState = newVal
|
|
460
|
-
// },
|
|
461
|
-
// deep: true
|
|
462
|
-
// },
|
|
463
|
-
// formState: {
|
|
464
|
-
// handler: function (newVal) {
|
|
465
|
-
// this.internalFormState = newVal
|
|
466
|
-
// this.setColState()
|
|
467
|
-
// },
|
|
468
|
-
// deep: true
|
|
469
|
-
// }
|
|
470
|
-
},
|
|
471
|
-
created() {
|
|
472
|
-
for (let i = 0; i < this.columns.length; i++) {
|
|
473
|
-
// if (this.columns[i].isLogo === true) {
|
|
474
|
-
// this.logoCol = this.columns[i]
|
|
475
|
-
// continue
|
|
476
|
-
// }
|
|
477
|
-
// if (this.columns[i].isTitle === true) {
|
|
478
|
-
// this.titleCols.push(this.columns[i])
|
|
479
|
-
// continue
|
|
480
|
-
// }
|
|
481
|
-
if (this.columns[i].controlType === 'popup') {
|
|
482
|
-
let formUrl =
|
|
483
|
-
process.env[
|
|
484
|
-
'VUE_APP_' +
|
|
485
|
-
this.columns[i].linkModuleData.objectService.toUpperCase() +
|
|
486
|
-
'_SERVICE_URL'
|
|
487
|
-
] +
|
|
488
|
-
'/' +
|
|
489
|
-
this.columns[i].linkModuleData.objectApiVersion +
|
|
490
|
-
'/' +
|
|
491
|
-
this.columns[i].linkModuleData.objectName +
|
|
492
|
-
'/'
|
|
493
|
-
this.columns[i]['api'] = this.columns[i].linkModuleData.objectApiRoute
|
|
494
|
-
? formUrl + this.columns[i].linkModuleData.objectApiRoute
|
|
495
|
-
: formUrl + 'Search'
|
|
496
|
-
|
|
497
|
-
this.columns[i]['columns'] = {}
|
|
498
|
-
|
|
499
|
-
for (
|
|
500
|
-
let x = 0;
|
|
501
|
-
x < this.columns[i].linkModuleData.moduleFields.length;
|
|
502
|
-
x++
|
|
503
|
-
) {
|
|
504
|
-
let tempField = this.columns[i].linkModuleData.moduleFields[x]
|
|
505
|
-
this.columns[i]['columns'][tempField.field] = {
|
|
506
|
-
title: tempField.caption,
|
|
507
|
-
width: tempField.width,
|
|
508
|
-
visible: tempField.visible,
|
|
509
|
-
linkField: tempField.linkValueField,
|
|
510
|
-
filter: tempField.isFilter,
|
|
511
|
-
}
|
|
512
|
-
if (tempField.field === this.columns[i].linkCaptionField) {
|
|
513
|
-
this.columns[i]['columns'][tempField.field].linkField =
|
|
514
|
-
this.columns[i].field
|
|
515
|
-
this.columns[i]['columns'][tempField.field].filter = true
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
// this.columns[i]['rules'] = {}
|
|
521
|
-
// if (this.columns[i].isRequire === true) {
|
|
522
|
-
// this.columns[i].rules['required'] = true
|
|
523
|
-
// }
|
|
524
|
-
// if (this.columns[i].maxLength) {
|
|
525
|
-
// this.columns[i].rules['length'] = [0, this.columns[i].maxLength]
|
|
526
|
-
// }
|
|
527
|
-
}
|
|
528
|
-
},
|
|
529
|
-
|
|
530
|
-
mounted() {
|
|
531
|
-
//let letterLength = this.$refs.content.value
|
|
532
|
-
//letterLength = this.$refs['content'].innerText.substr(0, 6) + '...'
|
|
533
|
-
window.addEventListener('beforeunload', (e) => this.beforeunloadHandler(e))
|
|
534
|
-
},
|
|
535
|
-
destroyed() {
|
|
536
|
-
window.removeEventListener('beforeunload', (e) =>
|
|
537
|
-
this.beforeunloadHandler(e)
|
|
538
|
-
)
|
|
539
|
-
},
|
|
540
|
-
activated() {},
|
|
541
|
-
methods: {
|
|
542
|
-
preSearch(searchInfo, repeatRowInfo) {
|
|
543
|
-
this.$emit('preSearch', searchInfo, repeatRowInfo)
|
|
544
|
-
},
|
|
545
|
-
beforeunloadHandler(e) {
|
|
546
|
-
if (this.formState !== 'view') {
|
|
547
|
-
e = e || window.event
|
|
548
|
-
e.returnValue = '提示'
|
|
549
|
-
return confirm('确认退出')
|
|
550
|
-
} else {
|
|
551
|
-
return
|
|
552
|
-
}
|
|
553
|
-
},
|
|
554
|
-
pulldownBtnClick(btnInfo) {
|
|
555
|
-
this.$emit('pulldownBtnClick', btnInfo)
|
|
556
|
-
},
|
|
557
|
-
showToolTip() {},
|
|
558
|
-
fieldCaptionClick(col) {
|
|
559
|
-
// 下拉框
|
|
560
|
-
if (
|
|
561
|
-
col.linkModuleData &&
|
|
562
|
-
col.linkModuleData.linkModuleId &&
|
|
563
|
-
col.linkModuleData.linkModuleOperate.indexOf(sysFormState.view) >= 0
|
|
564
|
-
) {
|
|
565
|
-
// 查找模块信息
|
|
566
|
-
let linkModule = this.$store.getters.addRouters.filter((filterItem) => {
|
|
567
|
-
return (
|
|
568
|
-
filterItem.meta &&
|
|
569
|
-
filterItem.meta.moduleId === col.linkModuleData.linkModuleId
|
|
570
|
-
)
|
|
571
|
-
})
|
|
572
|
-
if (linkModule.length > 0) {
|
|
573
|
-
this.$router.pushRoute({
|
|
574
|
-
name: linkModule[0].name,
|
|
575
|
-
query: { id: this.row[col.field] },
|
|
576
|
-
})
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
},
|
|
580
|
-
// selectChange(col) {
|
|
581
|
-
// if (col.field.indexOf('.') < 0) {
|
|
582
|
-
// this.updateDatas[col.field] = this.row[col.field]
|
|
583
|
-
// }
|
|
584
|
-
// if (
|
|
585
|
-
// this.row['sysRowState'] === sysRowState.add ||
|
|
586
|
-
// this.row['sysRowState'] === sysRowState.update
|
|
587
|
-
// ) {
|
|
588
|
-
// return
|
|
589
|
-
// }
|
|
590
|
-
// this.row['sysRowState'] = sysRowState.update
|
|
591
|
-
// },
|
|
592
|
-
pullDownChange(colInfo, row) {
|
|
593
|
-
this.$emit('change', colInfo)
|
|
594
|
-
},
|
|
595
|
-
selectMultiChange(colInfo, row) {
|
|
596
|
-
this.$emit('change', colInfo)
|
|
597
|
-
},
|
|
598
|
-
selectChange(colInfo) {
|
|
599
|
-
this.$emit('change', colInfo)
|
|
600
|
-
},
|
|
601
|
-
checkboxChange(colInfo) {
|
|
602
|
-
this.$emit('change', colInfo)
|
|
603
|
-
},
|
|
604
|
-
checkBoxChange(col) {
|
|
605
|
-
if (col.field.indexOf('.') < 0) {
|
|
606
|
-
this.updateDatas[col.field] = this.row[col.field]
|
|
607
|
-
}
|
|
608
|
-
this.$emit('change', col)
|
|
609
|
-
if (
|
|
610
|
-
this.row['sysRowState'] === sysRowState.add ||
|
|
611
|
-
this.row['sysRowState'] === sysRowState.update
|
|
612
|
-
) {
|
|
613
|
-
return
|
|
614
|
-
}
|
|
615
|
-
this.row['sysRowState'] = sysRowState.update
|
|
616
|
-
},
|
|
617
|
-
dateChange(col) {
|
|
618
|
-
if (col.field.indexOf('.') < 0) {
|
|
619
|
-
this.updateDatas[col.field] = this.row[col.field]
|
|
620
|
-
}
|
|
621
|
-
this.$emit('change', col)
|
|
622
|
-
if (
|
|
623
|
-
this.row['sysRowState'] === sysRowState.add ||
|
|
624
|
-
this.row['sysRowState'] === sysRowState.update
|
|
625
|
-
) {
|
|
626
|
-
return
|
|
627
|
-
}
|
|
628
|
-
this.row['sysRowState'] = sysRowState.update
|
|
629
|
-
},
|
|
630
|
-
inputChange(colInfo) {
|
|
631
|
-
// 输入框改变
|
|
632
|
-
this.$emit('change', colInfo)
|
|
633
|
-
},
|
|
634
|
-
// 按钮弹出组件返回输入的值
|
|
635
|
-
buttonHandleOk(colInfo, value) {
|
|
636
|
-
// 按钮弹出确定改变内容改变
|
|
637
|
-
this.$emit('buttonHandleOk', colInfo, value)
|
|
638
|
-
},
|
|
639
|
-
blurChange(colInfo) {
|
|
640
|
-
// 输入框失去焦点
|
|
641
|
-
this.$emit('blur', colInfo)
|
|
642
|
-
},
|
|
643
|
-
numberChange(colInfo) {
|
|
644
|
-
// 输入框改变
|
|
645
|
-
this.$emit('change', colInfo)
|
|
646
|
-
},
|
|
647
|
-
longtimeChange(data, col) {
|
|
648
|
-
this.row[col.field] = data
|
|
649
|
-
this.$emit('change', col)
|
|
650
|
-
if (
|
|
651
|
-
this.row['sysRowState'] === sysRowState.add ||
|
|
652
|
-
this.row['sysRowState'] === sysRowState.update
|
|
653
|
-
) {
|
|
654
|
-
return
|
|
655
|
-
}
|
|
656
|
-
this.row['sysRowState'] = sysRowState.update
|
|
657
|
-
},
|
|
658
|
-
changeControlType(field, controlType) {
|
|
659
|
-
let col = this.internalComputedHiddenCols.find(
|
|
660
|
-
(col) => col.field === field
|
|
661
|
-
)
|
|
662
|
-
col.controlType = controlType
|
|
663
|
-
},
|
|
664
|
-
},
|
|
665
|
-
}
|
|
666
|
-
</script>
|
|
667
|
-
|
|
668
|
-
<style lang="less" scoped>
|
|
669
|
-
.form-head {
|
|
670
|
-
display: flex;
|
|
671
|
-
flex-flow: row wrap;
|
|
672
|
-
margin-bottom: 10px;
|
|
673
|
-
.form-title {
|
|
674
|
-
margin-left: 10px;
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
.input-span {
|
|
678
|
-
// line-height: 33px;
|
|
679
|
-
color: #0b0b0b;
|
|
680
|
-
font-size: 12px;
|
|
681
|
-
font-weight: normal;
|
|
682
|
-
overflow: hidden;
|
|
683
|
-
text-overflow: ellipsis;
|
|
684
|
-
-o-text-overflow: ellipsis;
|
|
685
|
-
display: inline-block;
|
|
686
|
-
width: 100%;
|
|
687
|
-
height: 32.8px;
|
|
688
|
-
white-space: nowrap;
|
|
689
|
-
// font-family: "Arial", "Microsoft YaHei";
|
|
690
|
-
}
|
|
691
|
-
.title-first-input {
|
|
692
|
-
width: 200px;
|
|
693
|
-
height: 25px;
|
|
694
|
-
font-size: 15px;
|
|
695
|
-
margin-left: 10px;
|
|
696
|
-
font-weight: 500;
|
|
697
|
-
}
|
|
698
|
-
.title-second-input {
|
|
699
|
-
width: 200px;
|
|
700
|
-
height: 25px;
|
|
701
|
-
font-size: 15px;
|
|
702
|
-
margin-left: 10px;
|
|
703
|
-
font-weight: 500;
|
|
704
|
-
}
|
|
705
|
-
.title-first-value {
|
|
706
|
-
width: 200px;
|
|
707
|
-
height: 40px;
|
|
708
|
-
font-size: 24px;
|
|
709
|
-
margin-left: 10px;
|
|
710
|
-
font-weight: 700;
|
|
711
|
-
}
|
|
712
|
-
.title-second-value {
|
|
713
|
-
width: 200px;
|
|
714
|
-
height: 26px;
|
|
715
|
-
font-size: 18px;
|
|
716
|
-
margin-left: 10px;
|
|
717
|
-
font-weight: 600;
|
|
718
|
-
}
|
|
719
|
-
.option:hover {
|
|
720
|
-
background-color: #219bff;
|
|
721
|
-
}
|
|
722
|
-
.form {
|
|
723
|
-
margin-left: 30px;
|
|
724
|
-
}
|
|
725
|
-
</style>
|
|
726
|
-
<style lang="less">
|
|
727
|
-
@import '../../styles/default.less';
|
|
728
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="d-form-items">
|
|
3
|
+
<!-- <div @click="hiddenDetail = !hiddenDetail">展开</div> -->
|
|
4
|
+
<div
|
|
5
|
+
class="d-form-item"
|
|
6
|
+
v-for="col in internalComputedHiddenCols"
|
|
7
|
+
:key="col.field"
|
|
8
|
+
v-show="hiddenDetail ? colIndex === 0 : true"
|
|
9
|
+
>
|
|
10
|
+
<!-- 文本框输入控件 -->
|
|
11
|
+
<BaseInput
|
|
12
|
+
v-if="
|
|
13
|
+
col.controlType === 'text' &&
|
|
14
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
15
|
+
"
|
|
16
|
+
:label="col.title"
|
|
17
|
+
v-model="row[col.field]"
|
|
18
|
+
:edit="col.edit"
|
|
19
|
+
:tooltip="col.tooltip"
|
|
20
|
+
:rules="col.rules"
|
|
21
|
+
@change="
|
|
22
|
+
() => {
|
|
23
|
+
inputChange(col)
|
|
24
|
+
}
|
|
25
|
+
"
|
|
26
|
+
@blur="
|
|
27
|
+
() => {
|
|
28
|
+
blurChange(col)
|
|
29
|
+
}
|
|
30
|
+
"
|
|
31
|
+
/>
|
|
32
|
+
<!-- 按钮弹出框输入控件 -->
|
|
33
|
+
<!-- isButtonShow字段是额外添加字段,用于控制区分输入框控件 -->
|
|
34
|
+
<BaseButton
|
|
35
|
+
v-if="col.isButtonShow == true"
|
|
36
|
+
v-model="row[col.field]"
|
|
37
|
+
:colInfo="col"
|
|
38
|
+
:row="row"
|
|
39
|
+
:formRow="formRow"
|
|
40
|
+
@preSearch="preSearch"
|
|
41
|
+
@handleOk="
|
|
42
|
+
(value) => {
|
|
43
|
+
buttonHandleOk(col, value)
|
|
44
|
+
}
|
|
45
|
+
"
|
|
46
|
+
/>
|
|
47
|
+
<!-- 文本框输入控件 -->
|
|
48
|
+
<BaseTextArea
|
|
49
|
+
v-if="
|
|
50
|
+
col.controlType === 'textarea' &&
|
|
51
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
52
|
+
"
|
|
53
|
+
:label="col.title"
|
|
54
|
+
v-model="row[col.field]"
|
|
55
|
+
:edit="col.edit"
|
|
56
|
+
:tooltip="col.tooltip"
|
|
57
|
+
:rules="col.rules"
|
|
58
|
+
@change="
|
|
59
|
+
() => {
|
|
60
|
+
inputChange(col)
|
|
61
|
+
}
|
|
62
|
+
"
|
|
63
|
+
/>
|
|
64
|
+
<!-- 数字输入 -->
|
|
65
|
+
<BaseNumberInput
|
|
66
|
+
v-if="
|
|
67
|
+
col.controlType === 'number' &&
|
|
68
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
69
|
+
"
|
|
70
|
+
:label="col.title"
|
|
71
|
+
v-model="row[col.field]"
|
|
72
|
+
:edit="col.edit"
|
|
73
|
+
:rules="col.rules"
|
|
74
|
+
:min="col.min"
|
|
75
|
+
:tooltip="col.tooltip"
|
|
76
|
+
:max="col.max"
|
|
77
|
+
:precision="col.precision"
|
|
78
|
+
:percent="col.percent"
|
|
79
|
+
:doFormat="col.doFormat"
|
|
80
|
+
@change="
|
|
81
|
+
() => {
|
|
82
|
+
numberChange(col)
|
|
83
|
+
}
|
|
84
|
+
"
|
|
85
|
+
@blur="
|
|
86
|
+
() => {
|
|
87
|
+
blurChange(col)
|
|
88
|
+
}
|
|
89
|
+
"
|
|
90
|
+
/>
|
|
91
|
+
<BaseIntervalInput
|
|
92
|
+
v-if="
|
|
93
|
+
col.controlType === 'interval' &&
|
|
94
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
95
|
+
"
|
|
96
|
+
:label="col.title"
|
|
97
|
+
v-model="row[col.field]"
|
|
98
|
+
:edit="col.edit"
|
|
99
|
+
:rules="col.rules"
|
|
100
|
+
:tooltip="col.tooltip"
|
|
101
|
+
:displayType="col.displayType"
|
|
102
|
+
:valueType="col.valueType"
|
|
103
|
+
@change="
|
|
104
|
+
() => {
|
|
105
|
+
numberChange(col)
|
|
106
|
+
}
|
|
107
|
+
"
|
|
108
|
+
/>
|
|
109
|
+
<!-- 日期选择控件 -->
|
|
110
|
+
<BaseDate
|
|
111
|
+
v-if="
|
|
112
|
+
col.controlType === 'date' &&
|
|
113
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
114
|
+
"
|
|
115
|
+
:label="col.title"
|
|
116
|
+
v-model="row[col.field]"
|
|
117
|
+
:edit="col.edit"
|
|
118
|
+
:tooltip="col.tooltip"
|
|
119
|
+
:pastDate="col.pastDate"
|
|
120
|
+
:rules="col.rules"
|
|
121
|
+
:disabledDateValue="col.disabledDateValue"
|
|
122
|
+
@change="
|
|
123
|
+
() => {
|
|
124
|
+
inputChange(col)
|
|
125
|
+
}
|
|
126
|
+
"
|
|
127
|
+
/>
|
|
128
|
+
<!-- 日期时间控件 -->
|
|
129
|
+
<BaseDatetime
|
|
130
|
+
v-if="
|
|
131
|
+
col.controlType === 'datetime' &&
|
|
132
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
133
|
+
"
|
|
134
|
+
:label="col.title"
|
|
135
|
+
v-model="row[col.field]"
|
|
136
|
+
:pastDate="col.pastDate"
|
|
137
|
+
:tooltip="col.tooltip"
|
|
138
|
+
:edit="col.edit"
|
|
139
|
+
:rules="col.rules"
|
|
140
|
+
:disabledDateValue="col.disabledDateValue"
|
|
141
|
+
@change="
|
|
142
|
+
() => {
|
|
143
|
+
inputChange(col)
|
|
144
|
+
}
|
|
145
|
+
"
|
|
146
|
+
/>
|
|
147
|
+
<!-- 单选框 -->
|
|
148
|
+
<BaseCheckbox
|
|
149
|
+
v-if="
|
|
150
|
+
col.controlType === 'checkbox' &&
|
|
151
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
152
|
+
"
|
|
153
|
+
:label="col.title"
|
|
154
|
+
v-model="row[col.field]"
|
|
155
|
+
:edit="col.edit"
|
|
156
|
+
:tooltip="col.tooltip"
|
|
157
|
+
:rules="col.rules"
|
|
158
|
+
@change="
|
|
159
|
+
(rowInfo) => {
|
|
160
|
+
checkboxChange(col)
|
|
161
|
+
}
|
|
162
|
+
"
|
|
163
|
+
/>
|
|
164
|
+
<BaseTime
|
|
165
|
+
v-if="
|
|
166
|
+
col.controlType === 'time' &&
|
|
167
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
168
|
+
"
|
|
169
|
+
:label="col.title"
|
|
170
|
+
v-model="row[col.field]"
|
|
171
|
+
:tooltip="col.tooltip"
|
|
172
|
+
:edit="col.edit"
|
|
173
|
+
:rules="col.rules"
|
|
174
|
+
@change="
|
|
175
|
+
() => {
|
|
176
|
+
inputChange(col)
|
|
177
|
+
}
|
|
178
|
+
"
|
|
179
|
+
/>
|
|
180
|
+
<BaseDateWeek
|
|
181
|
+
v-if="
|
|
182
|
+
col.controlType === 'dateweek' &&
|
|
183
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
184
|
+
"
|
|
185
|
+
:label="col.title"
|
|
186
|
+
v-model="row[col.field]"
|
|
187
|
+
:edit="col.edit"
|
|
188
|
+
:tooltip="col.tooltip"
|
|
189
|
+
:rules="col.rules"
|
|
190
|
+
@change="
|
|
191
|
+
() => {
|
|
192
|
+
inputChange(col)
|
|
193
|
+
}
|
|
194
|
+
"
|
|
195
|
+
/>
|
|
196
|
+
<BaseDateMonth
|
|
197
|
+
v-if="
|
|
198
|
+
col.controlType === 'datemonth' &&
|
|
199
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
200
|
+
"
|
|
201
|
+
:label="col.title"
|
|
202
|
+
v-model="row[col.field]"
|
|
203
|
+
:edit="col.edit"
|
|
204
|
+
:tooltip="col.tooltip"
|
|
205
|
+
:rules="col.rules"
|
|
206
|
+
@change="
|
|
207
|
+
() => {
|
|
208
|
+
inputChange(col)
|
|
209
|
+
}
|
|
210
|
+
"
|
|
211
|
+
/>
|
|
212
|
+
<BaseSelect
|
|
213
|
+
v-if="
|
|
214
|
+
col.controlType === 'select' &&
|
|
215
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
216
|
+
"
|
|
217
|
+
:label="col.title"
|
|
218
|
+
v-model="row[col.field]"
|
|
219
|
+
:edit="col.edit"
|
|
220
|
+
:rules="col.rules"
|
|
221
|
+
:tooltip="col.tooltip"
|
|
222
|
+
:dataSource="col.dataSource"
|
|
223
|
+
@change="
|
|
224
|
+
(rowInfo) => {
|
|
225
|
+
selectChange(col)
|
|
226
|
+
}
|
|
227
|
+
"
|
|
228
|
+
/>
|
|
229
|
+
<BaseSelectMulti
|
|
230
|
+
v-if="
|
|
231
|
+
col.controlType === 'dropmulti' &&
|
|
232
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
233
|
+
"
|
|
234
|
+
:label="col.title"
|
|
235
|
+
v-model="row[col.field]"
|
|
236
|
+
:edit="col.edit"
|
|
237
|
+
:tooltip="col.tooltip"
|
|
238
|
+
:rules="col.rules"
|
|
239
|
+
@change="
|
|
240
|
+
(rowInfo) => {
|
|
241
|
+
selectMultiChange(col)
|
|
242
|
+
}
|
|
243
|
+
"
|
|
244
|
+
:dataSource="col.dataSource"
|
|
245
|
+
/>
|
|
246
|
+
<BasePulldown
|
|
247
|
+
v-if="
|
|
248
|
+
col.controlType === 'pulldown' &&
|
|
249
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
250
|
+
"
|
|
251
|
+
:formRow="formRow"
|
|
252
|
+
:isOld="isOld"
|
|
253
|
+
:edit="col.edit"
|
|
254
|
+
:defaultExpression="col.defaultExpression"
|
|
255
|
+
:row="row"
|
|
256
|
+
:api="col.api"
|
|
257
|
+
:tooltip="col.tooltip"
|
|
258
|
+
:optBtns="col.optBtns"
|
|
259
|
+
:popupAddName="col.popupAddName"
|
|
260
|
+
:popupAddPath="col.popupAddPath"
|
|
261
|
+
@pulldownBtnClick="pulldownBtnClick"
|
|
262
|
+
:label="col.title"
|
|
263
|
+
:rules="col.rules"
|
|
264
|
+
:route="col.route"
|
|
265
|
+
v-model="row[col.field]"
|
|
266
|
+
:field="col.field"
|
|
267
|
+
:columns="col.columns"
|
|
268
|
+
:pageSize="col.pageSize"
|
|
269
|
+
:immediate="col.immediate"
|
|
270
|
+
:allowAutoClear="col.allowAutoClear"
|
|
271
|
+
@preSearch="preSearch"
|
|
272
|
+
@selectChanged="
|
|
273
|
+
(rowInfo) => {
|
|
274
|
+
pullDownChange(col, rowInfo)
|
|
275
|
+
}
|
|
276
|
+
"
|
|
277
|
+
/>
|
|
278
|
+
<BaseTreeSelect
|
|
279
|
+
v-if="
|
|
280
|
+
col.controlType === 'treeSelect' &&
|
|
281
|
+
(col.isButtonShow == false || col.isButtonShow == undefined)
|
|
282
|
+
"
|
|
283
|
+
:formRow="formRow"
|
|
284
|
+
:api="col.api"
|
|
285
|
+
:tooltip="col.tooltip"
|
|
286
|
+
:row="row"
|
|
287
|
+
:edit="col.edit"
|
|
288
|
+
:label="col.title"
|
|
289
|
+
:rules="col.rules"
|
|
290
|
+
:route="col.route"
|
|
291
|
+
:field="col.field"
|
|
292
|
+
:columns="col.columns"
|
|
293
|
+
@preSearch="preSearch"
|
|
294
|
+
:replaceFields="col.replaceFields"
|
|
295
|
+
:treeWidth="col.treeWidth"
|
|
296
|
+
:width="col.width"
|
|
297
|
+
:linkedField="col.linkedField"
|
|
298
|
+
:showSearch="col.showSearch"
|
|
299
|
+
:allowClear="col.allowClear"
|
|
300
|
+
:placeholder="col.placeholder"
|
|
301
|
+
:linkedTitle="col.linkedTitle"
|
|
302
|
+
:method="col.method"
|
|
303
|
+
v-model="row[col.field]"
|
|
304
|
+
@change="
|
|
305
|
+
() => {
|
|
306
|
+
inputChange(col)
|
|
307
|
+
}
|
|
308
|
+
"
|
|
309
|
+
/>
|
|
310
|
+
</div>
|
|
311
|
+
<div class="d-form-item-ghost"></div>
|
|
312
|
+
<div class="d-form-item-ghost"></div>
|
|
313
|
+
<div class="d-form-item-ghost"></div>
|
|
314
|
+
<div class="d-form-item-ghost"></div>
|
|
315
|
+
</div>
|
|
316
|
+
</template>
|
|
317
|
+
|
|
318
|
+
<script>
|
|
319
|
+
import { sysFormState, sysRowState } from '../../utils/enum'
|
|
320
|
+
import BaseInput from '../../BaseInput/index'
|
|
321
|
+
import BaseCheckbox from '../../BaseCheckbox/index'
|
|
322
|
+
import BaseDate from '../../BaseDate/index'
|
|
323
|
+
import BaseDatetime from '../../BaseDatetime/index'
|
|
324
|
+
import BaseDateWeek from '../../BaseDateWeek/index'
|
|
325
|
+
import BaseTextArea from '../../BaseTextArea/index'
|
|
326
|
+
import BaseButton from '../../BaseButton/index'
|
|
327
|
+
import BaseSelect from '../../BaseSelect/index'
|
|
328
|
+
import BaseSelectMulti from '../../BaseSelectMulti/index'
|
|
329
|
+
import BaseTime from '../../BaseTime/index'
|
|
330
|
+
import BasePulldown from '../../BasePulldown/index'
|
|
331
|
+
import BaseIntervalInput from '../../BaseIntervalInput/index'
|
|
332
|
+
import BaseNumberInput from '../../BaseNumberInput/index'
|
|
333
|
+
import BaseTreeSelect from '../../BaseTreeSelect'
|
|
334
|
+
|
|
335
|
+
import moment from 'moment'
|
|
336
|
+
import BaseDateMonth from '../../BaseDateMonth'
|
|
337
|
+
export default {
|
|
338
|
+
components: {
|
|
339
|
+
BaseInput,
|
|
340
|
+
BaseCheckbox,
|
|
341
|
+
BaseDate,
|
|
342
|
+
BaseDatetime,
|
|
343
|
+
BaseDateWeek,
|
|
344
|
+
BaseDateMonth,
|
|
345
|
+
BaseTextArea,
|
|
346
|
+
BaseButton,
|
|
347
|
+
BaseSelect,
|
|
348
|
+
BaseSelectMulti,
|
|
349
|
+
BaseTime,
|
|
350
|
+
BasePulldown,
|
|
351
|
+
BaseIntervalInput,
|
|
352
|
+
BaseNumberInput,
|
|
353
|
+
BaseTreeSelect,
|
|
354
|
+
},
|
|
355
|
+
name: 'BaseForm',
|
|
356
|
+
props: {
|
|
357
|
+
updateDatas: {
|
|
358
|
+
// 更新的数据
|
|
359
|
+
type: Object,
|
|
360
|
+
default: function () {
|
|
361
|
+
return {}
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
showLoading: {
|
|
365
|
+
// 是否显示加载信息
|
|
366
|
+
type: Boolean,
|
|
367
|
+
default: false,
|
|
368
|
+
},
|
|
369
|
+
isOld: {
|
|
370
|
+
// 是否老系统
|
|
371
|
+
type: Boolean,
|
|
372
|
+
default: false,
|
|
373
|
+
},
|
|
374
|
+
valueState: {
|
|
375
|
+
type: Object,
|
|
376
|
+
default: function () {
|
|
377
|
+
return {}
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
formState: {
|
|
381
|
+
type: String,
|
|
382
|
+
default: sysFormState.view,
|
|
383
|
+
},
|
|
384
|
+
formRow: {
|
|
385
|
+
// 当前页面数据集
|
|
386
|
+
type: Object,
|
|
387
|
+
default: () => {
|
|
388
|
+
return {}
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
row: {
|
|
392
|
+
// 当前行,如果是表单的话当前行和当前页面数据集是一样的
|
|
393
|
+
type: Object,
|
|
394
|
+
default: () => {
|
|
395
|
+
return {}
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
columns: {
|
|
399
|
+
// 表格列信息
|
|
400
|
+
type: Array,
|
|
401
|
+
default: function () {
|
|
402
|
+
return []
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
dataName: {
|
|
406
|
+
type: String,
|
|
407
|
+
default: function () {
|
|
408
|
+
return ''
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
computed: {
|
|
413
|
+
internalComputedHiddenCols: function () {
|
|
414
|
+
let vm = this
|
|
415
|
+
return this.columns.filter((item) => {
|
|
416
|
+
// if (item.isTitle === true) {
|
|
417
|
+
// // vm.titleCol = item
|
|
418
|
+
// return false
|
|
419
|
+
// }
|
|
420
|
+
// if (item.controlType === controlType.image) {
|
|
421
|
+
// vm.logoCol = item
|
|
422
|
+
// return false
|
|
423
|
+
// }
|
|
424
|
+
return item.visible === true
|
|
425
|
+
})
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
filters: {},
|
|
429
|
+
data() {
|
|
430
|
+
return {
|
|
431
|
+
hiddenDetail: false,
|
|
432
|
+
moment,
|
|
433
|
+
editFormName: '',
|
|
434
|
+
internalEdit: false,
|
|
435
|
+
internalCols: [],
|
|
436
|
+
internalValueState: {},
|
|
437
|
+
internalFormState: sysFormState.view,
|
|
438
|
+
rules: {},
|
|
439
|
+
titleCols: [],
|
|
440
|
+
logoCol: null,
|
|
441
|
+
isShowEditForm: false,
|
|
442
|
+
ref: '',
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
watch: {
|
|
446
|
+
// row: {
|
|
447
|
+
// handler: function (newVal) {
|
|
448
|
+
// },
|
|
449
|
+
// deep: true
|
|
450
|
+
// },
|
|
451
|
+
// cols: {
|
|
452
|
+
// handler: function (newVal) {
|
|
453
|
+
// this.internalCols = newVal
|
|
454
|
+
// },
|
|
455
|
+
// deep: true
|
|
456
|
+
// },
|
|
457
|
+
// valueState: { // 表单值状态,更新,还是插入
|
|
458
|
+
// handler: function (newVal) {
|
|
459
|
+
// this.internalValueState = newVal
|
|
460
|
+
// },
|
|
461
|
+
// deep: true
|
|
462
|
+
// },
|
|
463
|
+
// formState: {
|
|
464
|
+
// handler: function (newVal) {
|
|
465
|
+
// this.internalFormState = newVal
|
|
466
|
+
// this.setColState()
|
|
467
|
+
// },
|
|
468
|
+
// deep: true
|
|
469
|
+
// }
|
|
470
|
+
},
|
|
471
|
+
created() {
|
|
472
|
+
for (let i = 0; i < this.columns.length; i++) {
|
|
473
|
+
// if (this.columns[i].isLogo === true) {
|
|
474
|
+
// this.logoCol = this.columns[i]
|
|
475
|
+
// continue
|
|
476
|
+
// }
|
|
477
|
+
// if (this.columns[i].isTitle === true) {
|
|
478
|
+
// this.titleCols.push(this.columns[i])
|
|
479
|
+
// continue
|
|
480
|
+
// }
|
|
481
|
+
if (this.columns[i].controlType === 'popup') {
|
|
482
|
+
let formUrl =
|
|
483
|
+
process.env[
|
|
484
|
+
'VUE_APP_' +
|
|
485
|
+
this.columns[i].linkModuleData.objectService.toUpperCase() +
|
|
486
|
+
'_SERVICE_URL'
|
|
487
|
+
] +
|
|
488
|
+
'/' +
|
|
489
|
+
this.columns[i].linkModuleData.objectApiVersion +
|
|
490
|
+
'/' +
|
|
491
|
+
this.columns[i].linkModuleData.objectName +
|
|
492
|
+
'/'
|
|
493
|
+
this.columns[i]['api'] = this.columns[i].linkModuleData.objectApiRoute
|
|
494
|
+
? formUrl + this.columns[i].linkModuleData.objectApiRoute
|
|
495
|
+
: formUrl + 'Search'
|
|
496
|
+
|
|
497
|
+
this.columns[i]['columns'] = {}
|
|
498
|
+
|
|
499
|
+
for (
|
|
500
|
+
let x = 0;
|
|
501
|
+
x < this.columns[i].linkModuleData.moduleFields.length;
|
|
502
|
+
x++
|
|
503
|
+
) {
|
|
504
|
+
let tempField = this.columns[i].linkModuleData.moduleFields[x]
|
|
505
|
+
this.columns[i]['columns'][tempField.field] = {
|
|
506
|
+
title: tempField.caption,
|
|
507
|
+
width: tempField.width,
|
|
508
|
+
visible: tempField.visible,
|
|
509
|
+
linkField: tempField.linkValueField,
|
|
510
|
+
filter: tempField.isFilter,
|
|
511
|
+
}
|
|
512
|
+
if (tempField.field === this.columns[i].linkCaptionField) {
|
|
513
|
+
this.columns[i]['columns'][tempField.field].linkField =
|
|
514
|
+
this.columns[i].field
|
|
515
|
+
this.columns[i]['columns'][tempField.field].filter = true
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// this.columns[i]['rules'] = {}
|
|
521
|
+
// if (this.columns[i].isRequire === true) {
|
|
522
|
+
// this.columns[i].rules['required'] = true
|
|
523
|
+
// }
|
|
524
|
+
// if (this.columns[i].maxLength) {
|
|
525
|
+
// this.columns[i].rules['length'] = [0, this.columns[i].maxLength]
|
|
526
|
+
// }
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
|
|
530
|
+
mounted() {
|
|
531
|
+
//let letterLength = this.$refs.content.value
|
|
532
|
+
//letterLength = this.$refs['content'].innerText.substr(0, 6) + '...'
|
|
533
|
+
window.addEventListener('beforeunload', (e) => this.beforeunloadHandler(e))
|
|
534
|
+
},
|
|
535
|
+
destroyed() {
|
|
536
|
+
window.removeEventListener('beforeunload', (e) =>
|
|
537
|
+
this.beforeunloadHandler(e)
|
|
538
|
+
)
|
|
539
|
+
},
|
|
540
|
+
activated() {},
|
|
541
|
+
methods: {
|
|
542
|
+
preSearch(searchInfo, repeatRowInfo) {
|
|
543
|
+
this.$emit('preSearch', searchInfo, repeatRowInfo)
|
|
544
|
+
},
|
|
545
|
+
beforeunloadHandler(e) {
|
|
546
|
+
if (this.formState !== 'view') {
|
|
547
|
+
e = e || window.event
|
|
548
|
+
e.returnValue = '提示'
|
|
549
|
+
return confirm('确认退出')
|
|
550
|
+
} else {
|
|
551
|
+
return
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
pulldownBtnClick(btnInfo) {
|
|
555
|
+
this.$emit('pulldownBtnClick', btnInfo)
|
|
556
|
+
},
|
|
557
|
+
showToolTip() {},
|
|
558
|
+
fieldCaptionClick(col) {
|
|
559
|
+
// 下拉框
|
|
560
|
+
if (
|
|
561
|
+
col.linkModuleData &&
|
|
562
|
+
col.linkModuleData.linkModuleId &&
|
|
563
|
+
col.linkModuleData.linkModuleOperate.indexOf(sysFormState.view) >= 0
|
|
564
|
+
) {
|
|
565
|
+
// 查找模块信息
|
|
566
|
+
let linkModule = this.$store.getters.addRouters.filter((filterItem) => {
|
|
567
|
+
return (
|
|
568
|
+
filterItem.meta &&
|
|
569
|
+
filterItem.meta.moduleId === col.linkModuleData.linkModuleId
|
|
570
|
+
)
|
|
571
|
+
})
|
|
572
|
+
if (linkModule.length > 0) {
|
|
573
|
+
this.$router.pushRoute({
|
|
574
|
+
name: linkModule[0].name,
|
|
575
|
+
query: { id: this.row[col.field] },
|
|
576
|
+
})
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
// selectChange(col) {
|
|
581
|
+
// if (col.field.indexOf('.') < 0) {
|
|
582
|
+
// this.updateDatas[col.field] = this.row[col.field]
|
|
583
|
+
// }
|
|
584
|
+
// if (
|
|
585
|
+
// this.row['sysRowState'] === sysRowState.add ||
|
|
586
|
+
// this.row['sysRowState'] === sysRowState.update
|
|
587
|
+
// ) {
|
|
588
|
+
// return
|
|
589
|
+
// }
|
|
590
|
+
// this.row['sysRowState'] = sysRowState.update
|
|
591
|
+
// },
|
|
592
|
+
pullDownChange(colInfo, row) {
|
|
593
|
+
this.$emit('change', colInfo)
|
|
594
|
+
},
|
|
595
|
+
selectMultiChange(colInfo, row) {
|
|
596
|
+
this.$emit('change', colInfo)
|
|
597
|
+
},
|
|
598
|
+
selectChange(colInfo) {
|
|
599
|
+
this.$emit('change', colInfo)
|
|
600
|
+
},
|
|
601
|
+
checkboxChange(colInfo) {
|
|
602
|
+
this.$emit('change', colInfo)
|
|
603
|
+
},
|
|
604
|
+
checkBoxChange(col) {
|
|
605
|
+
if (col.field.indexOf('.') < 0) {
|
|
606
|
+
this.updateDatas[col.field] = this.row[col.field]
|
|
607
|
+
}
|
|
608
|
+
this.$emit('change', col)
|
|
609
|
+
if (
|
|
610
|
+
this.row['sysRowState'] === sysRowState.add ||
|
|
611
|
+
this.row['sysRowState'] === sysRowState.update
|
|
612
|
+
) {
|
|
613
|
+
return
|
|
614
|
+
}
|
|
615
|
+
this.row['sysRowState'] = sysRowState.update
|
|
616
|
+
},
|
|
617
|
+
dateChange(col) {
|
|
618
|
+
if (col.field.indexOf('.') < 0) {
|
|
619
|
+
this.updateDatas[col.field] = this.row[col.field]
|
|
620
|
+
}
|
|
621
|
+
this.$emit('change', col)
|
|
622
|
+
if (
|
|
623
|
+
this.row['sysRowState'] === sysRowState.add ||
|
|
624
|
+
this.row['sysRowState'] === sysRowState.update
|
|
625
|
+
) {
|
|
626
|
+
return
|
|
627
|
+
}
|
|
628
|
+
this.row['sysRowState'] = sysRowState.update
|
|
629
|
+
},
|
|
630
|
+
inputChange(colInfo) {
|
|
631
|
+
// 输入框改变
|
|
632
|
+
this.$emit('change', colInfo)
|
|
633
|
+
},
|
|
634
|
+
// 按钮弹出组件返回输入的值
|
|
635
|
+
buttonHandleOk(colInfo, value) {
|
|
636
|
+
// 按钮弹出确定改变内容改变
|
|
637
|
+
this.$emit('buttonHandleOk', colInfo, value)
|
|
638
|
+
},
|
|
639
|
+
blurChange(colInfo) {
|
|
640
|
+
// 输入框失去焦点
|
|
641
|
+
this.$emit('blur', colInfo)
|
|
642
|
+
},
|
|
643
|
+
numberChange(colInfo) {
|
|
644
|
+
// 输入框改变
|
|
645
|
+
this.$emit('change', colInfo)
|
|
646
|
+
},
|
|
647
|
+
longtimeChange(data, col) {
|
|
648
|
+
this.row[col.field] = data
|
|
649
|
+
this.$emit('change', col)
|
|
650
|
+
if (
|
|
651
|
+
this.row['sysRowState'] === sysRowState.add ||
|
|
652
|
+
this.row['sysRowState'] === sysRowState.update
|
|
653
|
+
) {
|
|
654
|
+
return
|
|
655
|
+
}
|
|
656
|
+
this.row['sysRowState'] = sysRowState.update
|
|
657
|
+
},
|
|
658
|
+
changeControlType(field, controlType) {
|
|
659
|
+
let col = this.internalComputedHiddenCols.find(
|
|
660
|
+
(col) => col.field === field
|
|
661
|
+
)
|
|
662
|
+
col.controlType = controlType
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
}
|
|
666
|
+
</script>
|
|
667
|
+
|
|
668
|
+
<style lang="less" scoped>
|
|
669
|
+
.form-head {
|
|
670
|
+
display: flex;
|
|
671
|
+
flex-flow: row wrap;
|
|
672
|
+
margin-bottom: 10px;
|
|
673
|
+
.form-title {
|
|
674
|
+
margin-left: 10px;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
.input-span {
|
|
678
|
+
// line-height: 33px;
|
|
679
|
+
color: #0b0b0b;
|
|
680
|
+
font-size: 12px;
|
|
681
|
+
font-weight: normal;
|
|
682
|
+
overflow: hidden;
|
|
683
|
+
text-overflow: ellipsis;
|
|
684
|
+
-o-text-overflow: ellipsis;
|
|
685
|
+
display: inline-block;
|
|
686
|
+
width: 100%;
|
|
687
|
+
height: 32.8px;
|
|
688
|
+
white-space: nowrap;
|
|
689
|
+
// font-family: "Arial", "Microsoft YaHei";
|
|
690
|
+
}
|
|
691
|
+
.title-first-input {
|
|
692
|
+
width: 200px;
|
|
693
|
+
height: 25px;
|
|
694
|
+
font-size: 15px;
|
|
695
|
+
margin-left: 10px;
|
|
696
|
+
font-weight: 500;
|
|
697
|
+
}
|
|
698
|
+
.title-second-input {
|
|
699
|
+
width: 200px;
|
|
700
|
+
height: 25px;
|
|
701
|
+
font-size: 15px;
|
|
702
|
+
margin-left: 10px;
|
|
703
|
+
font-weight: 500;
|
|
704
|
+
}
|
|
705
|
+
.title-first-value {
|
|
706
|
+
width: 200px;
|
|
707
|
+
height: 40px;
|
|
708
|
+
font-size: 24px;
|
|
709
|
+
margin-left: 10px;
|
|
710
|
+
font-weight: 700;
|
|
711
|
+
}
|
|
712
|
+
.title-second-value {
|
|
713
|
+
width: 200px;
|
|
714
|
+
height: 26px;
|
|
715
|
+
font-size: 18px;
|
|
716
|
+
margin-left: 10px;
|
|
717
|
+
font-weight: 600;
|
|
718
|
+
}
|
|
719
|
+
.option:hover {
|
|
720
|
+
background-color: #219bff;
|
|
721
|
+
}
|
|
722
|
+
.form {
|
|
723
|
+
margin-left: 30px;
|
|
724
|
+
}
|
|
725
|
+
</style>
|
|
726
|
+
<style lang="less">
|
|
727
|
+
@import '../../styles/default.less';
|
|
728
|
+
</style>
|