Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bd33c200
authored
Aug 03, 2023
by
怪兽?别跑
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
敏感词编辑bug修复
1 parent
eee108da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
208 additions
and
201 deletions
vue3-lw-pc/src/views/conversation/security/setSensitiveWord.vue
vue3-lw-pc/src/views/conversation/security/setSensitiveWord.vue
View file @
bd33c20
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
class=
"add-sensitive-word"
>
<div
class=
"add-sensitive-word"
>
<div
class=
"g-card"
>
<div
class=
"g-card"
>
<div
class=
"mid-action"
>
<div
class=
"mid-action"
>
<el-input
v-model=
"form.patternWords"
placeholder=
"搜索关键词"
style=
"width: 300px"
>
<el-input
v-model=
"form.patternWords"
placeholder=
"搜索关键词"
style=
"width: 300px
;
"
>
<template
#
append
><el-button
icon=
"el-icon-search"
@
click=
"getSettingList"
></el-button></
template
>
<template
#
append
><el-button
icon=
"el-icon-search"
@
click=
"getSettingList"
></el-button></
template
>
</el-input>
</el-input>
<el-button
type=
"primary"
class=
"add-btn"
@
click=
"addSensitive"
>
添加敏感词
</el-button>
<el-button
type=
"primary"
class=
"add-btn"
@
click=
"addSensitive"
>
添加敏感词
</el-button>
...
@@ -27,7 +27,8 @@
...
@@ -27,7 +27,8 @@
v-model=
"scope.row.alertFlag"
v-model=
"scope.row.alertFlag"
:active-value=
"1"
:active-value=
"1"
:inactive-value=
"0"
:inactive-value=
"0"
@
change=
"handleStatusChange(scope.row)"
></el-switch>
@
change=
"handleStatusChange(scope.row)"
></el-switch>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
>
<el-table-column
label=
"操作"
>
...
@@ -42,7 +43,8 @@
...
@@ -42,7 +43,8 @@
:total=
"total"
:total=
"total"
v-model:page=
"query.pageNum"
v-model:page=
"query.pageNum"
v-model:limit=
"query.pageSize"
v-model:limit=
"query.pageSize"
@
pagination=
"getSettingList()"
/>
@
pagination=
"getSettingList()"
/>
</div>
</div>
<!-- 添加敏感词 -->
<!-- 添加敏感词 -->
...
@@ -56,7 +58,7 @@
...
@@ -56,7 +58,7 @@
<div
class=
"sub-title"
>
匹配词间用逗号隔开
</div>
<div
class=
"sub-title"
>
匹配词间用逗号隔开
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"审计范围"
:error=
"rangeErrorMsg"
>
<el-form-item
label=
"审计范围"
:error=
"rangeErrorMsg"
>
<div
class=
"tag-input"
style=
"width: auto"
@
click=
"openAuditUserRange"
>
<div
class=
"tag-input"
style=
"width: auto
;
"
@
click=
"openAuditUserRange"
>
<span
class=
"tag-place"
v-if=
"!auditUserRange.length"
>
<span
class=
"tag-place"
v-if=
"!auditUserRange.length"
>
请选择
请选择
<span
class=
"prompt-title"
>
若不选择,则默认全体成员
</span>
<span
class=
"prompt-title"
>
若不选择,则默认全体成员
</span>
...
@@ -67,7 +69,7 @@
...
@@ -67,7 +69,7 @@
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"审计人"
:required=
"true"
:error=
"errorMsg"
>
<el-form-item
label=
"审计人"
:required=
"true"
:error=
"errorMsg"
>
<div
class=
"tag-input"
style=
"width: auto"
@
click=
"openAuditUser"
>
<div
class=
"tag-input"
style=
"width: auto
;
"
@
click=
"openAuditUser"
>
<span
class=
"tag-place"
v-if=
"!auditUser.length"
>
<span
class=
"tag-place"
v-if=
"!auditUser.length"
>
请选择
请选择
<span
class=
"prompt-title"
>
请选择部门负责人
</span>
<span
class=
"prompt-title"
>
请选择部门负责人
</span>
...
@@ -95,218 +97,223 @@
...
@@ -95,218 +97,223 @@
v-model:visible=
"dialogVisibleSelectAuditUser"
v-model:visible=
"dialogVisibleSelectAuditUser"
title=
"选择添加人"
title=
"选择添加人"
isSigleSelect
isSigleSelect
@
success=
"selectedAuditUser"
></SelectUser>
@
success=
"selectedAuditUser"
></SelectUser>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
*
as
sensitiveApis
from
'@/api/conversation/security'
import
*
as
sensitiveApis
from
'@/api/conversation/security'
export
default
{
export
default
{
components
:
{},
components
:
{},
data
()
{
data
()
{
return
{
return
{
form
:
{
form
:
{
pageSize
:
10
,
pageSize
:
10
,
pageNum
:
1
,
pageNum
:
1
,
patternWords
:
''
,
// 关键词
patternWords
:
''
// 关键词
},
},
addForm
:
{
addForm
:
{
strategyName
:
''
,
// 策略名称
strategyName
:
''
,
// 策略名称
patternWords
:
''
,
// 匹配词
patternWords
:
''
// 匹配词
},
},
alertFlag
:
0
,
// 消息通知
alertFlag
:
0
,
// 消息通知
tableData
:
[],
// 敏感词列表
tableData
:
[],
// 敏感词列表
errorMsg
:
''
,
// 审计人错误提示
errorMsg
:
''
,
// 审计人错误提示
rangeErrorMsg
:
''
,
// 审计范围错误提示
rangeErrorMsg
:
''
,
// 审计范围错误提示
query
:
{
query
:
{
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
,
pageSize
:
10
},
},
auditUserRange
:
[],
// 审计范围
auditUserRange
:
[],
// 审计范围
auditUser
:
[],
// 审计人
auditUser
:
[],
// 审计人
total
:
0
,
total
:
0
,
dialogVisibleSelectUser
:
false
,
// 是否显示审计范围
dialogVisibleSelectUser
:
false
,
// 是否显示审计范围
dialogVisibleSelectAuditUser
:
false
,
// 是否显示审计人
dialogVisibleSelectAuditUser
:
false
,
// 是否显示审计人
open
:
false
,
// 是否显示添加敏感词弹框
open
:
false
,
// 是否显示添加敏感词弹框
submitFlag
:
''
,
// 添加或者修改
submitFlag
:
''
,
// 添加或者修改
rowId
:
''
,
// 修改的数据id
rowId
:
''
,
// 修改的数据id
rules
:
{
rules
:
{
strategyName
:
[{
required
:
true
,
message
:
'敏感词策略不能为空'
,
trigger
:
'blur'
}],
strategyName
:
[{
required
:
true
,
message
:
'敏感词策略不能为空'
,
trigger
:
'blur'
}],
patternWords
:
[{
required
:
true
,
message
:
'匹配词不能为空'
,
trigger
:
'blur'
}],
patternWords
:
[{
required
:
true
,
message
:
'匹配词不能为空'
,
trigger
:
'blur'
}]
},
}
},
mounted
()
{
this
.
getSettingList
()
},
methods
:
{
// 获取敏感词设置列表
getSettingList
()
{
this
.
form
.
pageSize
=
this
.
query
.
pageSize
this
.
form
.
pageNum
=
this
.
query
.
pageNum
sensitiveApis
.
getSettingSensitiveList
(
this
.
form
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
tableData
=
res
.
rows
this
.
total
=
Number
(
res
.
total
)
}
}
}
)
}
},
},
// 提交敏感词表单
mounted
()
{
addSensitiveForm
()
{
this
.
getSettingList
()
// console.log(this.auditUser)
},
this
.
$refs
.
addForm
.
validate
((
valid
)
=>
{
methods
:
{
if
(
valid
)
{
// 获取敏感词设置列表
// if (this.auditUserRange.length === 0) {
getSettingList
()
{
// this.rangeErrorMsg = '请选择审计范围'
this
.
form
.
pageSize
=
this
.
query
.
pageSize
// return
this
.
form
.
pageNum
=
this
.
query
.
pageNum
// } else {
sensitiveApis
.
getSettingSensitiveList
(
this
.
form
).
then
((
res
)
=>
{
// this.rangeErrorMsg = ''
if
(
res
.
code
===
200
)
{
// }
this
.
tableData
=
res
.
rows
if
(
this
.
auditUser
.
length
===
0
)
{
this
.
total
=
Number
(
res
.
total
)
this
.
errorMsg
=
'请选择审计人'
return
}
else
{
this
.
rangeErrorMsg
=
''
}
}
const
params
=
this
.
addForm
})
if
(
this
.
auditUserRange
.
length
)
{
},
let
auditUserScope
=
[]
// 提交敏感词表单
const
obj
=
{
addSensitiveForm
()
{
scopeType
:
2
,
// this.auditUserRange.map((d) => d.department) + '',
// console.log(this.auditUser)
auditScopeId
:
this
.
auditUserRange
.
map
((
d
)
=>
d
.
userId
)
+
''
,
this
.
$refs
.
addForm
.
validate
((
valid
)
=>
{
auditScopeName
:
this
.
auditUserRange
.
map
((
d
)
=>
d
.
name
)
+
''
,
if
(
valid
)
{
// if (this.auditUserRange.length === 0) {
// this.rangeErrorMsg = '请选择审计范围'
// return
// } else {
// this.rangeErrorMsg = ''
// }
if
(
this
.
auditUser
.
length
===
0
)
{
this
.
errorMsg
=
'请选择审计人'
return
}
else
{
this
.
rangeErrorMsg
=
''
}
}
auditUserScope
.
push
(
obj
)
const
params
=
this
.
addForm
params
.
auditUserScope
=
auditUserScope
if
(
this
.
auditUserRange
.
length
)
{
}
else
{
let
auditUserScope
=
[]
params
.
auditUserScope
=
[]
const
obj
=
{
}
scopeType
:
2
,
// this.auditUserRange.map((d) => d.department) + '',
params
.
auditUserId
=
this
.
auditUser
.
map
((
d
)
=>
d
.
userId
)
+
''
auditScopeId
:
this
.
auditUserRange
.
map
((
d
)
=>
d
.
userId
)
+
''
,
params
.
auditUserName
=
this
.
auditUser
.
map
((
d
)
=>
d
.
name
)
+
''
auditScopeName
:
this
.
auditUserRange
.
map
((
d
)
=>
d
.
name
)
+
''
params
.
alertFlag
=
this
.
alertFlag
if
(
this
.
submitFlag
===
'add'
)
{
sensitiveApis
.
addSettingSensitive
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
open
=
false
this
.
getSettingList
()
}
}
})
auditUserScope
.
push
(
obj
)
params
.
auditUserScope
=
auditUserScope
}
else
{
params
.
auditUserScope
=
[]
}
params
.
auditUserId
=
this
.
auditUser
.
map
((
d
)
=>
d
.
userId
)
+
''
params
.
auditUserName
=
this
.
auditUser
.
map
((
d
)
=>
d
.
name
)
+
''
params
.
alertFlag
=
this
.
alertFlag
if
(
this
.
submitFlag
===
'add'
)
{
sensitiveApis
.
addSettingSensitive
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
open
=
false
this
.
getSettingList
()
}
})
}
if
(
this
.
submitFlag
===
'modify'
)
{
params
.
id
=
this
.
rowId
sensitiveApis
.
modifySettingSensitive
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
open
=
false
this
.
getSettingList
()
}
})
}
}
}
if
(
this
.
submitFlag
===
'modify'
)
{
})
params
.
id
=
this
.
rowId
},
sensitiveApis
.
modifySettingSensitive
(
params
).
then
((
res
)
=>
{
// 打开审计范围
if
(
res
.
code
===
200
)
{
openAuditUserRange
()
{
this
.
open
=
false
this
.
dialogVisibleSelectUser
=
true
this
.
getSettingList
()
},
// 打开审计人
openAuditUser
()
{
this
.
dialogVisibleSelectAuditUser
=
true
},
resetForm
()
{
this
.
addForm
=
{
strategyName
:
''
,
patternWords
:
''
}
this
.
auditUserRange
=
[]
// 审计范围
this
.
auditUser
=
[]
this
.
alertFlag
=
0
this
.
errorMsg
=
''
},
// 添加敏感词
addSensitive
()
{
this
.
submitFlag
=
'add'
this
.
resetForm
()
this
.
open
=
true
},
selectedUser
(
list
)
{
// console.log(list)
this
.
auditUserRange
=
list
// this.form.scopeType = list.map(d => d.department) + ""
// this.form.auditScopeId = list.map(d => d.userId) + ""
},
selectedAuditUser
(
list
)
{
this
.
auditUser
=
list
},
// 修改敏感词
handleUpdate
(
row
)
{
console
.
log
(
row
)
this
.
submitFlag
=
'modify'
this
.
errorMsg
=
''
this
.
rowId
=
row
.
id
sensitiveApis
.
getSensitiveDetails
(
this
.
rowId
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
addForm
.
strategyName
=
res
.
data
.
strategyName
this
.
addForm
.
patternWords
=
res
.
data
.
patternWords
this
.
auditUser
=
[
{
name
:
res
.
data
.
auditUserName
,
userId
:
res
.
data
.
auditUserId
}
}
})
]
if
(
res
.
data
.
auditUserScope
.
length
)
{
this
.
auditUserRange
=
[
{
name
:
res
.
data
.
auditUserScope
[
0
].
auditScopeName
,
userId
:
res
.
data
.
auditUserScope
[
0
].
auditScopeId
,
department
:
res
.
data
.
auditUserScope
[
0
].
scopeType
}
]
}
else
{
this
.
auditUserRange
=
[]
}
this
.
alertFlag
=
res
.
data
.
alertFlag
}
}
}
})
})
this
.
open
=
true
},
},
// 打开审计范围
// 删除敏感词
openAuditUserRange
()
{
handleDelete
(
row
)
{
this
.
dialogVisibleSelectUser
=
true
this
.
$confirm
(
'是否确认删除吗?'
,
'警告'
,
{
},
confirmButtonText
:
'确定'
,
// 打开审计人
cancelButtonText
:
'取消'
,
openAuditUser
()
{
type
:
'warning'
,
this
.
dialogVisibleSelectAuditUser
=
true
confirmButtonText
:
'确定'
,
},
cancelButtonText
:
'取消'
resetForm
()
{
}).
then
(()
=>
{
this
.
addForm
=
{
return
sensitiveApis
.
deleteSensitive
(
row
.
id
).
then
((
res
)
=>
{
strategyName
:
''
,
if
(
res
.
code
===
200
)
{
patternWords
:
''
,
this
.
msgSuccess
(
'删除成功'
)
}
this
.
getSettingList
()
this
.
auditUserRange
=
[]
// 审计范围
}
this
.
auditUser
=
[]
})
this
.
alertFlag
=
0
})
this
.
errorMsg
=
''
},
},
handleStatusChange
(
row
)
{
// 添加敏感词
sensitiveApis
.
modifySettingSensitive
(
row
).
then
((
res
)
=>
{
addSensitive
()
{
this
.
submitFlag
=
'add'
this
.
resetForm
()
this
.
open
=
true
},
selectedUser
(
list
)
{
// console.log(list)
this
.
auditUserRange
=
list
// this.form.scopeType = list.map(d => d.department) + ""
// this.form.auditScopeId = list.map(d => d.userId) + ""
},
selectedAuditUser
(
list
)
{
this
.
auditUser
=
list
},
// 修改敏感词
handleUpdate
(
row
)
{
console
.
log
(
row
)
this
.
submitFlag
=
'modify'
this
.
errorMsg
=
''
this
.
rowId
=
row
.
id
sensitiveApis
.
getSensitiveDetails
(
this
.
rowId
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
addForm
.
strategyName
=
res
.
data
.
strategyName
this
.
addForm
.
patternWords
=
res
.
data
.
patternWords
this
.
auditUser
=
[
{
name
:
res
.
data
.
auditUserName
,
userId
:
res
.
data
.
auditUserId
,
},
]
this
.
auditUserRange
=
[
{
name
:
res
.
data
.
auditUserScope
[
0
].
auditScopeName
,
userId
:
res
.
data
.
auditUserScope
[
0
].
auditScopeId
,
department
:
res
.
data
.
auditUserScope
[
0
].
scopeType
,
},
]
this
.
alertFlag
=
res
.
data
.
alertFlag
}
})
this
.
open
=
true
},
// 删除敏感词
handleDelete
(
row
)
{
this
.
$confirm
(
'是否确认删除吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}).
then
(()
=>
{
return
sensitiveApis
.
deleteSensitive
(
row
.
id
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
this
.
msgSuccess
(
'
删除
成功'
)
this
.
msgSuccess
(
'
操作
成功'
)
this
.
getSettingList
()
this
.
getSettingList
()
}
}
})
})
})
}
},
}
handleStatusChange
(
row
)
{
}
sensitiveApis
.
modifySettingSensitive
(
row
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
msgSuccess
(
'操作成功'
)
this
.
getSettingList
()
}
})
},
},
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.content
{
.content
{
margin-top
:
15px
;
margin-top
:
15px
;
padding
:
10px
;
padding
:
10px
;
}
}
.prompt-title
{
.prompt-title
{
margin-left
:
10px
;
margin-left
:
10px
;
color
:
var
(
--font-black-6
);
color
:
var
(
--font-black-6
);
}
}
.tag-place
{
.tag-place
{
color
:
var
(
--color
);
color
:
var
(
--color
);
}
}
.sub-title
{
.sub-title
{
font-size
:
13px
;
font-size
:
13px
;
color
:
var
(
--font-black-6
);
color
:
var
(
--font-black-6
);
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment