refactor(项目管理): 环境管理环境参数修改
This commit is contained in:
parent
4d832ce503
commit
5e266613e6
|
@ -1,5 +1,3 @@
|
|||
import { key } from 'localforage';
|
||||
|
||||
export interface EnvListItem {
|
||||
name: string;
|
||||
id: string;
|
||||
|
@ -36,11 +34,12 @@ export interface EnvConfig {
|
|||
commmonVariables?: EnvConfigItem[];
|
||||
httpConfig?: EnvConfigItem[];
|
||||
dataSource?: DataSourceItem[];
|
||||
hostConfig?: EnvConfigItem[];
|
||||
hostConfig?: EnvConfigItem;
|
||||
authConfig?: EnvConfigItem;
|
||||
preScript?: EnvConfigItem[];
|
||||
postScript?: EnvConfigItem[];
|
||||
assertions?: EnvConfigItem[];
|
||||
preProcessorConfig?: EnvConfigItem;
|
||||
postProcessorConfig?: EnvConfigItem;
|
||||
assertionConfig?: EnvConfigItem;
|
||||
pluginConfigMap?: EnvConfigItem;
|
||||
}
|
||||
export interface EnvDetailItem {
|
||||
id?: string;
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
|
||||
const params = computed({
|
||||
set: (value: any) => {
|
||||
store.currentEnvDetailInfo.config.assertions = value;
|
||||
store.currentEnvDetailInfo.config.assertionConfig = value;
|
||||
},
|
||||
get: () => store.currentEnvDetailInfo.config.assertions || [],
|
||||
get: () => store.currentEnvDetailInfo.config.assertionConfig || [],
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="flex flex-row items-center gap-[8px]">
|
||||
<a-switch type="line" size="small" />
|
||||
<a-switch v-model:model-value="currentList.enable" type="line" size="small" />
|
||||
<div class="text-[var(--color-text-1)]">{{ t('project.environmental.host.config') }}</div>
|
||||
</div>
|
||||
<div class="mt-[8px]">
|
||||
|
@ -10,7 +10,7 @@
|
|||
:models="batchFormModels"
|
||||
:form-mode="ruleFormMode"
|
||||
add-text="project.menu.rule.addRule"
|
||||
:default-vals="currentList"
|
||||
:default-vals="currentList.hosts"
|
||||
show-enable
|
||||
:is-show-drag="false"
|
||||
></MsBatchForm>
|
||||
|
@ -35,14 +35,15 @@
|
|||
const store = useProjectEnvStore();
|
||||
|
||||
const currentList = computed({
|
||||
get: () => (store.currentEnvDetailInfo.config.hostConfig || []) as FakeTableListItem[],
|
||||
set: (value: EnvConfigItem[] | undefined) => {
|
||||
store.currentEnvDetailInfo.config.hostConfig = value;
|
||||
get: () => store.currentEnvDetailInfo.config.hostConfig || {},
|
||||
set: (value: EnvConfigItem) => {
|
||||
console.log(value);
|
||||
store.currentEnvDetailInfo.config.hostConfig = value || {};
|
||||
},
|
||||
});
|
||||
const batchFormRef = ref();
|
||||
onClickOutside(batchFormRef, () => {
|
||||
currentList.value = batchFormRef.value?.getFormResult();
|
||||
currentList.value.hosts = batchFormRef.value?.getFormResult();
|
||||
});
|
||||
type UserModalMode = 'create' | 'edit';
|
||||
const batchFormModels: Ref<FormItemModel[]> = ref([
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" async setup>
|
||||
import { defineModel } from 'vue';
|
||||
import { TableData } from '@arco-design/web-vue';
|
||||
|
||||
import MsButton from '@/components/pure/ms-button/index.vue';
|
||||
|
@ -69,9 +68,12 @@
|
|||
const tableStore = useTableStore();
|
||||
const addVisible = ref(false);
|
||||
const currentId = ref('');
|
||||
const innerParam = defineModel<TableData[]>('modelValue', {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
|
||||
const innerParam = computed({
|
||||
set: (value: TableData[]) => {
|
||||
store.currentEnvDetailInfo.config.httpConfig = value;
|
||||
},
|
||||
get: () => store.currentEnvDetailInfo.config.httpConfig || [],
|
||||
});
|
||||
|
||||
const columns: MsTableColumn = [
|
||||
|
@ -124,6 +126,7 @@
|
|||
showSetting: true,
|
||||
showPagination: false,
|
||||
showMode: false,
|
||||
debug: true,
|
||||
});
|
||||
|
||||
const form = reactive({
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
// TODO: 参数类型
|
||||
const params = computed<any>({
|
||||
set: (value: any) => {
|
||||
store.currentEnvDetailInfo.config.postScript = value;
|
||||
store.currentEnvDetailInfo.config.postProcessorConfig = value;
|
||||
},
|
||||
get: () => store.currentEnvDetailInfo.config.postScript || [],
|
||||
get: () => store.currentEnvDetailInfo.config.postProcessorConfig || {},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
// TODO:参数类型
|
||||
const params = computed<any>({
|
||||
set: (value: any) => {
|
||||
store.currentEnvDetailInfo.config.preScript = value;
|
||||
store.currentEnvDetailInfo.config.preProcessorConfig = value;
|
||||
},
|
||||
get: () => store.currentEnvDetailInfo.config.preScript || [],
|
||||
get: () => store.currentEnvDetailInfo.config.preProcessorConfig || {},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@
|
|||
const envList = ref<EnvListItem[]>([]); // 环境列表
|
||||
const evnGroupList = ref<EnvListItem[]>([]); // 环境组列表
|
||||
|
||||
const showType = ref<EnvAuthScopeEnum>(EnvAuthScopeEnum.PROJECT_GROUP); // 展示类型
|
||||
const showType = ref<EnvAuthScopeEnum>(EnvAuthScopeEnum.PROJECT); // 展示类型
|
||||
|
||||
const activeKey = computed(() => store.currentId); // 当前选中的id
|
||||
|
||||
|
|
Loading…
Reference in New Issue