diff --git a/public/js/global-math.js b/public/js/global-math.js index 6e5aaf4..9aa76a9 100644 --- a/public/js/global-math.js +++ b/public/js/global-math.js @@ -26,74 +26,72 @@ window.MathJax = window.MathJax || { // **定义全局渲染方法** window.renderMathJax = function (tinymceId) { - // if (window.MathJax && typeof window.MathJax.typesetPromise === "function") { - // console.log("正在渲染 MathJax 公式..."); + if (window.MathJax && typeof window.MathJax.typesetPromise === "function") { + console.log("正在渲染 MathJax 公式..."); - // // 如果提供了 TinyMCE 编辑器 ID - // if (tinymceId) { - // const editorInstance = window.tinymce.get(tinymceId); // 根据 ID 获取编辑器实例 - // if (!editorInstance) { - // return; - // } + // 如果提供了 TinyMCE 编辑器 ID + if (tinymceId) { + const editorInstance = window.tinymce.get(tinymceId); // 根据 ID 获取 TinyMCE 实例 + if (!editorInstance) return; + + const editorBody = editorInstance.getBody(); + + // 获取所有 元素 + const wmathElements = editorBody.querySelectorAll('wmath'); + + if (wmathElements.length > 0) { + wmathElements.forEach((element) => { + const latexContent = element.getAttribute('data-latex'); + if (latexContent) { + // 将公式内容填入标签内部 + element.innerHTML = latexContent; + + // 使用 MathJax 渲染该元素 + window.MathJax.typesetPromise([element]).catch((err) => { + console.warn("TinyMCE MathJax 渲染失败:", err); + }); + } + }); + } + + // 渲染 (MathML)标签,如果有的话 + const mathElements = editorBody.querySelectorAll('math'); + if (mathElements.length > 0) { + window.MathJax.typesetPromise(Array.from(mathElements)).catch((err) => { + console.warn("MathML 渲染失败:", err); + }); + } + } + else { + // 处理全局文档中的 标签 + const wmathElements = document.querySelectorAll('wmath'); + wmathElements.forEach((element) => { + // 检查 标签是否包含有效的 data-latex 属性值 + const latexContent = element.getAttribute('data-latex'); + if (latexContent) { + // 将元素的内部内容替换为 data-latex 的值 + element.innerHTML = latexContent; - // // 获取指定的 TinyMCE 编辑器中的内容 - // const editorBody = editorInstance.getBody(); + // 渲染 MathJax 公式 + window.MathJax.typesetPromise([element]).catch((err) => { + console.warn("MathJax 渲染失败:", err); + }); + } + }); - // // 渲染 editorBody 中所有 标签,并使用 data-latex 的值 - // const wmathElements = editorBody.querySelectorAll('wmath'); - // wmathElements.forEach((element) => { - // // 检查 标签是否包含有效的 data-latex 属性值 - // const latexContent = element.getAttribute('data-latex'); - // if (latexContent) { - // // 将元素的内部内容替换为 data-latex 的值 - // element.innerHTML = latexContent; + // 处理全局文档中的 标签(MathML 内容) + const mathElements = document.querySelectorAll('math'); + mathElements.forEach((element) => { + // 渲染 MathJax 公式 + window.MathJax.typesetPromise([element]).catch((err) => { + console.warn("MathJax 渲染失败:", err); + }); + }); + } - // // 渲染 MathJax 公式 - // window.MathJax.typesetPromise([element]).catch((err) => { - // console.warn("TinyMCE MathJax 渲染失败:", err); - // }); - // } - // }); - - // // 渲染 editorBody 中所有 标签(MathML 内容) - // const mathElements = editorBody.querySelectorAll('math'); - // mathElements.forEach((element) => { - // // 渲染 MathJax 公式 - // window.MathJax.typesetPromise([element]).catch((err) => { - // console.warn("MathJax 渲染失败:", err); - // }); - // }); - - // } else { - // // 处理全局文档中的 标签 - // const wmathElements = document.querySelectorAll('wmath'); - // wmathElements.forEach((element) => { - // // 检查 标签是否包含有效的 data-latex 属性值 - // const latexContent = element.getAttribute('data-latex'); - // if (latexContent) { - // // 将元素的内部内容替换为 data-latex 的值 - // element.innerHTML = latexContent; - - // // 渲染 MathJax 公式 - // window.MathJax.typesetPromise([element]).catch((err) => { - // console.warn("MathJax 渲染失败:", err); - // }); - // } - // }); - - // // 处理全局文档中的 标签(MathML 内容) - // const mathElements = document.querySelectorAll('math'); - // mathElements.forEach((element) => { - // // 渲染 MathJax 公式 - // window.MathJax.typesetPromise([element]).catch((err) => { - // console.warn("MathJax 渲染失败:", err); - // }); - // }); - // } - - // } else { - // console.warn("MathJax 未正确加载!"); - // } + } else { + console.warn("MathJax 未正确加载!"); + } } diff --git a/src/api/index.js b/src/api/index.js index 0b11630..170e883 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -19,8 +19,8 @@ const service = axios.create({ // baseURL: 'https://submission.tmrjournals.com/', //正式 记得切换 // baseURL: 'http://www.tougao.com/', //测试本地 记得切换 // baseURL: 'http://192.168.110.110/tougao/public/index.php/', - // baseURL: '/api', //本地 - baseURL: '/', //正式 + baseURL: '/api', //本地 + // baseURL: '/', //正式 }); diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 49dd4e7..956a84b 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -1170,10 +1170,10 @@ a { color: #000000; text-align: left !important; font-family: 'Charis SIL' !important; - font-size:12px !important; - + font-size: 12px !important; + line-height: 20px !important; - + } .wordTableHtml table .color-highlight { @@ -1213,7 +1213,7 @@ a { /* 给最后一个 table-header-row(第二行)加样式 */ .wordTableHtml table tr.table-header-row:nth-of-type(2) td { - border-bottom: 1px solid #000 !important; + border-bottom: 1px solid #000 !important; } .word-container b span { @@ -1294,7 +1294,7 @@ a { border-left: 1px dashed #dcdfe6 !important; border-right: 1px dashed #dcdfe6 !important; word-break: keep-all !important; - white-space: pre-wrap !important; + white-space: pre-wrap !important; /* text-align: justify !important; */ } @@ -1434,11 +1434,19 @@ a { text-decoration: line-through !important; /* 设置字体颜色 */ } + mjx-container { font-size: 14px !important; - } - wmath{ +} + +wmath { width: 100%; - display: block;display: flex; - } - \ No newline at end of file + display: block; + display: flex; +} + +/* 强制 MathLive 虚拟键盘浮在最顶层 */ +.ML__keyboard { + z-index: 99999 !important; + position: fixed !important; +} \ No newline at end of file diff --git a/src/common/js/commonJS.js b/src/common/js/commonJS.js index 77040c9..9043374 100644 --- a/src/common/js/commonJS.js +++ b/src/common/js/commonJS.js @@ -49,14 +49,14 @@ export default { replaceWMathContent(inputHtml, callback) { // 使用正则表达式查找所有 标签,并提取 data-latex 的内容 - var str = inputHtml.replace(/[^<]*<\/wmath>/g, function(match, latexContent) { + var str = inputHtml.replace(/[^<]*<\/wmath>/g, function (match, latexContent) { // 返回 标签,内容替换为 data-latex 的值 return `${latexContent}`; }); - + // 调用回调函数并传递处理后的结果 callback(str); - + // 输出结果到控制台 console.log('Processed HTML:', str); } @@ -65,37 +65,37 @@ export default { , // **解析 MathJax 公式,获取 LaTeX** async extractMathJaxLatex(cell, callback) { - console.log('cell at line 67:', cell) + console.log('cell at line 67:', cell) return new Promise((resolve, reject) => { // Step 1: First, process the math content and extract LaTeX from tags let updatedContent = cell.innerHTML; // Start with the cell's inner HTML console.log('cell content at the start:', updatedContent); - + // Find all elements const wmathElements = cell.querySelectorAll('wmath'); wmathElements.forEach((element) => { // Get the LaTeX content from the data-latex attribute const latexContent = element.getAttribute('data-latex'); console.log('LaTeX content from data-latex:', latexContent); - + // Replace the tag with its LaTeX content wrapped in $$...$$ updatedContent = updatedContent.replace(element.outerHTML, `${latexContent}`); }); - + console.log('updatedContent after processing wmath tags:', updatedContent); - + // Step 2: Now extract content without the outer tags updatedContent = this.extractContentWithoutOuterSpan(updatedContent); console.log('updatedContent after extractContentWithoutOuterSpan:', updatedContent); - + // Step 3: Call the callback function with the final updated content // callback(updatedContent); - + // Resolve the promise with the final content resolve(updatedContent); }); } - + , renderLatex(latexString) { @@ -112,7 +112,7 @@ export default { extractContentWithoutOuterSpan(cell) { console.log('cell at line 90:', cell) var str = '' - if(!cell){ + if (!cell) { return '' } // 获取单元格的 HTML 内容 @@ -753,7 +753,7 @@ export default { // 2️⃣ 将

内容转换为数组,并处理内容 let parsedData = Array.from(paragraphs).map(p => { let text = p.innerHTML.trim(); // 获取内容,去除两端空格 - text= this.transformHtmlString(text) + text = this.transformHtmlString(text) // 3️⃣ **正确移除 (Word 复制的无效标签)** text = text.replace(/<\/?o:p[^>]*>/g, ""); @@ -1948,18 +1948,39 @@ export default { } } }); + let latexEditorBookmark = null; // 用于记录插入点 + let activeEditorId = null; // 当前激活的编辑器 ID + + // 在编辑器工具栏中添加 "LateX" 按钮 ed.ui.registry.addButton('LateX', { text: 'LateX', // 按钮文本 - // className: 'custom-button-blue', // 添加自定义类 - // shortcut: "Ctrl+J", onAction: function () { - window.open('/LateX?id=4477', '_blank', 'width=600,height=400'); + // 1. 获取当前光标位置 + const latexEditorBookmark = ed.selection.getBookmark(2); // 获取光标位置 + const editorId = ed.id; // 保存当前编辑器 ID + console.log('activeEditorId:', editorId); - // 在新页面中插入 MathLive 编辑器 - // formulaWindow.document.write(``); - } + // 2. 生成一个随机的 ID,用于 wmath 标签 + const uid = 'wmath-' + Math.random().toString(36).substr(2, 9); + + // 3. 创建一个 标签并插入到光标处 + const wmathHtml = `Insert formula here`; + ed.insertContent(wmathHtml); // 在光标位置插入 wmath 标签 + + // 4. 打开公式编辑器窗口,并传递光标位置、编辑器 ID 和 wmathId + const url = `/LateX?editorId=${editorId}&wmathId=${uid}`; + // vueInstance.openLatexEditor({ + // editorId:editorId, + // wmathId:uid, + // }); + window.open(url, '_blank', 'width=600,height=460,scrollbars=no,resizable=no'); + } }); + + + + ed.ui.registry.addButton('myuppercase', { text: 'A', // 按钮文本 diff --git a/src/components/common/Home.vue b/src/components/common/Home.vue index 7515b4b..865907c 100644 --- a/src/components/common/Home.vue +++ b/src/components/common/Home.vue @@ -32,7 +32,7 @@ @@ -404,7 +358,9 @@ import bottomTinymce from '@/components/page/components/Tinymce'; export default { data() { return { + LateXInfo: {}, isEditComment: false, + showLateX: false, comments: [], remarkImageUrl: 'https://submission.tmrjournals.com/public/usericon/20241222/4e77ba3f29ce3cf798b36f24dc411b76.png', isFirstComponentLoaded: false, @@ -559,6 +515,11 @@ export default { }, methods: { + openLatexEditor(data) { + console.log('data at line 563:', data); + this.showLateX = true; + this.LateXInfo=data + }, isShowEditComment() { if (localStorage.getItem('U_role')) { var identity = localStorage.getItem('U_role'); @@ -602,7 +563,7 @@ export default { console.log('content at line 539:', content); if (type == 'content') { content = this.$commonJS.transformHtmlString(content); - console.log('content at line 604:', content) + console.log('content at line 604:', content); var div = document.createElement('div'); div.innerHTML = content; // 将 HTML 字符串加载到 div 中 // 替换所有 @@ -632,14 +593,13 @@ export default { type: 'warning', message: 'Table content is not supported!' }); - return false + return false; } var list = this.$commonJS.cleanAndParseWordContent(content); console.log('list at line 569:', list); this.saveContentList(list, this.currentId); } else if (type == 'table') { - this.saveTable(content); } else if (type == 'comment') { this.addComment(content); @@ -719,7 +679,31 @@ export default { .catch(() => {}); } }, + saveLateX(data) { + console.log('data at line 735:', data) + const { editorId, wmathId, latex } = data; + const newLatex = latex ? latex.trim() : ''; + if (!editorId || !wmathId) return; + const targetEditor = tinymce.get(editorId); + if (!targetEditor) return; + const targetWmath = targetEditor.dom.select(`wmath[data-id="${wmathId}"]`, targetEditor.getBody())[0]; + if (targetWmath) { + if (!newLatex) { + // ❌ 删除公式 + targetEditor.dom.remove(targetWmath); + } else { + // ✅ 更新公式 + targetWmath.setAttribute('data-latex', newLatex); + targetWmath.innerHTML = newLatex; + setTimeout(() => { + if (typeof renderMathJax === 'function') { + this.window.renderMathJax(editorId); + } + }, 10); + } + } + }, async huifu(id) { var that = this; await this.$confirm(this.$t('commonTable.reContent'), 'Prompt', { @@ -882,22 +866,22 @@ export default { console.log('err at line 466:', err); }); }, - async changeSort(type,id) { - var that=this + async changeSort(type, id) { + var that = this; await that.$api - .post(type=='up'?'/api/Preaccept/upArticleMain':'/api/Preaccept/downArticleMain', { - am_id: id - }) - .then(async (res) => { - if (res.code == 0) { - setTimeout(() => { - that.getDate(); - that.getCommentList(); - - that.$forceUpdate(); - }); - } + .post(type == 'up' ? '/api/Preaccept/upArticleMain' : '/api/Preaccept/downArticleMain', { + am_id: id + }) + .then(async (res) => { + if (res.code == 0) { + setTimeout(() => { + that.getDate(); + that.getCommentList(); + + that.$forceUpdate(); }); + } + }); }, async addCommentSetting(content) { console.log('content at line 602:', content); @@ -1152,7 +1136,7 @@ export default { } }, updateChange(content, type) { - console.log('content at line 1154:', content) + console.log('content at line 1154:', content); // console.log('content at line 976:', content); var str = this.$commonJS.transformHtmlString(content); if (type == 'imgNote') { @@ -1600,6 +1584,12 @@ export default { if (content && content.table && content.table.length > 0) { if (this.lineStyle.visiTitle == 'Edit Table') { + const loading = this.$loading({ + lock: true, + text: 'Loading...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); this.$api .post(this.urlList.editTable, { amt_id: this.lineStyle.amt_id, @@ -2123,5 +2113,4 @@ export default { ::-webkit-scrollbar-thumb:hover { background: #555; /* 滑块悬停时的颜色 */ } - diff --git a/src/components/page/components/Tinymce/index copy 2.vue b/src/components/page/components/Tinymce/index copy 2.vue deleted file mode 100644 index 1e1c65c..0000000 --- a/src/components/page/components/Tinymce/index copy 2.vue +++ /dev/null @@ -1,531 +0,0 @@ - - - diff --git a/src/components/page/components/Tinymce/index.vue b/src/components/page/components/Tinymce/index.vue index fc954ed..1c6a77d 100644 --- a/src/components/page/components/Tinymce/index.vue +++ b/src/components/page/components/Tinymce/index.vue @@ -127,7 +127,9 @@ wmath{ display: block; display: flex; } - + Info{ + color:#ff8f25; + } `; export default { name: 'tinymce', @@ -250,7 +252,8 @@ export default { this.destroyTinymce(); }, methods: { - onpenLatex() { + openLatexEditor(data) { + this.$emit('openLatexEditor',data) console.log('at line 254:', '打开数字公式'); }, handleSubmit() { @@ -284,7 +287,9 @@ export default { this.$forceUpdate(); }, - + generateUniqueId() { + return 'wmath-' + Math.random().toString(36).substr(2, 9); + }, initTinymce() { var _this = this; window.tinymce.init({ @@ -477,15 +482,45 @@ export default { //设置自定义按钮 myCustomToolbarButton setup(ed) { _this.$commonJS.initEditorButton(_this, ed); - ed.on('click', function (e) { - console.log('e at line 471:', e); - // 判断点击是否为 wmath 标签 - const wmathElement = e.target.closest('wmath'); - if (wmathElement) { - // 执行点击 wmath 标签时的操作 - } - }); + var currentWmathElement = null; + + ed.on('click', function (e) { + const wmathElement = e.target.closest('wmath'); + + if (wmathElement) { + currentWmathElement = wmathElement; // 👈 保存当前点击的元素 + + const latexContentRaw = wmathElement.getAttribute('data-latex') || ''; + console.log('at line 488: raw =', latexContentRaw); + + // 去除所有 $ 符号 + const latexContent = latexContentRaw.replace(/\$/g, '').trim(); + console.log('at line 489: cleaned =', latexContent); + + // 编码后用于传递到弹窗 + const encoded = encodeURIComponent(latexContent); + + // 给 wmath 添加唯一 data-id,方便后续精准替换 + let wmathId = wmathElement.getAttribute('data-id'); + if (!wmathId) { + wmathId = 'wmath-' + Math.random().toString(36).substr(2, 9); + wmathElement.setAttribute('data-id', wmathId); + } + + // 当前编辑器 ID 也保存下来(如果你有多个编辑器) + const editorId = ed.id; + + // 打开编辑窗口并传参(传递 data-id + 内容) + window.open( + `/LateX?id=${encoded}&wmathId=${wmathId}&editorId=${editorId}`, + '_blank', + 'width=600,height=460,scrollbars=no,resizable=no' + ); + } +}); + + ed.ui.registry.addButton('uploadWord', { text: 'Word', icon: 'import-word', // 使用自定义图标 @@ -511,32 +546,16 @@ export default { } }); - // ed.ui.registry.addMenuButton('customDropdown', { - // text: _this.$t('commonTable.PaperRotation'), // 下拉框标题 - // fetch: function (callback) { - // // 定义下拉框的内容 - // const items = [..._this.typesettingTypeOptions]; - // const menuItems = items.map((item) => ({ - // type: 'menuitem', - // text: item.label, - // onAction: function () { - // _this.typesettingType = item.value; - // _this.changeTable(); - // // ed.execCommand(item.value); // 执行命令 - // } - // })); - // callback(menuItems); - // } - // }); - ed.on('init', function () { _this.$commonJS.inTinymceButtonClass(); const editorBody = ed.getBody(); - + + // 监听点击事件来确保用户可以删除元素 + // 创建 MutationObserver 监听内容变化 const observer = new MutationObserver(() => { const currentContent = ed.getContent(); - console.log('currentContent at line 447:', currentContent); + // console.log('currentContent at line 447:', currentContent); if (_this.isAutomaticUpdate) { // _this.$emit('updateChange', _this.$commonJS.decodeHtml(currentContent)); @@ -589,6 +608,11 @@ export default { }); ed.on('SetContent', function (e) { + const editorBody = ed.getBody(); + ed.dom.select('wmath', editorBody).forEach(function (wmathElement) { + ed.dom.setAttrib(wmathElement, 'contenteditable', 'false'); + // ed.dom.addClass(wmathElement, 'non-editable-wmath'); + }); e.content = e.content.replace(//g, '').replace(/<\/strong>/g, ''); e.content = e.content.replace(//g, '').replace(/<\/em>/g, ''); }); @@ -618,6 +642,87 @@ export default { }); } }); + if (!window._wmath_listener_registered) { + // 💾 新增公式插入点记录 + let latexEditorBookmark = null; + let activeEditorId = null; + + // 👂 message 监听器:处理编辑 + 新增两种情况 + window.addEventListener('message', function (event) { + const data = event.data; + console.log('data at line 648:', data); + + // ✅ 编辑现有公式:替换或删除 + if (data && data.type === 'update-wmath') { + const { editorId, wmathId, latex } = data; + const newLatex = latex ? latex.trim() : ''; + + if (!editorId || !wmathId) return; + const targetEditor = tinymce.get(editorId); + if (!targetEditor) return; + + const targetWmath = targetEditor.dom.select(`wmath[data-id="${wmathId}"]`, targetEditor.getBody())[0]; + + if (targetWmath) { + if (!newLatex) { + // ❌ 删除公式 + targetEditor.dom.remove(targetWmath); + } else { + // ✅ 更新公式 + targetWmath.setAttribute('data-latex', newLatex); + targetWmath.innerHTML = newLatex; + + setTimeout(() => { + if (typeof renderMathJax === 'function') { + this.window.renderMathJax(editorId); + } + }, 10); + } + } + } + + // ✅ 插入新公式 + // if (data && data.type === 'insert-new-wmath') { + // const latex = data.latex ? data.latex.trim() : ''; + // // if (!activeEditorId || !latexEditorBookmark) return; + + // const editor = window.tinymce.get(activeEditorId); + + // if (!editor) return; + + // // 恢复光标位置 + // editor.focus(); + // setTimeout(() => { + // editor.selection.moveToBookmark(latexEditorBookmark); + + // const uid = 'wmath-' + Math.random().toString(36).substr(2, 9); + // const wmathHtml = `${latex}`; + // editor.insertContent(wmathHtml); + + // // 清除焦点,防止影响渲染 + // editor.focus(false); // 取消焦点 + + // // 清除 + // latexEditorBookmark = null; + // activeEditorId = null; + // }, 20); + // setTimeout(() => { + // if (typeof renderMathJax === 'function') { + // _this.window.renderMathJax(_this.tinymceId); + // } + // }, 1000); + // } + }); + + // 🚩 标记为已注册,防止重复 + window._wmath_listener_registered = true; + + // 🧠 导出保存位置函数(你可以在按钮点击时调用它) + window._recordLatexInsertContext = function (editorInstance) { + latexEditorBookmark = editorInstance.selection.getBookmark(2); + activeEditorId = editorInstance.id; + }; + } }, // 提取 Word 文件中的表格 diff --git a/src/components/page/components/table/LateX copy.vue b/src/components/page/components/table/LateX copy.vue new file mode 100644 index 0000000..bede63d --- /dev/null +++ b/src/components/page/components/table/LateX copy.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/src/components/page/components/table/LateX.vue b/src/components/page/components/table/LateX.vue index bede63d..163caca 100644 --- a/src/components/page/components/table/LateX.vue +++ b/src/components/page/components/table/LateX.vue @@ -1,151 +1,198 @@ diff --git a/src/components/page/components/table/content.vue b/src/components/page/components/table/content.vue index f43a8c1..9c23951 100644 --- a/src/components/page/components/table/content.vue +++ b/src/components/page/components/table/content.vue @@ -11,11 +11,12 @@ :wordStyle="wordStyle" :isAutomaticUpdate="isAutomaticUpdate" @getContent="getContent" + @openLatexEditor="openLatexEditor" @updateChange="updateChange" :value="value" :typesettingType="typesettingType" class="paste-area text-container" - :toolbar="['bold italic|customBlue removeBlue|myuppercase myuppercasea Line|subscript superscript|searchreplace|clearButton']" + :toolbar="`['bold italic|customBlue removeBlue|${!isAutomaticUpdate?'LateX|':''}myuppercase myuppercasea Line|subscript superscript|searchreplace|clearButton']`" style=" /* white-space: pre-line; */ line-height: 12px; @@ -73,6 +74,10 @@ export default { } }, methods: { + openLatexEditor(data) { + this.$emit('openLatexEditor',data) + console.log('at line 254:', '打开数字公式'); + }, updateChange(content){ this.$emit('updateChange',content) }, diff --git a/src/components/page/components/table/table.vue b/src/components/page/components/table/table.vue index 7ed2ca1..5371a6e 100644 --- a/src/components/page/components/table/table.vue +++ b/src/components/page/components/table/table.vue @@ -8,11 +8,12 @@ ref="tinymceChild1" :wordStyle="wordStyle" @getContent="getContent" + @openLatexEditor="openLatexEditor" :height="calcDynamicWidth()" :value="updatedHtml" :typesettingType="typesettingType" class="paste-area text-container" - :toolbar="['bold italic|customBlue removeBlue|kityformula-editor |myuppercase myuppercasea Line|subscript superscript|table tabledelete| searchreplace |clearButton']" + :toolbar="['bold italic|customBlue removeBlue|kityformula-editor|LateX |myuppercase myuppercasea Line|subscript superscript|table tabledelete| searchreplace |clearButton']" style=" /* white-space: pre-line; */ line-height: 12px; @@ -101,6 +102,10 @@ export default { } }, methods: { + openLatexEditor(data) { + this.$emit('openLatexEditor',data) + console.log('at line 254:', '打开数字公式'); + }, calcDynamicWidth() { const parentWidth = window.innerHeight; // 获取窗口宽度 const result = parentWidth - 420; // 计算 `100% - 200px` diff --git a/src/components/page/components/table/word.vue b/src/components/page/components/table/word.vue index 9733d99..3466299 100644 --- a/src/components/page/components/table/word.vue +++ b/src/components/page/components/table/word.vue @@ -899,7 +899,7 @@ export default { this.currentId = null; this.currentData = {}; // this.uniqueIds = [...new Set(this.wordList.filter((item) => item.checked).map((item) => item.am_id))]; - console.log('this.uniqueIds at line 839:', this.selectedIds); + // console.log('this.uniqueIds at line 839:', this.selectedIds); this.$forceUpdate(); }, onEdit() { @@ -911,7 +911,7 @@ export default { this.$emit('onAddRow', this.currentId); }, onDelete() { - console.log('this.uniqueIds.length at line 866:', this.selectedIds.length); + // console.log('this.uniqueIds.length at line 866:', this.selectedIds.length); if (this.selectedIds.length > 0) { this.$emit('onDeletes', this.selectedIds.toString()); this.$forceUpdate();