diff --git a/frontend/config/vite.config.base.ts b/frontend/config/vite.config.base.ts index acb40392af..ea2ff70eaf 100644 --- a/frontend/config/vite.config.base.ts +++ b/frontend/config/vite.config.base.ts @@ -51,7 +51,7 @@ export default defineConfig({ preprocessorOptions: { less: { modifyVars: { - hack: `true; @import (reference) "${resolve('src/assets/style/breakpoint.less')}";`, + hack: `true; @import (reference) "${resolve('src/assets/style/var.less')}";`, }, javascriptEnabled: true, }, diff --git a/frontend/src/api/http/index.ts b/frontend/src/api/http/index.ts index 4f32f1513e..50c9fa02ce 100644 --- a/frontend/src/api/http/index.ts +++ b/frontend/src/api/http/index.ts @@ -172,7 +172,7 @@ function createAxios(opt?: Partial) { // authentication schemes,e.g: Bearer // authenticationScheme: 'Bearer', authenticationScheme: '', - baseURL: import.meta.env.VITE_API_BASE_URL as string, + baseURL: `${window.location.origin}/${import.meta.env.VITE_API_BASE_URL as string}`, timeout: 30 * 1000, headers: { 'Content-Type': ContentTypeEnum.JSON, 'X-AUTH-TOKEN': sessionId, 'CSRF-TOKEN': csrfToken }, // 如果是form-data格式 diff --git a/frontend/src/assets/style/arco-reset.less b/frontend/src/assets/style/arco-reset.less index afbc534820..571b45488c 100644 --- a/frontend/src/assets/style/arco-reset.less +++ b/frontend/src/assets/style/arco-reset.less @@ -1,21 +1,124 @@ -.arco-reset { - /** 表格样式 **/ - .arco-table-cell { - .circle { - @apply inline-block rounded-full; +/** 表格样式 **/ +.arco-table-cell { + .circle { + @apply inline-block rounded-full; - margin-right: 4px; - width: 6px; - height: 6px; - background-color: rgb(var(--blue-6)); - &.pass { - background-color: rgb(var(--green-6)); + margin-right: 4px; + width: 6px; + height: 6px; + background-color: rgb(var(--blue-6)); + &.pass { + background-color: rgb(var(--green-6)); + } + } +} + +/** Tabs 组件样式 **/ +.arco-tabs-nav-add-btn { + font-size: var(--font-size-body-3); +} + +/** Modal对话框 **/ +.arco-modal { + @apply bg-white; + + padding: 24px; + .arco-modal-header { + margin-bottom: 16px; + } + .arco-modal-footer { + margin-top: 16px; + text-align: right; + } +} +.ms-modal-weak { + .arco-modal-footer { + .arco-btn:first-child { + color: var(--color-text-1) !important; + } + } +} + +/** 按钮 **/ +.arco-btn-primary { + &:disabled { + background-color: rgb(var(--primary-3)) !important; + } +} +.arco-btn-secondary { + color: var(--clolor-text-1) !important; + background-color: var(--color-text-n8) !important; + &:not(:disabled):hover { + background-color: var(--color-text-input-border) !important; + } + &:not(:disabled):active { + background-color: var(--color-text-brand) !important; + } +} +.arco-btn-text { + &:not(:disabled):hover { + background-color: var(--color-text-n9) !important; + } + &:not(:disabled):active { + background-color: var(--color-text-n8) !important; + } +} +.arco-btn-outline { + color: rgb(var(--primary-5)) !important; + &:not(:disabled):hover { + border-color: rgb(var(--primary-4)) !important; + color: rgb(var(--primary-4)) !important; + background-color: rgb(var(--primary-1)) !important; + } + &:not(:disabled):active { + border-color: rgb(var(--primary-7)) !important; + color: rgb(var(--primary-7)) !important; + background-color: rgb(var(--primary-9)) !important; + } + &:disabled { + border-color: rgb(var(--primary-3)) !important; + color: rgb(var(--primary-3)) !important; + background-color: rgb(var(--primary-1)) !important; + } +} + +/** 输入框 **/ +.arco-input-wrapper { + border: 1px solid var(--color-text-input-border); + background-color: var(--color-text-fff) !important; + &:not(:disabled):hover { + border-color: rgb(var(--primary-5)); + } +} + +/** Message **/ +.arco-message { + border: 0.5px solid var(--color-text-n8); + border-radius: var(--border-radius-medium); + box-shadow: 0 6px 30px 5px rgb(0 0 0 / 5%), 0 16px 24px 2px rgb(0 0 0 / 4%), 0 8px 10px -5px rgb(0 0 0 / 8%); +} + +/** 图标 **/ +.arco-icon { + font-size: 16px; +} + +/** 下拉菜单 **/ +.arco-dropdown { + border: 0.5px solid var(--color-text-n8); + box-shadow: 0 3px 14px 2px rgb(0 0 0 / 5%), 0 8px 10px 1px rgb(0 0 0 / 6%), 0 5px 5px -3px rgb(0 0 0 / 10%); + .arco-dropdown-list { + @apply relative flex w-full flex-col overflow-hidden; + .arco-dropdown-option { + @apply w-auto; + + margin: 0 6px; + padding: 3px 8px; + border-radius: var(--border-radius-small); + line-height: normal; + &:hover { + background-color: rgb(var(--primary-1)); } } } - - /** Tabs 组件样式 **/ - .arco-tabs-nav-add-btn { - font-size: var(--font-size-base); - } } diff --git a/frontend/src/assets/style/var.less b/frontend/src/assets/style/var.less new file mode 100644 index 0000000000..dfa32e60a6 --- /dev/null +++ b/frontend/src/assets/style/var.less @@ -0,0 +1,5 @@ +/** 主题变量覆盖 **/ +@border-radius-mini: 2px; +@border-radius-small: 4px; +@border-radius-medium: 6px; +@border-radius-large: 12px; diff --git a/frontend/src/components/pure/ms-button/index.vue b/frontend/src/components/pure/ms-button/index.vue new file mode 100644 index 0000000000..e90fd3ea7a --- /dev/null +++ b/frontend/src/components/pure/ms-button/index.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/frontend/src/components/pure/ms-table-more-action/index.vue b/frontend/src/components/pure/ms-table-more-action/index.vue new file mode 100644 index 0000000000..8dd344ae1c --- /dev/null +++ b/frontend/src/components/pure/ms-table-more-action/index.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/frontend/src/components/pure/ms-table-more-action/types.ts b/frontend/src/components/pure/ms-table-more-action/types.ts new file mode 100644 index 0000000000..c8c3de748d --- /dev/null +++ b/frontend/src/components/pure/ms-table-more-action/types.ts @@ -0,0 +1,8 @@ +export interface ActionsItem { + label?: string; + eventTag?: string; + isDivider?: boolean; + danger?: boolean; +} + +export type SelectedValue = string | number | Record | undefined; diff --git a/frontend/src/hooks/useModal.ts b/frontend/src/hooks/useModal.ts index 85198454ed..9782082eb3 100644 --- a/frontend/src/hooks/useModal.ts +++ b/frontend/src/hooks/useModal.ts @@ -20,6 +20,12 @@ export default function useModal() { ...options, titleAlign: 'start', modalClass: `ms-modal-${options.mode || 'default'} ms-modal-${options.size || 'medium'}`, + okButtonProps: { + type: options.mode === 'weak' ? 'text' : 'primary', + }, + cancelButtonProps: { + type: options.mode === 'weak' ? 'text' : 'secondary', + }, }), }; } diff --git a/frontend/src/layout/default-layout.vue b/frontend/src/layout/default-layout.vue index c6684957d4..971214ec77 100644 --- a/frontend/src/layout/default-layout.vue +++ b/frontend/src/layout/default-layout.vue @@ -1,5 +1,5 @@