Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mingchiuli committed Dec 22, 2024
1 parent edec73c commit b580157
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 5 additions & 8 deletions src/components/sys/EditorItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ onMounted(() => {
})
const selectWord = (row: SensitiveContentItem) => {
console.log(row)
const sensitive: SensitiveTrans = {
startIndex: row.startIndex,
endIndex: row.endIndex,
Expand All @@ -114,8 +113,7 @@ const findAllOccurrences = (text: string, pattern: string) => {
occurrences.push({
startIndex: match.index,
endIndex: match.index + match[0].length,
type: SensitiveType.CONTENT,
content: match[0]
content: `<span style="color:red">${match[0]}</span>`
})
}
Expand All @@ -131,12 +129,11 @@ const onUploadImg = async (files: File[], callback: Function) => {
</script>

<template>
<el-dialog v-model="showSensitiveListDialog" title="Sensitive List" width="500">
<el-dialog v-model="showSensitiveListDialog" title="选择一个词汇" width="500">
<el-table :data="selectSensitiveData" @row-click="selectWord" border stripe>
<el-table-column property="startIndex" label="StartIndex" />
<el-table-column property="endIndex" label="EndIndex" />
<el-table-column property="type" label="Type" />
<el-table-column property="content" label="Content" width="200"/>
<el-table-column property="startIndex" label="开始位置" />
<el-table-column property="endIndex" label="结束位置" />
<el-table-column property="content" label="内容" width="200"/>
</el-table>
</el-dialog>

Expand Down
4 changes: 3 additions & 1 deletion src/type/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ export interface SensitiveItem {
type: SensitiveType
}

export interface SensitiveContentItem extends SensitiveItem {
export interface SensitiveContentItem {
startIndex: number
endIndex: number
content: string
}

Expand Down

0 comments on commit b580157

Please sign in to comment.