diff --git a/src/assets/css/components/views/setting/knowledgeBase.scss b/src/assets/css/components/views/setting/knowledgeBase.scss index e69de29b..ea6e4c61 100644 --- a/src/assets/css/components/views/setting/knowledgeBase.scss +++ b/src/assets/css/components/views/setting/knowledgeBase.scss @@ -0,0 +1,331 @@ +.edit-knowledge-base { + height: 100%; + + .edit-knowledge-base__header { + padding: 30px 0 30px 20px; + font-size: 24px; + line-height: 24px; + font-weight: 900; + color: #353636; + } + .edit-knowledge-base__body { + display: flex; + height: calc(100% - 147px); + padding-left: 20px; + overflow: auto; + + .el-steps { + margin-left: 10px; + + .el-step { + transition: flex-basis ease-in-out .28s; + } + .el-step__head { + .el-step__line { + top: 26px; + bottom: 2px; + background-color: #38ACD2; + border-color: transparent; + opacity: 0.66; + } + + &.is-finish, &.is-process { + .el-step__icon { + border-color: #38ACD2; + color: white; + background: #38ACD2; + } + } + + &.is-process { + .el-step__line { + opacity: 1; + } + } + + &.is-wait { + .el-step__icon { + border-color: #38ACD2; + color: #38ACD2; + } + } + + .el-step__icon-inner { + font-size: 16px; + font-weight: normal; + } + } + } + + .el-collapse { + width: 655px; + margin-left: 5px; + border: none; + + .el-collapse-item.upload-collapse { + .el-collapse-item__wrap { + height: 260px; + } + } + .el-collapse-item { + min-height: 58px; + + .el-collapse-item__header { + height: unset; + line-height: unset; + border: none; + font-size: 16px; + color: #333333; + + &.focusing:focus:not(:hover) { + color: unset; + } + .form-sub-title { + padding-left: 35px; + } + } + .el-collapse-item__header > i { + transform: translateX(-630px); + color: #38ACD2; + font-weight: bold; + } + .el-collapse-item__header > i.is-active { + transform: translateX(-630px) rotate(90deg); + } + .el-collapse-item__wrap { + padding-left: 35px; + border: none; + } + .el-collapse-item__content { + padding-bottom: 20px; + } + + .upload-error-tip, .preview-error-tip { + color: $--color-danger; + } + .upload-error-tip { + margin-top: -11px; + } + .el-upload { + margin-top: 12px; + + .upload-tip { + font-size: 12px; + color: #999999; + } + .el-upload-dragger { + width: 320px; + border-radius: 2px; + transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + } + + } + .el-upload--error .el-upload-dragger { + border-color: $--color-danger; + } + .el-upload-list { + .el-upload-list__item { + padding: 0 5px; + margin-top: unset; + height: 36px; + line-height: 36px; + background: #F5F8FA; + border-radius: 2px; + color: #353636; + + .el-icon-close { + top: 11px; + } + .el-icon-close-tip { + top: 11px; + } + .el-progress.el-progress--line { + top: unset; + } + } + } + } + } + + .el-form { + margin-top: 20px; + width: 620px; + + label { + padding-bottom: 6px; + font-size: 14px; + color: #333333; + line-height: unset; + } + + .el-form-item { + margin-bottom: 12px; + } + .el-form-item__content { + line-height: unset; + + .el-input__inner { + padding-left: 8px; + font-size: 14px; + color: #353636; + } + + .form-select { + width: 100%; + + .el-input__inner { + background-color: #F5F8FA; + } + } + } + } + .skeleton-border { + position: relative; + margin-top: 12px; + padding: 15px; + border: 1px solid #DCDFE6; + border-radius: 2px; + + .skeleton-item-row:not(:nth-of-type(6)) { + margin-bottom: 5px; + } + .el-skeleton__item { + background: #F5F8FA; + } + .skeleton-tip { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 14px; + color: #353636; + } + } + .imported-tip { + margin-top: 8px; + margin-bottom: 4px; + font-size: 14px; + color: #333333; + + .cn-icon { + font-size: 16px; + color: #38ACD2; + } + } + .imported-table-box { + position: relative; + height: 367px; + border: 1px solid #DEDEDE; + border-radius: 2px; + transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + + &.imported-table-box--error { + border-color: $--color-danger; + } + .imported-table { + padding: 0 12px; + width: 100%; + table-layout: fixed; + + th { + text-align: left; + font-size: 14px; + color: #353636;; + } + td { + font-size: 14px; + color: #353636; + } + .imported-data-msg, .imported-data-item, .imported-data-value { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .imported-data-msg { + width: 140px; + } + + .el-icon-close { + color: #666; + font-weight: bold; + cursor: pointer; + + &:hover { + color: #111; + } + } + .el-icon-success { + color: #749F4D; + } + .el-icon-error { + color: #E26154; + } + } + + .imported-pagination.pagination { + position: absolute; + width: 100%; + bottom: 0; + margin-top: 4px; + padding-top: 8px; + height: 42px; + border-top: 1px solid #eee; + + .btn-prev, .btn-next, .number { + margin: 0 2px; + } + .el-pager li, .el-pagination .btn-next, .el-pagination .btn-prev { + border: none; + font-size: 12px; + } + .el-pagination .el-pager li { + color: #353636; + } + .el-pagination .el-pager li.active { + background-color: #38ACD2; + color: white; + } + } + } + } + .edit-knowledge-base__footer { + display: flex; + align-items: center; + justify-content: center; + height: 60px; + margin-top: 3px; + box-shadow: 0 -1px 4px 0 rgba(0,0,0,0.10); + + .footer__btn { + margin: 0 10px; + height: 30px; + min-width: 74px; + padding: 0 15px; + color: white; + background-color: #38ACD2; + border: none; + border-radius: 4px; + outline: none; + font-size: 14px; + cursor: pointer; + transition: background-color linear .2s, color linear .1s; + } + .footer__btn:hover:not(.footer__btn--disabled) { + background-color: lighten(#38ACD2, 10%); + } + .footer__btn--light { + background-color: #F5F6F7; + border: 1px solid $--border-color-primary; + color: #333; + } + .footer__btn.footer__btn--light:hover:not(.footer__btn--disabled) { + background-color: white; + border-color: lighten(#38ACD2, 40%); + color: #38ACD2; + } + .footer__btn--disabled { + opacity: .6; + cursor: default; + } + } +} diff --git a/src/assets/css/themes/theme-light.scss b/src/assets/css/themes/theme-light.scss index b6684553..e405c677 100644 --- a/src/assets/css/themes/theme-light.scss +++ b/src/assets/css/themes/theme-light.scss @@ -2,10 +2,10 @@ /** 重写element-ui变量 **/ -$--color-primary: #0091ff; // 主题色 -$--color-primary-dark-10: darken(#0091ff, 10%); // 默认主题色 深10% -$--color-primary-light-10: lighten(#0091ff, 10%); // 默认主题色 浅10% -$--color-primary-light-20: lighten(#0091ff, 20%); // 默认主题色 浅20% +$--color-primary: #699DC9; // 主题色 +$--color-primary-dark-10: darken(#699DC9, 10%); // 默认主题色 深10% +$--color-primary-light-10: lighten(#699DC9, 10%); // 默认主题色 浅10% +$--color-primary-light-20: lighten(#699DC9, 20%); // 默认主题色 浅20% /* menu相关 */ $--menu-background-color: #00162B; // menu背景色 diff --git a/src/components/common/Pagination.vue b/src/components/common/Pagination.vue index e3e0297a..286c0a95 100644 --- a/src/components/common/Pagination.vue +++ b/src/components/common/Pagination.vue @@ -11,6 +11,7 @@ :page-size="Number(pageObj.pageSize)" :layout="layout" :total="pageObj.total" + v-bind="bind" > {} + }, + storePageNoOnUrl: { + type: Boolean, + default: true } }, /** * 添加vue3的setup,目的是添加/获取地址栏的参数 */ - setup () { + setup (props) { const { query } = useRoute() const pageSize = ref(defaultPageSize) - const currentPageNo = ref(query.pageNo || 1) + const currentPageNo = ref(props.storePageNoOnUrl ? (query.pageNo || (props.pageObj.pageNo || 1)) : (props.pageObj.pageNo || 1)) return { pageSize, diff --git a/src/components/table/setting/KnowledgeBaseTable.vue b/src/components/table/setting/KnowledgeBaseTable.vue index 35aa956c..25f3d40a 100644 --- a/src/components/table/setting/KnowledgeBaseTable.vue +++ b/src/components/table/setting/KnowledgeBaseTable.vue @@ -44,6 +44,14 @@ - + {{scope.row[item.prop]}} @@ -103,7 +111,7 @@ export default { show: true }, { label: this.$t('overall.updateTime'), - prop: 'updateTime', + prop: 'utime', show: true } ] diff --git a/src/store/index.js b/src/store/index.js index 3fd48010..6aac6e55 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -12,7 +12,8 @@ const store = createStore({ return { i18n: false, showEntityTypeSelector: false, // 在entity explore页面时,控制header显示实体类型选择框 - from: '' // entity type + from: '', // entity type + test: 'jest' // 用于单测的demo } }, getters: { @@ -24,6 +25,9 @@ const store = createStore({ }, entityName (state) { return state.entityName + }, + getTest (state) { + return state.test } }, mutations: { @@ -37,6 +41,9 @@ const store = createStore({ }, showEntityTypeSelector (state, show) { state.showEntityTypeSelector = show + }, + setTest (state, test) { + state.test = test } } }) diff --git a/src/utils/api.js b/src/utils/api.js index 08f2cb29..5103d533 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -34,7 +34,7 @@ export const api = { // galaxyProxy galaxyProxy: '/galaxy/setting', // 知识库 - knowledgeBase: '/knowledgeBase', + knowledgeBase: '/knowledge', // 报告相关 reportJob: '/report/job', diff --git a/src/utils/constants.js b/src/utils/constants.js index 96d4807d..62247abc 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -277,6 +277,21 @@ export const cycle = { pre: 1 } +export const knowledgeBaseType = [ + { + name: 'IP', + value: 'ip' + }, + { + name: 'Domain', + value: 'domain' + }, + { + name: 'APP', + value: 'app' + } +] + export const curTabState = { curTab: 'curTab', tableMetric: 'tableMetric', diff --git a/src/views/setting/KnowledgeBase.vue b/src/views/setting/KnowledgeBase.vue index 1e91be06..d7163843 100644 --- a/src/views/setting/KnowledgeBase.vue +++ b/src/views/setting/KnowledgeBase.vue @@ -74,28 +74,6 @@ export default { t: +new Date() } }) - }, - getTableData () { - this.tools.loading = false - this.tableData = [ - { - tagName: '我的IP库', - buildIn: 0, - id: 1, - tagType: 'ip', - remark: '我的IP库描述', - updateTime: new Date() - }, - { - tagName: '我的domain库', - buildIn: 0, - id: 2, - tagType: 'domain', - remark: '我的domain库描述', - updateTime: new Date() - } - ] - this.pageObj.total = 2 } } } diff --git a/src/views/setting/KnowledgeBaseForm.vue b/src/views/setting/KnowledgeBaseForm.vue index cf8b05b2..6893370e 100644 --- a/src/views/setting/KnowledgeBaseForm.vue +++ b/src/views/setting/KnowledgeBaseForm.vue @@ -1,28 +1,306 @@ - - -