refactor: 环境编辑添加取消按钮

This commit is contained in:
chenjianxing 2020-07-16 13:20:37 +08:00
parent 82cc66dbcd
commit 042b97b838
2 changed files with 12 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<el-container v-loading="result.loading"> <el-container v-loading="result.loading">
<ms-aside-item :title="$t('api_test.environment.environment_list')" :data="environments" :item-operators="environmentOperators" :add-fuc="addEnvironment" <ms-aside-item :title="$t('api_test.environment.environment_list')" :data="environments" :item-operators="environmentOperators" :add-fuc="addEnvironment"
:delete-fuc="deleteEnvironment" @itemSelected="environmentSelected" ref="environmentItems"/> :delete-fuc="deleteEnvironment" @itemSelected="environmentSelected" ref="environmentItems"/>
<environment-edit :environment="currentEnvironment" ref="environmentEdit"/> <environment-edit :environment="currentEnvironment" ref="environmentEdit" @close="close"/>
</el-container> </el-container>
</el-dialog> </el-dialog>
</template> </template>
@ -96,6 +96,7 @@
}, },
close() { close() {
this.$emit('close'); this.$emit('close');
this.visible = false;
} }
} }
} }

View File

@ -28,7 +28,10 @@
<ms-api-key-value :items="environment.headers"/> <ms-api-key-value :items="environment.headers"/>
<div class="environment-footer"> <div class="environment-footer">
<el-button type="primary" @click="save">{{this.$t('commons.save')}}</el-button> <ms-dialog-footer
@cancel="cancel"
@confirm="save()"/>
<!-- <el-button type="primary" @click="save">{{this.$t('commons.save')}}</el-button>-->
</div> </div>
</el-form> </el-form>
@ -38,10 +41,11 @@
<script> <script>
import MsApiScenarioVariables from "../ApiScenarioVariables"; import MsApiScenarioVariables from "../ApiScenarioVariables";
import MsApiKeyValue from "../ApiKeyValue"; import MsApiKeyValue from "../ApiKeyValue";
import MsDialogFooter from "../../../../common/components/MsDialogFooter";
export default { export default {
name: "EnvironmentEdit", name: "EnvironmentEdit",
components: {MsApiKeyValue, MsApiScenarioVariables}, components: {MsDialogFooter, MsApiKeyValue, MsApiScenarioVariables},
props: { props: {
environment: { environment: {
type: Object, type: Object,
@ -127,8 +131,11 @@
return true return true
} }
return false; return false;
},
cancel() {
this.$emit('close');
} }
} },
} }
</script> </script>