| 1234567891011121314151617181920212223242526272829303132 |
- export default {
- props: {
- options: {
- type: Object,
- required: true,
- },
- params: Object,
- formItemLayout: {
- type: Object,
- required: true,
- },
- visible: {
- type: Boolean,
- default: false,
- },
- type: String,
- },
- methods: {
- setDefaultName (usage) {
- const usageKey = this.type === 'k8s' ? 'k8s_usage' : 'usage'
- if (!this.form.fc.isFieldTouched(this.decorators.name[0])) {
- this.form.fc.setFieldsValue({
- [this.decorators.name[0]]: this.$t(usageKey)[usage],
- })
- }
- this.currentUsageKey = usage
- },
- cancel () {
- this.$emit('cancel')
- },
- },
- }
|