|
@@ -18,7 +18,7 @@
|
|
|
<template v-if="is_status === 'show'">
|
|
|
<div class="show">
|
|
|
<div class="left">
|
|
|
- <el-card v-for="(item, i) in list" :key="i">
|
|
|
+ <el-card v-for="(item, i) in selectList()" :key="i">
|
|
|
<p
|
|
|
class="list"
|
|
|
style="font-size: 12px; font-weight: 400; color: #888"
|
|
@@ -27,196 +27,152 @@
|
|
|
{{ err_text[item.errorType].sub_text }}
|
|
|
</p>
|
|
|
<p class="list">
|
|
|
- <span v-text="item.sourceText"></span>
|
|
|
+ <span v-text="item.sourceText"></span>
|
|
|
<span
|
|
|
class="alert-go-right"
|
|
|
v-if="item.replaceText"
|
|
|
:style="{ backgroundImage: 'url(' + image_base64.right + ')' }"
|
|
|
></span>
|
|
|
- <span v-if="item.replaceText" class="replaceText" v-text="item.replaceText"></span>
|
|
|
+ <span
|
|
|
+ v-if="item.replaceText"
|
|
|
+ class="replaceText"
|
|
|
+ v-text="item.replaceText"
|
|
|
+ ></span>
|
|
|
</p>
|
|
|
<div class="list" v-html="item.alertMessage"></div>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
- <div class="right">2</div>
|
|
|
+ <div class="right">
|
|
|
+ <div
|
|
|
+ @click="() => selectList(i)"
|
|
|
+ class="item"
|
|
|
+ v-for="(item, i) in err_text"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="read"
|
|
|
+ :style="{
|
|
|
+ backgroundColor: item.color,
|
|
|
+ borderColor: item.color !== '#fff' ? item.color : '#222',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-icon
|
|
|
+ v-if="item.num != 0"
|
|
|
+ :size="16"
|
|
|
+ :color="'#fff' || item.color"
|
|
|
+ ><Check
|
|
|
+ /></el-icon>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ text-align: center;
|
|
|
+ font-size: 14px;
|
|
|
+ padding-left: 3px;
|
|
|
+ display: inline-block;
|
|
|
+ width: calc(100% - 16px);
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <p v-text="item.text" style="line-height: 1.5em"></p>
|
|
|
+ <p v-text="geterrNum(i)" style="line-height: 1.5em"></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
// 校阅
|
|
|
-import { ref } from 'vue';
|
|
|
-// import { checkContent } from '@/api/aleditor.js';
|
|
|
+import { ref, defineProps, defineExpose } from 'vue';
|
|
|
+import { checkContent } from '@/api/aleditor.js';
|
|
|
import { image_base64 } from './data';
|
|
|
import jy from '@/assets/img/jy.png';
|
|
|
-const is_status = ref('show');
|
|
|
-// const props = defineProps({
|
|
|
-// headTitle: String,
|
|
|
-// html: Function,
|
|
|
-// text: Function,
|
|
|
-// });
|
|
|
-const list = ref([]);
|
|
|
+const is_status = ref('none');
|
|
|
+const props = defineProps({
|
|
|
+ headTitle: String,
|
|
|
+ html: Function,
|
|
|
+ text: Function,
|
|
|
+});
|
|
|
+let li = [];
|
|
|
+let select = ref(0);
|
|
|
const err_text = ref([
|
|
|
- {
|
|
|
- text: '所有提示',
|
|
|
- sub_text: '',
|
|
|
- color: '#ff7a7a'
|
|
|
- },
|
|
|
- {
|
|
|
- text: '字词错误',
|
|
|
- sub_text: '',
|
|
|
- color: '#ff7a7a'
|
|
|
- },
|
|
|
- {
|
|
|
- text: '标点错误',
|
|
|
- sub_text: '',
|
|
|
- color: '#aaaaaa'
|
|
|
- },
|
|
|
- {
|
|
|
- text: '语序问题',
|
|
|
- sub_text: '·建议交换为',
|
|
|
- color: '#977aff'
|
|
|
- },
|
|
|
- {
|
|
|
- text: '语法问题',
|
|
|
- sub_text: '',
|
|
|
- color: '#ee6bbb'
|
|
|
- },
|
|
|
- {
|
|
|
- text: '敏感词',
|
|
|
- sub_text: '',
|
|
|
- color: '#636363'
|
|
|
- },
|
|
|
-])
|
|
|
+ {
|
|
|
+ text: '所有提示',
|
|
|
+ sub_text: '',
|
|
|
+ color: '#fff',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '字词错误',
|
|
|
+ sub_text: '',
|
|
|
+ color: '#ff7a7a',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '标点错误',
|
|
|
+ sub_text: '',
|
|
|
+ color: '#aaaaaa',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '语序问题',
|
|
|
+ sub_text: '·建议交换为',
|
|
|
+ color: '#977aff',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '语法问题',
|
|
|
+ sub_text: '',
|
|
|
+ color: '#ee6bbb',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '敏感词',
|
|
|
+ sub_text: '',
|
|
|
+ color: '#636363',
|
|
|
+ },
|
|
|
+]);
|
|
|
+const geterrNum = i => {
|
|
|
+ let n = 0;
|
|
|
+ for (let o = 0; o < li.length; o++) {
|
|
|
+ const v = li[o];
|
|
|
+ v.errorType === i && n++;
|
|
|
+ }
|
|
|
+ return n;
|
|
|
+};
|
|
|
+
|
|
|
+const selectList = i => {
|
|
|
+ const index = !i && i !== 0 ? select.value : i;
|
|
|
+ select.value = index;
|
|
|
+ let l = [];
|
|
|
+ for (let o = 0; o < li.length; o++) {
|
|
|
+ if (index === 0) l.push(li[o]);
|
|
|
+ else if (li[o].errorType === index) l.push(li[o]);
|
|
|
+ }
|
|
|
+ return l;
|
|
|
+};
|
|
|
|
|
|
const jiaoyue = () => {
|
|
|
is_status.value = 'load';
|
|
|
-// checkContent({
|
|
|
-// data: {
|
|
|
-// content: props.html(),
|
|
|
-// contentText: props.text(),
|
|
|
-// docId: localStorage.getItem('fileId') || undefined,
|
|
|
-// generationInfo: null,
|
|
|
-// shouldGenerate: false,
|
|
|
-// },
|
|
|
-// noload: true,
|
|
|
-// })
|
|
|
-// .then(r => {
|
|
|
- let r = {
|
|
|
- errCode: 0,
|
|
|
- errMsg: '',
|
|
|
- data: {
|
|
|
- sid: null,
|
|
|
- domain: null,
|
|
|
- result: null,
|
|
|
- },
|
|
|
- docId: '8347703226129424384',
|
|
|
- paragraphUnitEntity: {
|
|
|
- paragraphUnitId: '8347703226146201600',
|
|
|
- updateTime: '2023-05-19T00:55:55.206+00:00',
|
|
|
- paragraphMd5: null,
|
|
|
- formatting: null,
|
|
|
- segmentIndex: 1,
|
|
|
- docId: '8347703226129424384',
|
|
|
- source: '',
|
|
|
- target: '<p>饭吃了没;有</p><p> </p>',
|
|
|
- targetFromMemory: null,
|
|
|
- memoryLibraryItemId: null,
|
|
|
- ensure: null,
|
|
|
- marked: null,
|
|
|
- sharedStringId: null,
|
|
|
- hide: 0,
|
|
|
- confirmUsers: null,
|
|
|
- savedCounter: 1,
|
|
|
- operateUserId: null,
|
|
|
- sortIndex: 1,
|
|
|
- words: '["饭","吃","了","没",";","有"]',
|
|
|
- tags: '["n","v","y","v","wf","vyou"]',
|
|
|
- lastCheckTextContent: '饭吃了没;有\n ',
|
|
|
- newestTextContent: '饭吃了没;有\n ',
|
|
|
- entityId: '8347703226146201600',
|
|
|
- },
|
|
|
- saveStatus: null,
|
|
|
- alerts: [
|
|
|
- {
|
|
|
- id: '8347725246119264256',
|
|
|
- updateTime: '2023-05-19T02:23:25.176+00:00',
|
|
|
- docId: '8347703226129424384',
|
|
|
- alertType: 4,
|
|
|
- alertMessage:
|
|
|
- '<div class="des_div"><p class="des_p">建议用“<b>没有;</b>”替换“<b>没;有</b>”。</p></div>',
|
|
|
- sourceText: '没;有',
|
|
|
- replaceText: '没有;',
|
|
|
- start: 3,
|
|
|
- end: 5,
|
|
|
- errorType: 3,
|
|
|
- explanation: null,
|
|
|
- sourceInZdic: false,
|
|
|
- checkType: 0,
|
|
|
- errorSourceType: 0,
|
|
|
- permissionTags: '["0","1"]',
|
|
|
- subTitle: null,
|
|
|
- advancedTip: false,
|
|
|
- paid: false,
|
|
|
- },
|
|
|
- ],
|
|
|
- checkFinished: true,
|
|
|
- docWordCountLimitExceed: false,
|
|
|
- dayCheckLimitExceed: false,
|
|
|
- todayCheckWordCount: 29,
|
|
|
- readability: 0.23,
|
|
|
- totalWord: 6,
|
|
|
- teamActive: false,
|
|
|
- checkEachLimit: '30000',
|
|
|
- checkDailyLimit: '8000',
|
|
|
- dayTeamCheckLimitExceed: false,
|
|
|
- teamTotalCheckLimitExceed: false,
|
|
|
- product: {
|
|
|
- id: 1,
|
|
|
- productType: 0,
|
|
|
- recommend: 0,
|
|
|
- productDesc: '立即体验智能纠错',
|
|
|
- originPriceYear: 0,
|
|
|
- priceYear: 0,
|
|
|
- status: 0,
|
|
|
- duration: null,
|
|
|
- originPriceMonth: null,
|
|
|
- originPriceHalfYear: null,
|
|
|
- originPriceSeason: null,
|
|
|
- priceMonth: null,
|
|
|
- productId: null,
|
|
|
- productName: '免费版',
|
|
|
- monthProductId: null,
|
|
|
- singleMonthProductId: null,
|
|
|
- seasonProductId: null,
|
|
|
- halfYearProductId: null,
|
|
|
- checkEachLimit: 30000,
|
|
|
- checkDailyLimit: 8000,
|
|
|
- translationEachLimit: 2000,
|
|
|
- translationDailyLimit: 2000,
|
|
|
- rewriteEachLimit: 4000,
|
|
|
- rewriteDailyLimit: 8000,
|
|
|
- textToSpeechEachLimit: 1000,
|
|
|
- textToSpeechDailyLimit: 1000,
|
|
|
- advancedRewriteLimit: null,
|
|
|
- generateWordCountMonthLimit: null,
|
|
|
- generateWordCountTotalLimit: null,
|
|
|
- generateWordTimesDailyLimit: null,
|
|
|
- dialogDailyLimit: null,
|
|
|
- },
|
|
|
- superUser: false,
|
|
|
- tooFarFromUpdateTime: true,
|
|
|
- };
|
|
|
+ checkContent({
|
|
|
+ data: {
|
|
|
+ content: props.html(),
|
|
|
+ contentText: props.text(),
|
|
|
+ docId: localStorage.getItem('fileId') || undefined,
|
|
|
+ generationInfo: null,
|
|
|
+ shouldGenerate: false,
|
|
|
+ },
|
|
|
+ noload: true,
|
|
|
+ })
|
|
|
+ .then(r => {
|
|
|
if (r.errCode !== 0) return;
|
|
|
console.log(r);
|
|
|
- list.value = r.alerts || [];
|
|
|
- is_status.value = list.value.length ? 'show' : 'none';
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // is_status.value = 'none';
|
|
|
- // });
|
|
|
+ li = r.alerts || [];
|
|
|
+ is_status.value = li.length ? 'show' : 'none';
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ is_status.value = 'none';
|
|
|
+ });
|
|
|
};
|
|
|
jiaoyue();
|
|
|
+defineExpose({
|
|
|
+ jiaoyue
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
@@ -374,4 +330,18 @@ ul > li {
|
|
|
text-overflow: ellipsis;
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
+
|
|
|
+.read {
|
|
|
+ display: inline-block;
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ line-height: 16px;
|
|
|
+ text-align: center;
|
|
|
+ border: 1px solid #fff;
|
|
|
+ border-radius: 50%;
|
|
|
+ font-size: 0;
|
|
|
+}
|
|
|
+.item {
|
|
|
+ margin-bottom: 1em;
|
|
|
+}
|
|
|
</style>
|