钟日健
2022-02-08 2c461eb9efb980d55dfd7407ee70088fc90a4a7a
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/*
 * @Author: Morpheus
 * @Date: 2021-07-13 11:19:28
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-07-15 16:40:40
 */
<template>
    <div class="app-container">
 
        <el-tabs v-model="activeName"
                 @tab-click="handleClick">
            <el-tab-pane label="单选题"
                         name="first">
 
                <div>
 
                    <el-row>
                        <el-col :span="12">
                        </el-col>
                    </el-row>
 
                </div>
 
                <avue-form v-model="form"
                           :option="option">
 
                    <template slot-scope="scope"
                              slot="text">
                        <div>
                            <el-input v-model="form.text"
                                      placeholder="这里是自定的表单"></el-input>
                        </div>
                    </template>
 
                    <template slot-scope="scope"
                              slot="rate">
                        <div>
                            <avue-rate v-model="form.rate"></avue-rate>
 
                        </div>
                    </template>
 
                    <template slot="provinceType"
                              slot-scope="{item,value,label}">
                        <span>{{ item }}</span>
                    </template>
 
                </avue-form>
 
            </el-tab-pane>
            <el-tab-pane label="多选题"
                         name="second">多选题</el-tab-pane>
            <el-tab-pane label="判断题"
                         name="third">判断题</el-tab-pane>
        </el-tabs>
    </div>
</template>
 
<script>
export default {
    data () {
        return {
            activeName: 'first',
 
            rateObj: {
                state: '一般',
                value: 4
            },
 
            tempSubject: {
 
            },
            dialogStatus: '',
            dialogStatusType: {
 
            },
            subjectsType:
                '',
            form: {
                text: '',
                rate: 4
            },
            option: {
                labelWidth: 120,
                column: [
                    {
                        label: '分值',
                        prop: 'text',
                        formslot: true,
                        labelslot: true,
                        errorslot: true,
                        rules: [{
                            required: true,
                            message: "请输入姓名",
                            trigger: "blur"
                        }]
                    },
                    {
                        label: '难度',
                        prop: 'rate',
                        formslot: true,
                        labelslot: true,
                    },
                    {
                        label: "参考答案",
                        prop: "sex",
                        span: 6,
                        type: "radio",
                        dicData: [{
                            label: 'A',
                            value: 0
                        }, {
                            label: 'B',
                            value: 1
                        }, {
                            label: 'C',
                            value: 2
                        }, {
                            label: 'D',
                            value: 3
                        }],
                        errorslot: true,
                        rules: [{
                            required: true,
                            message: "请选择答案",
                            trigger: "blur"
                        }],
                        mock: {
                            type: 'dic'
                        }
                    },
                    {
                        type: 'ueditor',
                        component: 'AvueUeditor',
                        label: '题目名称',
                        span: 24,
                        display: true,
                        action: '',
                        oss: '',
                        props: {},
                        ali: {},
                        qiniu: {},
                        prop: 'titleName',
                        rules: [{
                            required: true,
                            message: "请输入题目名称",
                            trigger: "blur"
                        }],
                    },
                    {
                        label: '',
                        labelWidth: 40,
                        prop: 'divider',
                        component: 'elDivider',//ele分割线
                        span: 24,
                        event: {
                            click: () => {
                                this.$message.success('点击方法')
                            },
                        },
                        params: {
                            html: '<h2 style="font-size: 16px; font-weight: normal"> 选项列表 </h2>',
                            contentPosition: "center",
                        }
                    },
                    {
                        label: "题目名称",
                        prop: "content",
                        component: 'AvueUeditor',
                        options: {
                            action: '/api/blade-resource/oss/endpoint/put-file',
                            props: {
                                res: "data",
                                url: "link",
                            }
                        },
                        hide: true,
                        minRows: 6,
                        span: 24,
                        rules: [{
                            required: true,
                            message: "请输入题目名称",
                            trigger: "blur"
                        }],
                    }
                ]
            }
        }
    },
    methods: {
        handleTabChange () { },
        handleSelectSubject () { },
        dialogSubjectFormVisible () { },
        createSubjectData () { },
        updateSubjectData () { },
        updateAndAddSubjectData () { },
        handleClick (tab, event) {
            console.log(tab, event);
        }
 
    }
}
 
</script>
 
 
<style lang="scss" scoped>
.dialog-footer {
    margin-top: 20px;
}
</style>