diff --git a/src/dashboard-front/src/language/lang.ts b/src/dashboard-front/src/language/lang.ts index 6499ca447..65df24cda 100644 --- a/src/dashboard-front/src/language/lang.ts +++ b/src/dashboard-front/src/language/lang.ts @@ -237,6 +237,7 @@ const lang: ILANG = { '访问地址': ['Access URL'], '子路径': ['Subpath'], '选择日期时间范围': ['Select date and time range'], + '输入的时间错误': ['Invalid Time Format'], '隐藏示例': ['Hide example'], '显示示例': ['Show example'], '创建时间': ['Create Time'], @@ -1577,6 +1578,9 @@ const lang: ILANG = { '环境删除': ['Stage Delete'], '环境更新': ['Stage Update'], '服务更新': ['Backend Update'], + '文件名需要跟资源名称完全一致才能导入,请检查文件名': ['Filename must matches resource name'], + '已匹配到资源': ['Resource matched'], + '未匹配到资源': ['Resource not matched'], // 变量的使用 $t('test', { vari1: 1, vari2: 2 }) // // 变量的使用 $t('test', { vari1: 1, vari2: 2 }) diff --git a/src/dashboard-front/src/views/operate-data/access-log/index.vue b/src/dashboard-front/src/views/operate-data/access-log/index.vue index ae0cf16e3..36a825648 100644 --- a/src/dashboard-front/src/views/operate-data/access-log/index.vue +++ b/src/dashboard-front/src/views/operate-data/access-log/index.vue @@ -25,7 +25,10 @@ :use-shortcut-text="true" :clearable="false" :shortcut-selected-index="shortcutSelectedIndex" - @shortcut-change="handleShortcutChange" @change="handlePickerChange" /> + @shortcut-change="handleShortcutChange" + @change="handlePickerChange" + @pick-success="handlePickerConfirm" + /> { }); }; +// 处理用户自行输入日期,点击确认后的情况。v-model 不会自动更新,要从 picker 内部拿输入的日期。 +const handlePickerConfirm = () => { + const internalValue = datePickerRef.value?.internalValue; + if (internalValue) { + dateTimeRange.value = internalValue; + handlePickerChange(); + } else { + Message({ theme: 'warning', message: t('输入的时间错误'), delay: 2000, dismissable: false }); + } +}; + const handleStageChange = (value: number) => { searchParams.value.stage_id = value; pagination.value.current = 1; diff --git a/src/dashboard-front/src/views/operate-data/report/index.vue b/src/dashboard-front/src/views/operate-data/report/index.vue index 54f13e768..37f3c93d8 100644 --- a/src/dashboard-front/src/views/operate-data/report/index.vue +++ b/src/dashboard-front/src/views/operate-data/report/index.vue @@ -432,7 +432,13 @@ const handleResourceChange = (value: any) => { }; const handleTimeChange = () => { - getDataByDimension(); + const internalValue = datePickerRef.value?.internalValue; + if (internalValue) { + dateTimeRange.value = internalValue; + getDataByDimension(); + } else { + Message({ theme: 'warning', message: t('输入的时间错误'), delay: 2000, dismissable: false }); + } }; const handleShortcutChange = (value: any, index: number) => { diff --git a/src/dashboard-front/src/views/operate-records/index.vue b/src/dashboard-front/src/views/operate-records/index.vue index da6292359..ca79f8950 100644 --- a/src/dashboard-front/src/views/operate-records/index.vue +++ b/src/dashboard-front/src/views/operate-records/index.vue @@ -100,6 +100,7 @@ import { TableEmptyConfType, } from './common/type'; import { fetchApigwAuditLogs } from '@/http'; +import { Message } from 'bkui-vue'; const { t } = i18n.global; const AccessLogStore = useAccessLog(); @@ -355,7 +356,13 @@ const getOpObjectTypeText = (type: string) => { }; const handleTimeChange = () => { - setSearchTimeRange(); + const internalValue = topDatePicker.value?.internalValue; + if (internalValue) { + dateTimeRange.value = internalValue; + setSearchTimeRange(); + } else { + Message({ theme: 'warning', message: t('输入的时间错误'), delay: 2000, dismissable: false }); + } }; const handleTimeClear = () => { diff --git a/src/dashboard-front/src/views/resource/setting/comps/edit-import-resource-side-slider.vue b/src/dashboard-front/src/views/resource/setting/comps/edit-import-resource-side-slider.vue index e54e8659a..4219d4bc3 100644 --- a/src/dashboard-front/src/views/resource/setting/comps/edit-import-resource-side-slider.vue +++ b/src/dashboard-front/src/views/resource/setting/comps/edit-import-resource-side-slider.vue @@ -146,7 +146,7 @@ watch(() => props.isSliderShow, (val) => { padding: 24px 24px 0 24px; :deep(.collapse-cls) { - margin-bottom: 52px; + margin-bottom: 24px; .bk-collapse-item { background: #fff; diff --git a/src/dashboard-front/src/views/resource/setting/import-doc.vue b/src/dashboard-front/src/views/resource/setting/import-doc.vue index c5c9bfc01..8e68f9544 100644 --- a/src/dashboard-front/src/views/resource/setting/import-doc.vue +++ b/src/dashboard-front/src/views/resource/setting/import-doc.vue @@ -120,12 +120,14 @@ show-overflow-tooltip :checked="checkData" :is-row-select-enable="isRowSelectEnable" + :row-class="getRowClass" @selection-change="handleSelectionChange" > @@ -285,7 +293,7 @@ const handleUploadDone = async (response: any) => { const res = response[0].response.data; const data = res.map((e: any) => ({ ...e, ...e.resource, ...e.resource_doc })); tableData.value = data; - checkData.value = data.filter((e: any) => !!e.resource_doc); // 有资源文档的才默认选中 + checkData.value = data.filter((e: any) => !!e.resource); // 有资源文档的才默认选中 curView.value = 'resources'; nextTick(() => { selections.value = JSON.parse(JSON.stringify(checkData.value)); @@ -360,9 +368,22 @@ const handleImportDoc = async () => { // 没有资源不能导入 const isRowSelectEnable = (data: any) => { - console.log('row', data); + // console.log('row', data); if (docType.value === 'swagger') return true; // 如果是swagger 则可以选择 - return data?.row.resource_doc; + return !!data?.row.resource; +}; + +// 获取 checkbox 悬浮时的文本 +const getColExplainContent = (row: any) => { + if (docType.value !== 'swagger' && !row?.resource) { + return t('文件名需要跟资源名称完全一致才能导入,请检查文件名'); + } + return t('已匹配到资源'); +}; + +// 为不能选中的行添加类名 +const getRowClass = (data: any) => { + if (docType.value !== 'swagger' && !data?.resource) return 'row-disabled'; }; // 取消返回到资源列表 @@ -431,5 +452,12 @@ const handleHiddenExample = () => { display: none !important; } } + + // 不能被选中的表格行的样式 + :deep(.row-disabled) { + td { + background-color: #fafbfd; + } + } } diff --git a/src/dashboard-front/src/views/resource/setting/import.vue b/src/dashboard-front/src/views/resource/setting/import.vue index 104387468..1b4cfd780 100644 --- a/src/dashboard-front/src/views/resource/setting/import.vue +++ b/src/dashboard-front/src/views/resource/setting/import.vue @@ -801,7 +801,6 @@ v-if="curView === 'resources'" > { activeCodeMsgType.value = (type === activeCodeMsgType.value) ? 'All' : type; activeVisibleErrorMsgIndex.value = -1; updateEditorDecorations(); - // 如果有错误消息,点击后可以展开错误消息栏 - if (isEditorMsgCollapsed && visibleErrorReasons.value.length > 0) { + // 如果有错误消息,点击后可以展开/收起错误消息栏 + if (visibleErrorReasons.value.length > 0) { nextTick(() => { - resizeLayoutRef?.value?.setCollapse(false); + if (isEditorMsgCollapsed) { + resizeLayoutRef.value?.setCollapse(false); + } else { + resizeLayoutRef.value?.setCollapse(true); + } }); } }; @@ -1893,6 +1896,12 @@ const handleReturnClick = () => { bottom: 0; padding-left: 48px; border-top: 1px solid #DCDEE5; + + .page-actions { + display: flex; + align-items: center; + gap: 8px; + } } } @@ -2109,8 +2118,11 @@ const handleReturnClick = () => { :deep(.bk-resize-layout > .bk-resize-layout-aside .bk-resize-collapse) { margin-bottom: 9px; margin-left: -16px; - background: #1a1a1a; - box-shadow: 0 0 2px 0 rgba(255, 255, 255, 0.1); + background: #313238; + + &:hover { + background-color: #63656E; + } } &.hide-collapse-btn { @@ -2177,7 +2189,7 @@ const handleReturnClick = () => { .res-counter-banner { height: 40px; padding: 0 24px 0 12px; - margin-bottom: 8px; + margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center;