Skip to content

Commit

Permalink
perf: Translate
Browse files Browse the repository at this point in the history
  • Loading branch information
w940853815 committed Nov 6, 2024
1 parent e4669a4 commit 646e2e5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 25 deletions.
13 changes: 3 additions & 10 deletions src/components/Apps/VariableCreateUpdateForm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,22 @@ export default {
AutoDataForm
},
props: {
asset: {
type: Object,
default: null
},
variable: {
type: Object,
default: () => ({})
}
},
data() {
return {
loading: true,
usernameChanged: false,
submitBtnText: this.$t('Confirm'),
url: '/api/v1/ops/variable/',
form: Object.assign({ 'on_invalid': 'error' }, this.variable || {}),
encryptedFields: ['password_default_value'],
fields: [
['', ['name', 'var_name', 'type', 'text_default_value', 'select_default_value', 'extra_args', 'tips', 'required']]
],
fieldsMeta: {
text_default_value: {
label: this.$t('Default Value'),
label: this.$t('DefaultValue'),
hidden: (formValue) => {
return formValue.type !== 'text'
},
Expand All @@ -48,7 +41,7 @@ export default {
}
},
select_default_value: {
label: this.$t('Default Value'),
label: this.$t('DefaultValue'),
hidden: (formValue) => {
return formValue.type !== 'select'
},
Expand All @@ -58,7 +51,7 @@ export default {
hidden: (formValue) => {
return formValue.type !== 'select'
},
el: { type: 'textarea', rows: 4, placeholder: this.$t('每行一个选项,例如:\n选项1:值1\n选项2:值2\n') }
el: { type: 'textarea', rows: 4, placeholder: this.$t('ExtraArgsPlaceholder') }
}
},
hasSaveContinue: false,
Expand Down
8 changes: 2 additions & 6 deletions src/components/Apps/VariableSetForm/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<AutoDataForm
ref="AutoDataForm"
class="variable-add"
class="variable-set"
:submit-btn-text="submitBtnText"
v-bind="$data"
:fields="fields"
Expand Down Expand Up @@ -29,12 +29,10 @@ export default {
},
data() {
return {
loading: true,
submitBtnText: this.$t('Confirm'),
// 防止缓存form remoteMeta
url: `/api/v1/ops/variable/form_data/?t=${new Date().getTime()}&` + this.queryParam,
form: {},
encryptedFields: ['secret'],
hasSaveContinue: false,
method: 'get',
hasReset: false
Expand All @@ -45,8 +43,6 @@ export default {
return [['', this.formData.map(item => item.var_name)]]
}
},
mounted() {
},
methods: {
confirm(form) {
this.$emit('confirm', form)
Expand All @@ -56,7 +52,7 @@ export default {
</script>

<style lang='scss' scoped>
.variable-add {
.variable-set {
::v-deep .el-form-item {
margin-bottom: 5px;
Expand Down
4 changes: 1 addition & 3 deletions src/views/ops/Job/components/loadTemplateLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<AdhocOpenDialog v-if="showOpenAdhocDialog" :visible.sync="showOpenAdhocDialog" @select="onSelectAdhoc" />
<el-link :underline="false" type="default" @click="onClick()">
从模板中获取
{{ $t('LoadTemplate') }}
</el-link>
</div>
</template>
Expand All @@ -15,13 +15,11 @@ export default {
components: {
AdhocOpenDialog
},
props: {},
data() {
return {
showOpenAdhocDialog: false
}
},
watch: {},
methods: {
onClick() {
this.showOpenAdhocDialog = true
Expand Down
4 changes: 0 additions & 4 deletions src/views/ops/Template/components/AddVariableDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
>
<VariableCreateForm
:variable="variable"
:encrypt-password="false"
@add="addVariable"
@edit="editVariable"
/>
Expand Down Expand Up @@ -41,9 +40,6 @@ export default {
default: () => ([])
}
},
data() {
return {}
},
computed: {
iVisible: {
get() {
Expand Down
4 changes: 2 additions & 2 deletions src/views/ops/Template/components/Variable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div>
<div class="variables el-data-table">
<el-table :data="variables" class="el-table--fit el-table--border">
<el-table-column :label="$tc('VariableName')" prop="name" />
<el-table-column :label="$tc('VariableUsername')" prop="var_name" />
<el-table-column :label="$tc('Name')" prop="name" />
<el-table-column :label="$tc('VariableName')" prop="var_name" />
<el-table-column :label="$tc('Actions')" align="center" class-name="buttons" fixed="right" width="135">
<template v-slot="scope">
<el-button icon="el-icon-minus" size="mini" type="danger" @click="removeVariable(scope.row)" />
Expand Down

0 comments on commit 646e2e5

Please sign in to comment.