|
@@ -0,0 +1,92 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form ref="form" :model="form" label-width="80px">
|
|
|
+ <el-row class="row_auto">
|
|
|
+ <el-col :span="24" class="text_auto">{{ info.name }}</el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="row_auto">
|
|
|
+ <el-col :span="24" class="text_left" v-for="(item, index) in info.question" :key="index">
|
|
|
+ <!-- 题目 -->
|
|
|
+ <el-col :span="24"> {{ index + 1 }} . {{ item.topic }} </el-col>
|
|
|
+ <!-- 选项需判断所属类型,然后循环选项加入标签即可 -->
|
|
|
+ <el-col :span="24" class="text_center" v-if="item.type === '0'">
|
|
|
+ <el-col :span="24" class="text_left" v-for="(items, index) in item.option" :key="index">
|
|
|
+ <el-radio v-model="form.radio" :label="items.opname">{{ items.opname }}</el-radio>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="text_center" v-if="item.type === '1'">
|
|
|
+ <el-col :span="24" class="text_left" v-for="(items, index) in item.option" :key="index">
|
|
|
+ <el-checkbox-group v-model="form.checkList">
|
|
|
+ <el-checkbox :label="items.opname">{{ items.opname }}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="item.type === '2'">
|
|
|
+ <el-input type="textarea" placeholder="请输入内容" v-model="form.answer" :autosize="{ minRows: 4, maxRows: 6 }" maxlength="300" show-word-limit>
|
|
|
+ </el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24"><el-button type="primary" @click="onSubmit">提交</el-button></el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {
|
|
|
+ info: null,
|
|
|
+ form: null,
|
|
|
+ },
|
|
|
+ components: {},
|
|
|
+ data: () => ({
|
|
|
+ text: '',
|
|
|
+ textarea: '',
|
|
|
+
|
|
|
+ radio: '',
|
|
|
+ }),
|
|
|
+ created() {},
|
|
|
+ computed: {},
|
|
|
+ methods: {
|
|
|
+ onSubmit() {
|
|
|
+ this.$emit('submit', { data: this.form });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+.text_auto {
|
|
|
+ width: 100%;
|
|
|
+ // height: 50px;
|
|
|
+ line-height: 50px;
|
|
|
+ position: relative;
|
|
|
+ text-align: center;
|
|
|
+ border-bottom: 1px dashed #333;
|
|
|
+}
|
|
|
+
|
|
|
+.text_left {
|
|
|
+ width: 100%;
|
|
|
+ line-height: 50px;
|
|
|
+ position: relative;
|
|
|
+ // padding-left: 25px;
|
|
|
+ color: blue;
|
|
|
+}
|
|
|
+.text_center {
|
|
|
+ width: 100%;
|
|
|
+ line-height: 25px;
|
|
|
+ padding-left: 20px;
|
|
|
+ color: black;
|
|
|
+ background: #f7f7f7;
|
|
|
+}
|
|
|
+.row_auto {
|
|
|
+ padding: 0 20px;
|
|
|
+}
|
|
|
+button {
|
|
|
+ width: 335px;
|
|
|
+}
|
|
|
+</style>
|