feat: 长文本组件调整
This commit is contained in:
@@ -33,7 +33,7 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const IGNORED_FIELD_KEYS = ["container_type", "content", "components"];
|
||||
const IGNORED_FIELD_KEYS = ["container_type", "content", "content_summary", "components"];
|
||||
|
||||
const isArrayValue = (value) => Array.isArray(value);
|
||||
|
||||
|
||||
@@ -62,12 +62,18 @@ const longTextData = ref(null);
|
||||
|
||||
let unsubscribe = null;
|
||||
|
||||
const HIDDEN_DETAIL_SECTION_KEYS = [
|
||||
LONG_TEXT_KEYS.containerType,
|
||||
LONG_TEXT_KEYS.contentSummary,
|
||||
];
|
||||
|
||||
const shouldUseParsedValueView = (section) => {
|
||||
return (
|
||||
section.fromLongTextData &&
|
||||
section.contentKey !== LONG_TEXT_KEYS.tag &&
|
||||
section.contentKey !== LONG_TEXT_KEYS.title &&
|
||||
section.contentKey !== LONG_TEXT_KEYS.content
|
||||
section.contentKey !== LONG_TEXT_KEYS.content &&
|
||||
!HIDDEN_DETAIL_SECTION_KEYS.includes(section.contentKey)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -99,7 +105,8 @@ const contentSections = computed(() => {
|
||||
return renderSections.value.filter(
|
||||
(section) =>
|
||||
section.contentKey !== LONG_TEXT_KEYS.title &&
|
||||
section.contentKey !== LONG_TEXT_KEYS.tag
|
||||
section.contentKey !== LONG_TEXT_KEYS.tag &&
|
||||
!HIDDEN_DETAIL_SECTION_KEYS.includes(section.contentKey)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -267,6 +274,7 @@ onUnload(() => {
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.long-answer-tag {
|
||||
display: inline-flex;
|
||||
|
||||
@@ -58,7 +58,7 @@ const props = defineProps({
|
||||
const tag = computed(() => getLongTextValue(props.longTextData, "tag"));
|
||||
const title = computed(() => getLongTextValue(props.longTextData, "title"));
|
||||
const previewContent = computed(() => {
|
||||
return getLongTextPreviewText(props.longTextData, ["content"]) || (props.content ? String(props.content) : "");
|
||||
return getLongTextPreviewText(props.longTextData, ["content_summary"]);
|
||||
});
|
||||
|
||||
// 处理文本内容:按行截断以保证预览最多显示三行(更贴近视觉行数)
|
||||
|
||||
Reference in New Issue
Block a user