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