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