review.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <div class="review" v-if="is_status !== 'show'">
  3. <el-image style="width: 310px; height: 232.5px" :src="jy" fit="fill" />
  4. <template v-if="is_status === 'none'">
  5. <div class="none_title">检查完毕,一切都好</div>
  6. <ul>
  7. <li>实时分析文本内容进行校阅</li>
  8. <li>鼠标划选句子进行风格改写,提供写作新思路</li>
  9. </ul>
  10. </template>
  11. <template v-if="is_status === 'load'">
  12. <div class="checking_tip_text">
  13. 为您检查中
  14. <div class="dot-flashing"></div>
  15. </div>
  16. </template>
  17. </div>
  18. <template v-if="is_status === 'show'">
  19. <div class="show">
  20. <div class="left">
  21. <el-card v-for="(item, i) in list" :key="i">
  22. <p
  23. class="list"
  24. style="font-size: 12px; font-weight: 400; color: #888"
  25. >
  26. {{ err_text[item.errorType].text }}
  27. {{ err_text[item.errorType].sub_text }}
  28. </p>
  29. <p class="list">
  30. <span v-text="item.sourceText"></span>
  31. <span
  32. class="alert-go-right"
  33. v-if="item.replaceText"
  34. :style="{ backgroundImage: 'url(' + image_base64.right + ')' }"
  35. ></span>
  36. <span v-if="item.replaceText" class="replaceText" v-text="item.replaceText"></span>
  37. </p>
  38. <div class="list" v-html="item.alertMessage"></div>
  39. </el-card>
  40. </div>
  41. <div class="right">2</div>
  42. </div>
  43. </template>
  44. </template>
  45. <script setup>
  46. // 校阅
  47. import { ref } from 'vue';
  48. // import { checkContent } from '@/api/aleditor.js';
  49. import { image_base64 } from './data';
  50. import jy from '@/assets/img/jy.png';
  51. const is_status = ref('show');
  52. // const props = defineProps({
  53. // headTitle: String,
  54. // html: Function,
  55. // text: Function,
  56. // });
  57. const list = ref([]);
  58. const err_text = ref([
  59. {
  60. text: '所有提示',
  61. sub_text: '',
  62. color: '#ff7a7a'
  63. },
  64. {
  65. text: '字词错误',
  66. sub_text: '',
  67. color: '#ff7a7a'
  68. },
  69. {
  70. text: '标点错误',
  71. sub_text: '',
  72. color: '#aaaaaa'
  73. },
  74. {
  75. text: '语序问题',
  76. sub_text: '·建议交换为',
  77. color: '#977aff'
  78. },
  79. {
  80. text: '语法问题',
  81. sub_text: '',
  82. color: '#ee6bbb'
  83. },
  84. {
  85. text: '敏感词',
  86. sub_text: '',
  87. color: '#636363'
  88. },
  89. ])
  90. const jiaoyue = () => {
  91. is_status.value = 'load';
  92. // checkContent({
  93. // data: {
  94. // content: props.html(),
  95. // contentText: props.text(),
  96. // docId: localStorage.getItem('fileId') || undefined,
  97. // generationInfo: null,
  98. // shouldGenerate: false,
  99. // },
  100. // noload: true,
  101. // })
  102. // .then(r => {
  103. let r = {
  104. errCode: 0,
  105. errMsg: '',
  106. data: {
  107. sid: null,
  108. domain: null,
  109. result: null,
  110. },
  111. docId: '8347703226129424384',
  112. paragraphUnitEntity: {
  113. paragraphUnitId: '8347703226146201600',
  114. updateTime: '2023-05-19T00:55:55.206+00:00',
  115. paragraphMd5: null,
  116. formatting: null,
  117. segmentIndex: 1,
  118. docId: '8347703226129424384',
  119. source: '',
  120. target: '<p>饭吃了没;有</p><p> </p>',
  121. targetFromMemory: null,
  122. memoryLibraryItemId: null,
  123. ensure: null,
  124. marked: null,
  125. sharedStringId: null,
  126. hide: 0,
  127. confirmUsers: null,
  128. savedCounter: 1,
  129. operateUserId: null,
  130. sortIndex: 1,
  131. words: '["饭","吃","了","没",";","有"]',
  132. tags: '["n","v","y","v","wf","vyou"]',
  133. lastCheckTextContent: '饭吃了没;有\n ',
  134. newestTextContent: '饭吃了没;有\n ',
  135. entityId: '8347703226146201600',
  136. },
  137. saveStatus: null,
  138. alerts: [
  139. {
  140. id: '8347725246119264256',
  141. updateTime: '2023-05-19T02:23:25.176+00:00',
  142. docId: '8347703226129424384',
  143. alertType: 4,
  144. alertMessage:
  145. '<div class="des_div"><p class="des_p">建议用“<b>没有;</b>”替换“<b>没;有</b>”。</p></div>',
  146. sourceText: '没;有',
  147. replaceText: '没有;',
  148. start: 3,
  149. end: 5,
  150. errorType: 3,
  151. explanation: null,
  152. sourceInZdic: false,
  153. checkType: 0,
  154. errorSourceType: 0,
  155. permissionTags: '["0","1"]',
  156. subTitle: null,
  157. advancedTip: false,
  158. paid: false,
  159. },
  160. ],
  161. checkFinished: true,
  162. docWordCountLimitExceed: false,
  163. dayCheckLimitExceed: false,
  164. todayCheckWordCount: 29,
  165. readability: 0.23,
  166. totalWord: 6,
  167. teamActive: false,
  168. checkEachLimit: '30000',
  169. checkDailyLimit: '8000',
  170. dayTeamCheckLimitExceed: false,
  171. teamTotalCheckLimitExceed: false,
  172. product: {
  173. id: 1,
  174. productType: 0,
  175. recommend: 0,
  176. productDesc: '立即体验智能纠错',
  177. originPriceYear: 0,
  178. priceYear: 0,
  179. status: 0,
  180. duration: null,
  181. originPriceMonth: null,
  182. originPriceHalfYear: null,
  183. originPriceSeason: null,
  184. priceMonth: null,
  185. productId: null,
  186. productName: '免费版',
  187. monthProductId: null,
  188. singleMonthProductId: null,
  189. seasonProductId: null,
  190. halfYearProductId: null,
  191. checkEachLimit: 30000,
  192. checkDailyLimit: 8000,
  193. translationEachLimit: 2000,
  194. translationDailyLimit: 2000,
  195. rewriteEachLimit: 4000,
  196. rewriteDailyLimit: 8000,
  197. textToSpeechEachLimit: 1000,
  198. textToSpeechDailyLimit: 1000,
  199. advancedRewriteLimit: null,
  200. generateWordCountMonthLimit: null,
  201. generateWordCountTotalLimit: null,
  202. generateWordTimesDailyLimit: null,
  203. dialogDailyLimit: null,
  204. },
  205. superUser: false,
  206. tooFarFromUpdateTime: true,
  207. };
  208. if (r.errCode !== 0) return;
  209. console.log(r);
  210. list.value = r.alerts || [];
  211. is_status.value = list.value.length ? 'show' : 'none';
  212. // })
  213. // .catch(() => {
  214. // is_status.value = 'none';
  215. // });
  216. };
  217. jiaoyue();
  218. </script>
  219. <style scoped>
  220. .review {
  221. width: 310px;
  222. margin: 0 auto;
  223. }
  224. .none_title {
  225. font-size: 24px;
  226. text-align: left;
  227. font-weight: 700;
  228. margin-bottom: 16px;
  229. margin-left: 11.3%;
  230. }
  231. ul {
  232. margin-left: 20px;
  233. }
  234. ul > li {
  235. font-size: 14px;
  236. color: #2c3e50;
  237. margin-bottom: 16px;
  238. }
  239. .checking_tip_text {
  240. font-weight: 400;
  241. font-size: 16px;
  242. line-height: 24px;
  243. display: -webkit-box;
  244. display: -ms-flexbox;
  245. display: flex;
  246. -webkit-box-orient: horizontal;
  247. -webkit-box-direction: normal;
  248. -ms-flex-direction: row;
  249. flex-direction: row;
  250. -webkit-box-pack: center;
  251. -ms-flex-pack: center;
  252. justify-content: center;
  253. -webkit-box-align: center;
  254. -ms-flex-align: center;
  255. align-items: center;
  256. margin-left: -38px;
  257. margin-top: -26px;
  258. }
  259. .dot-flashing {
  260. margin-left: 22px;
  261. margin-top: 3px;
  262. position: relative;
  263. width: 8px;
  264. height: 8px;
  265. border-radius: 50%;
  266. background-color: #2d2d2d;
  267. color: #2d2d2d;
  268. -webkit-animation: dot-flashing-0833031b 0.6s linear infinite alternate;
  269. animation: dot-flashing-0833031b 0.6s linear infinite alternate;
  270. -webkit-animation-delay: 0.3s;
  271. animation-delay: 0.3s;
  272. }
  273. .dot-flashing:after,
  274. .dot-flashing:before {
  275. content: '';
  276. display: inline-block;
  277. position: absolute;
  278. top: 0;
  279. }
  280. .dot-flashing:before {
  281. left: -14px;
  282. width: 8px;
  283. height: 8px;
  284. border-radius: 50%;
  285. background-color: #2d2d2d;
  286. color: #2d2d2d;
  287. -webkit-animation: dot-flashing-0833031b 0.6s infinite alternate;
  288. animation: dot-flashing-0833031b 0.6s infinite alternate;
  289. -webkit-animation-delay: 0s;
  290. animation-delay: 0s;
  291. }
  292. .dot-flashing:after {
  293. left: 14px;
  294. width: 8px;
  295. height: 8px;
  296. border-radius: 50%;
  297. background-color: #2d2d2d;
  298. color: #2d2d2d;
  299. -webkit-animation: dot-flashing-0833031b 0.6s infinite alternate;
  300. animation: dot-flashing-0833031b 0.6s infinite alternate;
  301. -webkit-animation-delay: 0.6s;
  302. animation-delay: 0.6s;
  303. }
  304. @-webkit-keyframes dot-flashing-0833031b {
  305. 0% {
  306. background-color: #2d2d2d;
  307. }
  308. 50%,
  309. to {
  310. background-color: hsla(0, 0%, 100%, 0.1);
  311. }
  312. }
  313. @keyframes dot-flashing-0833031b {
  314. 0% {
  315. background-color: #2d2d2d;
  316. }
  317. 50%,
  318. to {
  319. background-color: hsla(0, 0%, 100%, 0.1);
  320. }
  321. }
  322. .show .left {
  323. width: 60%;
  324. padding: 0 10px;
  325. display: inline-block;
  326. }
  327. .show .right {
  328. display: inline-block;
  329. }
  330. .list {
  331. font-size: 14px;
  332. font-weight: 400;
  333. height: 32px;
  334. line-height: 32px;
  335. color: #111;
  336. margin-left: 26px;
  337. }
  338. .alert-go-right,
  339. .alert-two-way {
  340. vertical-align: middle;
  341. display: inline-block;
  342. width: 24px;
  343. height: 24px;
  344. background-size: contain;
  345. }
  346. .replaceText {
  347. background: #d9e6ff;
  348. color: #2470ff;
  349. font-size: 14px;
  350. font-weight: 400;
  351. text-align: center;
  352. height: 32px;
  353. line-height: 32px;
  354. padding: 0 8px;
  355. border-radius: 4px;
  356. display: inline-block;
  357. max-width: 150px;
  358. overflow: hidden;
  359. white-space: nowrap;
  360. text-overflow: ellipsis;
  361. vertical-align: middle;
  362. }
  363. </style>