CN-1096 fix: 知识库update逻辑实现

This commit is contained in:
chenjinsong
2023-08-15 19:05:16 +08:00
parent 2b967dacd9
commit 631163c36e
5 changed files with 367 additions and 433 deletions

View File

@@ -1551,308 +1551,83 @@ height:300px !important;
} }
} }
.update-knowledge-tip { .update-knowledge-tip {
display:flex; display:flex;
flex-direction: column; flex-direction: column;
padding-bottom:0px !important; padding-bottom: 0 !important;
width:480px !important; width: 480px !important;
.el-dialog__header{ .el-dialog__header{
display: flex;
flex-direction: row;
border-bottom:1px solid #eee;
height:42px;
min-height:42px;
background: #F7F7F7;
box-shadow: 0 1px 0 0 rgba(53,54,54,0.08);
padding-left:20px;
padding-top:14px;
padding-bottom:14px;
.el-dialog__headerbtn {
display: flex !important;
flex-direction: row-reverse;
justify-content: center;
align-items: center;
font-size: 10px;
line-height: 10px;
padding-right: 5px !important;
i {
width:10px;
height:10px;
}
}
.el-dialog__title {
font-size: 14px !important;
color: #353636;
letter-spacing: 0;
font-weight: 400;
}
}
.el-dialog__body {
height:96px;
min-height:96px;
font-size: 14px;
color: #353636;
letter-spacing: 0;
line-height: 22px;
font-weight: 400;
padding-top:8px;
padding-right:20px;
padding-left:20px;
.dialog-message {
padding-left:0px !important;
padding-right:0px !important;
}
}
.el-dialog__footer {
height:52px;
min-height:52px;
border-top:1px solid #eee;
box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.07);
padding:11px 0 12px!important;
.el-button {
padding:8px 21px !important;
line-height: 12px;
font-size: 12px;
font-weight: 500;
min-height: 28px;
}
.el-button:nth-child(1) {
margin-right:20px;
width:80px;
height:28px;
color: #353636;
background: #F5F6F7;
border: 1px solid rgba(215,215,215,1);
border-radius: 2px;
}
.el-button:nth-child(2) {
width:80px;
height:28px;
margin-right:20px;
margin-left:0px !important;
background: #38ACD2;
border: 1px solid rgba(46,136,166,1);
border-radius: 2px;
}
}
}
.center-dialog {
display: flex;
align-items: center;
justify-content: center;
}
.update-knowledge {
display:flex;
flex-direction: column;
padding-bottom:0px !important;
width:1080px !important;
height:fit-content;
margin:15vh auto !important;
top:0;
left:0;
.knowledge-update__top {
display: flex;
flex-direction: row;
margin-bottom:22px;
.update-left__icon {
margin-top:3px;
width:107px;
height:60px;
color:red;
display:flex;
justify-content: center;
align-items: center;
.cn-icon-add-knowledge-base {
font-size:60px;
}
}
.update-right {
display: flex; display: flex;
flex-direction: column; flex-direction: row;
width:893px; border-bottom:1px solid #eee;
.knowledge-enable { height:42px;
display: flex; min-height:42px;
flex-direction: row; background: #F7F7F7;
justify-content: space-between; box-shadow: 0 1px 0 0 rgba(53,54,54,0.08);
margin-bottom:7px; padding-left:20px;
.update-title { padding-top:14px;
font-size: 16px; padding-bottom:14px;
color: #333333; .el-dialog__headerbtn {
letter-spacing: 0; display: flex !important;
font-weight: 500; flex-direction: row-reverse;
height:24px; justify-content: center;
font-family: NotoSansSC-Medium; align-items: center;
font-size: 10px;
line-height: 10px;
padding-right: 5px !important;
i {
width:10px;
height:10px;
} }
} }
.knowledge-desc { .el-dialog__title {
font-family: Roboto-Regular; font-size: 14px !important;
font-size: 14px; color: #353636;
color: #717171;
letter-spacing: 0; letter-spacing: 0;
line-height: 16px;
font-weight: 400; font-weight: 400;
} }
} }
} .el-dialog__body {
.knowledge-update { height:96px;
display: flex; min-height:96px;
flex-direction: row;
justify-content: space-between;
align-items:flex-end;
margin-bottom:12px;
.update-title {
line-height: 14px;
font-family: NotoSansSC-Bold;
font-size: 14px; font-size: 14px;
color: #353636; color: #353636;
font-weight: 700;
}
.update-operate {
height:28px;
display:flex;
flex-direction: row;
justify-content:center;
font-size: 14px;
font-weight: 400;
align-items: center;
.top-tool-btn--update {
background-color: #38ACD2 !important;
padding-left:7px;
padding-right:7px;
color:#FFFFFF;
font-size: 12px;
font-weight: 500;
border: 1px solid rgba(46,136,166,0.85);
border-radius: 2px;
line-height: 28px;
height:28px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
i {
color: #FFFFFF;
font-size:14px !important;
margin-right:5px;
}
}
.top-tool-btn--update:hover {
background-color: #57B8D9 !important;
border-color: #2E88A6 !important;
}
}
}
.el-dialog__header{
display: flex;
flex-direction: row;
height:32px;
min-height:32px;
padding-left:20px;
padding-top:20px;
padding-bottom:0px;
.el-dialog__headerbtn {
display: flex !important;
flex-direction: row-reverse;
justify-content: center;
align-items: center;
line-height: 12px;
i {
font-size:12px;
color:#999999;
}
}
.el-dialog__title {
font-size: 14px !important;
color: #353636;
letter-spacing: 0; letter-spacing: 0;
line-height: 22px;
font-weight: 400; font-weight: 400;
} padding-top:8px;
} padding-right:20px;
.el-dialog__body { padding-left:20px;
font-size: 14px; .dialog-message {
color: #353636; padding-left: 0 !important;
letter-spacing: 0; padding-right: 0 !important;
line-height: 22px;
font-weight: 400;
padding-top:0px;
padding-right:30px;
padding-left:30px;
.dialog-message {
padding-left:0px !important;
padding-right:0px !important;
}
.update-dialog__table {
border-bottom: none;
border-radius: 0.28571rem;
.el-table--border th, .el-table--border td {
border-right: none;
} }
} }
.update-knowledge-form { .el-dialog__footer {
.el-upload { height:52px;
width:100%; min-height:52px;
} border-top:1px solid #eee;
.form-input { box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.07);
.el-input__inner{ padding:11px 0 12px!important;
padding-right: 50px !important;
font-size: 14px;
}
}
.uploadBtn {
background: #F5F8FA;
border: 1px solid rgba(222,222,222,1);
box-shadow: 0px 2px 4px 0px rgba(51,51,51,0.02);
border-radius: 2px;
width:100%;
height:28px;
min-height:28px !important;
color: #575757;
padding-top:0px;
padding-bottom:0px;
i {
font-size:12px;
}
}
.el-form-item__label {
font-family: NotoSansHans-Medium;
font-size: 14px;
color: #333333;
font-weight: 500;
padding-bottom:12px;
line-height:14px;
}
.el-form-item__content {
line-height:normal;
}
.el-form-item {
margin-bottom:20px;
}
.knowledge-remark {
margin-bottom:0px !important;
}
}
.dialog-footer {
display:flex;
justify-content: flex-end;
padding-top:32px;
.el-button { .el-button {
padding:10px 21px !important; padding:8px 21px !important;
line-height: 12px; line-height: 12px;
font-size: 12px; font-size: 12px;
font-weight: 500; font-weight: 500;
min-height: 32px; min-height: 28px;
width:80px;
height:32px;
} }
.el-button:nth-child(1) { .el-button:nth-child(1) {
margin-right:20px; margin-right:20px;
width:80px;
height:28px;
color: #353636; color: #353636;
background: #F5F6F7; background: #F5F6F7;
border: 1px solid rgba(215,215,215,1); border: 1px solid rgba(215,215,215,1);
border-radius: 2px; border-radius: 2px;
} }
.el-button:nth-child(2) { .el-button:nth-child(2) {
color: #FFFFFF; width:80px;
height:28px;
margin-right:20px;
margin-left:0px !important; margin-left:0px !important;
background: #38ACD2; background: #38ACD2;
border: 1px solid rgba(46,136,166,1); border: 1px solid rgba(46,136,166,1);
@@ -1860,4 +1635,233 @@ left:0;
} }
} }
} }
.center-dialog {
display: flex;
align-items: center;
justify-content: center;
}
.update-knowledge {
display:flex;
flex-direction: column;
padding-bottom:0 !important;
width: 1080px !important;
height: calc(100% - 240px);
overflow: hidden;
&.update-knowledge--upload {
height: auto;
}
.el-dialog__body {
overflow: hidden;
}
.knowledge-update__top {
display: flex;
flex-direction: row;
margin-bottom:22px;
.update-left__icon {
margin-top:3px;
width:107px;
height:60px;
color:red;
display:flex;
justify-content: center;
align-items: center;
.cn-icon-add-knowledge-base {
font-size:60px;
}
}
.update-right {
display: flex;
flex-direction: column;
width:893px;
.knowledge-enable {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom:7px;
.update-title {
font-size: 16px;
color: #333333;
letter-spacing: 0;
font-weight: 500;
height:24px;
font-family: NotoSansSC-Medium;
}
}
.knowledge-desc {
font-family: Roboto-Regular;
font-size: 14px;
color: #717171;
letter-spacing: 0;
line-height: 16px;
font-weight: 400;
}
}
}
.knowledge-update {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items:flex-end;
margin-bottom:12px;
.update-title {
line-height: 14px;
font-family: NotoSansSC-Bold;
font-size: 14px;
color: #353636;
font-weight: 700;
}
.update-operate {
height:28px;
display:flex;
flex-direction: row;
justify-content:center;
font-size: 14px;
font-weight: 400;
align-items: center;
.top-tool-btn--update {
background-color: #38ACD2 !important;
padding-left:7px;
padding-right:7px;
color:#FFFFFF;
font-size: 12px;
font-weight: 500;
border: 1px solid rgba(46,136,166,0.85);
border-radius: 2px;
line-height: 28px;
height:28px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
i {
color: #FFFFFF;
font-size:14px !important;
margin-right:5px;
}
}
.top-tool-btn--update:hover {
background-color: #57B8D9 !important;
border-color: #2E88A6 !important;
}
}
}
.el-dialog__header{
display: flex;
flex-direction: row;
height:32px;
min-height:32px;
padding-left:20px;
padding-top:20px;
padding-bottom:0px;
.el-dialog__headerbtn {
display: flex !important;
flex-direction: row-reverse;
justify-content: center;
align-items: center;
line-height: 12px;
i {
font-size:12px;
color:#999999;
}
}
.el-dialog__title {
font-size: 14px !important;
color: #353636;
letter-spacing: 0;
font-weight: 400;
}
}
.el-dialog__body {
font-size: 14px;
color: #353636;
letter-spacing: 0;
line-height: 22px;
font-weight: 400;
padding-top:0px;
padding-right:30px;
padding-left:30px;
.dialog-message {
padding-left:0px !important;
padding-right:0px !important;
}
.update-dialog__table {
border-bottom: none;
border-radius: 0.28571rem;
.el-table--border th, .el-table--border td {
border-right: none;
}
}
.update-knowledge-form {
.el-upload {
width:100%;
}
.form-input {
.el-input__inner{
padding-right: 50px !important;
font-size: 14px;
}
}
.uploadBtn {
background: #F5F8FA;
border: 1px solid rgba(222,222,222,1);
box-shadow: 0px 2px 4px 0px rgba(51,51,51,0.02);
border-radius: 2px;
width:100%;
height:28px;
min-height:28px !important;
color: #575757;
padding-top:0px;
padding-bottom:0px;
i {
font-size:12px;
}
}
.el-form-item__label {
font-family: NotoSansHans-Medium;
font-size: 14px;
color: #333333;
font-weight: 500;
padding-bottom:12px;
line-height:14px;
}
.el-form-item__content {
line-height:normal;
}
.el-form-item {
margin-bottom:20px;
}
.knowledge-remark {
margin-bottom:0px !important;
}
}
.dialog-footer {
display:flex;
justify-content: flex-end;
padding-top:32px;
.el-button {
padding:10px 21px !important;
line-height: 12px;
font-size: 12px;
font-weight: 500;
min-height: 32px;
width:80px;
height:32px;
}
.el-button:nth-child(1) {
margin-right:20px;
color: #353636;
background: #F5F6F7;
border: 1px solid rgba(215,215,215,1);
border-radius: 2px;
}
.el-button:nth-child(2) {
color: #FFFFFF;
margin-left:0px !important;
background: #38ACD2;
border: 1px solid rgba(46,136,166,1);
border-radius: 2px;
}
}
}
} }

View File

@@ -37,7 +37,7 @@
</el-form-item> </el-form-item>
<!--value--> <!--value-->
<el-form-item :label="$t('config.i18n.value')" label-width="200px" prop="value"> <el-form-item :label="$t('config.i18n.value')" label-width="200px" prop="value">
<el-input id="account-input-value" v-model="editObject.value" maxlength="64" placeholder="" <el-input id="account-input-value" v-model="editObject.value" maxlength="256" placeholder=""
show-word-limit size="small"></el-input> show-word-limit size="small"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@@ -9,7 +9,7 @@
<el-tooltip <el-tooltip
effect="light" effect="light"
trigger="hover" trigger="hover"
:content="$t('tip.notAvailableYet')" :content="$t('tip.notAvailable')"
placement="right" placement="right"
popper-class="panel-tooltip" popper-class="panel-tooltip"
> >
@@ -31,7 +31,7 @@
<div class="card-title"> <div class="card-title">
<div class="card-title-name" :title="data.label">{{data.label}}</div> <div class="card-title-name" :title="data.label">{{data.label}}</div>
</div> </div>
<div class="card-desc" :title="data.description">{{data.description?data.description:'—'}}</div> <div class="card-desc" :title="data.desc">{{data.desc ? data.desc : '—'}}</div>
</div> </div>
<div class="card-operate__footer"> <div class="card-operate__footer">
<button v-if="data.showUpdate" <button v-if="data.showUpdate"
@@ -55,7 +55,7 @@
<div class="card-title"> <div class="card-title">
<div class="card-title-name" :title="data.label">{{data.label}}</div> <div class="card-title-name" :title="data.label">{{data.label}}</div>
</div> </div>
<div class="card-desc" :title="data.description?data.description:'—'">{{data.description?data.description:'—'}}</div> <div class="card-desc" :title="data.desc ? data.desc:'—'">{{data.desc ? data.desc : '—'}}</div>
</div> </div>
<div class="card-operate__footer"> <div class="card-operate__footer">
<button v-if="data.showUpdate" :title="$t('overall.update')" class="top-tool-btn--update" <button v-if="data.showUpdate" :title="$t('overall.update')" class="top-tool-btn--update"
@@ -75,26 +75,35 @@
<div class="center-dialog"> <div class="center-dialog">
<el-dialog v-model="showUpdateDialog" <el-dialog v-model="showUpdateDialog"
custom-class="update-knowledge" :custom-class="showAddUpdateDialog ? 'update-knowledge update-knowledge--upload' : 'update-knowledge'"
:before-close="handleClose"> :after-close="handleClose">
<div class="knowledge-update__top" > <div class="knowledge-update__top" >
<div class="update-left__icon"> <div class="update-left__icon">
<img :src="updateKnowledge.iconUrl"/> <img width="60" height="60" :src="updateKnowledge.iconUrl"/>
</div> </div>
<div class="update-right"> <div class="update-right">
<div class="knowledge-enable"> <div class="knowledge-enable">
<div class="update-title"> <div class="update-title">
<div class="card-title-name" :title="updateKnowledge.label">{{updateKnowledge.label}}</div> <div class="card-title-name" :title="updateKnowledge.label">{{updateKnowledge.label}}</div>
</div> </div>
<el-switch v-model="updateKnowledge.status" <el-tooltip
v-if="showEnable" effect="light"
active-color="#38ACD2" trigger="hover"
inactive-color="#C0CEDB" v-if="showEnable"
:active-value="1" :content="$t('tip.notAvailable')"
:inactive-value="0" placement="right"
@change="changeStatus($event,updateKnowledge.knowledgeId)" popper-class="panel-tooltip"
> >
</el-switch> <el-switch v-model="updateKnowledge.status"
active-color="#38ACD2"
inactive-color="#C0CEDB"
:disabled="true"
:active-value="1"
:inactive-value="0"
@change="changeStatus($event,updateKnowledge.knowledgeId)"
>
</el-switch>
</el-tooltip>
</div> </div>
<div class="knowledge-desc" :title="updateKnowledge.description">{{updateKnowledge.description?updateKnowledge.description:'—'}}</div> <div class="knowledge-desc" :title="updateKnowledge.description">{{updateKnowledge.description?updateKnowledge.description:'—'}}</div>
</div> </div>
@@ -106,7 +115,7 @@
</div> </div>
<div class="update-operate"> <div class="update-operate">
<button :title="$t('overall.update')" class="top-tool-btn--update" <button :title="$t('overall.update')" class="top-tool-btn--update"
@click="uploadRecord()"> @click="uploadRecord">
<i class="cn-icon-update-knowledge-base cn-icon"></i> <i class="cn-icon-update-knowledge-base cn-icon"></i>
<span>{{$t('overall.update')}}</span> <span>{{$t('overall.update')}}</span>
</button> </button>
@@ -116,19 +125,24 @@
border border
:data="updateHistoryList" :data="updateHistoryList"
@selection-change="secondSelectionChange" @selection-change="secondSelectionChange"
max-height="653px"
width="100%" width="100%"
height="calc(100% - 125px)"
class="update-dialog__table" class="update-dialog__table"
cell-style="padding:6px 0px;font-size: 12px;color: #353636;font-weight: 400;line-height: 20px;border-right: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;"> header-cell-style="padding:8px 0px;font-size: 12px;color: #353636;font-weight: 500;border-right:none;">
<el-table-column property="opTime" label="Update time" width="150" ></el-table-column> <el-table-column prop="opTime" label="Update time" width="150" ></el-table-column>
<el-table-column property="opUser" label="Operating user" width="150" ></el-table-column> <el-table-column prop="user" label="Operating user" width="150" >
<el-table-column property="version" label="Version information" width="150" ></el-table-column> <template #default="scope" :column="item">
<el-table-column property="description" label="Description"></el-table-column> <span>{{$_.get(scope.row, 'user.name', '-')}}</span>
</template>
</el-table-column>
<el-table-column prop="commitVersion" label="Version information" width="150" ></el-table-column>
<el-table-column prop="description" label="Description"></el-table-column>
</el-table> </el-table>
</template> </template>
<template v-if="showAddUpdateDialog"> <template v-if="showAddUpdateDialog">
<div class="update-knowledge-form" > <div class="update-knowledge-form">
<loading :loading="uploadLoading"></loading>
<el-form :model="updateObject" label-position="top" ref="form" :rules="rules"> <el-form :model="updateObject" label-position="top" ref="form" :rules="rules">
<!--name--> <!--name-->
<el-form-item :label="$t('overall.name')" prop="name"> <el-form-item :label="$t('overall.name')" prop="name">
@@ -144,10 +158,10 @@
:on-change="fileChange" :on-change="fileChange"
:on-success="uploadSuccess" :on-success="uploadSuccess"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:on-progress="onUpload"
:on-error="uploadError" :on-error="uploadError"
:class="uploadErrorTip ? 'el-upload--error' : ''" :class="uploadErrorTip ? 'el-upload--error' : ''"
:accept="fileTypeLimit" :accept="fileTypeLimit"
:auto-upload="false"
ref="knowledgeUpload" ref="knowledgeUpload"
id="knowledgeUpload" id="knowledgeUpload"
> >
@@ -157,7 +171,7 @@
<el-form-item :label="$t('knowledge.version')" prop="version"> <el-form-item :label="$t('knowledge.version')" prop="version">
<el-input class="form-input" maxlength="64" placeholder="" disabled show-word-limit <el-input class="form-input" maxlength="64" placeholder="" disabled show-word-limit
size="mini" type="text" v-model="updateObject.version" @blur="tagNameBlur"></el-input> size="mini" type="text" v-model="currentVersion"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('overall.remark')" prop="description" class="knowledge-remark"> <el-form-item :label="$t('overall.remark')" prop="description" class="knowledge-remark">
<el-input maxlength="255" show-word-limit :rows="4" size='mini' type="textarea" resize='none' <el-input maxlength="255" show-word-limit :rows="4" size='mini' type="textarea" resize='none'
@@ -188,6 +202,7 @@
<script> <script>
import table from '@/mixins/table' import table from '@/mixins/table'
import Loading from '@/components/common/Loading'
import { knowledgeCategoryValue, storageKey, builtInKnowledgeBaseBasicInfo } from '@/utils/constants' import { knowledgeCategoryValue, storageKey, builtInKnowledgeBaseBasicInfo } from '@/utils/constants'
import { ref } from 'vue' import { ref } from 'vue'
import { api } from '@/utils/api' import { api } from '@/utils/api'
@@ -204,6 +219,9 @@ export default {
type: Boolean type: Boolean
} }
}, },
components: {
Loading
},
data () { data () {
return { return {
tableTitle: [], tableTitle: [],
@@ -216,7 +234,9 @@ export default {
updateKnowledge: {}, updateKnowledge: {},
showEnable: false, showEnable: false,
updateHistoryList: [], updateHistoryList: [],
updateObject: {} updateObject: {},
currentVersion: 0,
uploadLoading: false
} }
}, },
setup () { setup () {
@@ -238,45 +258,32 @@ export default {
this.fileList = fileList.slice(-1) this.fileList = fileList.slice(-1)
}, },
uploadError () { uploadError () {
this.uploadLoading = false
this.$message.error(this.$t('tip.uploadFailed', { msg: 'error' })) this.$message.error(this.$t('tip.uploadFailed', { msg: 'error' }))
}, },
uploadSuccess (response) { uploadSuccess (response) {
const uploadFile = this.fileList ? this.fileList[0] : null this.uploadLoading = false
let fileName = uploadFile ? uploadFile.name : ''
fileName = fileName.substring(0, fileName.indexOf('.'))
this.updateObject.version = fileName.length >= 8 ? fileName.substring(fileName.length - 8) : fileName
this.uploaded = response.code === 200 this.uploaded = response.code === 200
if (response.code === 200) { if (response.code === 200) {
this.$message.success(this.$t('tip.success'))
this.showAddUpdateDialog = false
axios.get(api.knowledgeBaseLog + '/' + this.updateKnowledge.knowledgeId, { params: { pageSize: 999 } }).then(res => {
this.updateHistoryList = res.data.data.list
this.currentVersion = this.updateHistoryList[0].commitVersion + 1
})
} else { } else {
this.$message.error(this.$t('tip.uploadFailed', { msg: response.message })) this.$message.error(this.$t('tip.uploadFailed', { msg: response.message }))
} }
}, },
beforeUpload (file) { beforeUpload (file) {
this.uploadLoading = true
}, this.showConfirmDialog = false
onUpload () {
},
updateKnowledgeBase () {
axios.post(this.updateKnowledgeUrl + '?knowledgeIds=' + ids).then(response => {
if (response.data.code === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.success') })
// 重新查询历史记录
} else {
this.$message.error(response.data.message)
}
}).finally(() => {
})
}, },
submitConfirm () { submitConfirm () {
this.showConfirmDialog = true this.showConfirmDialog = true
}, },
submit () { submit () {
// this.updateKnowledgeBase()//更新列表数据 this.$refs.knowledgeUpload.submit()
this.showConfirmDialog = false
this.showAddUpdateDialog = false
}, },
clickCard (data, event) { clickCard (data, event) {
if (data.isSelected) { // 原来为选中,当前点击后未选中 if (data.isSelected) { // 原来为选中,当前点击后未选中
@@ -301,6 +308,7 @@ export default {
handleClose () { handleClose () {
this.showUpdateDialog = false this.showUpdateDialog = false
this.showAddUpdateDialog = false this.showAddUpdateDialog = false
this.uploadLoading = false
}, },
handleConfirmClose () { handleConfirmClose () {
this.showConfirmDialog = false this.showConfirmDialog = false
@@ -314,17 +322,18 @@ export default {
}, },
jumpToUpdatePage (data, showEnable) { jumpToUpdatePage (data, showEnable) {
axios.get(api.knowledgeBaseLog + '/' + data.knowledgeId, { params: { pageSize: 999 } }).then(res => { axios.get(api.knowledgeBaseLog + '/' + data.knowledgeId, { params: { pageSize: 999 } }).then(res => {
this.updateKnowledge = data
this.updateHistoryList = res.data.data.list
this.currentVersion = this.updateHistoryList[0].commitVersion + 1
this.showEnable = showEnable
this.showUpdate()
}) })
this.updateKnowledge = data
this.showEnable = showEnable
this.showUpdate()
}, },
uploadRecord () { uploadRecord () {
this.showAddUpdateDialog = true this.showAddUpdateDialog = true
this.updateObject.name = this.updateKnowledge.name this.updateObject.name = this.updateKnowledge.name
this.updateObject.label = this.updateKnowledge.label this.updateObject.label = this.updateKnowledge.label
this.updateObject.version = '' this.updateObject.description = ''
}, },
clearSelect () { clearSelect () {
this.$nextTick(() => { this.$nextTick(() => {
@@ -415,7 +424,8 @@ export default {
uploadParams () { uploadParams () {
return { return {
knowledgeId: this.updateKnowledge.knowledgeId, knowledgeId: this.updateKnowledge.knowledgeId,
action: 'update' action: 'update',
description: this.updateObject.description
} }
} }
} }

View File

@@ -1730,52 +1730,62 @@ export const builtInKnowledgeBaseBasicInfo = [
{ {
knowledgeId: 10, knowledgeId: 10,
label: 'Psiphon3 VPN', label: 'Psiphon3 VPN',
iconUrl: 'images/knowledge-base-logo/psiphon3-vpn.png' iconUrl: 'images/knowledge-base-logo/psiphon3-vpn.png',
desc: 'Psiphon3 is a circumvention software for Windows and other platforms that provides uncensored access to Internet content.'
}, },
{ {
knowledgeId: 5, knowledgeId: 5,
label: 'FQDN Category', label: 'Domain Category',
iconUrl: 'images/knowledge-base-logo/fqdn.png' iconUrl: 'images/knowledge-base-logo/fqdn.png',
desc: 'Domain category provides basic information including categories, providers, reputation score.'
}, },
{ {
knowledgeId: 6, knowledgeId: 6,
label: 'FQDN Whois', label: 'Domain Whois',
iconUrl: 'images/knowledge-base-logo/fqdn-whois.png' iconUrl: 'images/knowledge-base-logo/fqdn-whois.png',
desc: 'Domain whois contains registration and ownership information for domain names. It includes details like domain registrar, registrant, creation/expiry dates, and contact information.'
}, },
{ {
knowledgeId: 2, knowledgeId: 2,
label: 'IP ASN', label: 'IP ASN',
iconUrl: 'images/knowledge-base-logo/ip-asn.png' iconUrl: 'images/knowledge-base-logo/ip-asn.png',
desc: 'ASN Database associates IP addresses with their corresponding Autonomous System Numbers, which are unique identifiers assigned to internet networks. This database helps identify the network and its owner, facilitating network analysis and monitoring tasks.'
}, },
{ {
knowledgeId: 3, knowledgeId: 3,
label: 'DNS Server Info', label: 'DNS Server Info',
iconUrl: 'images/knowledge-base-logo/dns-server-info.png' iconUrl: 'images/knowledge-base-logo/dns-server-info.png',
desc: 'A DNS Server Info stores information about Domain Name System (DNS) servers. It includes details such as IP addresses, host names, locations, software name, operation system, and roles of the servers.'
}, },
{ {
knowledgeId: 9, knowledgeId: 9,
label: 'APP Category', label: 'APP Category',
iconUrl: 'images/knowledge-base-logo/app-category.png' iconUrl: 'images/knowledge-base-logo/app-category.png',
desc: 'APP category provides basic information for over 3000 popular applications, including their categories and service providers.'
}, },
{ {
knowledgeId: 7, knowledgeId: 7,
label: 'Indicators of Compromise', label: 'Indicators of Compromise',
iconUrl: 'images/knowledge-base-logo/indicators-of-compromise.png' iconUrl: 'images/knowledge-base-logo/indicators-of-compromise.png',
desc: 'Indicator of Compromise (IoC) refers to forensic artifacts, such as unusual network traffic or malicious files, indicating a security breach or cyberattack.'
}, },
{ {
knowledgeId: 4, knowledgeId: 4,
label: 'ICP', label: 'ICP',
iconUrl: 'images/knowledge-base-logo/icp.png' iconUrl: 'images/knowledge-base-logo/icp.png',
desc: 'ICP (Internet Content Provider) license is a permit issued by Chinese authorities, mandatory for websites to legally operate and publish content within mainland China.'
}, },
{ {
knowledgeId: 1, knowledgeId: 1,
label: 'IP Location', label: 'IP Location',
iconUrl: 'images/knowledge-base-logo/ip-location.png' iconUrl: 'images/knowledge-base-logo/ip-location.png',
desc: 'IP location Database is a repository containing geographical data associated with IP addresses, such as country, city, ISP, organization, latitude, longitude, and other relevant details.'
}, },
{ {
knowledgeId: 8, knowledgeId: 8,
label: 'Anonymity', label: 'Anonymity',
iconUrl: 'images/knowledge-base-logo/anonymity.png' iconUrl: 'images/knowledge-base-logo/anonymity.png',
desc: 'Communication system that conceals users\' identities and activities to protect privacy and prevent tracking or surveillance. This database provides lists of Tor nodes, I2P nodes, obfs4, etc.'
} }
] ]

View File

@@ -477,93 +477,3 @@ export default {
} }
} }
</script> </script>
<style lang="scss">
.del-model__hint {
display:flex;
flex-direction: column;
padding-bottom:0px !important;
width:480px !important;
height:190px;
.el-message-box__header{
display: flex;
flex-direction: row;
border-bottom:1px solid #eee;
height:42px;
background: #F7F7F7;
box-shadow: 0 1px 0 0 rgba(53,54,54,0.08);
padding-left:20px;
padding-top:14px;
padding-bottom:14px;
.el-message-box__headerbtn {
display: flex !important;
flex-direction: row-reverse;
justify-content: center;
align-items: center;
font-size: 10px;
line-height: 10px;
padding-right: 5px !important;
i {
width:10px;
height:10px;
}
}
.el-message-box__title {
font-size: 14px !important;
color: #353636;
letter-spacing: 0;
font-weight: 400;
}
}
.el-message-box__content {
height:96px;
font-size: 14px;
color: #353636;
letter-spacing: 0;
line-height: 22px;
font-weight: 400;
padding-top:8px;
padding-right:20px;
padding-left:20px;
.el-message-box__message {
padding-left:0px !important;
padding-right:0px !important;
}
}
.el-message-box__btns {
height:52px;
border-top:1px solid #eee;
box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.07);
padding:11px 0px 12px!important;
.el-button--small {
padding:8px 21px !important;
line-height: 12px;
//font-family: NotoSansHans-Medium !important;
font-size: 12px;
font-weight: 500;
min-height: 28px;
}
.el-button:nth-child(1) {
margin-right:20px;
width:80px;
height:28px;
color: #353636;
}
.el-button:nth-child(2) {
width:80px;
height:28px;
margin-right:20px;
margin-left:0px !important;
background-color:#2d8cf0;
border-color:#2d8cf0;
}
}
}
.el-dialog {
display: flex;
flex-direction: column; // 水平分布
margin: 0 !important;
position: absolute;
top: calc(50% - 150px);
left: calc(50% - 240px);
}
</style>