From 4dc8ffee08e9dd0562dce0445fc9e5a864073272 Mon Sep 17 00:00:00 2001 From: q15971095971 <764419406@qq.com> Date: Fri, 23 Aug 2024 18:07:58 +0800 Subject: [PATCH 01/15] =?UTF-8?q?feat:=20=E6=8F=90=E4=BA=A4=E5=AE=A1?= =?UTF-8?q?=E6=89=B970%=E8=BF=9B=E5=BA=A6=20--story=3D115998324?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bcs-services/bcs-bscp/ui/index.html | 1 + bcs-services/bcs-bscp/ui/package.json | 3 + bcs-services/bcs-bscp/ui/src/api/config.ts | 54 +- bcs-services/bcs-bscp/ui/src/api/index.ts | 8 + .../ui/src/components/user-selector/index.vue | 27 + .../user-selector-origin/alternate-item.tsx | 120 ++ .../user-selector-origin/alternate-list.tsx | 168 +++ .../user-selector-origin/icon-user.svg | 1 + .../user-selector-origin/index.ts | 31 + .../user-selector-origin/instance-store.ts | 16 + .../user-selector-origin/render-alternate.ts | 20 + .../user-selector-origin/render-avatar.tsx | 51 + .../user-selector-origin/render-list.ts | 43 + .../user-selector-origin/render-tag.ts | 44 + .../user-selector-origin/request.ts | 231 ++++ .../user-selector-origin/selector.vue | 1204 +++++++++++++++++ .../user-selector-origin/style.css | 401 ++++++ .../user-selector-origin/tooltips.ts | 31 + .../bcs-bscp/ui/src/constants/config.ts | 24 + bcs-services/bcs-bscp/ui/src/i18n/en-us.ts | 2 +- bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts | 25 +- bcs-services/bcs-bscp/ui/src/request/index.ts | 3 + .../detail/components/detail-header.vue | 18 + .../detail/components/header-more-options.vue | 95 ++ .../components/modify-group-publish.vue | 54 +- .../publish-version/confirm-dialog.vue | 104 +- .../components/publish-version/index.vue | 65 +- .../components/version-approve-status.vue | 132 ++ .../version-simple-list.vue | 4 + .../list/components/create-service.vue | 19 +- .../service/list/components/edit-service.vue | 73 +- .../service/list/components/service-form.vue | 240 +++- .../list/components/service-list-content.vue | 10 +- bcs-services/bcs-bscp/ui/types/app.ts | 3 + bcs-services/bcs-bscp/ui/types/service.ts | 5 + bcs-services/bcs-bscp/ui/vite.config.ts | 2 + bcs-services/bcs-bscp/ui/yarn.lock | 364 ++++- 37 files changed, 3661 insertions(+), 35 deletions(-) create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/index.vue create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/alternate-item.tsx create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/alternate-list.tsx create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/icon-user.svg create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/index.ts create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/instance-store.ts create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-alternate.ts create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-avatar.tsx create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-list.ts create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-tag.ts create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/request.ts create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/selector.vue create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/style.css create mode 100644 bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/tooltips.ts create mode 100644 bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue create mode 100644 bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/version-approve-status.vue diff --git a/bcs-services/bcs-bscp/ui/index.html b/bcs-services/bcs-bscp/ui/index.html index 91a22afac5..babe358239 100644 --- a/bcs-services/bcs-bscp/ui/index.html +++ b/bcs-services/bcs-bscp/ui/index.html @@ -16,6 +16,7 @@ var GRPC_ADDR = '{{ .GRPC_ADDR }}'; var HTTP_ADDR = '{{ .HTTP_ADDR }}'; var BK_NODE_HOST = '{{ .BK_NODE_HOST }}'; + var User_Man_Host = '{{ .User_Man_Host }}'; window.BSCP_CONFIG = JSON.parse('{{ .BK_BSCP_CONFIG }}'); diff --git a/bcs-services/bcs-bscp/ui/package.json b/bcs-services/bcs-bscp/ui/package.json index faf77b7a2d..cd4a37fb7d 100644 --- a/bcs-services/bcs-bscp/ui/package.json +++ b/bcs-services/bcs-bscp/ui/package.json @@ -15,8 +15,10 @@ "@blueking/login-modal": "^1.0.1", "@blueking/notice-component": "^2.0.1", "@blueking/platform-config": "^1.0.3", + "@icon-cool/bk-icon-bk-biz-components": "^0.0.4", "@types/js-cookie": "^3.0.2", "@types/lodash.clonedeep": "^4.5.7", + "@vitejs/plugin-vue-jsx": "^4.0.1", "axios": "^1.6.0", "bkui-vue": "1.0.3-beta.32", "crypto-js": "^4.2.0", @@ -29,6 +31,7 @@ "monaco-editor": "^0.34.1", "pinia": "^2.0.33", "sass": "^1.54.8", + "tippy.js": "^6.3.7", "vue": "^3.4.21", "vue-i18n": "9", "vue-router": "^4.1.5" diff --git a/bcs-services/bcs-bscp/ui/src/api/config.ts b/bcs-services/bcs-bscp/ui/src/api/config.ts index 31e9d4d577..fb7d0ef474 100644 --- a/bcs-services/bcs-bscp/ui/src/api/config.ts +++ b/bcs-services/bcs-bscp/ui/src/api/config.ts @@ -182,11 +182,7 @@ export const downloadConfigContent = (bizId: string, appId: number, signature: s * @param signature 文件内容的SHA256值 * @returns */ -export const getConfigUploadFileIsExist = ( - bizId: string, - appId: number, - signature: string, -) => +export const getConfigUploadFileIsExist = (bizId: string, appId: number, signature: string) => http .get(`/biz/${bizId}/content/metadata`, { headers: { @@ -278,6 +274,35 @@ export const publishVersion = ( }, ) => http.post(`/config/update/strategy/publish/publish/release_id/${releaseId}/app_id/${appId}/biz_id/${bizId}`, data); +/** + * 发布版本(增加审批) + * @param bizId 业务ID + * @param appId 应用ID + * @param data 参数 + * @param publish_type 上线方式 + * @param publish_time 定时上线时间 + * @returns + */ +export const publishVerSubmit = ( + bizId: string, + appId: number, + releaseId: number, + data: { + groups: Array; + all: boolean; + memo: string; + publishType: 'Manually' | 'Automatically' | 'Periodically' | 'Immediately' | ''; + publishTime: Date | string; + }, +) => + http.post(`/config/biz_id/${bizId}/app_id/${appId}/release_id/${releaseId}/submit`, { + groups: data.groups, + all: data.all, + memo: data.memo, + publish_type: data.publishType, + publish_time: data.publishTime, + }); + /** * 获取服务下初始化脚本引用配置 * @param bizId 业务ID @@ -663,3 +688,22 @@ export const importKvFormYaml = (bizId: string, appId: number, content: string) */ export const createVersionNameCheck = (bizId: string, appId: number, name: string) => http.get(`/config/biz_id/${bizId}/app_id/${appId}/release/${name}/check`); + +/** + * 上次上线方式查询 + * @param bizId 业务ID + * @param appId 应用ID + * @returns + */ +export const publishType = (bizId: string, appId: number) => + http.get(`/config/biz_id/${bizId}/app_id/${appId}/last/select`); + +/** + * 版本上线状态查询 + * @param bizId 业务ID + * @param appId 应用ID + * @param releaseId 版本ID + * @returns + */ +export const versionStatusQuery = (bizId: number, appId: number, releaseId: number) => + http.get(`/config/biz_id/${bizId}/app_id/${appId}/release_id/${releaseId}/status`); diff --git a/bcs-services/bcs-bscp/ui/src/api/index.ts b/bcs-services/bcs-bscp/ui/src/api/index.ts index 6ec63b509e..c51cb7488c 100644 --- a/bcs-services/bcs-bscp/ui/src/api/index.ts +++ b/bcs-services/bcs-bscp/ui/src/api/index.ts @@ -114,3 +114,11 @@ export const loginOut = () => http.get('/logout').then((resp) => { window.location.href = `${resp.data.login_url}${encodeURIComponent(window.location.href)}&is_from_logout=1`; }); + +/** + * 审批人员名单 + * @returns + */ +export const approverListApi = () => + `${(window as any).User_Man_Host}/api/c/compapi/v2/usermanage/fs_list_users/?app_code=bk-magicbox&page_size=1000&page=1`; +// /api/c/compapi/v2/usermanage/fs_list_users/?app_code=bk-magicbox&page_size=1000&page=1" diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/index.vue b/bcs-services/bcs-bscp/ui/src/components/user-selector/index.vue new file mode 100644 index 0000000000..1db30c01f4 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/index.vue @@ -0,0 +1,27 @@ + + + diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/alternate-item.tsx b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/alternate-item.tsx new file mode 100644 index 0000000000..150de4d9b6 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/alternate-item.tsx @@ -0,0 +1,120 @@ +// @ts-nocheck +import { computed, defineComponent, toRefs, withModifiers } from 'vue'; + +import RenderAvatar from './render-avatar'; +import RenderList from './render-list'; +import tooltips from './tooltips'; + +export default defineComponent({ + name: 'AlternateItem', + directives: { + tooltips, + }, + // props: ['selector', 'user', 'keyword', 'index'], + props: { + selector: { + type: Object, + }, + user: { + type: Object, + }, + keyword: { + type: String, + }, + index: { + type: Number, + }, + }, + setup(props) { + const { selector, user, keyword } = toRefs(props); + const disabled = computed(() => selector.value.disabledUsers.includes(user.value.username)); + const getItemContent = () => { + const [nameWithoutDomain, domain] = user.value.username.split('@'); + let displayText = nameWithoutDomain; + if (keyword.value) { + displayText = displayText.replace( + new RegExp(keyword.value, 'g'), + `${keyword.value}`, + ); + } + const displayUsername = selector.value.displayDomain && domain + ? `${displayText}@${domain}` + : displayText; + + const displayName = user.value.display_name; + if (displayName) { + return `${displayUsername}(${displayName})`; + } + + return displayUsername; + }; + const getTitle = () => selector.value.getDisplayText(user.value); + + return { + disabled, + getItemContent, + getTitle, + }; + }, + render() { + return ( +
  • e.stopPropagation()} + onMousedown={withModifiers(() => this.selector.handleUserMousedown(this.user, this.disabled), ['left', 'stop'])} + onMouseup={withModifiers(() => this.selector.handleUserMouseup(this.user, this.disabled), ['left', 'stop'])}> + { + this.selector.renderList + ? <> + + + + : <> + { + this.selector.tagType === 'avatar' + ? <> + + + + : null + } + { + this.selector.displayListTips && this.user.category_name + ? <> + + { this.user.category_name } + + + : null + } + + + } +
  • + ); + }, +}); diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/alternate-list.tsx b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/alternate-list.tsx new file mode 100644 index 0000000000..e195ea3b39 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/alternate-list.tsx @@ -0,0 +1,168 @@ +// @ts-nocheck +/* eslint-disable */ +import { hideAll } from 'tippy.js'; +import { + type ComponentPublicInstance, + computed, + defineComponent, + getCurrentInstance, + type HTMLAttributes, + nextTick, + ref, + watch, + withModifiers, +} from 'vue'; + +import AlternateItem from './alternate-item'; +import instanceStore from './instance-store'; + +export default defineComponent({ + setup() { + const { proxy } = getCurrentInstance(); + instanceStore.setInstance('alternateContent', 'alternateList', proxy); + + const selector = ref(null); + const keyword = ref(''); + const next = ref(true); + const loading = ref(true); + const matchedUsers = ref([]); + const wrapperStyle = computed(() => { + const style: any = {}; + if (selector.value?.panelWidth) { + style.width = `${parseInt(selector.value.panelWidth, 10)}px`; + } + return style; + }); + const listStyle = computed(() => { + const style = { + 'max-height': '192px', + }; + if (selector.value) { + const maxHeight = parseInt(selector.value.listScrollHeight, 10); + if (!isNaN(maxHeight)) { + style['max-height'] = `${maxHeight}px`; + } + } + return style; + }); + const getIndex = (index: number, childIndex = 0) => { + let flattenedIndex = 0; + matchedUsers.value.slice(0, index).forEach((user) => { + if (user.hasOwnProperty('children')) { + flattenedIndex += user.children.length; + } else { + flattenedIndex += 1; + } + }); + return flattenedIndex + childIndex; + }; + + const handleScroll = () => { + hideAll({ exclude: selector.value.inputRef, duration: 0 }); + if (loading.value || !next.value) { + return false; + } + const list = alternateList.value; + const threshold = 32; + if (list.scrollTop + list.clientHeight > list.scrollHeight - threshold) { + selector.value.search(keyword.value, next.value); + } + }; + + watch(keyword, () => { + alternateItem.value = []; + nextTick(() => { + alternateList.value.scrollTop = 0; + }); + }); + + const alternateListContainer = ref(null); + const alternateList = ref(null); + const alternateItem = ref([]); + + const setRef = (el: HTMLElement | ComponentPublicInstance | HTMLAttributes) => { + alternateItem.value.push(el); + }; + + return { + selector, + keyword, + next, + loading, + matchedUsers, + wrapperStyle, + listStyle, + getIndex, + handleScroll, + alternateListContainer, + alternateList, + alternateItem, + setRef, + }; + }, + render() { + return ( +
    + + { + (!this.loading && !this.matchedUsers.length) + ? <> +

    + { this.selector.emptyText } +

    + + : null + } +
    + ); + }, +}); diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/icon-user.svg b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/icon-user.svg new file mode 100644 index 0000000000..4bdf4f533d --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/icon-user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/index.ts b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/index.ts new file mode 100644 index 0000000000..250dbc4e80 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/index.ts @@ -0,0 +1,31 @@ +import type { App, Plugin } from 'vue'; + +import request from './request'; +import UserSelector from './selector.vue'; + +// UserSelector.install = (Vue) => { +// window.$vueApp.component(UserSelector.name, UserSelector); +// }; + +// export default UserSelector; + +// export { request }; + +export interface OriginComponent { + name: string; + install?: Plugin; +} + +const withInstall = (component: T): T & Plugin => { + // eslint-disable-next-line no-param-reassign + component.install = function (app: App, { prefix } = {}) { + const pre = app.config.globalProperties.bkUIPrefix || prefix || 'Bk'; + app.component(pre + component.name, component); + }; + return component as T & Plugin; +}; + +export { request }; + +const BkUserSelector = withInstall(UserSelector); +export default BkUserSelector; diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/instance-store.ts b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/instance-store.ts new file mode 100644 index 0000000000..fedc963480 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/instance-store.ts @@ -0,0 +1,16 @@ +import { type ComponentPublicInstance } from 'vue'; + +const store = {}; + +export default { + setInstance(group: string, id: string, proxy: ComponentPublicInstance) { + if (!store[group]) { + store[group] = {}; + } + + store[group][id] = proxy; + }, + getInstance(group: string, id: string) { + return store[group][id]; + }, +}; diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-alternate.ts b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-alternate.ts new file mode 100644 index 0000000000..3d7cc39a91 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-alternate.ts @@ -0,0 +1,20 @@ +// import * as Vue from 'vue'; +// export default { +// name: 'render-alternate', +// data() { +// return { selector: null }; +// }, +// render() { +// return this.selector.defaultAlternate(Vue.h); +// }, +// }; + +import { h } from 'vue'; + +export default { + name: 'render-alternate', + props: ['selector'], + setup(props: any): any { + return () => props.selector.defaultAlternate(h); + }, +}; diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-avatar.tsx b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-avatar.tsx new file mode 100644 index 0000000000..886945aaa1 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-avatar.tsx @@ -0,0 +1,51 @@ +// export default { +// name: 'render-avatar', +// props: ['user', 'urlMethod'], +// render() { +// return ; +// }, +// async created() { +// try { +// let avatar = null; +// if (typeof this.user === 'string') { +// avatar = await this.urlMethod(this.user); +// } else if (typeof this.user === 'object') { +// avatar = this.user.avatar +// || this.user.logo +// || (await this.urlMethod(this.user.username)); +// } +// if (avatar) { +// this.$el.style.backgroundImage = `url(${avatar})`; +// } +// } catch (e) {} +// }, +// }; + +import { onMounted, ref, watch } from 'vue'; + +export default { + name: 'render-avatar', + props: ['user', 'urlMethod'], + setup(props: any) { + const avatar = ref(''); + onMounted(async () => { + try { + if (typeof props.user === 'string') { + avatar.value = await props.urlMethod(props.user); + } else if (typeof props.user === 'object') { + avatar.value = props.user.avatar || props.user.logo || (await props.urlMethod(props.user.username)); + } + } catch (e) {} + }); + + const userSelectorAvatarRef = ref(null); + + watch(avatar, (v: string) => { + if (v) { + userSelectorAvatarRef.value.style.backgroundImage = `url(${avatar.value})`; + } + }); + + return () => ; + }, +}; diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-list.ts b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-list.ts new file mode 100644 index 0000000000..2712e201f8 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-list.ts @@ -0,0 +1,43 @@ +import { h } from 'vue'; + +// export default { +// name: 'render-list', +// props: ['selector', 'user', 'index', 'keyword', 'disabled'], +// render() { +// return this.selector.renderList(h, { +// user: this.user, +// index: this.index, +// keyword: this.keyword, +// disabled: this.disabled, +// }); +// }, +// }; + +export default { + name: 'render-list', + props: { + selector: { + type: Object, + }, + user: { + type: Object, + }, + keyword: { + type: String, + }, + index: { + type: Number, + }, + disabled: { + type: Boolean, + }, + }, + setup(props: any): any { + return () => props.selector.renderList(h, { + user: props.user, + index: props.index, + keyword: props.keyword, + disabled: props.disabled, + }); + }, +}; diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-tag.ts b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-tag.ts new file mode 100644 index 0000000000..113f18216d --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/render-tag.ts @@ -0,0 +1,44 @@ +// import * as Vue from 'vue'; +// export default { +// name: 'render-tag', +// props: ['username', 'user', 'index'], +// render() { +// return this.$parent.renderTag(Vue.h, { +// username: this.username, +// index: this.index, +// user: this.user, +// }); +// }, +// }; + +import { h, inject } from 'vue'; + +export default { + name: 'render-tag', + props: ['username', 'user', 'index'], + // props: { + // selector: { + // type: Object, + // }, + // user: { + // type: Object, + // }, + // keyword: { + // type: String, + // }, + // index: { + // type: Number, + // }, + // disabled: { + // type: Boolean, + // }, + // }, + setup(props: any) { + const parentSelector = inject('parentSelector'); + return () => (parentSelector as any).renderTag(h, { + username: props.username, + index: props.index, + user: props.user, + }); + }, +}; diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/request.ts b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/request.ts new file mode 100644 index 0000000000..02e0bc7f23 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/request.ts @@ -0,0 +1,231 @@ +// @ts-nocheck +/* eslint-disable */ +import { createApp, getCurrentInstance, ref, watch } from 'vue'; + +import instanceStore from './instance-store'; + +let callbackSeed = 0; +function JSONP(api: string, params = {}, options: any = {}) { + return new Promise((resolve, reject) => { + let timer: number; + const callbackName = `USER_LIST_CALLBACK_${(callbackSeed += 1)}`; + window[callbackName] = (response: any) => { + timer && clearTimeout(timer); + document.body.removeChild(script); + delete window[callbackName]; + resolve(response); + }; + const script = document.createElement('script'); + script.onerror = (_event) => { + document.body.removeChild(script); + delete window[callbackName]; + reject('Get user list failed.'); + }; + const query = []; + // eslint-disable-next-line no-restricted-syntax + for (const key in params) { + query.push(`${key}=${params[key]}`); + } + script.src = `${api}?${query.join('&')}&callback=${callbackName}`; + if (options.timeout) { + setTimeout(() => { + document.body.removeChild(script); + delete window[callbackName]; + reject('Get user list timeout.'); + }, options.timeout); + } + document.body.appendChild(script); + }); +} + +// 缓存已经加载过的人员 +// 以api为key,存储不同数据源的用户 +const userMap = new Map(); + +function getMap(api: string) { + if (userMap.has(api)) { + return userMap.get(api); + } + const map = new Map(); + userMap.set(api, map); + return map; +} + +function storeUsers(api: string, users: any) { + const map = getMap(api); + users.forEach((user: any) => map.set(user.username, user)); +} + +function getUsers(api: string, usernames: any) { + const map = getMap(api); + const users: string[] = []; + usernames.forEach((username: string) => { + if (map.has(username)) { + users.push(map.get(username)); + } + }); + return users; +} + +// 接口最大支持100条记录,超过100条需要将请求拆分为多个 +async function handleBatchSearch(api: string, usernames: string[], options: any) { + const map = getMap(api); + const unique = [...new Set(usernames)].filter((username) => !map.has(username)); + if (!unique.length) { + return Promise.resolve(getUsers(api, usernames)); + } + const slices: string[][] = []; + unique.reduce((slice, username, index) => { + if (slice.length < 100) { + slice.push(username); + if (index === unique.length - 1) { + slices.push(slice); + } + return slice; + } + slices.push(slice); + return []; + }, []); + try { + const responses = await Promise.all( + slices.map((slice) => + JSONP( + api, + { + app_code: 'bk-magicbox', + exact_lookups: slice.join(','), + page_size: 100, + page: 1, + }, + options, + ), + ), + ); + responses.forEach((response: any) => { + if (response.code !== 0) return; + storeUsers(api, response.data.results || []); + }); + } catch (error) { + console.error(error); + } + return Promise.resolve(getUsers(api, usernames)); +} + +function createVm(apiStr: string) { + const app = { + setup() { + const { proxy } = getCurrentInstance(); + instanceStore.setInstance('exactSearch', apiStr, proxy); + + const api = ref(''); + api.value = apiStr; + + const queue = ref([]); + + watch( + () => queue, + (q: any) => { + q.value.length && dispatchSeach(); + }, + { deep: true }, + ); + + const search = (usernames) => + new Promise((resolve) => { + queue.value.push({ + resolve, + usernames, + }); + }); + + const dispatchSeach = async () => { + const currentQueue = [...queue.value]; + queue.value = []; + try { + const allNames = currentQueue.reduce((all, { usernames }) => all.concat(usernames), []); + const users = await request.exactSearch(api.value, allNames); + const map = {}; + users.forEach((user) => { + map[user.username] = user; + }); + currentQueue.forEach(({ resolve, usernames }) => { + const resolveData = []; + usernames.forEach((username) => { + // eslint-disable-next-line no-prototype-builtins + if (map.hasOwnProperty(username)) { + resolveData.push(map[username]); + } + }); + resolve(resolveData); + }); + } catch (error) { + currentQueue.forEach(({ resolve }) => { + resolve([]); + }); + console.error(error); + } + }; + + return { + api, + queue, + search, + dispatchSeach, + }; + }, + render() { + return null; // 渲染为空 + }, + }; + + const vm = createApp(app); + const vmContainer = document.createElement('div'); + vm.mount(vmContainer); + // document.body.appendChild(vmContainer); + // vmMap.set(apiStr, vm); + return vm; +} + +const request = { + // 模糊搜索,失败时返回空 + async fuzzySearch(api, params, options) { + const data = {}; + try { + const response = await JSONP(api, params, options); + if (response.code !== 0) { + throw new Error(response); + } + data.count = response.data.count; + data.results = response.data.results || []; + storeUsers(api, data.results); + } catch (error) { + console.error(error.message); + data.count = 0; + data.results = []; + } + return data; + }, + // 精确搜索,不在此处捕获异常,在上层捕获并显示在tooltips中 + async exactSearch(api, username, options) { + const isArray = Array.isArray(username); + const usernames = isArray ? username : [username]; + const users = await handleBatchSearch(api, usernames, options); + if (isArray) { + return users; + } + return users[0]; + }, + // 粘贴时对粘贴的用户进行校验 + pasteValidate(api, usernames, options) { + return handleBatchSearch(api, usernames, options); + }, + // 队列式查询,用于多个组件共存时,批量拉取已存在的用户信息 + scheduleExactSearch(api, username) { + const usernames = Array.isArray(username) ? username : [username]; + createVm(api); + const vm = instanceStore.getInstance('exactSearch', api); + return vm.search(usernames); + }, +}; + +export default request; diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/selector.vue b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/selector.vue new file mode 100644 index 0000000000..2bbc4b521d --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/selector.vue @@ -0,0 +1,1204 @@ + + + diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/style.css b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/style.css new file mode 100644 index 0000000000..b22a084988 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/style.css @@ -0,0 +1,401 @@ +.user-selector * { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +.user-selector { + display: inline-block; + min-width: 120px; + font-size: 14px; + cursor: text; + color: #63656e; +} + +.user-selector.user-selector-info { + display: inline; + min-width: initial; + color: inherit; +} + +.user-selector .user-selector-layout { + position: relative; + height: 100%; +} + +.user-selector .user-selector-layout .user-selector-container { + position: relative; + min-width: 100%; + min-height: 100%; + padding: 0 9px 0 3px; + line-height: 1; + border: 1px solid #c4c6cc; + border-radius: 2px; + background-color: #fff; + font-size: 0; + overflow: hidden; +} + +.user-selector .user-selector-layout .user-selector-container.is-flex-height { + min-height: 32px; +} + +.user-selector .user-selector-layout .user-selector-container.is-fast-clear { + padding-right: 22px; +} + +.user-selector .user-selector-layout .user-selector-container.disabled { + cursor: not-allowed; + background-color: #fafbfd !important; + border-color: #dcdee5 !important; +} + +.user-selector .user-selector-layout .user-selector-container.focus { + overflow: auto; + overflow-x: hidden; + overflow-y: auto; + white-space: normal; + border-color: #3a84ff; + z-index: 1; +} + +.user-selector .user-selector-layout .user-selector-container.focus::-webkit-scrollbar { + width: 4px; + height: 4px; +} + +.user-selector .user-selector-layout .user-selector-container.focus::-webkit-scrollbar-thumb { + border-radius: 2px; + background: #c4c6cc; + box-shadow: inset 0 0 6px rgba(204, 204, 204, .3); +} + +.user-selector .user-selector-layout .user-selector-container.placeholder:after { + position: absolute; + left: 0; + top: 0; + height: 100%; + padding: 0 0 0 10px; + line-height: 30px; + content: attr(data-placeholder); + font-size: 12px; + color: #c3cdd7; +} + +.user-selector .user-selector-layout .user-selector-container.has-avatar .user-selector-selected { + background: transparent; + padding: 0; + margin: 4px 5px; +} + +.user-selector .user-selector-layout .user-selector-container.has-avatar .user-selector-overflow-tag { + border-radius: 10px; +} + +.user-selector .user-selector-layout .user-selector-container.is-loading:before { + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(255, 255, 255, .7); + z-index: 2; +} + +.user-selector .user-selector-layout .user-selector-container.is-loading:after { + content: ""; + position: absolute; + top: 50%; + left: 50%; + width: 6px; + height: 6px; + margin-left: -24px; + border-radius: 50%; + box-shadow: 12px 0px 0px 0px #fd6154, 24px 0px 0px 0px #ffb726, 36px 0px 0px 0px #4cd084, 48px 0px 0px 0px #57a3f1; + animation: user-selector-loading 1s linear infinite; + z-index: 3; +} + +.user-selector .user-selector-layout .user-selector-overflow-count { + min-width: 22px; + height: 22px; + line-height: 22px; + text-align: center; + padding: 0 4px; + background-color: #f0f1f5; + font-size: 12px; + color: #63656e; +} + +.user-selector .user-selector-layout .user-selector-clear { + position: absolute; + top: 10px; + right: 5px; + font-size: 12px; + color: #c4c6cc; + cursor: pointer; + z-index: 1; +} + +.user-selector .user-selector-layout .user-selector-clear:hover { + color: #979ba5; +} + +.user-selector .user-selector-selected { + display: inline-flex; + max-width: 100%; + align-items: center; + vertical-align: top; + margin: 4px 0 4px 6px; + padding: 0 2px 0 4px; + border-radius: 2px; + background: #f0f1f5; + line-height: 22px; + outline: 0; + font-size: 12px; + cursor: pointer; +} + +.user-selector .user-selector-selected:hover { + background: #dcdee5; +} + +.user-selector .user-selector-selected .user-selector-selected-value { + flex: 1; + font-size: 12px; + color: #63656e; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.user-selector .user-selector-selected .user-selector-selected-clear { + flex: 18px 0 0; + height: 18px; + line-height: 18px; + text-align: center; + color: #979ba5; + font-size: 18px; + cursor: pointer; +} + +.user-selector .user-selector-selected .user-selector-selected-clear:hover { + color: #63656e; +} + +.user-selector .user-selector-input { + display: inline-block; + vertical-align: top; + max-width: 100%; + height: 22px; + margin: 4px 0 0; + padding: 0 0 0 6px; + white-space: nowrap; + line-height: 22px; + font-size: 12px; + outline: none; + overflow: hidden; +} + +.user-selector .user-selector-overflow-tag { + display: inline-flex; + padding: 0 5px; + margin: 4px 0 4px 6px; + min-width: 22px; + line-height: 22px; + font-size: 12px; + text-align: center; + background: #f0f1f5; +} + +.user-selector .user-selector-overflow-tag ~ .user-selector-selected { + visibility: hidden; + pointer-events: none; +} + +.user-selector .alternate-empty { + height: 32px; + padding: 0; + margin: 0; + text-align: center; + line-height: 32px; +} + +@keyframes user-selector-loading { + 0% { + box-shadow: 12px 0px 0px 0px #fd6154, 24px 0px 0px 0px #ffb726, 36px 0px 0px 0px #4cd084, 48px 0px 0px 0px #57a3f1; + } + + 14% { + box-shadow: 12px 0px 0px 1px #fd6154, 24px 0px 0px 0px #ffb726, 36px 0px 0px 0px #4cd084, 48px 0px 0px 0px #57a3f1; + } + + 28% { + box-shadow: 12px 0px 0px 2px #fd6154, 24px 0px 0px 1px #ffb726, 36px 0px 0px 0px #4cd084, 48px 0px 0px 0px #57a3f1; + } + + 42% { + box-shadow: 12px 0px 0px 1px #fd6154, 24px 0px 0px 2px #ffb726, 36px 0px 0px 1px #4cd084, 48px 0px 0px 0px #57a3f1; + } + + 56% { + box-shadow: 12px 0px 0px 0px #fd6154, 24px 0px 0px 1px #ffb726, 36px 0px 0px 2px #4cd084, 48px 0px 0px 1px #57a3f1; + } + + 70% { + box-shadow: 12px 0px 0px 0px #fd6154, 24px 0px 0px 0px #ffb726, 36px 0px 0px 1px #4cd084, 48px 0px 0px 2px #57a3f1; + } + + 84% { + box-shadow: 12px 0px 0px 0px #fd6154, 24px 0px 0px 0px #ffb726, 36px 0px 0px 0px #4cd084, 48px 0px 0px 1px #57a3f1; + } +} + +.user-selector-alternate-list-wrapper { + width: 190px; + color: #63656e; + position: relative; + background-color: #fff; +} + +.user-selector-alternate-list-wrapper.has-folder { + width: 300px; +} + +.user-selector-alternate-list-wrapper.is-loading { + min-height: 32px; +} + +.user-selector-alternate-list-wrapper.is-loading:before { + content: ''; + position: absolute; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, .7); + z-index: 1; +} + +.user-selector-alternate-list-wrapper.is-loading:after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + width: 6px; + height: 6px; + margin-left: -30px; + border-radius: 50%; + background-color: transparent; + box-shadow: 12px 0px 0px 0px #fd6154, 24px 0px 0px 0px #ffb726, 36px 0px 0px 0px #4cd084, 48px 0px 0px 0px #57a3f1; + animation: user-selector-loading 1s linear infinite; +} + +.user-selector-alternate-list-wrapper .alternate-list { + margin: 0; + padding: 0; + max-height: 162px; + font-size: 12px; + line-height: 32px; + background: #fff; + overflow-y: auto; +} + +.user-selector-alternate-list-wrapper .alternate-list::-webkit-scrollbar { + width: 4px; + height: 4px; +} + +.user-selector-alternate-list-wrapper .alternate-list::-webkit-scrollbar-thumb { + border-radius: 2px; + background: #c4c6cc; + box-shadow: inset 0 0 6px rgba(204, 204, 204, .3); +} + +.user-selector-alternate-list-wrapper .alternate-item { + padding: 0 10px; + justify-content: space-between; + cursor: pointer; +} + +.user-selector-alternate-list-wrapper .alternate-item.highlight, .user-selector-alternate-list-wrapper .alternate-item:hover { + background-color: #f1f7ff; +} + +.user-selector-alternate-list-wrapper .alternate-item.disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.user-selector-alternate-list-wrapper .alternate-item .item-avatar { + float: left; + margin: 5px 8px 0 0; +} + +.user-selector-alternate-list-wrapper .alternate-item .item-name { + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.user-selector-alternate-list-wrapper .alternate-item .item-name span { + color: #3a84ff; +} + +.user-selector-alternate-list-wrapper .alternate-item .item-folder { + float: right; + max-width: 140px; + outline: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.user-selector-alternate-list-wrapper .alternate-group { + padding: 0 11px; + color: #979ba5; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.user-selector-alternate-list-wrapper .alternate-empty { + padding: 0; + margin: 0; + text-align: center; + line-height: 44px; + font-size: 12px; +} + +.user-selector-avatar { + display: inline-block; + width: 22px; + height: 22px; + border-radius: 50%; + background-color: #eff0f5; + background-repeat: no-repeat; + background-position: center center; + background-size: 100% 100%; + background-image: url('./icon-user.svg'); +} + +.tippy-box[data-theme~=light] { + border: 1px solid #dcdee5; + border-radius: 2px; + box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.1); + color: #63656e; + font-size: 12px; + line-height: 24px; +} + +.tippy-box[data-theme~=light][data-theme~=user-selected-tips], .tippy-box[data-theme~=light][data-theme~=list-item-tips] { + padding: 0 9px; +} + +.tippy-box[data-theme~=light][data-theme~=small-arrow] > .tippy-arrow:before { + transform: scale(0.75); +} + +.tippy-content { + padding: 0; +} diff --git a/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/tooltips.ts b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/tooltips.ts new file mode 100644 index 0000000000..6f4ef7bcb0 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/components/user-selector/user-selector-origin/tooltips.ts @@ -0,0 +1,31 @@ +// @ts-nocheck +/* eslint-disable */ +import type { DirectiveBinding } from 'vue'; + +import Tippy, { ReferenceElement } from 'tippy.js'; +import 'tippy.js/dist/tippy.css'; +import 'tippy.js/themes/light.css'; +export default { + mounted(el: ReferenceElement, binding: DirectiveBinding) { + const props = typeof binding.value === 'object' + ? binding.value + : { disabled: false, content: binding.value }; + const instance = Tippy( + el, + Object.assign({ appendTo: document.body }, props), + ); + if (props.disabled) { + instance.disable(); + } + }, + unmounted(el: ReferenceElement) { + el._tippy?.destroy(); + }, + updated(el: ReferenceElement, binding: DirectiveBinding) { + const props = typeof binding.value === 'object' + ? binding.value + : { disabled: false, content: binding.value }; + props.disabled ? el._tippy.disable() : el._tippy.enable(); + el._tippy.setContent(props.content); + }, +}; diff --git a/bcs-services/bcs-bscp/ui/src/constants/config.ts b/bcs-services/bcs-bscp/ui/src/constants/config.ts index da7acd2ea4..097a70b641 100644 --- a/bcs-services/bcs-bscp/ui/src/constants/config.ts +++ b/bcs-services/bcs-bscp/ui/src/constants/config.ts @@ -67,3 +67,27 @@ export const GET_UNNAMED_VERSION_DATA = (): IConfigVersion => ({ fully_released: false, }, }); + +// 版本上线格式 +export enum APPROVE_TYPE { + PendApproval, // 0 待审批 + PendPublish, // 1 审批通过 + Rejected, // 2 驳回/撤销 +} + +// 版本上线状态 +export const ONLINE_TYPE = { + Manually: 'Manually', // 手动上线 + Automatically: 'Automatically', // 审批通过后自动上线 + Periodically: 'Periodically', // 定时上线 + Immediately: 'Immediately', // 立即上线 +}; + +// 版本上线方式 +export const APPROVE_STATUS = { + PendApproval: 'PendApproval', // 待审批 + PendPublish: 'PendPublish', // 待上线 + RevokedPublish: 'RevokedPublish', // 撤销上线 + RejectedApproval: 'RejectedApproval', // 上线驳回 + AlreadyPublish: 'AlreadyPublish', // 已上线 +}; diff --git a/bcs-services/bcs-bscp/ui/src/i18n/en-us.ts b/bcs-services/bcs-bscp/ui/src/i18n/en-us.ts index 829f537969..8251dc9347 100644 --- a/bcs-services/bcs-bscp/ui/src/i18n/en-us.ts +++ b/bcs-services/bcs-bscp/ui/src/i18n/en-us.ts @@ -314,7 +314,6 @@ export default { 本次上线版本对以下分组实例: 'his version update will ', 不会产生影响: 'not affect the following group instances', 对比并上线: 'Compare and go online', - 版本已上线: 'Version is online', 请选择分组实例: 'Please select an online group', 本次上线分组: 'This online group', 上线说明: 'Online instructions', @@ -475,6 +474,7 @@ export default { '上传后,该服务配置文件数量将超过最大限制': 'After uploading, the number of configuration files in the service will exceed the maximum limit', '文件上传准备中,请稍候…': 'File upload is in preparation, please wait...', '( 后台已存在此文件,上传快速完成 )': '( The background already has this file, the upload is completed quickly )', + '立即上线:点击“确认上线”后,配置版本将立即上线,适用于紧急更新等立即生效的场景定时上线:点击“确认上线”后,配置版本不会立即生效,可设定具体时间点,使版本在该时间自动上线,适用于非紧急更新场景,避免高峰时段上线,降低用户影响': '立即上线:点击“确认上线”后,配置版本将立即上线,适用于紧急更新等立即生效的场景\n定时上线:点击“确认上线”后,配置版本不会立即生效,可设定具体时间点,使版本在该时间自动上线,适用于非紧急更新场景,避免高峰时段上线,降低用户影响', // 分组管理 新增分组: 'New group', diff --git a/bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts b/bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts index 5a68f791fd..3ef3a32f00 100644 --- a/bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts +++ b/bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts @@ -69,6 +69,10 @@ export default { 请输入服务名: '请输入服务名', 同时会删除服务密钥对服务的关联规则: '同时会删除服务密钥对服务的关联规则', 删除服务成功: '删除服务成功', + 或签: '或签', + 会签: '会签', + '建议在生产环境中开启审批流程,以保证系统稳定性。测试环境中可以考虑关闭审批流程以提升操作效率': '建议在生产环境中开启审批流程,以保证系统稳定性。测试环境中可以考虑关闭审批流程以提升操作效率', + '或签:多人同时审批,一人同意即可通过n会签:审批人依次审批,每人都需同意才能通过': '或签:多人同时审批,一人同意即可通过\n会签:审批人依次审批,每人都需同意才能通过', // 导航栏 服务配置中心: '服务配置中心', @@ -314,7 +318,6 @@ export default { 本次上线版本对以下分组实例: '本次上线版本对以下分组实例', 不会产生影响: '不会产生影响', 对比并上线: '对比并上线', - 版本已上线: '版本已上线', 请选择分组实例: '请选择分组实例', 本次上线分组: '本次上线分组', 上线说明: '上线说明', @@ -474,6 +477,26 @@ export default { '上传后,该服务配置文件数量将超过最大限制': '上传后,该服务配置文件数量将超过最大限制', '文件上传准备中,请稍候…': '文件上传准备中,请稍候…', '( 后台已存在此文件,上传快速完成 )': '( 后台已存在此文件,上传快速完成 )', + 审批开启的文案: '此服务版本上线已启用审批流程,请选择审批通过后的上线方式\n手动上线:适用于需人工干预和确认的场景,常用于重要业务或正式环\n境中的模块配置上线\n审批通过后立即上线:适用于高度自动化的场景,常用于非正式环境的\n配置上线,以提升部署效率\n定时上线:适用于需在特定时间上线的场景;若在指定时间前审批流程\n未完成,则将自动切换为手动上线', + 审批关闭的文案: '立即上线:点击“确认上线”后,配置版本将立即上线,\n适用于紧急更新等立即生效的场景\n定时上线:点击“确认上线”后,配置版本不会立即生\n效,可设定具体时间点,使版本在该时间自动上线,适用\n于非紧急更新场景,避免高峰时段上线,降低用户影响', + 指定审批人不能为空: '指定审批人不能为空', + 提交上线审批: '提交上线审批', + 不能选择过去的时间: '不能选择过去的时间', + 上线方式: '上线方式', + 立即上线: '立即上线', + 定时上线: '定时上线', + 手动上线: '手动上线', + 审批通过后立即上线: '审批通过后立即上线', + 定时上线文案: '版本将于 {time} 上线', + 调整分组定时上线文案: '调整分组上线版本将于 {time} 生效', + 手动上线文案: '待审批通过后,{text}需手动进行上线操作', + 审批通过后上线文案: '待审批通过后,{text}将自动上线', + 版本已上线: '版本已上线', + 等待定时上线: '等待定时上线', + 待审批: '待审批', + 上线驳回: '上线驳回', + 撤销上线: '撤销上线', + 审批通过: '审批通过', // 分组管理 新增分组: '新增分组', diff --git a/bcs-services/bcs-bscp/ui/src/request/index.ts b/bcs-services/bcs-bscp/ui/src/request/index.ts index 0d5c4de29d..7e91a99b2e 100644 --- a/bcs-services/bcs-bscp/ui/src/request/index.ts +++ b/bcs-services/bcs-bscp/ui/src/request/index.ts @@ -5,6 +5,9 @@ import pinia from '../store/index'; import useGlobalStore from '../store/global'; const http = axios.create({ + headers: { + 'X-Bscp-Operate-Way': 'WebUI', + }, baseURL: `${(window as any).BK_BCS_BSCP_API}/api/v1`, withCredentials: true, }); diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue index fc2620520d..2f31229fd8 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue @@ -40,6 +40,7 @@ + + + + @@ -77,6 +83,8 @@ import PublishVersion from './publish-version/index.vue'; import CreateVersion from './create-version/index.vue'; import ModifyGroupPublish from './modify-group-publish.vue'; + import HeaderMoreOptions from './header-more-options.vue'; + import VersionApproveStatus from './version-approve-status.vue'; const route = useRoute(); const router = useRouter(); @@ -103,6 +111,16 @@ { name: 'script', label: t('前/后置脚本'), routeName: 'init-script' }, ]); + const approveData = ref<{ + status: string; + time: string; + type: string; + }>({ + status: '', + time: '', + type: '', + }); + const getDefaultTab = () => { const tab = tabs.value.find((item) => item.routeName === route.name); return tab ? tab.name : 'config'; diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue new file mode 100644 index 0000000000..b438e5c028 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue index 30cc53556a..1790e6905d 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue @@ -1,7 +1,9 @@ @@ -132,4 +265,107 @@ margin-left: 20px; } } + .label-key { + display: flex; + justify-content: flex-start; + align-items: center; + } + .key-management { + margin-left: auto; + } + .approval-content { + padding: 12px 16px; + background-color: #f5f7fa; + .bk-form-item:last-child { + margin-bottom: 0; + } + :deep(.bk-form-error) { + top: 32px; + } + } + .content-info { + margin-top: 4px; + padding: 12px 16px; + font-size: 14px; + line-height: 22px; + color: #63656e; + background-color: #f5f6fa; + } + .label-wrap { + display: flex; + justify-content: flex-start; + align-items: center; + .label-help { + margin: 0 9px; + font-size: 16px; + color: #979ba5; + cursor: pointer; + } + .label-switch { + position: relative; + padding-left: 8px; + height: 16px; + line-height: 14px; + &::after { + content: ''; + position: absolute; + left: 0; + top: 0; + height: 100%; + border-left: 1px solid #dcdee5; + } + } + } + :deep(.confirm-dialog) { + .bk-modal-body { + padding-bottom: 0; + } + .bk-modal-content { + padding: 0 32px; + height: auto; + max-height: none; + min-height: auto; + border-radius: 2px; + } + .bk-modal-footer { + position: relative; + padding: 24px 0; + height: auto; + border: none; + } + .bk-dialog-footer .bk-button { + min-width: 88px; + } + } + .tip-icon__wrap { + margin: 0 auto; + width: 42px; + height: 42px; + position: relative; + &::after { + content: ''; + position: absolute; + z-index: -1; + top: 50%; + left: 50%; + transform: translate3d(-50%, -50%, 0); + width: 30px; + height: 30px; + border-radius: 50%; + background-color: #ff9c01; + } + .tip-icon { + font-size: 42px; + line-height: 42px; + vertical-align: middle; + color: #ffe8c3; + } + } + .headline { + margin-top: 16px; + text-align: center; + } + .user-selector { + min-width: 100%; + } diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/service-list-content.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/service-list-content.vue index 250048ae68..afd7e8f472 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/service-list-content.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/service-list-content.vue @@ -80,8 +80,11 @@
    {{ t('确认删除服务?') }}
    -
    {{ t('删除的服务') }}{{ t('无法找回') }}{{t(',请谨慎操作!')}}
    -
    {{ t('同时会删除服务密钥对服务的关联规则')}}
    +
    + {{ t('删除的服务') }}{{ t('无法找回') }} + {{ t(',请谨慎操作!') }} +
    +
    {{ t('同时会删除服务密钥对服务的关联规则') }}
    {{ t('请输入服务名') }} {{ deleteService!.spec.name }} {{ t('以确认删除') }} @@ -149,6 +152,9 @@ memo: '', alias: '', data_type: '', + is_approve: true, + approver: '', + approve_type: 'OrSign', }, revision: { creator: '', diff --git a/bcs-services/bcs-bscp/ui/types/app.ts b/bcs-services/bcs-bscp/ui/types/app.ts index c746fd3c0e..36b8bb9855 100644 --- a/bcs-services/bcs-bscp/ui/types/app.ts +++ b/bcs-services/bcs-bscp/ui/types/app.ts @@ -16,6 +16,9 @@ export interface IAppItem { memo: string; alias: string; data_type: string; + is_approve: boolean; + approver: string; + approve_type: string; }; revision: { creator: string; diff --git a/bcs-services/bcs-bscp/ui/types/service.ts b/bcs-services/bcs-bscp/ui/types/service.ts index e6ef2c416d..5cd85a26ae 100644 --- a/bcs-services/bcs-bscp/ui/types/service.ts +++ b/bcs-services/bcs-bscp/ui/types/service.ts @@ -7,6 +7,11 @@ export interface IServiceEditForm { config_type: string; memo: string; data_type?: string; + is_approve: boolean; + approver: string; + approve_type: string; + // encryptionSwtich: boolean; + // encryptionKey: string; } export interface ISingleLineKVDIffItem { diff --git a/bcs-services/bcs-bscp/ui/vite.config.ts b/bcs-services/bcs-bscp/ui/vite.config.ts index d6a55ab961..a0834668b4 100644 --- a/bcs-services/bcs-bscp/ui/vite.config.ts +++ b/bcs-services/bcs-bscp/ui/vite.config.ts @@ -4,6 +4,7 @@ import eslintPlugin from 'vite-plugin-eslint'; // import basicSsl from '@vitejs/plugin-basic-ssl'; import viteCompression from 'vite-plugin-compression'; import { visualizer } from 'rollup-plugin-visualizer'; +import vueJsx from '@vitejs/plugin-vue-jsx'; const viteHtml = (options?: any) => ({ name: 'vite-plugin-html-transform', @@ -25,6 +26,7 @@ export default defineConfig(({ command, mode }) => { filter: /\.js|.css$/, threshold: 1, }), + vueJsx(), ]; console.error('defineConfig command', command); if (command === 'build') { diff --git a/bcs-services/bcs-bscp/ui/yarn.lock b/bcs-services/bcs-bscp/ui/yarn.lock index d67bdcc70a..5e77755d63 100644 --- a/bcs-services/bcs-bscp/ui/yarn.lock +++ b/bcs-services/bcs-bscp/ui/yarn.lock @@ -215,7 +215,7 @@ csstype "^3.0.8" tslib "^2.0.3" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.24.7": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/code-frame/-/code-frame-7.24.7.tgz" integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== @@ -228,6 +228,11 @@ resolved "https://mirrors.tencent.com/npm/@babel/compat-data/-/compat-data-7.24.7.tgz" integrity sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw== +"@babel/compat-data@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.2.tgz#e41928bd33475305c586f6acbbb7e3ade7a6f7f5" + integrity sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ== + "@babel/core@^7.23.0": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/core/-/core-7.24.7.tgz" @@ -249,6 +254,27 @@ json5 "^2.2.3" semver "^6.3.1" +"@babel/core@^7.24.7": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" + integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.25.0" + "@babel/helper-compilation-targets" "^7.25.2" + "@babel/helper-module-transforms" "^7.25.2" + "@babel/helpers" "^7.25.0" + "@babel/parser" "^7.25.0" + "@babel/template" "^7.25.0" + "@babel/traverse" "^7.25.2" + "@babel/types" "^7.25.2" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + "@babel/eslint-parser@^7.22.15": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/eslint-parser/-/eslint-parser-7.24.7.tgz" @@ -268,6 +294,23 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^2.5.1" +"@babel/generator@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.0.tgz#f858ddfa984350bc3d3b7f125073c9af6988f18e" + integrity sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw== + dependencies: + "@babel/types" "^7.25.0" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + +"@babel/helper-annotate-as-pure@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz#5373c7bc8366b12a033b4be1ac13a206c6656aab" + integrity sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg== + dependencies: + "@babel/types" "^7.24.7" + "@babel/helper-compilation-targets@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz" @@ -279,6 +322,30 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz#e1d9410a90974a3a5a66e84ff55ef62e3c02d06c" + integrity sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw== + dependencies: + "@babel/compat-data" "^7.25.2" + "@babel/helper-validator-option" "^7.24.8" + browserslist "^4.23.1" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-create-class-features-plugin@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.0.tgz#a109bf9c3d58dfed83aaf42e85633c89f43a6253" + integrity sha512-GYM6BxeQsETc9mnct+nIIpf63SAyzvyYN7UB/IlTyd+MBg06afFGp0mIeUqGyWgS2mxad6vqbMrHVlaL3m70sQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.24.7" + "@babel/helper-member-expression-to-functions" "^7.24.8" + "@babel/helper-optimise-call-expression" "^7.24.7" + "@babel/helper-replace-supers" "^7.25.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.24.7" + "@babel/traverse" "^7.25.0" + semver "^6.3.1" + "@babel/helper-environment-visitor@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz" @@ -301,6 +368,14 @@ dependencies: "@babel/types" "^7.24.7" +"@babel/helper-member-expression-to-functions@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.8.tgz#6155e079c913357d24a4c20480db7c712a5c3fb6" + integrity sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA== + dependencies: + "@babel/traverse" "^7.24.8" + "@babel/types" "^7.24.8" + "@babel/helper-module-imports@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz" @@ -309,6 +384,13 @@ "@babel/traverse" "^7.24.7" "@babel/types" "^7.24.7" +"@babel/helper-module-imports@~7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== + dependencies: + "@babel/types" "^7.22.15" + "@babel/helper-module-transforms@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz" @@ -320,6 +402,37 @@ "@babel/helper-split-export-declaration" "^7.24.7" "@babel/helper-validator-identifier" "^7.24.7" +"@babel/helper-module-transforms@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz#ee713c29768100f2776edf04d4eb23b8d27a66e6" + integrity sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ== + dependencies: + "@babel/helper-module-imports" "^7.24.7" + "@babel/helper-simple-access" "^7.24.7" + "@babel/helper-validator-identifier" "^7.24.7" + "@babel/traverse" "^7.25.2" + +"@babel/helper-optimise-call-expression@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz#8b0a0456c92f6b323d27cfd00d1d664e76692a0f" + integrity sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A== + dependencies: + "@babel/types" "^7.24.7" + +"@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.24.7", "@babel/helper-plugin-utils@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" + integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== + +"@babel/helper-replace-supers@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.25.0.tgz#ff44deac1c9f619523fe2ca1fd650773792000a9" + integrity sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.24.8" + "@babel/helper-optimise-call-expression" "^7.24.7" + "@babel/traverse" "^7.25.0" + "@babel/helper-simple-access@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz" @@ -328,6 +441,14 @@ "@babel/traverse" "^7.24.7" "@babel/types" "^7.24.7" +"@babel/helper-skip-transparent-expression-wrappers@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz#5f8fa83b69ed5c27adc56044f8be2b3ea96669d9" + integrity sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-split-export-declaration@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz" @@ -340,6 +461,11 @@ resolved "https://mirrors.tencent.com/npm/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz" integrity sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg== +"@babel/helper-string-parser@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" + integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== + "@babel/helper-validator-identifier@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz" @@ -350,6 +476,11 @@ resolved "https://mirrors.tencent.com/npm/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz" integrity sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw== +"@babel/helper-validator-option@^7.24.8": + version "7.24.8" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" + integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== + "@babel/helpers@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/helpers/-/helpers-7.24.7.tgz" @@ -358,6 +489,14 @@ "@babel/template" "^7.24.7" "@babel/types" "^7.24.7" +"@babel/helpers@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.0.tgz#e69beb7841cb93a6505531ede34f34e6a073650a" + integrity sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw== + dependencies: + "@babel/template" "^7.25.0" + "@babel/types" "^7.25.0" + "@babel/highlight@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/highlight/-/highlight-7.24.7.tgz" @@ -368,11 +507,43 @@ js-tokens "^4.0.0" picocolors "^1.0.0" +"@babel/parser@^7.23.9", "@babel/parser@^7.25.0", "@babel/parser@^7.25.3": + version "7.25.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.3.tgz#91fb126768d944966263f0657ab222a642b82065" + integrity sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw== + dependencies: + "@babel/types" "^7.25.2" + "@babel/parser@^7.24.7", "@babel/parser@^7.7.0": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/parser/-/parser-7.24.7.tgz" integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw== +"@babel/plugin-syntax-jsx@^7.23.3": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz#39a1fa4a7e3d3d7f34e2acc6be585b718d30e02d" + integrity sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ== + dependencies: + "@babel/helper-plugin-utils" "^7.24.7" + +"@babel/plugin-syntax-typescript@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.7.tgz#58d458271b4d3b6bb27ee6ac9525acbb259bad1c" + integrity sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA== + dependencies: + "@babel/helper-plugin-utils" "^7.24.7" + +"@babel/plugin-transform-typescript@^7.24.7": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.2.tgz#237c5d10de6d493be31637c6b9fa30b6c5461add" + integrity sha512-lBwRvjSmqiMYe/pS0+1gggjJleUJi7NzjvQ1Fkqtt69hBa/0t1YuW/MLQMAPixfwaQOHUXsd6jeU3Z+vdGv3+A== + dependencies: + "@babel/helper-annotate-as-pure" "^7.24.7" + "@babel/helper-create-class-features-plugin" "^7.25.0" + "@babel/helper-plugin-utils" "^7.24.8" + "@babel/helper-skip-transparent-expression-wrappers" "^7.24.7" + "@babel/plugin-syntax-typescript" "^7.24.7" + "@babel/runtime@^7.21.0": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/runtime/-/runtime-7.24.7.tgz" @@ -380,6 +551,15 @@ dependencies: regenerator-runtime "^0.14.0" +"@babel/template@^7.23.9", "@babel/template@^7.25.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.0.tgz#e733dc3134b4fede528c15bc95e89cb98c52592a" + integrity sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/parser" "^7.25.0" + "@babel/types" "^7.25.0" + "@babel/template@^7.24.7": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/template/-/template-7.24.7.tgz" @@ -389,6 +569,19 @@ "@babel/parser" "^7.24.7" "@babel/types" "^7.24.7" +"@babel/traverse@^7.23.9", "@babel/traverse@^7.24.8", "@babel/traverse@^7.25.0", "@babel/traverse@^7.25.2": + version "7.25.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.3.tgz#f1b901951c83eda2f3e29450ce92743783373490" + integrity sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.25.0" + "@babel/parser" "^7.25.3" + "@babel/template" "^7.25.0" + "@babel/types" "^7.25.2" + debug "^4.3.1" + globals "^11.1.0" + "@babel/traverse@^7.24.7", "@babel/traverse@^7.7.0": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/traverse/-/traverse-7.24.7.tgz" @@ -405,6 +598,15 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/types@^7.22.15", "@babel/types@^7.23.9", "@babel/types@^7.24.8", "@babel/types@^7.25.0", "@babel/types@^7.25.2": + version "7.25.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.2.tgz#55fb231f7dc958cd69ea141a4c2997e819646125" + integrity sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q== + dependencies: + "@babel/helper-string-parser" "^7.24.8" + "@babel/helper-validator-identifier" "^7.24.7" + to-fast-properties "^2.0.0" + "@babel/types@^7.24.7", "@babel/types@^7.7.0": version "7.24.7" resolved "https://mirrors.tencent.com/npm/@babel/types/-/types-7.24.7.tgz" @@ -531,6 +733,11 @@ resolved "https://mirrors.tencent.com/npm/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@icon-cool/bk-icon-bk-biz-components@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@icon-cool/bk-icon-bk-biz-components/-/bk-icon-bk-biz-components-0.0.4.tgz#bab349dbc9d29d89717848b09676f0780bde1e70" + integrity sha512-6RnPbu3urilXn6AP+vIyN5tabqGCTyzUrAGZzeR0Stw4TfJbha+4hvj0GOR7pmbG3Jd5DAXeGONP2I3LUELb0A== + "@intlify/core-base@9.13.1": version "9.13.1" resolved "https://mirrors.tencent.com/npm/@intlify/core-base/-/core-base-9.13.1.tgz" @@ -631,7 +838,7 @@ resolved "https://mirrors.tencent.com/npm/@pkgr/core/-/core-0.1.1.tgz" integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA== -"@popperjs/core@~2.11.8": +"@popperjs/core@^2.9.0", "@popperjs/core@~2.11.8": version "2.11.8" resolved "https://mirrors.tencent.com/npm/@popperjs/core/-/core-2.11.8.tgz" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== @@ -843,6 +1050,15 @@ resolved "https://mirrors.tencent.com/npm/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-1.1.0.tgz" integrity sha512-wO4Dk/rm8u7RNhOf95ZzcEmC9rYOncYgvq4z3duaJrCgjN8BxAnDVyndanfcJZ0O6XZzHz6Q0hTimxTg8Y9g/A== +"@vitejs/plugin-vue-jsx@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue-jsx/-/plugin-vue-jsx-4.0.1.tgz#7be8a66da75ad412c30e57f43486fd2af20697c0" + integrity sha512-7mg9HFGnFHMEwCdB6AY83cVK4A6sCqnrjFYF4WIlebYAQVVJ/sC/CiTruVdrRlhrFoeZ8rlMxY9wYpPTIRhhAg== + dependencies: + "@babel/core" "^7.24.7" + "@babel/plugin-transform-typescript" "^7.24.7" + "@vue/babel-plugin-jsx" "^1.2.2" + "@vitejs/plugin-vue@^3.2.0": version "3.2.0" resolved "https://mirrors.tencent.com/npm/@vitejs/plugin-vue/-/plugin-vue-3.2.0.tgz" @@ -871,6 +1087,39 @@ path-browserify "^1.0.1" vscode-uri "^3.0.8" +"@vue/babel-helper-vue-transform-on@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-transform-on/-/babel-helper-vue-transform-on-1.2.2.tgz#7f1f817a4f00ad531651a8d1d22e22d9e42807ef" + integrity sha512-nOttamHUR3YzdEqdM/XXDyCSdxMA9VizUKoroLX6yTyRtggzQMHXcmwh8a7ZErcJttIBIc9s68a1B8GZ+Dmvsw== + +"@vue/babel-plugin-jsx@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@vue/babel-plugin-jsx/-/babel-plugin-jsx-1.2.2.tgz#eb426fb4660aa510bb8d188ff0ec140405a97d8a" + integrity sha512-nYTkZUVTu4nhP199UoORePsql0l+wj7v/oyQjtThUVhJl1U+6qHuoVhIvR3bf7eVKjbCK+Cs2AWd7mi9Mpz9rA== + dependencies: + "@babel/helper-module-imports" "~7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-jsx" "^7.23.3" + "@babel/template" "^7.23.9" + "@babel/traverse" "^7.23.9" + "@babel/types" "^7.23.9" + "@vue/babel-helper-vue-transform-on" "1.2.2" + "@vue/babel-plugin-resolve-type" "1.2.2" + camelcase "^6.3.0" + html-tags "^3.3.1" + svg-tags "^1.0.0" + +"@vue/babel-plugin-resolve-type@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@vue/babel-plugin-resolve-type/-/babel-plugin-resolve-type-1.2.2.tgz#66844898561da6449e0f4a261b0c875118e0707b" + integrity sha512-EntyroPwNg5IPVdUJupqs0CFzuf6lUrVvCspmv2J1FITLeGnUCuoGNNk78dgCusxEiYj6RMkTJflGSxk5aIC4A== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/helper-module-imports" "~7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/parser" "^7.23.9" + "@vue/compiler-sfc" "^3.4.15" + "@vue/compiler-core@3.4.29": version "3.4.29" resolved "https://mirrors.tencent.com/npm/@vue/compiler-core/-/compiler-core-3.4.29.tgz" @@ -882,6 +1131,17 @@ estree-walker "^2.0.2" source-map-js "^1.2.0" +"@vue/compiler-core@3.4.38": + version "3.4.38" + resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.4.38.tgz#326dfe3c92fa2b0f1dc9b39a948a231980253496" + integrity sha512-8IQOTCWnLFqfHzOGm9+P8OPSEDukgg3Huc92qSG49if/xI2SAwLHQO2qaPQbjCWPBcQoO1WYfXfTACUrWV3c5A== + dependencies: + "@babel/parser" "^7.24.7" + "@vue/shared" "3.4.38" + entities "^4.5.0" + estree-walker "^2.0.2" + source-map-js "^1.2.0" + "@vue/compiler-dom@3.4.29", "@vue/compiler-dom@^3.4.0": version "3.4.29" resolved "https://mirrors.tencent.com/npm/@vue/compiler-dom/-/compiler-dom-3.4.29.tgz" @@ -890,6 +1150,14 @@ "@vue/compiler-core" "3.4.29" "@vue/shared" "3.4.29" +"@vue/compiler-dom@3.4.38": + version "3.4.38" + resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.4.38.tgz#90348fac1130e0bbd408b650635cb626b3b9df06" + integrity sha512-Osc/c7ABsHXTsETLgykcOwIxFktHfGSUDkb05V61rocEfsFDcjDLH/IHJSNJP+/Sv9KeN2Lx1V6McZzlSb9EhQ== + dependencies: + "@vue/compiler-core" "3.4.38" + "@vue/shared" "3.4.38" + "@vue/compiler-sfc@3.4.29": version "3.4.29" resolved "https://mirrors.tencent.com/npm/@vue/compiler-sfc/-/compiler-sfc-3.4.29.tgz" @@ -905,6 +1173,21 @@ postcss "^8.4.38" source-map-js "^1.2.0" +"@vue/compiler-sfc@^3.4.15": + version "3.4.38" + resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.4.38.tgz#954c3f6777bbbcca28771ba59b795f12f76ef188" + integrity sha512-s5QfZ+9PzPh3T5H4hsQDJtI8x7zdJaew/dCGgqZ2630XdzaZ3AD8xGZfBqpT8oaD/p2eedd+pL8tD5vvt5ZYJQ== + dependencies: + "@babel/parser" "^7.24.7" + "@vue/compiler-core" "3.4.38" + "@vue/compiler-dom" "3.4.38" + "@vue/compiler-ssr" "3.4.38" + "@vue/shared" "3.4.38" + estree-walker "^2.0.2" + magic-string "^0.30.10" + postcss "^8.4.40" + source-map-js "^1.2.0" + "@vue/compiler-ssr@3.4.29": version "3.4.29" resolved "https://mirrors.tencent.com/npm/@vue/compiler-ssr/-/compiler-ssr-3.4.29.tgz" @@ -913,6 +1196,14 @@ "@vue/compiler-dom" "3.4.29" "@vue/shared" "3.4.29" +"@vue/compiler-ssr@3.4.38": + version "3.4.38" + resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.4.38.tgz#9ded18f6d9c8b2440039a58492cfff36fa1a7774" + integrity sha512-YXznKFQ8dxYpAz9zLuVvfcXhc31FSPFDcqr0kyujbOwNhlmaNvL2QfIy+RZeJgSn5Fk54CWoEUeW+NVBAogGaw== + dependencies: + "@vue/compiler-dom" "3.4.38" + "@vue/shared" "3.4.38" + "@vue/devtools-api@^6.5.0", "@vue/devtools-api@^6.5.1": version "6.6.3" resolved "https://mirrors.tencent.com/npm/@vue/devtools-api/-/devtools-api-6.6.3.tgz" @@ -985,6 +1276,11 @@ resolved "https://mirrors.tencent.com/npm/@vue/shared/-/shared-3.4.29.tgz" integrity sha512-hQ2gAQcBO/CDpC82DCrinJNgOHI2v+FA7BDW4lMSPeBpQ7sRe2OLHWe5cph1s7D8DUQAwRt18dBDfJJ220APEA== +"@vue/shared@3.4.38": + version "3.4.38" + resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.4.38.tgz#552a6770098bfd556fa3e2c686c9d3b4f4cd94c2" + integrity sha512-q0xCiLkuWWQLzVrecPb0RMsNWyxICOjPrcrwxTUEHb1fsnvni4dcuyG7RT/Ie7VPTvnjzIaWzRMUBsrqNj/hhw== + acorn-jsx@^5.2.0, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://mirrors.tencent.com/npm/acorn-jsx/-/acorn-jsx-5.3.2.tgz" @@ -1359,6 +1655,16 @@ browserslist@^4.22.2: node-releases "^2.0.14" update-browserslist-db "^1.0.16" +browserslist@^4.23.1: + version "4.23.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.3.tgz#debb029d3c93ebc97ffbc8d9cbb03403e227c800" + integrity sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA== + dependencies: + caniuse-lite "^1.0.30001646" + electron-to-chromium "^1.5.4" + node-releases "^2.0.18" + update-browserslist-db "^1.1.0" + buffer-xor@^1.0.3: version "1.0.3" resolved "https://mirrors.tencent.com/npm/buffer-xor/-/buffer-xor-1.0.3.tgz" @@ -1399,11 +1705,21 @@ camelcase@^1.0.2: resolved "https://mirrors.tencent.com/npm/camelcase/-/camelcase-1.2.1.tgz" integrity sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g== +camelcase@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + caniuse-lite@^1.0.30001629: version "1.0.30001636" resolved "https://mirrors.tencent.com/npm/caniuse-lite/-/caniuse-lite-1.0.30001636.tgz" integrity sha512-bMg2vmr8XBsbL6Lr0UHXy/21m84FTxDLWn2FSqMd5PrlbMxwJlQnC2YWYxVgp66PZE+BBNF2jYQUBKCo1FDeZg== +caniuse-lite@^1.0.30001646: + version "1.0.30001651" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz#52de59529e8b02b1aedcaaf5c05d9e23c0c28138" + integrity sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg== + center-align@^0.1.1: version "0.1.3" resolved "https://mirrors.tencent.com/npm/center-align/-/center-align-0.1.3.tgz" @@ -1889,6 +2205,11 @@ electron-to-chromium@^1.4.796: resolved "https://mirrors.tencent.com/npm/electron-to-chromium/-/electron-to-chromium-1.4.807.tgz" integrity sha512-kSmJl2ZwhNf/bcIuCH/imtNOKlpkLDn2jqT5FJ+/0CXjhnFaOa9cOe9gHKKy71eM49izwuQjZhKk+lWQ1JxB7A== +electron-to-chromium@^1.5.4: + version "1.5.8" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.8.tgz#0a3225b305212f347be48f159a3c0a117d5e9801" + integrity sha512-4Nx0gP2tPNBLTrFxBMHpkQbtn2hidPVr/+/FTtcCiBYTucqc70zRyVZiOLj17Ui3wTO7SQ1/N+hkHYzJjBzt6A== + elliptic@^6.5.3, elliptic@^6.5.5: version "6.5.5" resolved "https://mirrors.tencent.com/npm/elliptic/-/elliptic-6.5.5.tgz" @@ -2949,6 +3270,11 @@ hosted-git-info@^2.1.4: resolved "https://mirrors.tencent.com/npm/hosted-git-info/-/hosted-git-info-2.8.9.tgz" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== +html-tags@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.3.1.tgz#a04026a18c882e4bba8a01a3d39cfe465d40b5ce" + integrity sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ== + https-browserify@^1.0.0: version "1.0.0" resolved "https://mirrors.tencent.com/npm/https-browserify/-/https-browserify-1.0.0.tgz" @@ -3694,6 +4020,11 @@ node-releases@^2.0.14: resolved "https://mirrors.tencent.com/npm/node-releases/-/node-releases-2.0.14.tgz" integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== +node-releases@^2.0.18: + version "2.0.18" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.18.tgz#f010e8d35e2fe8d6b2944f03f70213ecedc4ca3f" + integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g== + normalize-package-data@^2.3.2: version "2.5.0" resolved "https://mirrors.tencent.com/npm/normalize-package-data/-/normalize-package-data-2.5.0.tgz" @@ -4021,6 +4352,15 @@ postcss@^8.4.18, postcss@^8.4.31, postcss@^8.4.38: picocolors "^1.0.0" source-map-js "^1.2.0" +postcss@^8.4.40: + version "8.4.41" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.41.tgz#d6104d3ba272d882fe18fc07d15dc2da62fa2681" + integrity sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ== + dependencies: + nanoid "^3.3.7" + picocolors "^1.0.1" + source-map-js "^1.2.0" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://mirrors.tencent.com/npm/prelude-ls/-/prelude-ls-1.2.1.tgz" @@ -4655,6 +4995,11 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://mirrors.tencent.com/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +svg-tags@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/svg-tags/-/svg-tags-1.0.0.tgz#58f71cee3bd519b59d4b2a843b6c7de64ac04764" + integrity sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA== + synckit@^0.8.6: version "0.8.8" resolved "https://mirrors.tencent.com/npm/synckit/-/synckit-0.8.8.tgz" @@ -4722,6 +5067,13 @@ tinycolor2@~1.6.0: resolved "https://mirrors.tencent.com/npm/tinycolor2/-/tinycolor2-1.6.0.tgz" integrity sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw== +tippy.js@^6.3.7: + version "6.3.7" + resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c" + integrity sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ== + dependencies: + "@popperjs/core" "^2.9.0" + tmp@^0.0.33: version "0.0.33" resolved "https://mirrors.tencent.com/npm/tmp/-/tmp-0.0.33.tgz" @@ -4904,6 +5256,14 @@ update-browserslist-db@^1.0.16: escalade "^3.1.2" picocolors "^1.0.1" +update-browserslist-db@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" + integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== + dependencies: + escalade "^3.1.2" + picocolors "^1.0.1" + uri-js@^4.2.2: version "4.4.1" resolved "https://mirrors.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz" From 5316fb20c2fb17823a185114247a8b0104a1c8fe Mon Sep 17 00:00:00 2001 From: q15971095971 <764419406@qq.com> Date: Wed, 28 Aug 2024 14:45:58 +0800 Subject: [PATCH 02/15] =?UTF-8?q?feat:=20=E5=AE=A1=E6=89=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E7=BB=86=E8=8A=82=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= =?UTF-8?q?=E3=80=82=E5=8E=BB=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?--story=3D115998324?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bcs-services/bcs-bscp/ui/src/api/config.ts | 14 +- .../detail/components/dialog-publish-warn.vue | 231 ++++++++++++++++++ .../detail/components/header-more-options.vue | 4 +- .../components/modify-group-publish.vue | 57 ++++- .../components/publish-version/index.vue | 59 ++++- .../components/version-approve-status.vue | 10 +- .../version-simple-list.vue | 2 - .../service/list/components/service-form.vue | 2 +- 8 files changed, 350 insertions(+), 29 deletions(-) create mode 100644 bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/dialog-publish-warn.vue diff --git a/bcs-services/bcs-bscp/ui/src/api/config.ts b/bcs-services/bcs-bscp/ui/src/api/config.ts index f0e3dc3daf..a7f2bb1aef 100644 --- a/bcs-services/bcs-bscp/ui/src/api/config.ts +++ b/bcs-services/bcs-bscp/ui/src/api/config.ts @@ -711,11 +711,21 @@ export const publishType = (bizId: string, appId: number) => http.get(`/config/biz_id/${bizId}/app_id/${appId}/last/select`); /** - * 版本上线状态查询 + * 当前版本状态查询 * @param bizId 业务ID * @param appId 应用ID * @param releaseId 版本ID * @returns */ -export const versionStatusQuery = (bizId: number, appId: number, releaseId: number) => +export const versionStatusQuery = (bizId: string, appId: number, releaseId: number) => http.get(`/config/biz_id/${bizId}/app_id/${appId}/release_id/${releaseId}/status`); + +/** + * 当前服务下 所有版本上线状态检查 + * @param bizId 业务ID + * @param appId 应用ID + * @param releaseId 版本ID + * @returns + */ +export const versionStatusCheck = (bizId: string, appId: number) => + http.get(`/config/biz_id/${bizId}/app_id/${appId}/last/publish`); diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/dialog-publish-warn.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/dialog-publish-warn.vue new file mode 100644 index 0000000000..d081290154 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/dialog-publish-warn.vue @@ -0,0 +1,231 @@ + + + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue index b438e5c028..17e5aa4168 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue @@ -24,10 +24,10 @@ ); const handleLinkTo = () => { - console.log('跳转服务上线记录'); + console.log('跳转服务上线记录'); // 等接口更新 }; const handleUndo = () => { - console.log('撤销'); + console.log('撤销'); // 等接口更新 }; diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue index 1790e6905d..f60426577a 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue @@ -22,7 +22,7 @@ :disabled="approveData.type === ONLINE_TYPE.Periodically" theme="primary" :class="['trigger-button', { 'bk-button-with-no-perm': !props.hasPerm }]" - @click="handleOnlineClick"> + @click="handlePublishClick"> {{ approveData.type === ONLINE_TYPE.Periodically ? t('等待定时上线') : t('确定上线') }} @@ -86,6 +86,7 @@ :current-version-groups="groupsPendingtoPublish" @publish="handleOpenPublishDialog" @close="isDiffSliderShow = false" /> + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-confirm.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-confirm.vue new file mode 100644 index 0000000000..539c0bcf2a --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-confirm.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/more-actions.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/more-actions.vue new file mode 100644 index 0000000000..dc31fab4b0 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/more-actions.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/record-table.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/record-table.vue new file mode 100644 index 0000000000..632791920f --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/record-table.vue @@ -0,0 +1,518 @@ + + + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/search-option.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/search-option.vue new file mode 100644 index 0000000000..d6977f7219 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/search-option.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/service-selector.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/service-selector.vue new file mode 100644 index 0000000000..34059eed93 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/service-selector.vue @@ -0,0 +1,206 @@ + + + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/version-diff.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/version-diff.vue new file mode 100644 index 0000000000..8ecb20d353 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/version-diff.vue @@ -0,0 +1,177 @@ + + + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/index.vue new file mode 100644 index 0000000000..fa585f9a6b --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue index 2f31229fd8..e1edcfb95d 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue @@ -40,7 +40,7 @@
    - + - + @@ -99,6 +99,7 @@ create: false, publish: false, }); + const verAppStatus = ref(); const props = defineProps<{ bkBizId: string; diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue index 17e5aa4168..14a96884e5 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/header-more-options.vue @@ -3,16 +3,26 @@
    • 服务上线记录
    • -
    • - 撤销 -
    • + +
    • + 撤销 +
    • +
    diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue index f60426577a..19f8dcde8f 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue @@ -2,7 +2,8 @@
    { - handleConfirm(true); + const handlePublishClick = async () => { + const { bkBizId: biz_id, appId: app_id } = props; + const resp = await approve(biz_id, app_id, publishedVersionId.value, { publish_status: 'AlreadyPublish' }); + handleConfirm(resp.haveCredentials); }; // 打开上线版本确认弹窗 diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/index.vue index a14c88b339..32e0a69975 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/index.vue @@ -3,7 +3,7 @@ { - handleConfirm(true); + const handlePublishClick = async () => { + const { bkBizId: biz_id, appId: app_id } = props; + const resp = await approve(biz_id, app_id, publishedVersionId.value, { publish_status: 'AlreadyPublish' }); + handleConfirm(resp.haveCredentials); }; const handleOpenPublishDialog = () => { diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/version-approve-status.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/version-approve-status.vue index c274a3ef84..a31af321c4 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/version-approve-status.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/version-approve-status.vue @@ -1,8 +1,9 @@ - + {{ t('或签') }} {{ t('会签') }} diff --git a/bcs-services/bcs-bscp/ui/types/record.ts b/bcs-services/bcs-bscp/ui/types/record.ts new file mode 100644 index 0000000000..807e849e60 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/types/record.ts @@ -0,0 +1,119 @@ +// 操作记录列表参数 +export interface IRecordQuery { + start?: number; + limit?: number; + app_id?: number; + all?: boolean; + start_time?: string; + end_time?: string; + search_value?: string; + operate?: string; +} + +// 审批操作:撤销/驳回/通过/手动上线 +export interface IDialogData { + service?: string; + version?: string; + group?: string; +} + +// 列表每行的数据 +export interface IRowData { + audit: { + id: number; + spec: { + res_type: string; + action: string; + rid?: string; + app_code?: string; + detail?: string; + operator: string; + res_instance: string; + operate_way: string; + status: string; + }; + attachment: { + biz_id: number; + app_id: number; + res_id: number; + }; + revision: { + created_at: string; + }; + }; + strategy: { + publish_type: string; + publish_time: string; + publish_status: string; + reject_reason: string; + approver: string; + approver_progress: string; + updated_at: string; + reviser: string; + release_id: number; + scope: { + groups: [ + { + id: number; + spec: { + name: string; + public: boolean; + bind_apps: []; + mode: string; + selector: { + labels_and: [ + { + key: string; + op: string; + value: string; + }, + ]; + }; + uid: string; + }; + attachment: { + biz_id: number; + }; + revision: { + creator: string; + reviser: string; + create_at: string; + update_at: string; + }; + }, + { + id: 2; + spec: { + name: string; + public: true; + bind_apps: []; + mode: string; + selector: { + labels_and: [ + { + key: string; + op: string; + value: string; + }, + ]; + }; + uid: string; + }; + attachment: { + biz_id: number; + }; + revision: { + creator: string; + reviser: string; + create_at: string; + update_at: string; + }; + }, + ]; + }; + }; + app: { + name: string; + creator: string; + }; +} From b156375355dfbf56d2e91c43fdd43c5dd68a04dd Mon Sep 17 00:00:00 2001 From: q15971095971 <764419406@qq.com> Date: Mon, 16 Sep 2024 22:06:04 +0800 Subject: [PATCH 04/15] =?UTF-8?q?feat:=20=E6=93=8D=E4=BD=9C=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=88=97=E8=A1=A8=E8=BF=87=E6=BB=A4=E3=80=81=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E9=A9=B3=E5=9B=9E=E5=BC=B9=E7=AA=97--story=3D11599832?= =?UTF-8?q?4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bcs-services/bcs-bscp/ui/src/api/config.ts | 11 +- .../bcs-bscp/ui/src/constants/record.ts | 6 +- bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts | 1 + .../space/records/components/date-picker.vue | 47 ++--- .../records/components/dialog-confirm.vue | 5 +- .../records/components/dialog-reject.vue | 193 ++++++++++++++++++ .../space/records/components/record-table.vue | 192 ++++++++++++----- .../records/components/service-selector.vue | 42 ++-- .../space/records/components/version-diff.vue | 123 +++++++---- .../ui/src/views/space/records/index.vue | 25 ++- .../detail/components/header-more-options.vue | 4 +- .../components/publish-version-diff.vue | 2 + .../publish-version/confirm-dialog.vue | 7 +- .../config/components/version-diff/index.vue | 8 +- bcs-services/bcs-bscp/ui/types/record.ts | 14 +- 15 files changed, 508 insertions(+), 172 deletions(-) create mode 100644 bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-reject.vue diff --git a/bcs-services/bcs-bscp/ui/src/api/config.ts b/bcs-services/bcs-bscp/ui/src/api/config.ts index a7f2bb1aef..2e613df8fe 100644 --- a/bcs-services/bcs-bscp/ui/src/api/config.ts +++ b/bcs-services/bcs-bscp/ui/src/api/config.ts @@ -281,6 +281,7 @@ export const publishVersion = ( * @param data 参数 * @param publish_type 上线方式 * @param publish_time 定时上线时间 + * @param allFirstPublish 所有待上线的分组是否为首次上线 * @returns */ export const publishVerSubmit = ( @@ -293,15 +294,9 @@ export const publishVerSubmit = ( memo: string; publishType: 'Manually' | 'Automatically' | 'Periodically' | 'Immediately' | ''; publishTime: Date | string; + allFirstPublish: boolean; }, -) => - http.post(`/config/biz_id/${bizId}/app_id/${appId}/release_id/${releaseId}/submit`, { - groups: data.groups, - all: data.all, - memo: data.memo, - publish_type: data.publishType, - publish_time: data.publishTime, - }); +) => http.post(`/config/biz_id/${bizId}/app_id/${appId}/release_id/${releaseId}/submit`, data); /** * 获取服务下初始化脚本引用配置 diff --git a/bcs-services/bcs-bscp/ui/src/constants/record.ts b/bcs-services/bcs-bscp/ui/src/constants/record.ts index 05d081ee37..6c3e822b96 100644 --- a/bcs-services/bcs-bscp/ui/src/constants/record.ts +++ b/bcs-services/bcs-bscp/ui/src/constants/record.ts @@ -11,7 +11,7 @@ export const ACTION = { Publish: localT('上线服务'), Update: localT('更新服务'), Delete: localT('删除服务'), - PublishVersionConfig: localT('上线版本配置'), // 2024.9 第一版只有这个字段 + PublishVersionConfig: localT('上线版本配置'), }; // 资源实例 @@ -27,8 +27,8 @@ export const STATUS = { RevokedPublish: localT('撤销上线'), RejectedApproval: localT('审批驳回'), AlreadyPublish: localT('已上线'), - Failure: localT('失败'), // 脚本相关的才会有 - Success: localT('成功'), // 脚本相关的才会有 + Failure: localT('失败'), + Success: localT('成功'), }; // 版本状态 diff --git a/bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts b/bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts index 7fb7707748..db7c4598af 100644 --- a/bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts +++ b/bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts @@ -523,6 +523,7 @@ export default { 去审批: '去审批', 审批: '审批', 再次提交: '再次提交', + 确认驳回该上线任务: '确认驳回该上线任务', // 分组管理 新增分组: '新增分组', diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/date-picker.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/date-picker.vue index 614de03290..736cc8673b 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/records/components/date-picker.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/date-picker.vue @@ -1,7 +1,6 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-confirm.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-confirm.vue index 539c0bcf2a..1220e08a0b 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-confirm.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-confirm.vue @@ -67,7 +67,7 @@ {}, ); - const emits = defineEmits(['update:show']); + const emits = defineEmits(['update:show', 'refreshList']); const reason = ref(''); @@ -84,8 +84,9 @@ reason: reason.value, }); emits('update:show', false); + emits('refreshList'); BkMessage({ - theme: 'primary', + theme: 'success', message: t('操作成功'), }); }; diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-reject.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-reject.vue new file mode 100644 index 0000000000..7105020f23 --- /dev/null +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/dialog-reject.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/records/components/record-table.vue b/bcs-services/bcs-bscp/ui/src/views/space/records/components/record-table.vue index 632791920f..7ce2709fdf 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/records/components/record-table.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/records/components/record-table.vue @@ -2,8 +2,15 @@
    - - + + @@ -11,12 +18,26 @@ - + - + @@ -42,7 +63,12 @@ + :width="locale === 'zh-cn' ? '130' : '160'" + :filter="{ + filterFn: () => true, + list: approveStatusFilterList, + checked: approveStatusFilterChecked, + }">