doway-coms 2.10.36 → 2.10.38

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