diff --git a/src/editor/html/wang-editor/wang-editor.scss b/src/editor/html/wang-editor/wang-editor.scss index 702b4a3e767a609ca5309203e3bcbda9935ede86..738fbd47bd59c4dbf25cdbc1c167c53e6f3e069a 100644 --- a/src/editor/html/wang-editor/wang-editor.scss +++ b/src/editor/html/wang-editor/wang-editor.scss @@ -54,6 +54,33 @@ $html: ( background-color: getCssVar(color, bg, 0); } } + + .table-container { + table { + width: 100%; + } + } +} + +.rich-html-table { + width: 100% !important; + border-collapse: collapse; + + th { + height: 49px; + min-height: 49px; + padding: 8px; + background-color: #F3F3F3; + border: 1px solid lightgray; + } + + td { + height: 49px; + min-height: 49px; + padding: 8px; + empty-cells: show; + border: 1px solid lightgray; + } } @include b('html-editor-readonly') { diff --git a/src/editor/html/wang-editor/wang-editor.tsx b/src/editor/html/wang-editor/wang-editor.tsx index fed297d7c98edd48df1469b95a2df2cd1e5a5bae..ddccf7a85233c2136fb6d4ce75f50dd9e6b82ebc 100644 --- a/src/editor/html/wang-editor/wang-editor.tsx +++ b/src/editor/html/wang-editor/wang-editor.tsx @@ -255,7 +255,7 @@ const IBizHtml = defineComponent({ // console.log('change:', editor.getHtml()); const html = editor.getHtml(); // wangEditor初始值抛空字符串给后台 - const emitValue = html === '


' ? '' : html; + let emitValue = html === '


' ? '' : html; if ( emitValue === props.value || (emitValue === '' && isNil(props.value)) @@ -264,6 +264,9 @@ const IBizHtml = defineComponent({ } // 修复初始化有值编辑器也会抛值导致表单脏值检查异常问题 if (!hasEnableEdit.value && editor.isFocused()) { + emitValue = emitValue + .replaceAll('class="rich-html-table"', "") + .replace(/ { readonlyState.value = true; editorRef.value.disable(); - emit('change', valueHtml.value); + const value = valueHtml.value + .replaceAll('class="rich-html-table"', "") + .replace(/