Merge branch 'master' of https://git.nuttyreading.com/wangjinlei/tougao_web into Editorial-Board
This commit is contained in:
@@ -19,8 +19,8 @@ const service = axios.create({
|
|||||||
// baseURL: 'https://submission.tmrjournals.com/', //正式 记得切换
|
// baseURL: 'https://submission.tmrjournals.com/', //正式 记得切换
|
||||||
// baseURL: 'http://www.tougao.com/', //测试本地 记得切换
|
// baseURL: 'http://www.tougao.com/', //测试本地 记得切换
|
||||||
// baseURL: 'http://192.168.110.110/tougao/public/index.php/',
|
// baseURL: 'http://192.168.110.110/tougao/public/index.php/',
|
||||||
baseURL: '/api', //本地
|
// baseURL: '/api', //本地
|
||||||
// baseURL: '/', //正式
|
baseURL: '/', //正式
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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(/ /ig, "");
|
||||||
|
result = result.replace(/[\r\n\t]/g, "");
|
||||||
|
result = result.replace(/\s+/g, "");
|
||||||
|
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,6 @@
|
|||||||
:form="baseQuestionform"
|
:form="baseQuestionform"
|
||||||
@update="(e) => (questionform = e)"
|
@update="(e) => (questionform = e)"
|
||||||
></newForm>
|
></newForm>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -134,7 +131,6 @@ export default {
|
|||||||
recommend: [{ required: true, message: 'please select', trigger: 'blur' }]
|
recommend: [{ required: true, message: 'please select', trigger: 'blur' }]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
questionSubmit() {
|
questionSubmit() {
|
||||||
if (this.questionform.is_anonymous == '' && this.questionform.is_anonymous != '0') {
|
if (this.questionform.is_anonymous == '' && this.questionform.is_anonymous != '0') {
|
||||||
@@ -161,30 +157,29 @@ export default {
|
|||||||
}
|
}
|
||||||
let Char_Cter = null;
|
let Char_Cter = null;
|
||||||
// 验证相加的字数
|
// 验证相加的字数
|
||||||
if (this.isNewForm) {
|
const contents = this.isNewForm
|
||||||
Char_Cter = [
|
? [
|
||||||
this.questionform.qu5contents,
|
this.questionform.qu5contents,
|
||||||
this.questionform.qu6contents,
|
this.questionform.qu6contents,
|
||||||
this.questionform.qu7contents,
|
this.questionform.qu7contents,
|
||||||
this.questionform.qu8contents,
|
this.questionform.qu8contents,
|
||||||
this.questionform.qu9contents,
|
this.questionform.qu9contents,
|
||||||
this.questionform.qu10contents,
|
this.questionform.qu10contents,
|
||||||
this.questionform.qu11contents,
|
this.questionform.qu11contents,
|
||||||
this.questionform.qu12contents,
|
this.questionform.qu12contents,
|
||||||
this.questionform.qu13contents,
|
this.questionform.qu13contents,
|
||||||
this.questionform.qu14contents,
|
this.questionform.qu14contents,
|
||||||
this.questionform.comment
|
this.questionform.comment
|
||||||
].join(' ');
|
]
|
||||||
} else {
|
: [
|
||||||
Char_Cter = [
|
this.questionform.qu9contents,
|
||||||
this.questionform.qu9contents,
|
this.questionform.qu10contents,
|
||||||
this.questionform.qu10contents,
|
this.questionform.qu11contents,
|
||||||
this.questionform.qu11contents,
|
this.questionform.qu12contents,
|
||||||
this.questionform.qu12contents,
|
this.questionform.qu13contents,
|
||||||
this.questionform.qu13contents,
|
this.questionform.comment
|
||||||
this.questionform.comment
|
];
|
||||||
].join(' ');
|
Char_Cter = this.$commonJS.getCleanTextForCount(contents.join(' '));
|
||||||
}
|
|
||||||
|
|
||||||
if (new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(Char_Cter)) {
|
if (new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(Char_Cter)) {
|
||||||
//中文
|
//中文
|
||||||
|
|||||||
@@ -342,6 +342,7 @@ export default {
|
|||||||
|
|
||||||
return content;
|
return content;
|
||||||
},
|
},
|
||||||
|
|
||||||
async questionSubmit() {
|
async questionSubmit() {
|
||||||
|
|
||||||
if (this.questionform.is_anonymous == '' && this.questionform.is_anonymous != '0') {
|
if (this.questionform.is_anonymous == '' && this.questionform.is_anonymous != '0') {
|
||||||
@@ -368,30 +369,29 @@ export default {
|
|||||||
}
|
}
|
||||||
let Char_Cter = null;
|
let Char_Cter = null;
|
||||||
// 验证相加的字数
|
// 验证相加的字数
|
||||||
if (this.isNewForm) {
|
const contents = this.isNewForm ? [
|
||||||
Char_Cter = [
|
this.questionform.qu5contents,
|
||||||
this.questionform.qu5contents,
|
this.questionform.qu6contents,
|
||||||
this.questionform.qu6contents,
|
this.questionform.qu7contents,
|
||||||
this.questionform.qu7contents,
|
this.questionform.qu8contents,
|
||||||
this.questionform.qu8contents,
|
this.questionform.qu9contents,
|
||||||
this.questionform.qu9contents,
|
this.questionform.qu10contents,
|
||||||
this.questionform.qu10contents,
|
this.questionform.qu11contents,
|
||||||
this.questionform.qu11contents,
|
this.questionform.qu12contents,
|
||||||
this.questionform.qu12contents,
|
this.questionform.qu13contents,
|
||||||
this.questionform.qu13contents,
|
this.questionform.qu14contents,
|
||||||
this.questionform.qu14contents,
|
this.questionform.comment
|
||||||
this.questionform.comment
|
] : [
|
||||||
].join(' ');
|
this.questionform.qu9contents,
|
||||||
} else {
|
this.questionform.qu10contents,
|
||||||
Char_Cter = [
|
this.questionform.qu11contents,
|
||||||
this.questionform.qu9contents,
|
this.questionform.qu12contents,
|
||||||
this.questionform.qu10contents,
|
this.questionform.qu13contents,
|
||||||
this.questionform.qu11contents,
|
this.questionform.comment
|
||||||
this.questionform.qu12contents,
|
];
|
||||||
this.questionform.qu13contents,
|
Char_Cter = this.$commonJS.getCleanTextForCount(contents.join(' '));
|
||||||
this.questionform.comment
|
|
||||||
].join(' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(Char_Cter)) {
|
if (new RegExp('[\\u4E00-\\u9FFF]+', 'g').test(Char_Cter)) {
|
||||||
//中文
|
//中文
|
||||||
|
|||||||
Reference in New Issue
Block a user