fix: bug
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="comment-textarea">
|
||||
<Textarea v-model:value="text" :rows="3"/>
|
||||
<Textarea v-model:value="text" :rows="3" />
|
||||
<div class="action-part">
|
||||
<div class="image-upload"></div>
|
||||
<div class="btn-wrapper">
|
||||
<Button type="link" size="small" style="color: #8C8C8C" @click="handleCancel">取消</Button>
|
||||
<Button type="link" size="small" style="color: #8c8c8c" @click="handleCancel">取消</Button>
|
||||
<Divider type="vertical" />
|
||||
<Button type="link" size="small" @click="handleCommit">发送</Button>
|
||||
</div>
|
||||
@@ -12,56 +12,66 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import { defineComponent, ref, computed } from "vue";
|
||||
import { defineComponent, ref, computed, watch } from "vue";
|
||||
import { Textarea, Button, Divider } from "ant-design-vue";
|
||||
|
||||
export default defineComponent({
|
||||
props: ['content'],
|
||||
emits: ['update:content', 'cancel:content'],
|
||||
props: ["content"],
|
||||
emits: ["update:content", "cancel:content"],
|
||||
components: { Textarea, Button, Divider },
|
||||
setup(props, { emit }) {
|
||||
const loading = ref(false);
|
||||
const text = computed({
|
||||
get() {
|
||||
return props.content
|
||||
return props.content;
|
||||
},
|
||||
set(newValue) {
|
||||
emit('update:content', newValue)
|
||||
emit("update:content", newValue);
|
||||
},
|
||||
});
|
||||
|
||||
// 监听答案
|
||||
watch(text, (newVal) => {
|
||||
if (!newVal && loading.value) {
|
||||
loading.value = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* 清空内容
|
||||
*/
|
||||
function handleCancel() {
|
||||
text.value = ''
|
||||
emit('cancel:content')
|
||||
text.value = "";
|
||||
emit("cancel:content");
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交内容
|
||||
*/
|
||||
function handleCommit() {
|
||||
emit('commit:message', text.value)
|
||||
if (loading.value) return;
|
||||
if (text.value) loading.value = true;
|
||||
emit("commit:message", text.value);
|
||||
}
|
||||
|
||||
return {
|
||||
text,
|
||||
loading,
|
||||
handleCancel,
|
||||
handleCommit,
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.comment-textarea {
|
||||
height: auto;
|
||||
border-right: 6px;
|
||||
background: #F6F6F6;
|
||||
background: #f6f6f6;
|
||||
:deep(.ant-input) {
|
||||
background: #F6F6F6;
|
||||
background: #f6f6f6;
|
||||
border: none;
|
||||
outline: none;
|
||||
&:focus {
|
||||
@@ -77,5 +87,4 @@ export default defineComponent({
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
</div>
|
||||
<div class="option">
|
||||
<span v-if="config.location === 1" class="label left answer-color">{{
|
||||
config.show_label
|
||||
config.show_label || "总和"
|
||||
}}</span>
|
||||
<a-input-number type="number" :value="sum" disabled />
|
||||
<span v-if="config.location === 0" class="label right answer-color">{{
|
||||
config.show_label
|
||||
config.show_label || "总和"
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -464,11 +464,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
.footer {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
padding: 20px 0;
|
||||
margin-top: 48px;
|
||||
|
||||
:deep(.previous) {
|
||||
border: 1px solid $yili-default-color;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<!-- 标题 -->
|
||||
<div class="q-title">
|
||||
<div class="left">
|
||||
<div class="">
|
||||
<div v-html="title" class="answer-color"></div>
|
||||
<!-- 问题提示 -->
|
||||
<a-tooltip v-if="config.is_placeholder">
|
||||
@@ -69,8 +69,8 @@
|
||||
<a-radio value="b" />
|
||||
</div>
|
||||
<div class="td option scrollbar">
|
||||
<img v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<div v-else v-html="option.option" />
|
||||
<a-image v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<rich-text v-else :nodes="option.option" isPreview />
|
||||
</div>
|
||||
<div class="td">
|
||||
<a-radio value="w" />
|
||||
@@ -85,8 +85,8 @@
|
||||
<a-radio value="w" />
|
||||
</div>
|
||||
<div class="td option scrollbar">
|
||||
<img v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<div v-else v-html="option.option" />
|
||||
<a-image v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<rich-text v-else :nodes="option.option" isPreview />
|
||||
</div>
|
||||
<div class="td">
|
||||
<a-radio value="b" />
|
||||
@@ -104,8 +104,8 @@
|
||||
<a-radio value="w" />
|
||||
</div>
|
||||
<div class="td option scrollbar">
|
||||
<img v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<div v-else v-html="option.option" />
|
||||
<a-image v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<rich-text v-else :nodes="option.option" isPreview />
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@@ -120,8 +120,8 @@
|
||||
<a-radio value="b" />
|
||||
</div>
|
||||
<div class="td option scrollbar">
|
||||
<img v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<div v-else v-html="option.option" />
|
||||
<a-image v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<rich-text v-else :nodes="option.option" isPreview />
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@@ -130,8 +130,8 @@
|
||||
:class="index % 2 === 0 ? '' : 'bg-gray answer-background10'"
|
||||
>
|
||||
<div class="td option scrollbar">
|
||||
<img v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<div v-else v-html="option.option" />
|
||||
<a-image v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<rich-text v-else :nodes="option.option" isPreview />
|
||||
</div>
|
||||
<div class="td">
|
||||
<a-radio value="b" />
|
||||
@@ -146,8 +146,8 @@
|
||||
:class="index % 2 === 0 ? '' : 'bg-gray answer-background10'"
|
||||
>
|
||||
<div class="td option scrollbar">
|
||||
<img v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<div v-else v-html="option.option" />
|
||||
<a-image v-if="option.option_config.option_type === 2" :src="option.option" />
|
||||
<rich-text v-else :nodes="option.option" isPreview />
|
||||
</div>
|
||||
<div class="td">
|
||||
<a-radio value="w" />
|
||||
@@ -192,9 +192,10 @@ import PfePagination from "@/components/PfePagination.vue";
|
||||
import { defineComponent, ref, watch } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import Remark from "@/views/Answer/components/Remark";
|
||||
import RichText from '@/components/RichText.vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: { PfePagination, Remark },
|
||||
components: { PfePagination, Remark, RichText },
|
||||
props: {
|
||||
// 错误
|
||||
error: {
|
||||
@@ -328,10 +329,10 @@ export default defineComponent({
|
||||
// 当前页答案
|
||||
const currentOptions = allOptions.value[page.value - 1];
|
||||
if (currentOptions.findIndex((option) => option.value === "b") === -1) {
|
||||
return message.error("请选择高相关");
|
||||
return message.error(`请选择${props.config.first_text}`);
|
||||
}
|
||||
if (currentOptions.findIndex((option) => option.value === "w") === -1) {
|
||||
return message.error("请选择不相关");
|
||||
return message.error(`请选择${props.config.second_text}`);
|
||||
}
|
||||
// 最后一页
|
||||
if (page.value === pages.value) {
|
||||
@@ -366,7 +367,8 @@ export default defineComponent({
|
||||
() => props.answer,
|
||||
() => {
|
||||
context.emit("changeAnswer", {
|
||||
options: allOptions.value,
|
||||
options: options.value,
|
||||
mxdOptions: allOptions.value,
|
||||
});
|
||||
},
|
||||
{
|
||||
@@ -399,13 +401,8 @@ export default defineComponent({
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
width: 100%;
|
||||
margin-right: 24px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
color: #70b936;
|
||||
color: #3461ff;
|
||||
cursor: pointer;
|
||||
margin-left: 12px;
|
||||
}
|
||||
@@ -431,15 +428,20 @@ export default defineComponent({
|
||||
|
||||
.td {
|
||||
width: 106px;
|
||||
padding: 12px 0;
|
||||
text-align: center;
|
||||
padding: 12px 10px;
|
||||
// text-align: center;
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.option {
|
||||
flex: 1;
|
||||
display: block;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
:deep(img) {
|
||||
width: 87px;
|
||||
// height: 119px;
|
||||
}
|
||||
@@ -456,11 +458,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
.footer {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
padding: 20px 0;
|
||||
margin-top: 48px;
|
||||
|
||||
:deep(.previous) {
|
||||
border: 1px solid $yili-default-color;
|
||||
|
||||
@@ -267,7 +267,6 @@ export default {
|
||||
|
||||
if (loading.value === false) {
|
||||
loading.value = true;
|
||||
debugger;
|
||||
message.info(
|
||||
`该参数组合下建议您样本量不小于${Number.parseInt(
|
||||
500 / (infoConfig.value.config.concept * infoConfig.value.config.task)
|
||||
@@ -297,7 +296,6 @@ export default {
|
||||
};
|
||||
|
||||
const onInput = (name, value, isupdate) => {
|
||||
debugger;
|
||||
if (!isupdate) {
|
||||
if (infoConfig.value.config[name] <= 0) {
|
||||
infoConfig.value.config[name] = props.info.config[name];
|
||||
|
||||
Reference in New Issue
Block a user