Skip to content

Commit

Permalink
feat: 1.14 开发 (TencentBlueKing#65)
Browse files Browse the repository at this point in the history
* feat: 1.14 开发

* feat: 1.14 开发

* feat: 1.14 开发
  • Loading branch information
shuzhenyang authored Jul 7, 2024
1 parent fca8ec7 commit df34b1f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/dashboard-front/src/http/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ export const deleteResourceDocs = (apigwId: number, resourceId: number, docId: n
*/
export const checkNeedNewVersion = (apigwId: number) => fetch.get(`${BK_DASHBOARD_URL}/gateways/${apigwId}/resource-versions/need-new-version/`, { globalError: false });

/**
* 获取建议的版本
* @param apigwId 网关id
*/
export const getNextVersion = (apigwId: number) => fetch.get(`${BK_DASHBOARD_URL}/gateways/${apigwId}/resource-versions/next-version/`);

/**
* 设置标签
* @param apigwId 网关id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const props = defineProps({
},
});
const emit = defineEmits(['input', 'search', 'choose']);
const emit = defineEmits(['update:modeValue', 'search', 'choose']);
const searchInputRef = ref(null);
const localValue = ref('');
Expand Down Expand Up @@ -135,7 +135,7 @@ watch(
watch(
() => localValue.value,
(payload: string) => {
emit('input', payload);
emit('update:modeValue', payload);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</template>
</bk-collapse-panel>

<bk-collapse-panel :name="2" class="collapse-panel mb32">
<bk-collapse-panel :name="2" class="collapse-panel mb32" @change="handlePanelChange">
<template #header>
<div class="collapse-panel-header">
<angle-up-fill :class="['panel-title-icon', activeIndex?.includes(2) ? '' : 'packUp']" />
Expand Down Expand Up @@ -311,6 +311,12 @@ const setSearchTimeRange = () => {
});
};
const handlePanelChange = ({ name }: any) => {
if (name === 2) {
chartResize();
}
};
const renderChart = (data: Record<string, any>) => {
const { series, timeline } = data;
const xAxisData = timeline.map((time: number) => dayjs.unix(time).format('YYYY-MM-DD\nHH:mm:ss'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@
:description="t('版本号须符合 Semver 规范,例如:1.1.1,1.1.1-alpha.1')"
class="form-item-version mt-20"
required>
<bk-input
v-model="formData.version"
:placeholder="t('由数字、字母、中折线(-)、点号(.)组成,长度小于64个字符')"
/>
<bk-popover
:content="t('由数字、字母、中折线(-)、点号(.)组成,长度小于64个字符')"
theme="light"
>
<bk-input
v-model="formData.version"
:placeholder="t('由数字、字母、中折线(-)、点号(.)组成,长度小于64个字符')"
/>
</bk-popover>
<div class="form-tips">
<i class="apigateway-icon icon-ag-info"></i>
{{ t('版本号须符合 Semver 规范,例如:1.1.1,1.1.1-alpha.1') }}
Expand Down Expand Up @@ -186,6 +191,7 @@ import {
createResourceVersion,
resourceVersionsDiff,
getStageList,
getNextVersion,
} from '@/http';
import { useGetStageList } from '@/hooks';
import versionDiff from '@/components/version-diff/index.vue';
Expand Down Expand Up @@ -375,11 +381,19 @@ const handlePublish = async () => {
}
};
const getSuggestionVersion = async () => {
const res = await getNextVersion(apigwId.value);
if (res?.version) {
formData.version = res.version;
}
};
watch(
() => isShow.value,
(val) => {
if (val) {
getResourceVersions();
getSuggestionVersion();
} else {
stepsConfig.value.curStep = 1;
formData.version = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@
</bk-button>
<template v-else-if="stepsConfig.curStep === 2">
<bk-button theme="primary" style="width: 100px" @click="showPublishDia">
{{ isRollback ? $t('确认回滚') : $t('确认发布') }}
<!-- {{ isRollback ? $t('确认回滚') : $t('确认发布') }} -->
{{ $t('确认发布') }}
</bk-button>
<bk-button style="margin-left: 4px; width: 100px" @click="handleBack">
{{ $t('上一步') }}
Expand Down

0 comments on commit df34b1f

Please sign in to comment.