Browse Source

【市北代码迁移至安宁】【内容安全】-王公峰-2020-09-17

redesign
wanggongfeng 5 years ago
parent
commit
9634d480e5
  1. 208
      src/views/modules/contentSecurity/checkrecords-add-or-update.vue
  2. 87
      src/views/modules/contentSecurity/checkrecords-handle.vue
  3. 198
      src/views/modules/contentSecurity/checkrecords.vue
  4. 206
      src/views/modules/contentSecurity/checkrecordsDetail.vue
  5. 31
      src/views/modules/contentSecurity/checkrecordsroute.vue
  6. 208
      src/views/modules/contentSecurity/violationsrecords-add-or-update.vue
  7. 175
      src/views/modules/contentSecurity/violationsrecords.vue
  8. 183
      src/views/modules/contentSecurity/violationsrecordsDetail.vue
  9. 29
      src/views/modules/contentSecurity/violationsrecordsroute.vue

208
src/views/modules/contentSecurity/checkrecords-add-or-update.vue

@ -0,0 +1,208 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="用户ID" prop="userId">
<el-input v-model="dataForm.userId" placeholder="用户ID"></el-input>
</el-form-item>
<el-form-item label="用户名称" prop="name">
<el-input v-model="dataForm.name" placeholder="用户名称"></el-input>
</el-form-item>
<el-form-item label="工作类别:1工作2居民" prop="category">
<el-input v-model="dataForm.category" placeholder="工作类别:1工作2居民"></el-input>
</el-form-item>
<el-form-item label="关联信息表ID" prop="relationId">
<el-input v-model="dataForm.relationId" placeholder="关联信息表ID"></el-input>
</el-form-item>
<el-form-item label="功能模块" prop="module">
<el-input v-model="dataForm.module" placeholder="功能模块"></el-input>
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model="dataForm.content" placeholder="内容"></el-input>
</el-form-item>
<el-form-item label="图片地址" prop="url">
<el-input v-model="dataForm.url" placeholder="图片地址"></el-input>
</el-form-item>
<el-form-item label="系统返回编码" prop="code">
<el-input v-model="dataForm.code" placeholder="系统返回编码"></el-input>
</el-form-item>
<el-form-item label="系统返回信息" prop="msg">
<el-input v-model="dataForm.msg" placeholder="系统返回信息"></el-input>
</el-form-item>
<el-form-item label="审核状态" prop="suggestion">
<el-input v-model="dataForm.suggestion" placeholder="审核状态"></el-input>
</el-form-item>
<el-form-item label="检测结果分类" prop="label">
<el-input v-model="dataForm.label" placeholder="检测结果分类"></el-input>
</el-form-item>
<el-form-item label="结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。" prop="rate">
<el-input v-model="dataForm.rate" placeholder="结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。"></el-input>
</el-form-item>
<el-form-item label="是否全部审核通过" prop="allPass">
<el-input v-model="dataForm.allPass" placeholder="是否全部审核通过"></el-input>
</el-form-item>
<el-form-item label="删除标识:0未删除 1已删除" prop="delFlag">
<el-input v-model="dataForm.delFlag" placeholder="删除标识:0未删除 1已删除"></el-input>
</el-form-item>
<el-form-item label="乐观锁" prop="revision">
<el-input v-model="dataForm.revision" placeholder="乐观锁"></el-input>
</el-form-item>
<el-form-item label="创建人" prop="createdBy">
<el-input v-model="dataForm.createdBy" placeholder="创建人"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createdTime">
<el-input v-model="dataForm.createdTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="更新人" prop="updatedBy">
<el-input v-model="dataForm.updatedBy" placeholder="更新人"></el-input>
</el-form-item>
<el-form-item label="更新时间" prop="updatedTime">
<el-input v-model="dataForm.updatedTime" placeholder="更新时间"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
userId: '',
name: '',
category: '',
relationId: '',
module: '',
content: '',
url: '',
code: '',
msg: '',
suggestion: '',
label: '',
rate: '',
allPass: '',
delFlag: '',
revision: '',
createdBy: '',
createdTime: '',
updatedBy: '',
updatedTime: ''
}
}
},
computed: {
dataRule () {
return {
userId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
category: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
relationId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
module: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
content: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
url: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
code: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
msg: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
suggestion: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
label: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
rate: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
allPass: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
delFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
revision: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/news/checkrecords/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/news/checkrecords/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

87
src/views/modules/contentSecurity/checkrecords-handle.vue

@ -0,0 +1,87 @@
<template>
<el-dialog :visible.sync="visible" :title="'处理'" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="审核" prop="result" label-width="80px">
<el-select v-model="dataForm.result" placeholder="请选择" clearable>
<el-option label="通过" value="pass"> </el-option>
<el-option label="驳回" value="block"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="审核意见" prop="suggestion">
<el-input
type="textarea"
:rows="3"
v-model="dataForm.suggestion"
maxlength="2000"
style="width:calc(100% - 110px)"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
result: '',
suggestion: ''
},
isAble: false
}
},
computed: {
dataRule () {
return {
result: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
suggestion: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.isAble = false
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.isAble = true
this.$http['post']('/contentSecurity/handleResult/handleRecords', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
this.isAble = false
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.$emit('connectResponse')
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

198
src/views/modules/contentSecurity/checkrecords.vue

@ -0,0 +1,198 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__checkrecords}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()">
<el-form-item label="用户名" prop="name" label-width="75px">
<el-input v-model="dataForm.name" placeholder="用户名" clearable maxlength="10" @keyup.native="btKeyUpName" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="内容" prop="content" label-width="90px">
<el-input v-model="dataForm.content" placeholder="内容" clearable maxlength="20" @keyup.native="btKeyUpContent" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="功能模块" prop="module" label-width="90px">
<el-input v-model="dataForm.module" placeholder="功能模块" clearable maxlength="10" @keyup.native="btKeyUpModule" style="width:200px"></el-input>
</el-form-item>
<br>
<el-form-item label="手机号" prop="mobile" label-width="75px">
<el-input v-model="dataForm.mobile" placeholder="手机号" clearable maxlength="10" @keyup.native="btKeyUpMobile" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="审核状态" prop="suggestion" label-width="90px">
<el-select v-model="dataForm.suggestion" placeholder="请选择" clearable style="width:200px">
<el-option v-for="item in suggestionList" :key="item.code" :label="item.description" :value="item.code" >
</el-option>
</el-select>
</el-form-item>
<el-form-item label="系统状态" prop="decision" label-width="90px">
<el-select v-model="dataForm.systemStatus" placeholder="请选择" clearable>
<el-option label="正常" value="0"> </el-option>
<el-option label="异常" value="1"> </el-option>
</el-select>
</el-form-item>
<br>
<el-form-item label="提交时间"
prop="startTime" label-width="75px">
<el-date-picker v-model="dataForm.startTime"
type="date"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间"
style="width:200px"
@change="changeTime">
</el-date-picker>
</el-form-item>
<el-form-item label="至"
label-width="25px"
prop="endTime">
<el-date-picker v-model="dataForm.endTime"
type="date"
:picker-options="pickerBeginDateAfter"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间"
style="width:200px"
@change="changeTime">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="success" @click="getDataListSearch()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('news:checkrecords:save')" type="success" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('news:checkrecords:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<!-- <el-table-column prop="id" label="ID" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="userId" label="用户ID" header-align="center" align="center"></el-table-column>-->
<el-table-column prop="name" label="用户名称" header-align="center" align="center" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="mobile" label="手机号" header-align="center" align="center" width="120"></el-table-column>
<el-table-column prop="category" label="工作类别" header-align="center" align="center"></el-table-column>
<el-table-column prop="module" label="功能模块" header-align="center" align="center" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column prop="content" label="内容" header-align="center" align="center" min-width=400 show-overflow-tooltip></el-table-column>
<el-table-column prop="suggestion" label="审核状态" header-align="center" align="center"></el-table-column>
<el-table-column prop="label" label="检测结果分类" header-align="center" align="center" width="120"></el-table-column>
<el-table-column prop="system" label="系统状态" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="提交时间" header-align="center" align="center" width=180></el-table-column>
<el-table-column prop="auditTime" label="审核时间" header-align="center" align="center" width=180></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="scope.row.suggestionCode==='review'" type="text" size="small" @click="openHandle(scope.row.id)">{{ '审核' }}</el-button>
<el-button type="text" size="small" @click="selectDetails(scope.row.id)">{{ '查看详情' }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<checkrecords-handle v-if="handleVisible" ref="checkrecordsHandle" @refreshDataList="getDataList"></checkrecords-handle>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './checkrecords-add-or-update'
import CheckrecordsHandle from './checkrecords-handle'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/contentSecurity/checkrecords/page',
getDataListIsPage: true,
deleteURL: '/contentSecurity/checkrecords',
deleteIsBatch: true
},
dataForm: {
id: '',
content:'',
name:'',
module:'',
startTime:'',
endTime:'',
suggestionCode:'',
systemStatus:''
},
suggestionList:[],
handleVisible:false,
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.endTime;
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal + ' 00:00:00').getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.startTime;
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal + ' 00:00:00').getTime()
}
}
}
}
},
components: {
AddOrUpdate,
CheckrecordsHandle
},
created: function () {
this.getDataList()
this.getSuggestionInfo('check_state')
},
methods:{
btKeyUpName (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '');
this.dataForm.name = e.target.value
},
btKeyUpMobile (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '');
this.dataForm.mobile = e.target.value
},
btKeyUpModule (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '');
this.dataForm.module = e.target.value
},
btKeyUpContent (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '');
this.dataForm.content = e.target.value
},
selectDetails (id) {
this.$parent.selectComponent = 'CheckrecordsDetail'
this.$router.push({ path: '/contentSecurity-checkrecordsroute', query: { id: id} })
},
//
getSuggestionInfo (type) {
this.$http.get(`/contentSecurity/checkcode/getResourcesByType?type=` + type).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.suggestionList = res.data
}).catch(() => {})
},
openHandle (id) {
this.handleVisible = true
this.$nextTick(() => {
this.$refs.checkrecordsHandle.dataForm.id = id
this.$refs.checkrecordsHandle.init()
})
}
}
}
</script>

206
src/views/modules/contentSecurity/checkrecordsDetail.vue

@ -0,0 +1,206 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__masteruserrelation}">
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '120px'" disabled>
<el-form-item label="用户名称:" prop="name">
<!-- <el-input v-model="dataForm.name" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.name}}</div>
</el-form-item>
<el-form-item label="工作类别:" prop="category">
<!-- <el-input v-model="dataForm.category" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.category}}</div>
</el-form-item>
<el-form-item label="审核状态:" prop="decision">
<!-- <el-input v-model="dataForm.checkState" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.checkState}}</div>
</el-form-item>
<el-form-item label="功能模块:" prop="module">
<!-- <el-input v-model="dataForm.module" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.module}}</div>
</el-form-item>
<el-form-item label="内容:" prop="content">
<!-- <el-input-->
<!-- type="textarea"-->
<!-- :rows="3"-->
<!-- v-model="dataForm.content"-->
<!-- maxlength="2000"-->
<!-- style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.content}}</div>
</el-form-item>
<el-form-item label="图片:" prop="imgUrls" label-width="120px">
<el-upload
ref="upload"
:action="uploadUrl"
:class="{hide:hideUpload}"
list-type="picture-card"
:file-list="dataForm.imgUrls"
:limit=9
:on-preview="handlePictureCardPreview"
style="width:480px">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</el-form-item>
<el-form-item label="检测结果分类:" prop="label" >
<!-- <el-input v-model="dataForm.label" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.label}}</div>
</el-form-item>
<el-form-item label="分类概率:" prop="rate">
<!-- <el-input v-model="dataForm.rate" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.rate}}</div>
</el-form-item>
<el-form-item label="审核建议:" prop="suggestion">
<!-- <el-input-->
<!-- type="textarea"-->
<!-- :rows="3"-->
<!-- v-model="dataForm.suggestion"-->
<!-- maxlength="2000"-->
<!-- style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.suggestion}}</div>
</el-form-item>
<el-form-item label="创建时间:" prop="createdTime">
<!-- <el-date-picker v-model="dataForm.createdTime"-->
<!-- type="datetime"-->
<!-- value-format="yyyy-MM-dd HH:mm"-->
<!-- format="yyyy-MM-dd HH:mm"-->
<!-- style="width:calc(60% - 110px)">-->
<!-- </el-date-picker>-->
<div>{{dataForm.createdTime}}</div>
</el-form-item>
<el-form-item label="审批时间:" prop="auditTime">
<!-- <el-date-picker v-model="dataForm.auditTime"-->
<!-- type="datetime"-->
<!-- value-format="yyyy-MM-dd HH:mm"-->
<!-- format="yyyy-MM-dd HH:mm"-->
<!-- style="width:calc(60% - 110px)">-->
<!-- </el-date-picker>-->
<div>{{dataForm.auditTime}}</div>
</el-form-item>
</el-form>
<el-form>
<el-form-item style="margin-left:35px;">
<el-button type="primary" @click="backToUserRelationList">{{"返回"}}</el-button>
<el-button v-if="dataForm.suggestionCode==='review'" type="primary" @click="openHandle()">{{"审核"}}</el-button>
<!-- <el-button v-if="!pageDisabled" type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>-->
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
<checkrecords-handle v-if="handleVisible" ref="checkrecordsHandle" v-on:connectResponse="connectResponse"></checkrecords-handle>
</div>
</el-card>
</template>
<script>
import debounce from 'lodash/debounce'
import Cookies from 'js-cookie'
import 'quill/dist/quill.snow.css'
import CheckrecordsHandle from './checkrecords-handle'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
userId: '',
name: '',
category: '',
relationId: '',
decision: '',
module: '',
content: '',
url: '',
code: '',
msg: '',
suggestion: '',
suggestionCode: '',
label: '',
rate: '',
delFlag: '',
revision: '',
createdBy: '',
createdTime: '',
updatedBy: '',
auditTime: '',
imgUrls: []
},
dialogImageUrl: '',
dialogVisible: false,
hideUpload: true,
handleVisible:false
}
},
computed: {
},
components: {
CheckrecordsHandle
},
created: function () {
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}`
// this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}`
},
mounted () {
if (this.$route.query.id !== '' && this.$route.query.id != null) {
this.dataForm.id = this.$route.query.id
this.getInfo()
}
},
methods: {
init () {
this.dataForm.id = this.$route.query.id
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
handlePictureCardPreview (file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
//
backToUserRelationList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'Checkrecords'
this.$router.push({ path: '/contentSecurity-checkrecordsroute' })
},
//
getInfo () {
this.$http.get(`/contentSecurity/checkrecords/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
console.log(this.dataForm);
this.dataForm = {
...this.dataForm,
...res.data
}
console.log(this.dataForm);
}).catch(() => {})
},
openHandle () {
this.handleVisible = true
this.$nextTick(() => {
this.$refs.checkrecordsHandle.dataForm.id = this.dataForm.id
this.$refs.checkrecordsHandle.init()
})
},
connectResponse () {
this.backToUserRelationList ()
}
}
}
</script>
<style>
.hide .el-upload--picture-card {
display: none;
}
</style>

31
src/views/modules/contentSecurity/checkrecordsroute.vue

@ -0,0 +1,31 @@
<template>
<keep-alive include="checkrecords">
<component :is="selectComponent"></component>
</keep-alive>
</template>
<script>
import Checkrecords from './checkrecords'
import CheckrecordsDetail from './checkrecordsDetail'
import CheckrecordsHandle from './checkrecords-handle'
export default {
data () {
return {
selectComponent: Checkrecords
}
},
components: {
Checkrecords,
CheckrecordsDetail,
CheckrecordsHandle
},
methods: {
init () {
this.selectComponent = Checkrecords
}
}
}
</script>
<style lang="scss" scoped>
</style>

208
src/views/modules/contentSecurity/violationsrecords-add-or-update.vue

@ -0,0 +1,208 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="用户ID" prop="userId">
<el-input v-model="dataForm.userId" placeholder="用户ID"></el-input>
</el-form-item>
<el-form-item label="用户名称" prop="name">
<el-input v-model="dataForm.name" placeholder="用户名称"></el-input>
</el-form-item>
<el-form-item label="工作类别:1工作2居民" prop="category">
<el-input v-model="dataForm.category" placeholder="工作类别:1工作2居民"></el-input>
</el-form-item>
<el-form-item label="关联信息表ID" prop="relationId">
<el-input v-model="dataForm.relationId" placeholder="关联信息表ID"></el-input>
</el-form-item>
<el-form-item label="判定方式:1系统2人工" prop="decision">
<el-input v-model="dataForm.decision" placeholder="判定方式:1系统2人工"></el-input>
</el-form-item>
<el-form-item label="功能模块" prop="module">
<el-input v-model="dataForm.module" placeholder="功能模块"></el-input>
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model="dataForm.content" placeholder="内容"></el-input>
</el-form-item>
<el-form-item label="图片地址" prop="url">
<el-input v-model="dataForm.url" placeholder="图片地址"></el-input>
</el-form-item>
<el-form-item label="系统返回编码" prop="code">
<el-input v-model="dataForm.code" placeholder="系统返回编码"></el-input>
</el-form-item>
<el-form-item label="系统返回信息" prop="msg">
<el-input v-model="dataForm.msg" placeholder="系统返回信息"></el-input>
</el-form-item>
<el-form-item label="审核状态" prop="suggestion">
<el-input v-model="dataForm.suggestion" placeholder="审核状态"></el-input>
</el-form-item>
<el-form-item label="检测结果分类" prop="label">
<el-input v-model="dataForm.label" placeholder="检测结果分类"></el-input>
</el-form-item>
<el-form-item label="结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。" prop="rate">
<el-input v-model="dataForm.rate" placeholder="结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。"></el-input>
</el-form-item>
<el-form-item label="删除标识:0未删除 1已删除" prop="delFlag">
<el-input v-model="dataForm.delFlag" placeholder="删除标识:0未删除 1已删除"></el-input>
</el-form-item>
<el-form-item label="乐观锁" prop="revision">
<el-input v-model="dataForm.revision" placeholder="乐观锁"></el-input>
</el-form-item>
<el-form-item label="创建人" prop="createdBy">
<el-input v-model="dataForm.createdBy" placeholder="创建人"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createdTime">
<el-input v-model="dataForm.createdTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="更新人" prop="updatedBy">
<el-input v-model="dataForm.updatedBy" placeholder="更新人"></el-input>
</el-form-item>
<el-form-item label="更新时间" prop="updatedTime">
<el-input v-model="dataForm.updatedTime" placeholder="更新时间"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
userId: '',
name: '',
category: '',
relationId: '',
decision: '',
module: '',
content: '',
url: '',
code: '',
msg: '',
suggestion: '',
label: '',
rate: '',
delFlag: '',
revision: '',
createdBy: '',
createdTime: '',
updatedBy: '',
updatedTime: ''
}
}
},
computed: {
dataRule () {
return {
userId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
category: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
relationId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
decision: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
module: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
content: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
url: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
code: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
msg: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
suggestion: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
label: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
rate: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
delFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
revision: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/news/violationsrecords/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/news/violationsrecords/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

175
src/views/modules/contentSecurity/violationsrecords.vue

@ -0,0 +1,175 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-news__violationsrecords}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataListSearch()">
<el-form-item label="用户名" prop="name" label-width="75px">
<el-input v-model="dataForm.name" placeholder="用户名" clearable maxlength="10" @keyup.native="btKeyUpName" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="功能模块" prop="module" label-width="90px">
<el-input v-model="dataForm.module" placeholder="功能模块" clearable maxlength="10" @keyup.native="btKeyUpModule" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="内容" prop="content" label-width="70px">
<el-input v-model="dataForm.content" placeholder="内容" clearable maxlength="20" @keyup.native="btKeyUpContent" style="width:200px"></el-input>
</el-form-item>
<br>
<el-form-item label="手机号" prop="mobile" label-width="75px">
<el-input v-model="dataForm.mobile" placeholder="手机号" clearable maxlength="10" @keyup.native="btKeyUpMobile" style="width:200px"></el-input>
</el-form-item>
<el-form-item label="判定方式" prop="decision" label-width="90px">
<el-select v-model="dataForm.decision" placeholder="请选择" clearable>
<el-option label="系统判定" value="1"> </el-option>
<el-option label="人工审核" value="2"> </el-option>
</el-select>
</el-form-item>
<div>
<el-form-item label="提交时间"
prop="startTime" label-width="75px">
<el-date-picker v-model="dataForm.startTime"
type="date"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间"
style="width:200px"
@change="changeTime">
</el-date-picker>
</el-form-item>
<el-form-item label="至"
label-width="25px"
prop="endTime">
<el-date-picker v-model="dataForm.endTime"
type="date"
:picker-options="pickerBeginDateAfter"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期时间"
style="width:200px"
@change="changeTime">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="success" @click="getDataListSearch()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('news:violationsrecords:save')" type="success" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('news:violationsrecords:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</div>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="序号" header-align="center" align="center" width="50px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="name" label="用户名称" header-align="center" align="center" min-width="200" show-overflow-tooltip></el-table-column>
<el-table-column prop="mobile" label="手机号" header-align="center" align="center" width="120"></el-table-column>
<el-table-column prop="category" label="工作类别" header-align="center" align="center"></el-table-column>
<el-table-column prop="decision" label="判定方式" header-align="center" align="center"></el-table-column>
<el-table-column prop="module" label="功能模块" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="content" label="内容" header-align="center" align="left" min-width="400" show-overflow-tooltip></el-table-column>
<el-table-column prop="label" label="检测结果分类" header-align="center" align="center" width="120"></el-table-column>
<el-table-column prop="rate" label="分类概率" header-align="center" align="center"></el-table-column>
<el-table-column prop="createdTime" label="提交时间" header-align="center" align="center" width="180"></el-table-column>
<el-table-column prop="auditTime" label="审批时间" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="selectDetails(scope.row.id)">{{ '查看详情' }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './violationsrecords-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/contentSecurity/violationsrecords/page',
getDataListIsPage: true,
deleteURL: '/contentSecurity/violationsrecords',
deleteIsBatch: true
},
dataForm: {
id: '',
content:'',
name:'',
module:'',
startTime:'',
endTime:'',
mobile:''
},
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.endTime;
if (beginDateVal) {
return time.getTime() > new Date(beginDateVal + ' 00:00:00').getTime()
}
}
},
pickerBeginDateAfter: {
disabledDate: (time) => {
let EndDateVal = this.dataForm.startTime;
if (EndDateVal) {
return time.getTime() < new Date(EndDateVal + ' 00:00:00').getTime()
}
}
}
}
},
components: {
AddOrUpdate
},
created: function () {
this.getDataList()
},
methods:{
btKeyUpName (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '');
this.dataForm.name = e.target.value
},
btKeyUpModule (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '');
this.dataForm.module = e.target.value
},
btKeyUpContent (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '');
this.dataForm.content = e.target.value
},
btKeyUpMobile (e) {
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_+=<>?:"{}|·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/g, '');
this.dataForm.mobile = e.target.value
},
selectDetails (id) {
this.$parent.selectComponent = 'ViolationsrecordsDetail'
this.$router.push({ path: '/contentSecurity-violationsrecordsroute', query: { id: id} })
}
}
}
</script>
<!--<style>-->
<!-- .el-tooltip__popper {-->
<!-- max-width:1000px-->
<!-- }-->
<!--</style>-->

183
src/views/modules/contentSecurity/violationsrecordsDetail.vue

@ -0,0 +1,183 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-__masteruserrelation}">
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '120px'" disabled>
<el-form-item label="用户名称:" prop="name">
<!-- <el-input v-model="dataForm.name" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.name}}</div>
</el-form-item>
<el-form-item label="工作类别:" prop="category">
<!-- <el-input v-model="dataForm.category" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.category}}</div>
</el-form-item>
<el-form-item label="判定方式:" prop="decision">
<!-- <el-input v-model="dataForm.decision" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.decision}}</div>
</el-form-item>
<el-form-item label="功能模块:" prop="module">
<!-- <el-input v-model="dataForm.module" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.module}}</div>
</el-form-item>
<el-form-item label="内容:" prop="content">
<!-- <el-input-->
<!-- type="textarea"-->
<!-- :rows="3"-->
<!-- v-model="dataForm.content"-->
<!-- maxlength="2000"-->
<!-- style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.content}}</div>
</el-form-item>
<el-form-item label="图片:" prop="imgUrls" label-width="120px">
<el-upload
ref="upload"
:action="uploadUrl"
:class="{hide:hideUpload}"
list-type="picture-card"
:file-list="dataForm.imgUrls"
:limit=9
:on-preview="handlePictureCardPreview"
style="width:480px">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</el-form-item>
<el-form-item label="检测结果分类:" prop="label" >
<!-- <el-input v-model="dataForm.label" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.label}}</div>
</el-form-item>
<el-form-item label="分类概率:" prop="rate">
<!-- <el-input v-model="dataForm.rate" style="width:calc(60% - 110px)"></el-input>-->
<div>{{dataForm.rate}}</div>
</el-form-item>
<el-form-item label="创建时间:" prop="createdTime">
<!-- <el-date-picker v-model="dataForm.createdTime"-->
<!-- type="datetime"-->
<!-- value-format="yyyy-MM-dd HH:mm"-->
<!-- format="yyyy-MM-dd HH:mm"-->
<!-- style="width:calc(60% - 110px)">-->
<!-- </el-date-picker>-->
<div>{{dataForm.createdTime}}</div>
</el-form-item>
<el-form-item label="审批时间:" prop="auditTime">
<!-- <el-date-picker v-model="dataForm.auditTime"-->
<!-- type="datetime"-->
<!-- value-format="yyyy-MM-dd HH:mm"-->
<!-- format="yyyy-MM-dd HH:mm"-->
<!-- style="width:calc(60% - 110px)">-->
<!-- </el-date-picker>-->
<div>{{dataForm.auditTime}}</div>
</el-form-item>
</el-form>
<el-form>
<el-form-item style="margin-left:35px;">
<el-button type="primary" @click="backToUserRelationList">{{"返回"}}</el-button>
<!-- <el-button v-if="!pageDisabled" type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>-->
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</div>
</el-card>
</template>
<script>
import debounce from 'lodash/debounce'
import Cookies from 'js-cookie'
import 'quill/dist/quill.snow.css'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
userId: '',
name: '',
category: '',
relationId: '',
decision: '',
module: '',
content: '',
url: '',
code: '',
msg: '',
suggestion: '',
label: '',
rate: '',
delFlag: '',
revision: '',
createdBy: '',
createdTime: '',
updatedBy: '',
auditTime: '',
imgUrls: []
},
dialogImageUrl: '',
dialogVisible: false,
hideUpload: true
// imgUrlArr: [],
}
},
computed: {
},
created: function () {
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/uploadImg?token=${Cookies.get('token')}`
// this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}`
},
mounted () {
if (this.$route.query.id !== '' && this.$route.query.id != null) {
this.dataForm.id = this.$route.query.id
this.getInfo()
}
},
methods: {
init () {
this.dataForm.id = this.$route.query.id
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
handlePictureCardPreview (file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
//
backToUserRelationList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'Violationsrecords'
this.$router.push({ path: '/contentSecurity-violationsrecordsroute' })
},
//
getInfo () {
this.$http.get(`/contentSecurity/violationsrecords/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
console.log(this.dataForm);
this.dataForm = {
...this.dataForm,
...res.data
}
console.log(this.dataForm);
}).catch(() => {})
},
},
components: {
}
}
</script>
<style>
.hide .el-upload--picture-card {
display: none;
}
</style>

29
src/views/modules/contentSecurity/violationsrecordsroute.vue

@ -0,0 +1,29 @@
<template>
<keep-alive include="violationsrecords">
<component :is="selectComponent"></component>
</keep-alive>
</template>
<script>
import Violationsrecords from './violationsrecords'
import ViolationsrecordsDetail from './violationsrecordsDetail'
export default {
data () {
return {
selectComponent: Violationsrecords
}
},
components: {
Violationsrecords,
ViolationsrecordsDetail
},
methods: {
init () {
this.selectComponent = Violationsrecords
}
}
}
</script>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save