|
@@ -78,33 +78,34 @@ const WbwCaseWidget = ({ data, display, onSplit, onChange }: IWidget) => {
|
|
|
|
|
|
|
|
const showSplit: boolean = data.factors?.value?.includes("+") ? true : false;
|
|
const showSplit: boolean = data.factors?.value?.includes("+") ? true : false;
|
|
|
let caseElement: JSX.Element | JSX.Element[] | undefined;
|
|
let caseElement: JSX.Element | JSX.Element[] | undefined;
|
|
|
- if (
|
|
|
|
|
- display === "block" &&
|
|
|
|
|
- typeof data.case?.value === "string" &&
|
|
|
|
|
- data.case.value.trim() !== ""
|
|
|
|
|
- ) {
|
|
|
|
|
- caseElement = data.case.value
|
|
|
|
|
- .replace("#", "$")
|
|
|
|
|
- .split("$")
|
|
|
|
|
- .map((item, id) => {
|
|
|
|
|
- if (item !== "") {
|
|
|
|
|
- const strCase = item.replaceAll(".", "");
|
|
|
|
|
- return (
|
|
|
|
|
- <span key={id} className="case">
|
|
|
|
|
- {intl.formatMessage({
|
|
|
|
|
- id: `dict.fields.type.${strCase}.short.label`,
|
|
|
|
|
- })}
|
|
|
|
|
- </span>
|
|
|
|
|
- );
|
|
|
|
|
- } else {
|
|
|
|
|
- return <span key={id}></span>;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- //空白的语法信息在逐词解析模式显示占位字符串
|
|
|
|
|
- caseElement = (
|
|
|
|
|
- <span>{intl.formatMessage({ id: "dict.fields.case.label" })}</span>
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ if (display === "block") {
|
|
|
|
|
+ if (
|
|
|
|
|
+ typeof data.case?.value === "string" &&
|
|
|
|
|
+ data.case.value.trim().length > 0
|
|
|
|
|
+ ) {
|
|
|
|
|
+ caseElement = data.case.value
|
|
|
|
|
+ .replace("#", "$")
|
|
|
|
|
+ .split("$")
|
|
|
|
|
+ .map((item, id) => {
|
|
|
|
|
+ if (item !== "") {
|
|
|
|
|
+ const strCase = item.replaceAll(".", "");
|
|
|
|
|
+ return (
|
|
|
|
|
+ <span key={id} className="case">
|
|
|
|
|
+ {intl.formatMessage({
|
|
|
|
|
+ id: `dict.fields.type.${strCase}.short.label`,
|
|
|
|
|
+ })}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return <span key={id}>-</span>;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //空白的语法信息在逐词解析模式显示占位字符串
|
|
|
|
|
+ caseElement = (
|
|
|
|
|
+ <span>{intl.formatMessage({ id: "dict.fields.case.label" })}</span>
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (typeof data.real !== "undefined" && PaliReal(data.real.value) !== "") {
|
|
if (typeof data.real !== "undefined" && PaliReal(data.real.value) !== "") {
|