Compare commits
2 Commits
95dc8be6e8
...
b5926e868f
Author | SHA1 | Date | |
---|---|---|---|
b5926e868f | |||
110de95650 |
21
src/App.vue
21
src/App.vue
@ -177,14 +177,18 @@ export default {
|
||||
this.updateItem();
|
||||
}
|
||||
},
|
||||
transformAnswer(answer) {
|
||||
return isProxy(answer) ? [...answer]
|
||||
: (answer === undefined ? null : answer);
|
||||
},
|
||||
submit() {
|
||||
const results = this.items.map(item => ({
|
||||
title: item.title,
|
||||
key: item.key ? item.key : item.title,
|
||||
type: item.type,
|
||||
answer: isProxy(item.answer) ? [...item.answer] : (item.answer || null),
|
||||
answerText: isProxy(item.answerText) ? [...item.answerText] : (item.answerText || null),
|
||||
answerValue: isProxy(item.answerValue) ? [...item.answerValue] : (item.answerValue || null),
|
||||
answer: this.transformAnswer(item.answer),
|
||||
answerText: this.transformAnswer(item.answerText),
|
||||
answerValue: this.transformAnswer(item.answerValue),
|
||||
refilled: item.refilled,
|
||||
responseTime: item.responseTime,
|
||||
}));
|
||||
@ -201,7 +205,7 @@ export default {
|
||||
|
||||
<template>
|
||||
<div v-if="!isReady">Loading...</div>
|
||||
<transition name="el-fade-in-linear"><el-container id="main" v-if="isReady" v-show="showPanel">
|
||||
<transition name="el-fade-in"><el-container id="main" v-if="isReady" v-show="showPanel">
|
||||
<el-header height=24pt>
|
||||
<el-text class="mx-1" type="primary"><span id="display-title">{{ itemStatus.title }}</span></el-text>
|
||||
</el-header>
|
||||
@ -216,14 +220,13 @@ export default {
|
||||
:placeholder="lang[settings.lang].input" />
|
||||
</template>
|
||||
<template v-else-if="itemStatus.item.type === 'radio'">
|
||||
<el-radio-group v-model="itemStatus.answer" v-for="[index, optText] in iterOptions()" :key="index"
|
||||
@change="autoNext">
|
||||
<el-radio-button :label="optText" :value="index" />
|
||||
<el-radio-group v-model="itemStatus.answer" @change="autoNext">
|
||||
<el-radio-button v-for="[index, optText] in iterOptions()" :key="index" :label="optText" :value="index" />
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<template v-else-if="itemStatus.item.type === 'checkbox'">
|
||||
<el-checkbox-group v-model="itemStatus.answer" v-for="[index, optText] in iterOptions()" :key="index">
|
||||
<el-checkbox-button :label="optText" :value="index" />
|
||||
<el-checkbox-group v-model="itemStatus.answer">
|
||||
<el-checkbox-button v-for="[index, optText] in iterOptions()" :key="index" :label="optText" :value="index" />
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
<template v-else-if="itemStatus.item.type === 'scale'">
|
||||
|
Loading…
Reference in New Issue
Block a user