Merge branch 'master' of https://git.nuttyreading.com/wangjinlei/tougao_web into Editorial-Board

This commit is contained in:
2026-04-15 10:51:00 +08:00
4 changed files with 81 additions and 55 deletions

View File

@@ -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: '/', //正式
});

View File

@@ -1286,7 +1286,38 @@ str = str.replace(regex, function (match, content, offset, fullString) {
},
getCleanTextForCount(html) {
if (!html) return "";
// 创建临时容器解析 HTML
const tempDiv = document.createElement('div');
tempDiv.innerHTML = html;
// A. 特殊处理 wmath只拿它里面的公式文本扔掉里面生成的 mjx-container 等标签
const wmaths = tempDiv.querySelectorAll('wmath');
wmaths.forEach(wm => {
// textContent 会拿到最原始的公式字符,忽略内部所有标签
const textNode = document.createTextNode(wm.textContent);
wm.parentNode.replaceChild(textNode, wm);
});
// B. 获取现在的 HTML 内容
let result = tempDiv.innerHTML;
// C. 去掉特定排版标签的“壳”(保留里面的文字)
// 包含 b, strong, br, em, i, sup, sub 等
result = result.replace(/<(p|div|b|strong|br|em|i|sup|sub)[^>]*>/gi, "");
result = result.replace(/<\/(p|div|b|strong|br|em|i|sup|sub)>/gi, "");
// E. 彻底“脱水”:去掉 HTML 实体、换行符、所有空格
result = result.replace(/&nbsp;/ig, "");
result = result.replace(/[\r\n\t]/g, "");
result = result.replace(/\s+/g, "");
return result;
},

View File

@@ -17,9 +17,6 @@
:form="baseQuestionform"
@update="(e) => (questionform = e)"
></newForm>
</el-form>
</div>
</template>
@@ -134,7 +131,6 @@ export default {
recommend: [{ required: true, message: 'please select', trigger: 'blur' }]
};
}
},
questionSubmit() {
if (this.questionform.is_anonymous == '' && this.questionform.is_anonymous != '0') {
@@ -161,30 +157,29 @@ export default {
}
let Char_Cter = null;
// 验证相加的字数
if (this.isNewForm) {
Char_Cter = [
this.questionform.qu5contents,
this.questionform.qu6contents,
this.questionform.qu7contents,
this.questionform.qu8contents,
this.questionform.qu9contents,
this.questionform.qu10contents,
this.questionform.qu11contents,
this.questionform.qu12contents,
this.questionform.qu13contents,
this.questionform.qu14contents,
this.questionform.comment
].join(' ');
} else {
Char_Cter = [
this.questionform.qu9contents,
this.questionform.qu10contents,
this.questionform.qu11contents,
this.questionform.qu12contents,
this.questionform.qu13contents,
this.questionform.comment
].join(' ');
}
const contents = this.isNewForm
? [
this.questionform.qu5contents,
this.questionform.qu6contents,
this.questionform.qu7contents,
this.questionform.qu8contents,
this.questionform.qu9contents,
this.questionform.qu10contents,
this.questionform.qu11contents,
this.questionform.qu12contents,
this.questionform.qu13contents,
this.questionform.qu14contents,
this.questionform.comment
]
: [
this.questionform.qu9contents,
this.questionform.qu10contents,
this.questionform.qu11contents,
this.questionform.qu12contents,
this.questionform.qu13contents,
this.questionform.comment
];
Char_Cter = this.$commonJS.getCleanTextForCount(contents.join(' '));
if (new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(Char_Cter)) {
//中文

View File

@@ -342,6 +342,7 @@ export default {
return content;
},
async questionSubmit() {
if (this.questionform.is_anonymous == '' && this.questionform.is_anonymous != '0') {
@@ -368,30 +369,29 @@ export default {
}
let Char_Cter = null;
// 验证相加的字数
if (this.isNewForm) {
Char_Cter = [
this.questionform.qu5contents,
this.questionform.qu6contents,
this.questionform.qu7contents,
this.questionform.qu8contents,
this.questionform.qu9contents,
this.questionform.qu10contents,
this.questionform.qu11contents,
this.questionform.qu12contents,
this.questionform.qu13contents,
this.questionform.qu14contents,
this.questionform.comment
].join(' ');
} else {
Char_Cter = [
this.questionform.qu9contents,
this.questionform.qu10contents,
this.questionform.qu11contents,
this.questionform.qu12contents,
this.questionform.qu13contents,
this.questionform.comment
].join(' ');
}
const contents = this.isNewForm ? [
this.questionform.qu5contents,
this.questionform.qu6contents,
this.questionform.qu7contents,
this.questionform.qu8contents,
this.questionform.qu9contents,
this.questionform.qu10contents,
this.questionform.qu11contents,
this.questionform.qu12contents,
this.questionform.qu13contents,
this.questionform.qu14contents,
this.questionform.comment
] : [
this.questionform.qu9contents,
this.questionform.qu10contents,
this.questionform.qu11contents,
this.questionform.qu12contents,
this.questionform.qu13contents,
this.questionform.comment
];
Char_Cter = this.$commonJS.getCleanTextForCount(contents.join(' '));
if (new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(Char_Cter)) {
//中文