Commit 916bcdb8 by xinla

修改部分问题

1 parent 701ffb91
...@@ -30,10 +30,10 @@ export default { ...@@ -30,10 +30,10 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.app-main { .app-main {
/* 50= navbar 50 */ /* 50= navbar 50 */
min-height: calc(100vh - 50px); // min-height: calc(100vh - 50px);
width: 100%; width: 100%;
position: relative; position: relative;
overflow: hidden; overflow: auto;
background-color: #fff; background-color: #fff;
} }
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
.hasTagsView { .hasTagsView {
.app-main { .app-main {
/* 84 = navbar + tags-view = 50 + 34 */ /* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px); height: calc(100vh - 84px);
} }
.fixed-header + .app-main { .fixed-header + .app-main {
......
/** /**
* 通用css样式布局处理 * 通用css样式布局处理
*/ */
*,
*:before,
*:after {
box-sizing: border-box;
}
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
}
html {
height: 100%;
font-size: 14px;
}
li {
list-style: none;
}
/** 基础通用 **/
.bfc-o {
overflow: hidden;
position: relative;
}
.bfc-d {
display: inline-block;
vertical-align: top;
position: relative;
}
.bfc-p {
position: absolute;
}
.flex {
display: flex;
}
.fxbw {
display: flex;
align-items: flex-start;
justify-content: space-between;
}
ais {
align-items: stretch;
}
.aic {
align-items: center;
}
.fl {
float: left;
position: relative;
}
.fr {
float: right;
position: relative;
}
.al {
text-align: left;
}
.ac {
text-align: center;
}
.ar {
text-align: right;
}
.hide {
display: none;
}
/*top-fixed and bottom-fixed*/
.tf,
.bf {
position: fixed;
width: 100%;
left: 0;
height: 50px;
z-index: 999;
}
.tf {
top: 0;
}
.bf {
bottom: 0;
}
/*mask*/
.mask {
position: fixed;
width: 100%;
height: 100%;
background: rgba(39, 39, 39, 0.76);
left: 0;
bottom: 0;
margin: auto;
z-index: 9;
}
/*center-center*/
.cc {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
overflow: auto;
}
.toe {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cp {
cursor: pointer;
}
.pt5 {
padding-top: 5px;
}
.pr5 {
padding-right: 5px;
}
.pb5 {
padding-bottom: 5px;
}
.mt5 {
margin-top: 5px;
}
.mr5 {
margin-right: 5px;
}
.mb5 {
margin-bottom: 5px;
}
.mb8 {
margin-bottom: 8px;
}
.ml5 {
margin-left: 5px;
}
.mt10 {
margin-top: 10px;
}
.mr10 {
margin-right: 10px;
}
.mb10 {
margin-bottom: 10px;
}
.ml10 {
margin-left: 10px;
}
.mt15 {
margin-top: 15px;
}
.mr15 {
margin-right: 15px;
}
.mb15 {
margin-bottom: 15px;
}
.ml15 {
margin-left: 15px;
}
.mt20 {
margin-top: 20px;
}
.mr20 {
margin-right: 20px;
}
.mb20 {
margin-bottom: 20px;
}
.ml20 {
margin-left: 20px;
}
\ No newline at end of file \ No newline at end of file
*,
*:before,
*:after {
box-sizing: border-box;
}
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
Microsoft YaHei, Arial, sans-serif;
}
html {
height: 100%;
font-size: 14px;
}
li {
list-style: none;
}
/** 基础通用 **/
.bfc-o {
overflow: hidden;
position: relative;
}
.bfc-d {
display: inline-block;
vertical-align: top;
position: relative;
}
.bfc-p {
position: absolute;
}
.flex {
display: flex;
}
.fxbw {
display: flex;
align-items: flex-start;
justify-content: space-between;
}
.ais {
align-items: stretch;
}
.aic {
align-items: center;
}
.fl {
float: left;
position: relative;
}
.fr {
float: right;
position: relative;
}
.al {
text-align: left;
}
.ac {
text-align: center;
}
.ar {
text-align: right;
}
.hide {
display: none;
}
/*top-fixed and bottom-fixed*/
.tf,
.bf {
position: fixed;
width: 100%;
left: 0;
height: 50px;
z-index: 999;
}
.tf {
top: 0;
}
.bf {
bottom: 0;
}
/*mask*/
.mask {
position: fixed;
width: 100%;
height: 100%;
background: rgba(39, 39, 39, 0.76);
left: 0;
bottom: 0;
margin: auto;
z-index: 9;
}
/*center-center*/
.cc {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
overflow: auto;
}
.toe {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cp {
cursor: pointer;
}
.pt5 {
padding-top: 5px;
}
.pr5 {
padding-right: 5px;
}
.pb5 {
padding-bottom: 5px;
}
.mt5 {
margin-top: 5px;
}
.mr5 {
margin-right: 5px;
}
.mb5 {
margin-bottom: 5px;
}
.mb8 {
margin-bottom: 8px;
}
.ml5 {
margin-left: 5px;
}
.mt10 {
margin-top: 10px;
}
.mr10 {
margin-right: 10px;
}
.mb10 {
margin-bottom: 10px;
}
.ml10 {
margin-left: 10px;
}
.mt15 {
margin-top: 15px;
}
.mr15 {
margin-right: 15px;
}
.mb15 {
margin-bottom: 15px;
}
.ml15 {
margin-left: 15px;
}
.mt20 {
margin-top: 20px;
}
.mr20 {
margin-right: 20px;
}
.mb20 {
margin-bottom: 20px;
}
.ml20 {
margin-left: 20px;
}
...@@ -2,34 +2,69 @@ ...@@ -2,34 +2,69 @@
<template> <template>
<div class="add-sensitive-word"> <div class="add-sensitive-word">
<el-form :inline="true" :model="form" class="demo-form-inline"> <el-form :inline="true" :model="form" class="demo-form-inline">
<el-button type="primary" class="add-btn" icon="el-icon-plus" @click="addSensitive">添加敏感词</el-button> <el-button
type="primary"
class="add-btn"
icon="el-icon-plus"
@click="addSensitive"
>添加敏感词</el-button
>
<el-form-item> <el-form-item>
<el-input v-model="form.patternWords" placeholder="搜索关键词" style="width:300px"> <el-input
<el-button slot="prepend" icon="el-icon-search" @click="getSettingList"></el-button> v-model="form.patternWords"
placeholder="搜索关键词"
style="width:300px"
>
<el-button
slot="prepend"
icon="el-icon-search"
@click="getSettingList"
></el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="tableData" stripe style="width: 100%" :header-cell-style="{background:'#fff'}"> <el-table
<el-table-column prop="strategyName" label="策略名称"> :data="tableData"
</el-table-column> stripe
<el-table-column prop="patternWords" label="匹配词"> style="width: 100%"
</el-table-column> :header-cell-style="{ background: '#fff' }"
>
<el-table-column prop="strategyName" label="策略名称"> </el-table-column>
<el-table-column prop="patternWords" label="匹配词"> </el-table-column>
<el-table-column prop="auditScopeName" label="审计范围"> <el-table-column prop="auditScopeName" label="审计范围">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag size="medium">{{ scope.row.auditUserScope[0].auditScopeName }}</el-tag> <el-tag size="medium">{{
scope.row.auditUserScope[0].auditScopeName
}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="auditUserName" label="审计人"> <el-table-column prop="auditUserName" label="审计人"> </el-table-column>
</el-table-column>
<el-table-column label="消息通知"> <el-table-column label="消息通知">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-model="scope.row.alertFlag" :active-value="1" :inactive-value="0" @change="handleStatusChange(scope.row)"></el-switch> <el-switch
v-model="scope.row.alertFlag"
:active-value="1"
:inactive-value="0"
@change="handleStatusChange(scope.row)"
></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button> <el-button
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button> size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -41,18 +76,35 @@ ...@@ -41,18 +76,35 @@
@pagination="getSettingList()" @pagination="getSettingList()"
/> />
<!-- 添加敏感词 --> <!-- 添加敏感词 -->
<el-dialog title="添加敏感词" :visible.sync="open" width="600px" append-to-body> <el-dialog
<el-form ref="addForm" :model="addForm" :rules="rules" label-width="130px"> title="添加敏感词"
:visible.sync="open"
width="600px"
append-to-body
>
<el-form
ref="addForm"
:model="addForm"
:rules="rules"
label-width="130px"
>
<el-form-item label="敏感词策略名称" prop="strategyName"> <el-form-item label="敏感词策略名称" prop="strategyName">
<el-input v-model="addForm.strategyName" placeholder="例:红包" /> <el-input v-model="addForm.strategyName" placeholder="例:红包" />
</el-form-item> </el-form-item>
<el-form-item label="匹配词" prop="patternWords"> <el-form-item label="匹配词" prop="patternWords">
<el-input v-model="addForm.patternWords" placeholder="例:红包,hongbao,hb" /> <el-input
v-model="addForm.patternWords"
placeholder="例:红包,hongbao,hb"
/>
<div class="sub-title">匹配词间用逗号隔开</div> <div class="sub-title">匹配词间用逗号隔开</div>
</el-form-item> </el-form-item>
<el-form-item label="审计范围" :required="true" :error="rangeErrorMsg"> <el-form-item label="审计范围" :required="true" :error="rangeErrorMsg">
<div class="tag-input" @click="openAuditUserRange"> <div class="tag-input" @click="openAuditUserRange">
<span class="tag-place" v-if="!auditUserRange.length">请选择<span class="prompt-title">若不选择,则默认全体成员</span></span> <span class="tag-place" v-if="!auditUserRange.length"
>请选择<span class="prompt-title"
>若不选择,则默认全体成员</span
></span
>
<template v-else> <template v-else>
<el-tag <el-tag
type="info" type="info"
...@@ -65,7 +117,9 @@ ...@@ -65,7 +117,9 @@
</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" @click="openAuditUser"> <div class="tag-input" @click="openAuditUser">
<span class="tag-place" v-if="!auditUser.length">请选择<span class="prompt-title">请选择部门负责人</span></span> <span class="tag-place" v-if="!auditUser.length"
>请选择<span class="prompt-title">请选择部门负责人</span></span
>
<template v-else> <template v-else>
<el-tag <el-tag
type="info" type="info"
...@@ -77,47 +131,49 @@ ...@@ -77,47 +131,49 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="消息通知"> <el-form-item label="消息通知">
<el-switch v-model="alertFlag" :active-value="1" :inactive-value="0"></el-switch> <el-switch
v-model="alertFlag"
:active-value="1"
:inactive-value="0"
></el-switch>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addSensitiveForm">确 定</el-button> <el-button type="primary" @click="addSensitiveForm">确 定</el-button>
<el-button @click="open=false">取 消</el-button> <el-button @click="open = false">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 选择审计范围弹窗 --> <!-- 选择审计范围弹窗 -->
<SelectUser <SelectUser
:visible.sync="dialogVisibleSelectUser" :visible.sync="dialogVisibleSelectUser"
title="选择添加人" title="选择添加人"
:isSigleSelect="true"
@success="selectedUser" @success="selectedUser"
></SelectUser> ></SelectUser>
<!-- 选择审计人弹窗 --> <!-- 选择审计人弹窗 -->
<SelectUser <SelectUser
:visible.sync="dialogVisibleSelectAuditUser" :visible.sync="dialogVisibleSelectAuditUser"
title="选择添加人" title="选择添加人"
:isSigleSelect="true"
@success="selectedAuditUser" @success="selectedAuditUser"
></SelectUser> ></SelectUser>
</div> </div>
</template> </template>
<script> <script>
import * as sensitiveApis from '@/api/conversation/security' import * as sensitiveApis from '@/api/conversation/security'
import SelectUser from "@/components/SelectUser" import SelectUser from '@/components/SelectUser'
export default { export default {
components: { components: {
SelectUser SelectUser,
}, },
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: [], // 敏感词列表
...@@ -125,7 +181,7 @@ export default { ...@@ -125,7 +181,7 @@ export default {
rangeErrorMsg: '', // 审计范围错误提示 rangeErrorMsg: '', // 审计范围错误提示
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
}, },
auditUserRange: [], // 审计范围 auditUserRange: [], // 审计范围
auditUser: [], // 审计人 auditUser: [], // 审计人
...@@ -137,12 +193,12 @@ export default { ...@@ -137,12 +193,12 @@ export default {
rowId: '', // 修改的数据id rowId: '', // 修改的数据id
rules: { rules: {
strategyName: [ strategyName: [
{ required: true, message: "敏感词策略不能为空", trigger: "blur" } { required: true, message: '敏感词策略不能为空', trigger: 'blur' },
], ],
patternWords: [ patternWords: [
{ required: true, message: "匹配词不能为空", trigger: "blur" } { required: true, message: '匹配词不能为空', trigger: 'blur' },
] ],
} },
} }
}, },
mounted() { mounted() {
...@@ -153,7 +209,7 @@ export default { ...@@ -153,7 +209,7 @@ export default {
getSettingList() { getSettingList() {
this.form.pageSize = this.query.pageSize this.form.pageSize = this.query.pageSize
this.form.pageNum = this.query.pageNum this.form.pageNum = this.query.pageNum
sensitiveApis.getSettingSensitiveList(this.form).then(res => { sensitiveApis.getSettingSensitiveList(this.form).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.tableData = res.rows this.tableData = res.rows
this.total = Number(res.total) this.total = Number(res.total)
...@@ -163,7 +219,7 @@ export default { ...@@ -163,7 +219,7 @@ export default {
// 提交敏感词表单 // 提交敏感词表单
addSensitiveForm() { addSensitiveForm() {
// console.log(this.auditUser) // console.log(this.auditUser)
this.$refs.addForm.validate(valid => { this.$refs.addForm.validate((valid) => {
if (valid) { if (valid) {
if (this.auditUserRange.length === 0) { if (this.auditUserRange.length === 0) {
this.rangeErrorMsg = '请选择审计范围' this.rangeErrorMsg = '请选择审计范围'
...@@ -178,19 +234,19 @@ export default { ...@@ -178,19 +234,19 @@ export default {
this.rangeErrorMsg = '' this.rangeErrorMsg = ''
} }
const params = this.addForm const params = this.addForm
let auditUserScope = [] let auditUserScope = []
const obj = { const obj = {
scopeType: this.auditUserRange.map(d => d.department) + "", scopeType: this.auditUserRange.map((d) => d.department) + '',
auditScopeId: this.auditUserRange.map(d => d.userId) + "", auditScopeId: this.auditUserRange.map((d) => d.userId) + '',
auditScopeName: this.auditUserRange.map(d => d.name) + "" auditScopeName: this.auditUserRange.map((d) => d.name) + '',
} }
auditUserScope.push(obj) auditUserScope.push(obj)
params.auditUserScope = auditUserScope params.auditUserScope = auditUserScope
params.auditUserId = this.auditUser.map(d => d.userId) + "" params.auditUserId = this.auditUser.map((d) => d.userId) + ''
params.auditUserName = this.auditUser.map(d => d.name) + "" params.auditUserName = this.auditUser.map((d) => d.name) + ''
params.alertFlag = this.alertFlag params.alertFlag = this.alertFlag
if (this.submitFlag === 'add') { if (this.submitFlag === 'add') {
sensitiveApis.addSettingSensitive(params).then(res => { sensitiveApis.addSettingSensitive(params).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.open = false this.open = false
this.getSettingList() this.getSettingList()
...@@ -199,7 +255,7 @@ export default { ...@@ -199,7 +255,7 @@ export default {
} }
if (this.submitFlag === 'modify') { if (this.submitFlag === 'modify') {
params.id = this.rowId params.id = this.rowId
sensitiveApis.modifySettingSensitive(params).then(res => { sensitiveApis.modifySettingSensitive(params).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.open = false this.open = false
this.getSettingList() this.getSettingList()
...@@ -220,7 +276,7 @@ export default { ...@@ -220,7 +276,7 @@ export default {
resetForm() { resetForm() {
this.addForm = { this.addForm = {
strategyName: '', strategyName: '',
patternWords: '' patternWords: '',
} }
this.auditUserRange = [] // 审计范围 this.auditUserRange = [] // 审计范围
this.auditUser = [] this.auditUser = []
...@@ -234,8 +290,9 @@ export default { ...@@ -234,8 +290,9 @@ export default {
this.open = true this.open = true
}, },
selectedUser(list) { selectedUser(list) {
debugger
// console.log(list) // console.log(list)
this.auditUserRange = list this.auditUserRange = list
// this.form.scopeType = list.map(d => d.department) + "" // this.form.scopeType = list.map(d => d.department) + ""
// this.form.auditScopeId = list.map(d => d.userId) + "" // this.form.auditScopeId = list.map(d => d.userId) + ""
}, },
...@@ -248,19 +305,23 @@ export default { ...@@ -248,19 +305,23 @@ export default {
this.submitFlag = 'modify' this.submitFlag = 'modify'
this.errorMsg = '' this.errorMsg = ''
this.rowId = row.id this.rowId = row.id
sensitiveApis.getSensitiveDetails(this.rowId).then(res => { sensitiveApis.getSensitiveDetails(this.rowId).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.addForm.strategyName = res.data.strategyName this.addForm.strategyName = res.data.strategyName
this.addForm.patternWords = res.data.patternWords this.addForm.patternWords = res.data.patternWords
this.auditUser = [{ this.auditUser = [
name: res.data.auditUserName, {
userId: res.data.auditUserId name: res.data.auditUserName,
}] userId: res.data.auditUserId,
this.auditUserRange = [{ },
name: res.data.auditUserScope[0].auditScopeName, ]
userId: res.data.auditUserScope[0].auditScopeId, this.auditUserRange = [
department: res.data.auditUserScope[0].scopeType {
}] name: res.data.auditUserScope[0].auditScopeName,
userId: res.data.auditUserScope[0].auditScopeId,
department: res.data.auditUserScope[0].scopeType,
},
]
this.alertFlag = res.data.alertFlag this.alertFlag = res.data.alertFlag
} }
}) })
...@@ -268,40 +329,38 @@ export default { ...@@ -268,40 +329,38 @@ export default {
}, },
// 删除敏感词 // 删除敏感词
handleDelete(row) { handleDelete(row) {
sensitiveApis.deleteSensitive(row.id).then(res => { sensitiveApis.deleteSensitive(row.id).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg) this.$message.success(res.msg)
this.getSettingList() this.getSettingList()
} }
}) })
}, },
handleStatusChange(row) { handleStatusChange(row) {},
},
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.demo-form-inline {
background: #efefef;
padding: 18px 10px 0 10px;
}
/deep/ .add-btn {
margin-right: 10px;
}
.content {
margin-top: 15px;
padding: 10px;
}
.prompt-title {
margin-left: 10px;
color: #999;
}
.tag-place {
color: #1890ff;
}
.sub-title {
font-size: 13px;
color: #999;
}
</style>
\ No newline at end of file \ No newline at end of file
.demo-form-inline {
background: #efefef;
padding: 18px 10px 0 10px;
}
/deep/ .add-btn {
margin-right: 10px;
}
.content {
margin-top: 15px;
padding: 10px;
}
.prompt-title {
margin-left: 10px;
color: #999;
}
.tag-place {
color: #1890ff;
}
.sub-title {
font-size: 13px;
color: #999;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!