refactor(项目设置): 导入环境页面调整

This commit is contained in:
fit2-zhao 2024-03-07 17:17:41 +08:00 committed by Craftsman
parent c979ccc6c3
commit 240cf0581d
3 changed files with 49 additions and 5 deletions

View File

@ -13,8 +13,8 @@
<template #title>
<span>{{ t('common.import') + t(`project.environmental.${props.type}`) }}</span>
</template>
<template #default>
<div class="title">
<div>
<div v-if="props.type === EnvAuthTypeEnum.GLOBAL" class="title">
<icon-exclamation-circle-fill :size="20" class="text-[rgb(var(--primary-5))]" />
<span class="text-[var(--color-text-1)]"> {{ t('project.environmental.importTile') }}</span>
</div>
@ -32,12 +32,41 @@
:disabled="confirmLoading"
@change="handleChange"
/>
</div>
<template #footer>
<div class="flex items-center justify-between">
<a-spin class="left-items">
<a-spin v-if="props.type === EnvAuthTypeEnum.ENVIRONMENT">
<a-switch v-model="isCover" type="line" size="small" />
<span>
{{ t('project.environmental.cover') }}
<a-tooltip>
<template #content>
<div>
{{ t('project.environmental.cover.enable') }}
</div>
<div>
{{ t('project.environmental.cover.disable') }}
</div>
</template>
<icon-question-circle
class="ml-1 inline-block text-[var(--color-text-4)] hover:text-[rgb(var(--primary-5))]"
/>
</a-tooltip>
</span>
</a-spin>
</a-spin>
<div>
<a-button type="secondary">{{ t('system.plugin.pluginCancel') }}</a-button>
<a-button class="ml-3" type="primary" @click="confirmHandler">{{ t('common.import') }}</a-button>
</div>
</div>
</template>
</a-modal>
</template>
<script lang="ts" setup>
import { defineModel } from 'vue';
import { defineModel, ref } from 'vue';
import { type FileItem, Message } from '@arco-design/web-vue';
import MsUpload from '@/components/pure/ms-upload/index.vue';
@ -61,6 +90,7 @@
const visible = defineModel<boolean>('visible', { required: true, default: false });
const fileList = ref<FileItem[]>([]);
const isCover = ref<boolean>(false);
const handleCancel = (shouldSearch = false) => {
visible.value = false;
@ -73,7 +103,7 @@
try {
confirmLoading.value = true;
const params = {
request: {},
request: { cover: isCover.value },
fileList: fileList.value,
};
if (props.type === EnvAuthTypeEnum.GLOBAL) {
@ -104,4 +134,11 @@
background: rgb(var(--primary-1));
gap: 8px;
}
.right-align {
text-align: right;
}
.left-items {
align-items: center;
width: 100px;
}
</style>

View File

@ -104,4 +104,8 @@ export default {
'project.environmental.http.postTextPostTip':
'After rear script, environment a prerequisite for the script in the request after the script execution;',
'project.environmental.preOrPost.ignoreProtocols': 'Ignore request:',
'project.environmental.cover': 'Cover',
'project.environmental.cover.enable': 'Enable: Import and cover the environment with the same name',
'project.environmental.cover.disable': 'Disable: Import and do not cover the environment with the same name',
'project.environmental.ENVIRONMENT': 'Environment',
};

View File

@ -9,7 +9,7 @@ export default {
'project.environmental.requestHeader': '请求头',
'project.environmental.allParams': '全局参数',
'project.environmental.GLOBAL': '全局参数',
'project.environmental.ENVIRONMENT': '全局参数',
'project.environmental.ENVIRONMENT': '环境',
'project.environmental.ENVIRONMENT_PARAM': '全局参数',
'project.environmental.globalVariable': '参数',
'project.environmental.supportFormat': '仅支持MeterSphere导出的Json文件单个大小不超过 50M',
@ -116,4 +116,7 @@ export default {
'project.environmental.preOrPost.ignoreProtocols': '忽略请求:',
'project.environmental.preOrPost.pre': '脚本前',
'project.environmental.preOrPost.post': '脚本后',
'project.environmental.cover': '覆盖',
'project.environmental.cover.enable': '开启: 环境名称重复则覆盖,不重复则新增',
'project.environmental.cover.disable': '关闭: 环境名称重复则不导入',
};