meixioacomponent 0.3.27 → 0.3.30
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/meixioacomponent.common.js +2495 -8751
- package/lib/meixioacomponent.umd.js +2495 -8751
- package/lib/meixioacomponent.umd.min.js +23 -25
- package/package.json +41 -41
- package/packages/components/base/baseAvatar/baseAvatar.vue +24 -20
- package/packages/components/base/baseButtonHandle/baseButtonHandle.vue +13 -11
- package/packages/components/base/baseDialog/index.vue +40 -32
- package/packages/components/proForm/proForm/pro_form.vue +0 -1
- package/packages/components/proForm/proForm/pro_form_item.vue +112 -106
- package/packages/components/proPageTable/oa_pro_table.vue +227 -195
- package/src/component/test.vue +235 -65
- package/src/test.js +13 -0
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
:key="index"
|
|
30
30
|
:label="item.value"
|
|
31
31
|
v-for="(item, index) in config.list"
|
|
32
|
-
>{{ item.label }}</el-radio-button
|
|
33
32
|
>
|
|
33
|
+
{{ item.label }}
|
|
34
|
+
</el-radio-button>
|
|
34
35
|
</el-radio-group>
|
|
35
36
|
|
|
36
37
|
<!-- checkbox多选框 -->
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
:min="checkMin"
|
|
39
40
|
:max="checkMax"
|
|
40
41
|
v-model="module"
|
|
41
|
-
style="width: 100
|
|
42
|
+
style="width: 100%;"
|
|
42
43
|
v-else-if="config.type == 'checkbox'"
|
|
43
44
|
>
|
|
44
45
|
<el-checkbox
|
|
@@ -46,8 +47,9 @@
|
|
|
46
47
|
:key="index"
|
|
47
48
|
:label="item"
|
|
48
49
|
disabled
|
|
49
|
-
>{{ item }}</el-checkbox
|
|
50
50
|
>
|
|
51
|
+
{{ item }}
|
|
52
|
+
</el-checkbox>
|
|
51
53
|
</el-checkbox-group>
|
|
52
54
|
<!-- textarea -->
|
|
53
55
|
<el-input
|
|
@@ -57,8 +59,7 @@
|
|
|
57
59
|
type="textarea"
|
|
58
60
|
v-model="module"
|
|
59
61
|
v-if="config.type == 'textarea'"
|
|
60
|
-
>
|
|
61
|
-
</el-input>
|
|
62
|
+
></el-input>
|
|
62
63
|
|
|
63
64
|
<base-icon
|
|
64
65
|
:size="`s`"
|
|
@@ -78,9 +79,8 @@
|
|
|
78
79
|
v-model="module"
|
|
79
80
|
:disabled="isDisabled"
|
|
80
81
|
v-if="config.type == 'input'"
|
|
81
|
-
style="width: 100%; height: 100
|
|
82
|
-
>
|
|
83
|
-
</el-input>
|
|
82
|
+
style="width: 100%; height: 100%;"
|
|
83
|
+
></el-input>
|
|
84
84
|
<!-- 数字类型无小数 -->
|
|
85
85
|
<el-input-number
|
|
86
86
|
ref="target"
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
v-model.number="module"
|
|
90
90
|
:disabled="isDisabled"
|
|
91
91
|
v-else-if="config.type == 'number'"
|
|
92
|
-
style="width: 100%; height: 100
|
|
92
|
+
style="width: 100%; height: 100%;"
|
|
93
93
|
></el-input-number>
|
|
94
94
|
<!--数字类型两位小数 -->
|
|
95
95
|
<el-input-number
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
:controls="false"
|
|
100
100
|
v-model.number="module"
|
|
101
101
|
:disabled="isDisabled"
|
|
102
|
-
style="width: 100%; height: 100
|
|
102
|
+
style="width: 100%; height: 100%;"
|
|
103
103
|
v-else-if="config.type == 'number2'"
|
|
104
104
|
></el-input-number>
|
|
105
105
|
<!-- select选择器 -->
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
:loading="selectLoading"
|
|
114
114
|
:disabled="isDisabled"
|
|
115
115
|
@visible-change="visibleChange"
|
|
116
|
-
style="width: 100%; height: 100
|
|
116
|
+
style="width: 100%; height: 100%;"
|
|
117
117
|
v-else-if="config.type == 'select' && selectStore"
|
|
118
118
|
:multipleLimit="config.multipleLimit"
|
|
119
119
|
>
|
|
@@ -122,8 +122,7 @@
|
|
|
122
122
|
:key="item.value"
|
|
123
123
|
:label="item[`${selectConfig.label}`]"
|
|
124
124
|
:value="item[`${selectConfig.value}`]"
|
|
125
|
-
>
|
|
126
|
-
</el-option>
|
|
125
|
+
></el-option>
|
|
127
126
|
</el-select>
|
|
128
127
|
<!-- 时间选择器 -->
|
|
129
128
|
<el-date-picker
|
|
@@ -136,11 +135,10 @@
|
|
|
136
135
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
137
136
|
:disabled="isDisabled"
|
|
138
137
|
:prefix-icon="`el-icon-time`"
|
|
139
|
-
style="width: 100%; height: 100
|
|
138
|
+
style="width: 100%; height: 100%;"
|
|
140
139
|
v-else-if="config.type == 'time'"
|
|
141
140
|
:picker-options="config.pickerOptions"
|
|
142
|
-
>
|
|
143
|
-
</el-date-picker>
|
|
141
|
+
></el-date-picker>
|
|
144
142
|
<!-- 单选框 -->
|
|
145
143
|
<el-radio-group
|
|
146
144
|
v-model="module"
|
|
@@ -153,8 +151,9 @@
|
|
|
153
151
|
:label="item.value"
|
|
154
152
|
:disabled="isDisabled"
|
|
155
153
|
v-for="(item, index) in config.list"
|
|
156
|
-
>{{ item.label }}</el-radio-button
|
|
157
154
|
>
|
|
155
|
+
{{ item.label }}
|
|
156
|
+
</el-radio-button>
|
|
158
157
|
</el-radio-group>
|
|
159
158
|
<!-- 选择器 -->
|
|
160
159
|
<el-checkbox-group
|
|
@@ -162,7 +161,7 @@
|
|
|
162
161
|
:min="checkMin"
|
|
163
162
|
:max="checkMax"
|
|
164
163
|
v-model="module"
|
|
165
|
-
style="width: 100
|
|
164
|
+
style="width: 100%;"
|
|
166
165
|
:disabled="isDisabled"
|
|
167
166
|
v-else-if="config.type == 'checkbox'"
|
|
168
167
|
>
|
|
@@ -171,8 +170,9 @@
|
|
|
171
170
|
:label="item"
|
|
172
171
|
:disabled="isDisabled"
|
|
173
172
|
v-for="(item, index) in config.list"
|
|
174
|
-
>{{ item }}</el-checkbox
|
|
175
173
|
>
|
|
174
|
+
{{ item }}
|
|
175
|
+
</el-checkbox>
|
|
176
176
|
</el-checkbox-group>
|
|
177
177
|
<!-- 文本输入框 -->
|
|
178
178
|
<el-input
|
|
@@ -183,8 +183,7 @@
|
|
|
183
183
|
v-model="module"
|
|
184
184
|
:disabled="isDisabled"
|
|
185
185
|
v-if="config.type == 'textarea'"
|
|
186
|
-
>
|
|
187
|
-
</el-input>
|
|
186
|
+
></el-input>
|
|
188
187
|
<!-- 插槽 -->
|
|
189
188
|
<slot name="template" v-else-if="config.type == 'template'"></slot>
|
|
190
189
|
</div>
|
|
@@ -211,27 +210,27 @@
|
|
|
211
210
|
</template>
|
|
212
211
|
|
|
213
212
|
<script>
|
|
214
|
-
import { FilterTime } from
|
|
213
|
+
import { FilterTime } from '../../../utils/utils'
|
|
215
214
|
//
|
|
216
|
-
import componentConfig from
|
|
215
|
+
import componentConfig from '../../../config/componentConfig'
|
|
217
216
|
export default {
|
|
218
217
|
data() {
|
|
219
218
|
return {
|
|
220
219
|
isEdit: false,
|
|
221
220
|
oldValue: null,
|
|
222
|
-
}
|
|
221
|
+
}
|
|
223
222
|
},
|
|
224
223
|
created() {
|
|
225
|
-
this.init()
|
|
224
|
+
this.init()
|
|
226
225
|
},
|
|
227
226
|
mounted() {
|
|
228
227
|
this.$nextTick(() => {
|
|
229
|
-
const { labelWidth } = this.$props
|
|
230
|
-
this.$refs.formItemRef.parentNode.style.cssText += `;width:calc(100% - ${labelWidth}) !important
|
|
228
|
+
const { labelWidth } = this.$props
|
|
229
|
+
this.$refs.formItemRef.parentNode.style.cssText += `;width:calc(100% - ${labelWidth}) !important`
|
|
231
230
|
if (this.$props.disableWatcher) {
|
|
232
|
-
this.triggerDisable(this.$props.value)
|
|
231
|
+
this.triggerDisable(this.$props.value)
|
|
233
232
|
}
|
|
234
|
-
})
|
|
233
|
+
})
|
|
235
234
|
},
|
|
236
235
|
props: {
|
|
237
236
|
disabled: {
|
|
@@ -252,7 +251,7 @@ export default {
|
|
|
252
251
|
|
|
253
252
|
size: {
|
|
254
253
|
type: String,
|
|
255
|
-
default:
|
|
254
|
+
default: 'small',
|
|
256
255
|
},
|
|
257
256
|
|
|
258
257
|
labelWidth: {},
|
|
@@ -260,72 +259,72 @@ export default {
|
|
|
260
259
|
|
|
261
260
|
computed: {
|
|
262
261
|
isDisabled() {
|
|
263
|
-
const { config, disabled } = this.$props
|
|
264
|
-
return config.disabled || disabled
|
|
262
|
+
const { config, disabled } = this.$props
|
|
263
|
+
return config.disabled || disabled
|
|
265
264
|
},
|
|
266
265
|
multiple() {
|
|
267
|
-
return this.$props.config.multipleLimit ? true : false
|
|
266
|
+
return this.$props.config.multipleLimit ? true : false
|
|
268
267
|
},
|
|
269
268
|
selectLoading() {
|
|
270
|
-
return this.selectStore?.getLoading()
|
|
269
|
+
return this.selectStore?.getLoading()
|
|
271
270
|
},
|
|
272
271
|
selectStore() {
|
|
273
|
-
return componentConfig.selectStore.getStore(this.$props.config.useStore)
|
|
272
|
+
return componentConfig.selectStore.getStore(this.$props.config.useStore)
|
|
274
273
|
},
|
|
275
274
|
|
|
276
275
|
selectData() {
|
|
277
|
-
return this.selectStore.getData()
|
|
276
|
+
return this.selectStore.getData()
|
|
278
277
|
},
|
|
279
278
|
|
|
280
279
|
selectConfig() {
|
|
281
|
-
return this.selectStore.getConfig()
|
|
280
|
+
return this.selectStore.getConfig()
|
|
282
281
|
},
|
|
283
282
|
|
|
284
283
|
spContentType() {
|
|
285
|
-
let configType = this.$props.config.type
|
|
284
|
+
let configType = this.$props.config.type
|
|
286
285
|
if (
|
|
287
|
-
configType ==
|
|
288
|
-
configType ==
|
|
289
|
-
configType ==
|
|
290
|
-
configType ==
|
|
286
|
+
configType == 'radio' ||
|
|
287
|
+
configType == 'label' ||
|
|
288
|
+
configType == 'checkbox' ||
|
|
289
|
+
configType == 'textarea'
|
|
291
290
|
) {
|
|
292
|
-
return true
|
|
291
|
+
return true
|
|
293
292
|
}
|
|
294
|
-
return false
|
|
293
|
+
return false
|
|
295
294
|
},
|
|
296
295
|
contentValue() {
|
|
297
|
-
let type = this.$props.config.type
|
|
296
|
+
let type = this.$props.config.type
|
|
298
297
|
switch (type) {
|
|
299
|
-
case
|
|
300
|
-
case
|
|
301
|
-
return this.module
|
|
298
|
+
case 'input':
|
|
299
|
+
case 'textarea':
|
|
300
|
+
return this.module
|
|
302
301
|
|
|
303
|
-
case
|
|
304
|
-
let list = this.selectData
|
|
302
|
+
case 'select':
|
|
303
|
+
let list = this.selectData
|
|
305
304
|
if (list.length > 0) {
|
|
306
305
|
if (!this.multiple) {
|
|
307
306
|
if (this.module) {
|
|
308
307
|
let index = list.findIndex((item) => {
|
|
309
|
-
return item.value == this.module
|
|
310
|
-
})
|
|
311
|
-
return list[index].label
|
|
308
|
+
return item.value == this.module
|
|
309
|
+
})
|
|
310
|
+
return list[index].label
|
|
312
311
|
} else {
|
|
313
|
-
return
|
|
312
|
+
return '暂无数据'
|
|
314
313
|
}
|
|
315
314
|
} else {
|
|
316
|
-
let text =
|
|
315
|
+
let text = ''
|
|
317
316
|
this.module.forEach((item) => {
|
|
318
317
|
let index = list.findIndex((citem) => {
|
|
319
|
-
return citem.value == item
|
|
320
|
-
})
|
|
318
|
+
return citem.value == item
|
|
319
|
+
})
|
|
321
320
|
|
|
322
|
-
text += text ? ` / ${list[index].label}` : list[index].label
|
|
323
|
-
})
|
|
324
|
-
return text
|
|
321
|
+
text += text ? ` / ${list[index].label}` : list[index].label
|
|
322
|
+
})
|
|
323
|
+
return text
|
|
325
324
|
}
|
|
326
325
|
} else {
|
|
327
|
-
this.loadSelectData()
|
|
328
|
-
return this.$props.config.value
|
|
326
|
+
this.loadSelectData()
|
|
327
|
+
return this.$props.config.value
|
|
329
328
|
}
|
|
330
329
|
|
|
331
330
|
// case "time":
|
|
@@ -338,37 +337,37 @@ export default {
|
|
|
338
337
|
// }
|
|
339
338
|
|
|
340
339
|
default:
|
|
341
|
-
return this.module
|
|
340
|
+
return this.module
|
|
342
341
|
}
|
|
343
342
|
},
|
|
344
343
|
type() {
|
|
345
|
-
return this.$props.config.type
|
|
344
|
+
return this.$props.config.type
|
|
346
345
|
},
|
|
347
346
|
|
|
348
347
|
checkMax() {
|
|
349
|
-
let max = this.$props.config.max
|
|
350
|
-
return max ? max : this.$props.config.list.length
|
|
348
|
+
let max = this.$props.config.max
|
|
349
|
+
return max ? max : this.$props.config.list.length
|
|
351
350
|
},
|
|
352
351
|
|
|
353
352
|
checkMin() {
|
|
354
|
-
let min = this.$props.config.min
|
|
355
|
-
return min < 0 || min == undefined || min == null ? 0 : min
|
|
353
|
+
let min = this.$props.config.min
|
|
354
|
+
return min < 0 || min == undefined || min == null ? 0 : min
|
|
356
355
|
},
|
|
357
356
|
module: {
|
|
358
357
|
get() {
|
|
359
|
-
let type = this.$props.config.type
|
|
360
|
-
if (type ==
|
|
358
|
+
let type = this.$props.config.type
|
|
359
|
+
if (type == 'select') {
|
|
361
360
|
if (this.selectData.length <= 0) {
|
|
362
|
-
this.loadSelectData()
|
|
361
|
+
this.loadSelectData()
|
|
363
362
|
}
|
|
364
363
|
}
|
|
365
364
|
|
|
366
|
-
return this.$props.value
|
|
365
|
+
return this.$props.value
|
|
367
366
|
},
|
|
368
367
|
set(val) {
|
|
369
|
-
this.$emit(
|
|
368
|
+
this.$emit('input', val)
|
|
370
369
|
if (this.$props.disableWatcher) {
|
|
371
|
-
this.triggerDisable(val)
|
|
370
|
+
this.triggerDisable(val)
|
|
372
371
|
}
|
|
373
372
|
},
|
|
374
373
|
},
|
|
@@ -376,74 +375,81 @@ export default {
|
|
|
376
375
|
methods: {
|
|
377
376
|
init() {
|
|
378
377
|
if (this.$props.form) {
|
|
379
|
-
this.isEdit = true
|
|
378
|
+
this.isEdit = true
|
|
379
|
+
} else {
|
|
380
|
+
this.isEdit = false
|
|
380
381
|
}
|
|
381
382
|
},
|
|
382
383
|
handleContent() {
|
|
383
384
|
if (this.$props.config.click) {
|
|
384
|
-
this.$props.config.click(this.$props.config)
|
|
385
|
+
this.$props.config.click(this.$props.config)
|
|
385
386
|
}
|
|
386
387
|
},
|
|
387
388
|
handleClick(type) {
|
|
388
389
|
switch (type) {
|
|
389
|
-
case
|
|
390
|
-
this.isEdit = !this.isEdit
|
|
390
|
+
case 'edit':
|
|
391
|
+
this.isEdit = !this.isEdit
|
|
391
392
|
this.$nextTick(() => {
|
|
392
|
-
this.targetFocus()
|
|
393
|
-
})
|
|
393
|
+
this.targetFocus()
|
|
394
|
+
})
|
|
394
395
|
if (this.isEdit) {
|
|
395
|
-
this.oldValue = this.value
|
|
396
|
+
this.oldValue = this.value
|
|
396
397
|
} else {
|
|
397
|
-
this.module = this.oldValue
|
|
398
|
-
this.oldValue = null
|
|
398
|
+
this.module = this.oldValue
|
|
399
|
+
this.oldValue = null
|
|
399
400
|
}
|
|
400
|
-
break
|
|
401
|
-
case
|
|
402
|
-
this.handleContent()
|
|
403
|
-
break
|
|
404
|
-
case
|
|
405
|
-
this.$emit(
|
|
401
|
+
break
|
|
402
|
+
case 'content':
|
|
403
|
+
this.handleContent()
|
|
404
|
+
break
|
|
405
|
+
case 'confirm':
|
|
406
|
+
this.$emit('formItemConfirm', {
|
|
406
407
|
this: this,
|
|
407
408
|
config: this.$props.config,
|
|
408
|
-
})
|
|
409
|
-
break
|
|
409
|
+
})
|
|
410
|
+
break
|
|
410
411
|
default:
|
|
411
|
-
break
|
|
412
|
+
break
|
|
412
413
|
}
|
|
413
414
|
},
|
|
414
415
|
targetFocus() {
|
|
415
|
-
let ref = this.$refs.target
|
|
416
|
-
console.log(ref)
|
|
416
|
+
let ref = this.$refs.target
|
|
417
|
+
console.log(ref)
|
|
417
418
|
if (ref) {
|
|
418
|
-
ref.focus()
|
|
419
|
+
ref.focus()
|
|
419
420
|
}
|
|
420
421
|
},
|
|
421
422
|
handleConfirm() {
|
|
422
|
-
this.isEdit = false
|
|
423
|
+
this.isEdit = false
|
|
423
424
|
},
|
|
424
425
|
loadSelectData() {
|
|
425
|
-
this.selectStore.loadData()
|
|
426
|
+
this.selectStore.loadData()
|
|
426
427
|
},
|
|
427
428
|
visibleChange(visible) {
|
|
428
|
-
if (!visible) return
|
|
429
|
-
if (this.selectData.length > 0) return
|
|
430
|
-
this.loadSelectData()
|
|
429
|
+
if (!visible) return
|
|
430
|
+
if (this.selectData.length > 0) return
|
|
431
|
+
this.loadSelectData()
|
|
431
432
|
},
|
|
432
433
|
triggerDisable(val) {
|
|
433
|
-
let effects = this.$props.disableWatcher.effects
|
|
434
|
+
let effects = this.$props.disableWatcher.effects
|
|
434
435
|
effects.forEach((item) => {
|
|
435
436
|
let obj = {
|
|
436
437
|
key: item.key,
|
|
437
438
|
type: item.type,
|
|
438
439
|
result: item.fn(val),
|
|
439
|
-
}
|
|
440
|
+
}
|
|
440
441
|
|
|
441
|
-
console.log(val)
|
|
442
|
-
this.$emit(
|
|
443
|
-
})
|
|
442
|
+
console.log(val)
|
|
443
|
+
this.$emit('disableWatcherResult', obj)
|
|
444
|
+
})
|
|
444
445
|
},
|
|
445
446
|
},
|
|
446
|
-
|
|
447
|
+
watch: {
|
|
448
|
+
form(newVal, oldVal) {
|
|
449
|
+
this.init()
|
|
450
|
+
},
|
|
451
|
+
},
|
|
452
|
+
}
|
|
447
453
|
</script>
|
|
448
454
|
|
|
449
455
|
<style lang="less" scoped>
|