Commit 916bcdb8 by xinla

修改部分问题

1 parent 701ffb91
......@@ -30,10 +30,10 @@ export default {
<style lang="scss" scoped>
.app-main {
/* 50= navbar 50 */
min-height: calc(100vh - 50px);
// min-height: calc(100vh - 50px);
width: 100%;
position: relative;
overflow: hidden;
overflow: auto;
background-color: #fff;
}
......@@ -44,7 +44,7 @@ export default {
.hasTagsView {
.app-main {
/* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px);
height: calc(100vh - 84px);
}
.fixed-header + .app-main {
......
/**
/**
* 通用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
*,
*: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 @@
<template>
<div class="add-sensitive-word">
<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-input v-model="form.patternWords" placeholder="搜索关键词" style="width:300px">
<el-button slot="prepend" icon="el-icon-search" @click="getSettingList"></el-button>
<el-input
v-model="form.patternWords"
placeholder="搜索关键词"
style="width:300px"
>
<el-button
slot="prepend"
icon="el-icon-search"
@click="getSettingList"
></el-button>
</el-input>
</el-form-item>
</el-form>
<el-table :data="tableData" stripe style="width: 100%" :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
:data="tableData"
stripe
style="width: 100%"
: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="审计范围">
<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>
</el-table-column>
<el-table-column prop="auditUserName" label="审计人">
</el-table-column>
<el-table-column prop="auditUserName" label="审计人"> </el-table-column>
<el-table-column label="消息通知">
<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>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<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>
<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>
</el-table-column>
</el-table>
......@@ -41,18 +76,35 @@
@pagination="getSettingList()"
/>
<!-- 添加敏感词 -->
<el-dialog title="添加敏感词" :visible.sync="open" width="600px" append-to-body>
<el-form ref="addForm" :model="addForm" :rules="rules" label-width="130px">
<el-dialog
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-input v-model="addForm.strategyName" placeholder="例:红包" />
</el-form-item>
<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>
</el-form-item>
<el-form-item label="审计范围" :required="true" :error="rangeErrorMsg">
<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>
<el-tag
type="info"
......@@ -65,7 +117,9 @@
</el-form-item>
<el-form-item label="审计人" :required="true" :error="errorMsg">
<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>
<el-tag
type="info"
......@@ -77,47 +131,49 @@
</div>
</el-form-item>
<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>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addSensitiveForm">确 定</el-button>
<el-button @click="open=false">取 消</el-button>
<el-button @click="open = false">取 消</el-button>
</div>
</el-dialog>
<!-- 选择审计范围弹窗 -->
<SelectUser
:visible.sync="dialogVisibleSelectUser"
title="选择添加人"
:isSigleSelect="true"
@success="selectedUser"
></SelectUser>
<!-- 选择审计人弹窗 -->
<SelectUser
:visible.sync="dialogVisibleSelectAuditUser"
title="选择添加人"
:isSigleSelect="true"
@success="selectedAuditUser"
></SelectUser>
</div>
</template>
<script>
import * as sensitiveApis from '@/api/conversation/security'
import SelectUser from "@/components/SelectUser"
import SelectUser from '@/components/SelectUser'
export default {
components: {
SelectUser
SelectUser,
},
data() {
return {
form: {
pageSize: 10,
pageNum: 1,
patternWords: '' // 关键词
patternWords: '', // 关键词
},
addForm: {
strategyName: '', // 策略名称
patternWords: '' // 匹配词
patternWords: '', // 匹配词
},
alertFlag: 0, // 消息通知
tableData: [], // 敏感词列表
......@@ -125,7 +181,7 @@ export default {
rangeErrorMsg: '', // 审计范围错误提示
query: {
pageNum: 1,
pageSize: 10
pageSize: 10,
},
auditUserRange: [], // 审计范围
auditUser: [], // 审计人
......@@ -137,12 +193,12 @@ export default {
rowId: '', // 修改的数据id
rules: {
strategyName: [
{ required: true, message: "敏感词策略不能为空", trigger: "blur" }
{ required: true, message: '敏感词策略不能为空', trigger: 'blur' },
],
patternWords: [
{ required: true, message: "匹配词不能为空", trigger: "blur" }
]
}
{ required: true, message: '匹配词不能为空', trigger: 'blur' },
],
},
}
},
mounted() {
......@@ -153,7 +209,7 @@ export default {
getSettingList() {
this.form.pageSize = this.query.pageSize
this.form.pageNum = this.query.pageNum
sensitiveApis.getSettingSensitiveList(this.form).then(res => {
sensitiveApis.getSettingSensitiveList(this.form).then((res) => {
if (res.code === 200) {
this.tableData = res.rows
this.total = Number(res.total)
......@@ -163,7 +219,7 @@ export default {
// 提交敏感词表单
addSensitiveForm() {
// console.log(this.auditUser)
this.$refs.addForm.validate(valid => {
this.$refs.addForm.validate((valid) => {
if (valid) {
if (this.auditUserRange.length === 0) {
this.rangeErrorMsg = '请选择审计范围'
......@@ -178,19 +234,19 @@ export default {
this.rangeErrorMsg = ''
}
const params = this.addForm
let auditUserScope = []
let auditUserScope = []
const obj = {
scopeType: this.auditUserRange.map(d => d.department) + "",
auditScopeId: this.auditUserRange.map(d => d.userId) + "",
auditScopeName: this.auditUserRange.map(d => d.name) + ""
scopeType: this.auditUserRange.map((d) => d.department) + '',
auditScopeId: this.auditUserRange.map((d) => d.userId) + '',
auditScopeName: this.auditUserRange.map((d) => d.name) + '',
}
auditUserScope.push(obj)
params.auditUserScope = auditUserScope
params.auditUserId = this.auditUser.map(d => d.userId) + ""
params.auditUserName = this.auditUser.map(d => d.name) + ""
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 => {
sensitiveApis.addSettingSensitive(params).then((res) => {
if (res.code === 200) {
this.open = false
this.getSettingList()
......@@ -199,7 +255,7 @@ export default {
}
if (this.submitFlag === 'modify') {
params.id = this.rowId
sensitiveApis.modifySettingSensitive(params).then(res => {
sensitiveApis.modifySettingSensitive(params).then((res) => {
if (res.code === 200) {
this.open = false
this.getSettingList()
......@@ -220,7 +276,7 @@ export default {
resetForm() {
this.addForm = {
strategyName: '',
patternWords: ''
patternWords: '',
}
this.auditUserRange = [] // 审计范围
this.auditUser = []
......@@ -234,8 +290,9 @@ export default {
this.open = true
},
selectedUser(list) {
debugger
// console.log(list)
this.auditUserRange = list
this.auditUserRange = list
// this.form.scopeType = list.map(d => d.department) + ""
// this.form.auditScopeId = list.map(d => d.userId) + ""
},
......@@ -248,19 +305,23 @@ export default {
this.submitFlag = 'modify'
this.errorMsg = ''
this.rowId = row.id
sensitiveApis.getSensitiveDetails(this.rowId).then(res => {
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.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
}
})
......@@ -268,40 +329,38 @@ export default {
},
// 删除敏感词
handleDelete(row) {
sensitiveApis.deleteSensitive(row.id).then(res => {
sensitiveApis.deleteSensitive(row.id).then((res) => {
if (res.code === 200) {
this.$message.success(res.msg)
this.getSettingList()
}
})
},
handleStatusChange(row) {
}
}
handleStatusChange(row) {},
},
}
</script>
<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
.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!