This commit is contained in:
chenjianxing 2020-09-23 16:18:36 +08:00
commit ff2fcd620b
2 changed files with 6 additions and 5 deletions

View File

@ -33,12 +33,13 @@
:description="$t('api_test.scenario.kv_description')"/> :description="$t('api_test.scenario.kv_description')"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.scenario.headers')" name="headers"> <el-tab-pane :label="$t('api_test.scenario.headers')" name="headers">
<ms-api-key-value :is-read-only="isReadOnly" :isShowEnable="true" :items="scenario.headers" :suggestions="headerSuggestions" <ms-api-key-value :is-read-only="isReadOnly" :isShowEnable="true" :items="scenario.headers"
:suggestions="headerSuggestions"
:environment="scenario.environment" :environment="scenario.environment"
:description="$t('api_test.scenario.kv_description')"/> :description="$t('api_test.scenario.kv_description')"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.environment.database_config')" name="database"> <el-tab-pane :label="$t('api_test.environment.database_config')" name="database">
<ms-database-config :configs="scenario.databaseConfigs"/> <ms-database-config :configs="scenario.databaseConfigs" :is-read-only="isReadOnly"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.scenario.dubbo')" name="dubbo"> <el-tab-pane :label="$t('api_test.scenario.dubbo')" name="dubbo">
<div class="dubbo-config-title">Config Center</div> <div class="dubbo-config-title">Config Center</div>

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<ms-database-from :config="currentConfig" :callback="saveConfig" ref="databaseFrom"/> <ms-database-from :config="currentConfig" :callback="saveConfig" ref="databaseFrom" :is-read-only="isReadOnly"/>
<ms-database-config-list @rowSelect="rowSelect" v-if="configs.length > 0" :table-data="configs"/> <ms-database-config-list @rowSelect="rowSelect" v-if="configs.length > 0" :table-data="configs"/>
</div> </div>
</template> </template>
@ -9,7 +9,7 @@
import MsDatabaseConfigList from "./DatabaseConfigList"; import MsDatabaseConfigList from "./DatabaseConfigList";
import {DatabaseConfig} from "../../../model/ScenarioModel"; import {DatabaseConfig} from "../../../model/ScenarioModel";
import MsDatabaseFrom from "./DatabaseFrom"; import MsDatabaseFrom from "./DatabaseFrom";
import {getUUID} from "../../../../../../../common/js/utils"; import {getUUID} from "@/common/js/utils";
export default { export default {
name: "MsDatabaseConfig", name: "MsDatabaseConfig",
@ -30,7 +30,7 @@
methods: { methods: {
saveConfig(config) { saveConfig(config) {
for (let item of this.configs) { for (let item of this.configs) {
if (item.name === config.name && item.id != config.id) { if (item.name === config.name && item.id !== config.id) {
this.$warning(this.$t('commons.already_exists')); this.$warning(this.$t('commons.already_exists'));
return; return;
} }