1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
| import { Observable, Subscription, BehaviorSubject } from 'rxjs';
| import {
| Component,
| Prop,
| Vue,
| Emit,
| Model,
| Watch,
| } from 'vue-property-decorator';
|
| import { DFSchema } from './schema/DfSchema';
| import FormProperty from './domain/FormProperty';
|
| export interface IDyFormMixin {
| formitem?: FormProperty;
| }
|
| /**
| * 动态表单项组件的混入
| */
| @Component({})
| export default class DyFormMixin extends Vue implements IDyFormMixin {
|
| /**
| * 表单属性
| */
| @Prop({type: Object, default: () => {}})
| public formitem!: FormProperty;
|
| /**
| * 组件属性
| */
| get widgetAttrs() {
| return this.formitem.widgetAttrs;
| }
|
| /**
| * form-item 属性
| */
| get itemAttrs() {
| return this.formitem.formitemAttrs;
| }
|
| /**
| * 标签
| */
| get label(): string {
| return this.formitem.label;
| }
|
| }
|
|