Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0152c46d05 | ||
|
|
64f376e22a | ||
|
|
5b89fca77c | ||
|
|
d1f5997b88 | ||
|
|
88002a8fc4 | ||
|
|
556a9b03b4 | ||
|
|
ca5c81d8be | ||
|
|
02779c26d1 | ||
|
|
20692705e9 | ||
|
|
bc3bc7eaf3 | ||
|
|
d05ae06af6 | ||
|
|
ca3d8766ba | ||
|
|
00e73adadb | ||
|
|
4ede5768e4 | ||
|
|
541692f50f | ||
|
|
89294c98e1 | ||
|
|
8fd283c1e7 | ||
|
|
90b90fdd3c | ||
|
|
72ee214877 |
@@ -101,6 +101,12 @@
|
||||
justify-content: flex-start;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
|
||||
.policy-form-item {
|
||||
.el-form-item__error {
|
||||
width: 260px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-input--mini .el-input__inner {
|
||||
|
||||
@@ -1905,6 +1905,9 @@
|
||||
&.update-dialog__table--psiphon3 {
|
||||
height: calc(90vh - 190px - 200px - 50px - 10px);
|
||||
}
|
||||
&.update-dialog__table--system-user {
|
||||
height: calc(100% - 139px);
|
||||
}
|
||||
}
|
||||
.update-knowledge-form {
|
||||
.el-upload {
|
||||
|
||||
@@ -791,10 +791,10 @@ export default {
|
||||
})
|
||||
return
|
||||
}
|
||||
/* if (route === this.route) {
|
||||
if (route === this.route) {
|
||||
this.refresh()
|
||||
return
|
||||
} */
|
||||
}
|
||||
if (route) {
|
||||
this.$router.push({
|
||||
path: route,
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<el-option
|
||||
v-for="item in eventTypeList"
|
||||
:key="item.value"
|
||||
:label="$t(item.label)"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
@@ -66,7 +66,9 @@
|
||||
|
||||
<div class="center-dialog">
|
||||
<el-dialog v-model="showUpdateDialog"
|
||||
:destroy-on-close="true"
|
||||
:custom-class="showAddUpdateDialog ? 'update-knowledge update-knowledge--upload' : 'update-knowledge'"
|
||||
:before-close="beforeClose"
|
||||
:after-close="handleClose">
|
||||
<div class="knowledge-update__top" >
|
||||
<div class="update-left__icon">
|
||||
@@ -83,6 +85,7 @@
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
:before-change="(knowledgeId) => confirmSwitchLearning(updateKnowledge.knowledgeId)"
|
||||
v-if="updateKnowledge.source === 'cn_psiphon3_ip'"
|
||||
>
|
||||
</el-switch>
|
||||
</div>
|
||||
@@ -126,7 +129,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div :style="{height: updateKnowledge.source === 'cn_psiphon3_ip' ? 'calc(90vh - 190px - 200px - 50px - 42px)' : 'calc(100% - 242px)', marginTop: '42px', position: 'absolute', width: 'calc(100% - 60px)'}">
|
||||
<div :style="{height: updateKnowledge.source === 'cn_psiphon3_ip' && activeTab === 'intelligenceLearning' ? 'calc(90vh - 190px - 200px - 50px - 42px)' : 'calc(100% - 242px)', marginTop: '42px', position: 'absolute', width: 'calc(100% - 60px)'}">
|
||||
<loading :loading="updateLogLoading"></loading>
|
||||
</div>
|
||||
<el-table ref="updateDataTable"
|
||||
@@ -134,11 +137,19 @@
|
||||
:data="updateHistoryList"
|
||||
@selection-change="secondSelectionChange"
|
||||
width="100%"
|
||||
:class="updateKnowledge.source === 'cn_psiphon3_ip' ? 'update-dialog__table update-dialog__table--psiphon3' : 'update-dialog__table'"
|
||||
class="update-dialog__table"
|
||||
:class="{
|
||||
'update-dialog__table--psiphon3': updateKnowledge.source === 'cn_psiphon3_ip' && activeTab === 'intelligenceLearning',
|
||||
'update-dialog__table--system-user': updateKnowledge.source === 'cn_psiphon3_ip' && activeTab !== 'intelligenceLearning'
|
||||
}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#353636',fontWeight: '400',fontSize: '12px',borderRight: 'none',borderBottom: 'none'}"
|
||||
cell-style="padding:6px 0px;font-size: 12px;color: #353636;font-weight: 400;line-height: 20px;border-right:none;"
|
||||
header-cell-style="padding:8px 0px;font-size: 12px;color: #353636;font-weight: 500;border-right:none;">
|
||||
<el-table-column prop="opTime" :label="$t('entities.tab.informationAggregation.updateTime')" width="150" ></el-table-column>
|
||||
<el-table-column prop="opTime" :label="$t('entities.tab.informationAggregation.updateTime')" width="150" >
|
||||
<template #default="scope" :column="item">
|
||||
<span>{{scope.row.opTime ? dateFormatByAppearance(scope.row.opTime) : '-'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="user" :label="$t('knowledgeBase.operator')" width="150" v-if="activeTab === 'updateRecord'">
|
||||
<template #default="scope" :column="item">
|
||||
<span>{{$_.get(scope.row, 'user.name', '-')}}</span>
|
||||
@@ -154,7 +165,7 @@
|
||||
</template>
|
||||
</el-table>
|
||||
|
||||
<div class="psiphon3" v-if="updateKnowledge.source === 'cn_psiphon3_ip'">
|
||||
<div class="psiphon3" v-if="updateKnowledge.source === 'cn_psiphon3_ip' && activeTab === 'intelligenceLearning'">
|
||||
<div class="psiphon3-title">{{$t('knowledgeBase.psiphon3IpCount')}}</div>
|
||||
<div class="psiphon3-bar">
|
||||
<chart-error v-if="showErrorForPsiphon3" :content="errorMsgForPsiphon3"/>
|
||||
@@ -525,7 +536,9 @@ export default {
|
||||
timeChange () {
|
||||
this.timeFilter.endTime = window.$dayJs.tz().valueOf()
|
||||
this.timeFilter.startTime = this.timeFilter.endTime - this.selectTime * 60 * 1000
|
||||
if (this.updateKnowledge.source === 'cn_psiphon3_ip') {
|
||||
this.init()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.handleActiveBar()
|
||||
})
|
||||
@@ -535,7 +548,9 @@ export default {
|
||||
this.tabType = item.class
|
||||
}
|
||||
this.legendSelectChange(item)
|
||||
if (this.updateKnowledge.source === 'cn_psiphon3_ip') {
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
mouseenterTab (item) {
|
||||
if (this.isNoDataForPsiphon3) return
|
||||
@@ -577,7 +592,9 @@ export default {
|
||||
this.$message.success(this.$t('tip.success'))
|
||||
this.showAddUpdateDialog = false
|
||||
this.getCurTabData()
|
||||
if (this.updateKnowledge.source === 'cn_psiphon3_ip') {
|
||||
this.init()
|
||||
}
|
||||
/* } else {
|
||||
this.$message.error(this.$t('tip.uploadFailed', { msg: response.message }))
|
||||
} */
|
||||
@@ -612,6 +629,13 @@ export default {
|
||||
data.isSelected = val
|
||||
this.$emit('checkboxStatusChange', val, data)
|
||||
},
|
||||
beforeClose (done) {
|
||||
if (this.myChart) {
|
||||
this.myChart.dispose()
|
||||
this.myChart = null
|
||||
}
|
||||
done()
|
||||
},
|
||||
handleClose () {
|
||||
this.showUpdateDialog = false
|
||||
this.showAddUpdateDialog = false
|
||||
@@ -631,7 +655,9 @@ export default {
|
||||
this.updateKnowledge = data
|
||||
this.showEnable = showEnable
|
||||
await this.getCurTabData()
|
||||
if (data.source === 'cn_psiphon3_ip') {
|
||||
await this.init()
|
||||
}
|
||||
this.showUpdate()
|
||||
this.$nextTick(() => {
|
||||
this.handleActiveBar()
|
||||
@@ -676,6 +702,9 @@ export default {
|
||||
// 切换tab
|
||||
handleClick (tab) {
|
||||
this.getCurTabData()
|
||||
if (tab.index === '1') {
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
clearSelect () {
|
||||
this.$nextTick(() => {
|
||||
@@ -742,7 +771,9 @@ export default {
|
||||
},
|
||||
timeFilter: {
|
||||
handler () {
|
||||
if (this.updateKnowledge.source === 'cn_psiphon3_ip') {
|
||||
this.init()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.handleActiveBar()
|
||||
})
|
||||
@@ -750,7 +781,6 @@ export default {
|
||||
},
|
||||
tableData: {
|
||||
handler (n) {
|
||||
console.info(n)
|
||||
if (this.tableData && this.tableData.length > 0) {
|
||||
this.aiTaggingList = []
|
||||
this.websketchList = []
|
||||
@@ -772,6 +802,14 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
activeTab (n) {
|
||||
if (n === 'updateRecord') {
|
||||
if (this.myChart) {
|
||||
this.myChart.dispose()
|
||||
this.myChart = null
|
||||
}
|
||||
}
|
||||
},
|
||||
showAddUpdateDialog: {
|
||||
handler (n) {
|
||||
if (!n) {
|
||||
@@ -780,11 +818,13 @@ export default {
|
||||
this.init()
|
||||
}
|
||||
} else {
|
||||
this.myChart && this.myChart.dispose()
|
||||
if (this.myChart) {
|
||||
this.myChart.dispose()
|
||||
this.myChart = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.myChart = null
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -121,8 +121,6 @@ export function xAxisTimeFormatter (value) {
|
||||
':' +
|
||||
(date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes())
|
||||
// 如果是一天的开始
|
||||
console.info(date.getTime(), dayStart.getTime(), hourStart.getTime(), date.getTime() === dayStart.getTime(), date.getTime() === hourStart.getTime())
|
||||
console.info(getSecond(date.getTime()), getSecond(dayStart.getTime()), getSecond(hourStart.getTime()))
|
||||
if (getSecond(date.getTime()) === getSecond(dayStart.getTime())) {
|
||||
return '{day|' + dateFormat(date, 'YYYY-MM-DD') + '}'
|
||||
} else if (getSecond(date.getTime()) === getSecond(hourStart.getTime())) {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="new-filter-content-content">
|
||||
<el-checkbox-group v-model="checkEventType" @change="onChangeCategory" style="display: flex;flex-direction: column">
|
||||
<el-checkbox v-for="item in eventTypeList" :key="item.name" class="new-filter-content-checkbox" :label="item.name">
|
||||
{{ item.label }}
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
@@ -94,13 +94,7 @@ export default {
|
||||
}
|
||||
|
||||
if (data.eventTypeList) {
|
||||
this.eventTypeList = []
|
||||
data.eventTypeList.forEach(item => {
|
||||
const obj = detectionUnitList.eventTypeList.find(d => d.value === item.name)
|
||||
if (obj) {
|
||||
this.eventTypeList.push({ ...item, label: this.$t(obj.label) })
|
||||
}
|
||||
})
|
||||
this.eventTypeList = data.eventTypeList
|
||||
} else {
|
||||
this.eventTypeList = []
|
||||
}
|
||||
|
||||
@@ -57,12 +57,12 @@
|
||||
<div class="trigger-block-item margin-b-10">
|
||||
<div>At least</div>
|
||||
<el-form-item prop="atLeast">
|
||||
<el-input size="mini" v-model="triggerObj.atLeast" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
<el-input size="mini" maxlength="5" v-model="triggerObj.atLeast" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
</el-form-item>
|
||||
<div>times within</div>
|
||||
|
||||
<el-form-item prop="interval">
|
||||
<el-input size="mini" v-model="triggerObj.interval" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
<el-form-item prop="interval" class="policy-form-item">
|
||||
<el-input size="mini" maxlength="5" v-model="triggerObj.interval" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="intervalVal">
|
||||
@@ -79,8 +79,8 @@
|
||||
|
||||
<div class="trigger-block-item">
|
||||
<div>With the counter resetting after no activity for</div>
|
||||
<el-form-item prop="resetInterval">
|
||||
<el-input size="mini" v-model="triggerObj.resetInterval" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
<el-form-item prop="resetInterval" class="policy-form-item">
|
||||
<el-input size="mini" maxlength="5" v-model="triggerObj.resetInterval" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="resetIntervalVal">
|
||||
<el-select v-model="triggerObj.resetIntervalVal" class="form-trigger__select" placeholder=" " size="mini">
|
||||
@@ -98,7 +98,7 @@
|
||||
<div class="trigger-block-item margin-b-10">
|
||||
在
|
||||
<el-form-item prop="interval">
|
||||
<el-input size="mini" v-model="triggerObj.interval" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
<el-input size="mini" maxlength="5" v-model="triggerObj.interval" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="intervalVal">
|
||||
@@ -113,7 +113,7 @@
|
||||
</el-form-item>
|
||||
内至少发生
|
||||
<el-form-item prop="atLeast">
|
||||
<el-input size="mini" v-model="triggerObj.atLeast" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
<el-input size="mini" maxlength="5" v-model="triggerObj.atLeast" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
</el-form-item>
|
||||
次
|
||||
</div>
|
||||
@@ -121,7 +121,7 @@
|
||||
<div class="trigger-block-item">
|
||||
若连续
|
||||
<el-form-item prop="resetInterval">
|
||||
<el-input size="mini" v-model="triggerObj.resetInterval" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
<el-input size="mini" maxlength="5" v-model="triggerObj.resetInterval" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="resetIntervalVal">
|
||||
<el-select v-model="triggerObj.resetIntervalVal" class="form-trigger__select" placeholder=" " size="mini">
|
||||
@@ -165,6 +165,40 @@ import { storageKey, detectionUnitList } from '@/utils/constants'
|
||||
export default {
|
||||
name: 'DetectionForm',
|
||||
data () {
|
||||
const intervalValidator = (rule, value, callback) => {
|
||||
const obj = this.handleIntervalByDateType(rule, value, this.triggerObj.intervalVal)
|
||||
if (!obj.flag && obj.msg) {
|
||||
callback(new Error(obj.msg))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const intervalValValidator = (rule, value, callback) => {
|
||||
const obj = this.handleIntervalByDateType(rule, this.triggerObj.intervalVal, value)
|
||||
if (!obj.flag && obj.msg) {
|
||||
this.$refs.form3.validateField('interval')
|
||||
callback()
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const resetIntervalValidator = (rule, value, callback) => {
|
||||
const obj = this.handleIntervalByDateType(rule, value, this.triggerObj.resetIntervalVal)
|
||||
if (!obj.flag && obj.msg) {
|
||||
callback(new Error(obj.msg))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const resetIntervalValValidator = (rule, value, callback) => {
|
||||
const obj = this.handleIntervalByDateType(rule, this.triggerObj.resetIntervalVal, value)
|
||||
if (!obj.flag && obj.msg) {
|
||||
this.$refs.form3.validateField('resetInterval')
|
||||
callback()
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
activeNames: ['1'],
|
||||
rules: {
|
||||
@@ -180,6 +214,10 @@ export default {
|
||||
required: true,
|
||||
message: this.$t('validate.required'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
validator: intervalValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
intervalVal: [
|
||||
@@ -187,6 +225,10 @@ export default {
|
||||
required: true,
|
||||
message: this.$t('validate.required'),
|
||||
trigger: 'change'
|
||||
},
|
||||
{
|
||||
validator: intervalValValidator,
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
resetInterval: [
|
||||
@@ -194,6 +236,10 @@ export default {
|
||||
required: true,
|
||||
message: this.$t('validate.required'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
validator: resetIntervalValidator,
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
resetIntervalVal: [
|
||||
@@ -201,6 +247,10 @@ export default {
|
||||
required: true,
|
||||
message: this.$t('validate.required'),
|
||||
trigger: 'change'
|
||||
},
|
||||
{
|
||||
validator: resetIntervalValValidator,
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -368,6 +418,7 @@ export default {
|
||||
this.myLoading = false
|
||||
})
|
||||
} else {
|
||||
console.log('进来')
|
||||
this.myLoading = true
|
||||
axios.put(api.detection.create.create, formObj).then(response => {
|
||||
if (response.status === 200) {
|
||||
@@ -417,6 +468,29 @@ export default {
|
||||
})
|
||||
}
|
||||
this.$message.error(this.$t('detection.create.informationFilled'))
|
||||
},
|
||||
handleIntervalByDateType (rule, value, type) {
|
||||
if (value && (type === 'hours' || type === '小时')) {
|
||||
if (parseInt(value) <= 24) {
|
||||
return { flag: true }
|
||||
} else {
|
||||
return { flag: false, msg: this.$t('policy.dateTimeRangeHours') }
|
||||
}
|
||||
}
|
||||
if (value && (type === 'minutes' || type === '分钟')) {
|
||||
if (parseInt(value) <= 1440) {
|
||||
return { flag: true }
|
||||
} else {
|
||||
return { flag: false, msg: this.$t('policy.dateTimeRangeMinutes') }
|
||||
}
|
||||
}
|
||||
if (value && (type === 'seconds' || type === '秒')) {
|
||||
if (parseInt(value) <= 86400) {
|
||||
return { flag: true }
|
||||
} else {
|
||||
return { flag: false, msg: this.$t('policy.dateTimeRangeSeconds') }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,9 +56,6 @@
|
||||
<template v-else-if="item.prop === 'category'">
|
||||
{{ changeCategory(scope.row[item.prop]) }}
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'eventType'">
|
||||
{{ changeEventType(scope.row[item.prop]) }}
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'description'">
|
||||
<div style="padding-right: 20px">{{ scope.row[item.prop] }}</div>
|
||||
</template>
|
||||
@@ -181,16 +178,6 @@ export default {
|
||||
}
|
||||
return label
|
||||
}
|
||||
},
|
||||
changeEventType (value) {
|
||||
if (value) {
|
||||
const obj = detectionUnitList.eventTypeList.find(d => d.value === value)
|
||||
let label = value
|
||||
if (obj) {
|
||||
label = this.$t(obj.label)
|
||||
}
|
||||
return label
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user