|
|
|
@ -6,7 +6,7 @@ |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="题目" prop="question"> |
|
|
|
|
<div>{{ dialogForm.question }}</div> |
|
|
|
|
<img v-if="dialogForm.imageUrl" :src="dialogForm.imageUrl" width="200" alt=""> |
|
|
|
|
<img v-if="dialogForm.imageUrl" :src="dialogForm.imageUrl" width="200" alt="" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
@ -20,7 +20,7 @@ |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
:show-file-list="false" |
|
|
|
|
> |
|
|
|
|
<img v-if="dialogForm.imageUrl" :src="dialogForm.imageUrl" style="width: 300px;"> |
|
|
|
|
<img v-if="dialogForm.imageUrl" :src="dialogForm.imageUrl" style="width: 300px" /> |
|
|
|
|
<i v-else class="el-icon-plus" /> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
@ -28,14 +28,18 @@ |
|
|
|
|
<el-row> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="选项" prop="question"> |
|
|
|
|
<span v-if="dialogForm.chooseA">A:{{ dialogForm.chooseA }}<span> |
|
|
|
|
<span v-if="dialogForm.chooseB">B:{{ dialogForm.chooseB }} </span> |
|
|
|
|
<span v-if="dialogForm.chooseC">C:{{ dialogForm.chooseC }} </span> |
|
|
|
|
<span v-if="dialogForm.chooseD">D:{{ dialogForm.chooseD }}</span> |
|
|
|
|
<span v-if="dialogForm.chooseE">E:{{ dialogForm.chooseE }}</span> |
|
|
|
|
<span v-if="dialogForm.chooseF">F:{{ dialogForm.chooseF }}</span> |
|
|
|
|
<span v-if="dialogForm.chooseG">G:{{ dialogForm.chooseG }}</span> |
|
|
|
|
</span></span></el-form-item> |
|
|
|
|
<span v-if="dialogForm.chooseA" |
|
|
|
|
>A:{{ dialogForm.chooseA |
|
|
|
|
}}<span> |
|
|
|
|
<span v-if="dialogForm.chooseB">B:{{ dialogForm.chooseB }} </span> |
|
|
|
|
<span v-if="dialogForm.chooseC">C:{{ dialogForm.chooseC }} </span> |
|
|
|
|
<span v-if="dialogForm.chooseD">D:{{ dialogForm.chooseD }}</span> |
|
|
|
|
<span v-if="dialogForm.chooseE">E:{{ dialogForm.chooseE }}</span> |
|
|
|
|
<span v-if="dialogForm.chooseF">F:{{ dialogForm.chooseF }}</span> |
|
|
|
|
<span v-if="dialogForm.chooseG">G:{{ dialogForm.chooseG }}</span> |
|
|
|
|
</span></span |
|
|
|
|
></el-form-item |
|
|
|
|
> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
<el-row> |
|
|
|
@ -119,18 +123,17 @@ |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button plain @click="(visible = false)">取消</el-button> |
|
|
|
|
<el-button plain @click="visible = false">取消</el-button> |
|
|
|
|
<el-button v-jclick type="primary" :disabled="!canSubmit" @click="dialogFormSubmit()">确定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { updateQuestion } from '@/api/question'; |
|
|
|
|
|
|
|
|
|
import { updateQuestion, uploadFile } from '@/api/question'; |
|
|
|
|
// import axios from 'axios'; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
@ -184,7 +187,7 @@ export default { |
|
|
|
|
dialogFormSubmit() { |
|
|
|
|
this.$refs.dialogForm.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
updateQuestion(this.dialogForm).then(response => { |
|
|
|
|
updateQuestion(this.dialogForm).then((response) => { |
|
|
|
|
if (response.code == 200) { |
|
|
|
|
this.$modal.msgSuccess('修改成功'); |
|
|
|
|
this.$emit('update'); |
|
|
|
@ -197,13 +200,25 @@ export default { |
|
|
|
|
handleImport(opt) { |
|
|
|
|
const data = new FormData(); |
|
|
|
|
data.append('file', opt.file); |
|
|
|
|
// 上传 |
|
|
|
|
// api.upload(data).then(resp => { |
|
|
|
|
// if (resp.code == 200) { |
|
|
|
|
// axios({ |
|
|
|
|
// method: 'post', |
|
|
|
|
// url: 'http://xj.ahduima.com/xunjia/tiku/question/upload', |
|
|
|
|
// data: data |
|
|
|
|
// }).then((resp) => { |
|
|
|
|
// console.log(resp.data); |
|
|
|
|
// if (resp.data.code == 200) { |
|
|
|
|
// this.$modal.msgSuccess('文件上传成功'); |
|
|
|
|
// this.dialogForm.imageUrl = resp.data; |
|
|
|
|
// this.dialogForm.imageUrl = resp.data.msg; |
|
|
|
|
// } |
|
|
|
|
// console.log(this.dialogForm) |
|
|
|
|
// }); |
|
|
|
|
// 上传 |
|
|
|
|
uploadFile(data).then(resp => { |
|
|
|
|
if (resp.code == 200) { |
|
|
|
|
this.$modal.msgSuccess('文件上传成功'); |
|
|
|
|
this.dialogForm.imageUrl = resp.msg; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleExceed(files) { |
|
|
|
|
this.handleImport({ file: files[0] }); |
|
|
|
|