diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 362b97ffdd..7ed34f509d 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -96,6 +96,7 @@ module.exports = { '^echarts$', '^color$', '^localforage$', + 'vue-draggable-plus', ], // node依赖 ['.*/assets/.*', '^@/assets$'], // 项目静态资源 ['^@/components/pure/.*', '^@/components/business/.*', '.*\\.vue$'], // 组件 diff --git a/frontend/package.json b/frontend/package.json index 15cf672e1b..73e5c87657 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -48,7 +48,7 @@ "@vueuse/core": "^10.4.1", "ace-builds": "^1.24.2", "ahooks-vue": "^0.15.1", - "axios": "^0.24.0", + "axios": "^1.6.5", "dayjs": "^1.11.9", "echarts": "^5.4.3", "fastq": "^1.15.0", @@ -67,7 +67,7 @@ "tippy.js": "^6.3.7", "vue": "^3.3.4", "vue-dompurify-html": "^4.1.4", - "vue-draggable-plus": "^0.2.7", + "vue-draggable-plus": "^0.3.5", "vue-echarts": "^6.6.1", "vue-i18n": "^9.3.0", "vue-router": "^4.2.4", diff --git a/frontend/src/api/http/Axios.ts b/frontend/src/api/http/Axios.ts index e90e3a3b11..415dfd7e02 100644 --- a/frontend/src/api/http/Axios.ts +++ b/frontend/src/api/http/Axios.ts @@ -8,7 +8,7 @@ import { ContentTypeEnum } from '@/enums/httpEnum'; import { AxiosCanceler } from './axiosCancel'; import type { CreateAxiosOptions } from './axiosTransform'; import type { RequestOptions, Result, UploadFileParams } from '#/axios'; -import type { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; +import type { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'; export * from './axiosTransform'; @@ -56,7 +56,7 @@ export class MSAxios { if (requestInterceptors && isFunction(requestInterceptors)) { config = requestInterceptors(config, this.options); } - return config; + return config as InternalAxiosRequestConfig; // TODO: 拦截配置升级了,暂时 as 处理 }, undefined); // 响应拦截器 diff --git a/frontend/src/api/modules/project-management/project.ts b/frontend/src/api/modules/project-management/project.ts index 226a5f4e30..fb2f6c2206 100644 --- a/frontend/src/api/modules/project-management/project.ts +++ b/frontend/src/api/modules/project-management/project.ts @@ -1,5 +1,5 @@ import MSR from '@/api/http/index'; -import { ProjectListUrl } from '@/api/requrls/project-management/project'; +import { ProjectListUrl, ProjectSwitchUrl } from '@/api/requrls/project-management/project'; import type { ProjectListItem } from '@/models/setting/project'; @@ -7,4 +7,6 @@ export function getProjectList(organizationId: string) { return MSR.get({ url: ProjectListUrl, params: organizationId }); } -export default {}; +export function switchProject(data: { projectId: string; userId: string }) { + return MSR.post({ url: ProjectSwitchUrl, data }); +} diff --git a/frontend/src/api/requrls/project-management/project.ts b/frontend/src/api/requrls/project-management/project.ts index 75b85d9d24..d6d4d12fb1 100644 --- a/frontend/src/api/requrls/project-management/project.ts +++ b/frontend/src/api/requrls/project-management/project.ts @@ -1,3 +1,2 @@ -export const ProjectListUrl = '/project/list/options'; - -export default {}; +export const ProjectListUrl = '/project/list/options'; // 项目列表 +export const ProjectSwitchUrl = '/project/switch'; // 切换项目 diff --git a/frontend/src/assets/style/arco-reset.less b/frontend/src/assets/style/arco-reset.less index 0ac40f67e3..7d01178b40 100644 --- a/frontend/src/assets/style/arco-reset.less +++ b/frontend/src/assets/style/arco-reset.less @@ -604,15 +604,24 @@ } /** 开关 **/ -.arco-switch:not(.arco-switch-disabled) { - background: var(--color-fill-4) !important; -} -.arco-switch-checked:not(.arco-switch-disabled) { - background: rgb(var(--primary-6)) !important; -} .arco-switch[disabled] { background: var(--color-text-n8); } +.arco-switch-type-line.arco-switch-small { + height: 14px; + line-height: 14px; +} +.arco-switch-type-line.arco-switch-small { + .arco-switch-handle { + width: 14px; + height: 14px; + } +} +.arco-switch-type-line.arco-switch-small.arco-switch-checked { + .arco-switch-handle { + left: calc(100% - 14px - 0px); + } +} /** 分页 **/ .ms-pagination { diff --git a/frontend/src/assets/style/var.less b/frontend/src/assets/style/var.less index 698f56c2f0..a8609528da 100644 --- a/frontend/src/assets/style/var.less +++ b/frontend/src/assets/style/var.less @@ -208,6 +208,7 @@ &::before { position: absolute; top: 0; + left: 0; z-index: 1; width: 100%; height: 10px; @@ -222,6 +223,7 @@ &::after { position: absolute; bottom: 0; + left: 0; z-index: 1; width: 100%; height: 10px; diff --git a/frontend/src/components/business/ms-batch-form/index.vue b/frontend/src/components/business/ms-batch-form/index.vue index 8358b28847..42d0cf2263 100644 --- a/frontend/src/components/business/ms-batch-form/index.vue +++ b/frontend/src/components/business/ms-batch-form/index.vue @@ -122,6 +122,7 @@ class="mt-[8px]" :style="{ 'margin-top': index === 0 && !props.isShowDrag ? '36px' : '' }" size="small" + type="line" />
import { ref, unref, watchEffect } from 'vue'; + import { VueDraggable } from 'vue-draggable-plus'; import MsTagsInput from '@/components/pure/ms-tags-input/index.vue'; @@ -167,7 +169,6 @@ import type { FormItemModel, FormMode } from './types'; import type { FormInstance, ValidatedError } from '@arco-design/web-vue'; - import { VueDraggable } from 'vue-draggable-plus'; const { t } = useI18n(); diff --git a/frontend/src/components/business/ms-case-associate/index.vue b/frontend/src/components/business/ms-case-associate/index.vue index 5c8a7cabad..b6b6d3e5ff 100644 --- a/frontend/src/components/business/ms-case-associate/index.vue +++ b/frontend/src/components/business/ms-case-associate/index.vue @@ -129,6 +129,7 @@ diff --git a/frontend/src/views/api-test/debug/components/debug/query.vue b/frontend/src/views/api-test/debug/components/debug/query.vue index af1057faf0..3ccaaff321 100644 --- a/frontend/src/views/api-test/debug/components/debug/query.vue +++ b/frontend/src/views/api-test/debug/components/debug/query.vue @@ -16,7 +16,6 @@ :columns="columns" :height-used="heightUsed" :scroll="{ minWidth: 1160 }" - format="query" @change="handleParamTableChange" /> @@ -24,8 +23,7 @@ - - diff --git a/frontend/src/views/project-management/environmental/components/allParams/ParamDescInput.vue b/frontend/src/views/project-management/environmental/components/allParams/ParamDescInput.vue deleted file mode 100644 index d6c5fc970c..0000000000 --- a/frontend/src/views/project-management/environmental/components/allParams/ParamDescInput.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - diff --git a/frontend/src/views/project-management/environmental/components/allParams/ParamTagInput.vue b/frontend/src/views/project-management/environmental/components/allParams/ParamTagInput.vue deleted file mode 100644 index 7f1486ab65..0000000000 --- a/frontend/src/views/project-management/environmental/components/allParams/ParamTagInput.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - - diff --git a/frontend/src/views/project-management/environmental/components/allParams/index.vue b/frontend/src/views/project-management/environmental/components/allParams/index.vue index 7bba4ffa3d..8e727720b9 100644 --- a/frontend/src/views/project-management/environmental/components/allParams/index.vue +++ b/frontend/src/views/project-management/environmental/components/allParams/index.vue @@ -16,7 +16,7 @@
- import { useVModel } from '@vueuse/core'; - import { MsTableColumn } from '@/components/pure/ms-table/type'; - import AllParamsTable from './AllParamsTable.vue'; + import paramsTable, { type ParamTableColumn } from '@/views/api-test/components/paramTable.vue'; import batchAddKeyVal from '@/views/api-test/debug/components/debug/batchAddKeyVal.vue'; import { useI18n } from '@/hooks/useI18n'; @@ -56,7 +55,7 @@ const innerParams = useVModel(props, 'params', emit); - const columns: MsTableColumn = [ + const columns: ParamTableColumn[] = [ { title: 'project.environmental.paramName', dataIndex: 'name', @@ -70,6 +69,34 @@ slotName: 'type', showInTable: true, showDrag: true, + typeOptions: [ + { + label: t('common.string'), + value: 'string', + }, + { + label: t('common.integer'), + value: 'integer', + }, + { + label: t('common.number'), + value: 'number', + }, + { + label: t('common.array'), + value: 'array', + }, + { + label: t('common.json'), + value: 'json', + }, + { + label: t('common.file'), + value: 'file', + }, + ], + titleSlotName: 'typeTitle', + typeTitleTooltip: t('project.environmental.paramTypeTooltip'), }, { title: 'project.environmental.paramValue', diff --git a/frontend/src/views/project-management/environmental/components/requestHeader/index.vue b/frontend/src/views/project-management/environmental/components/requestHeader/index.vue index b57655aade..b6c34f0f3a 100644 --- a/frontend/src/views/project-management/environmental/components/requestHeader/index.vue +++ b/frontend/src/views/project-management/environmental/components/requestHeader/index.vue @@ -1,21 +1,15 @@