Browse Source

fix ui warningInstance title support internationalization.

pull/3/MERGE
zhuangchong 3 years ago
parent
commit
e05d93aa33
  1. 10
      dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue
  2. 6
      dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/index.vue
  3. 2
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  4. 2
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

10
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue

@ -39,7 +39,7 @@
<template slot="content"> <template slot="content">
<el-select v-model="pluginDefineId" size="small" style="width: 100%" @change="changePlugin" disabled="true" v-if="item.id"> <el-select v-model="pluginDefineId" size="small" style="width: 100%" @change="changePlugin" disabled="true" v-if="item.id">
<el-option <el-option
v-for="items in pulginInstance" v-for="items in pluginInstance"
:key="items.id" :key="items.id"
:value="items.id" :value="items.id"
:label="items.pluginName"> :label="items.pluginName">
@ -47,7 +47,7 @@
</el-select> </el-select>
<el-select v-model="pluginDefineId" size="small" style="width: 100%" @change="changePlugin" v-else> <el-select v-model="pluginDefineId" size="small" style="width: 100%" @change="changePlugin" v-else>
<el-option <el-option
v-for="items in pulginInstance" v-for="items in pluginInstance"
:key="items.id" :key="items.id"
:value="items.id" :value="items.id"
:label="items.pluginName"> :label="items.pluginName">
@ -83,7 +83,7 @@
}, },
props: { props: {
item: Object, item: Object,
pulginInstance: Array pluginInstance: Array
}, },
methods: { methods: {
_ok () { _ok () {
@ -121,7 +121,7 @@
this.rule = JSON.parse(res.pluginParams) this.rule = JSON.parse(res.pluginParams)
this.rule.forEach(item => { this.rule.forEach(item => {
if (item.title.indexOf('$t') !== -1) { if (item.title.indexOf('$t') !== -1) {
item.title = $t(item.field) item.title = this.$t(item.field)
} }
}) })
}).catch(e => { }).catch(e => {
@ -163,7 +163,7 @@
this.pluginDefineId = this.item.pluginDefineId this.pluginDefineId = this.item.pluginDefineId
JSON.parse(this.item.pluginInstanceParams).forEach(item => { JSON.parse(this.item.pluginInstanceParams).forEach(item => {
if (item.title.indexOf('$t') !== -1) { if (item.title.indexOf('$t') !== -1) {
item.title = $t(item.field) item.title = this.$t(item.field)
} }
pluginInstanceParams.push(item) pluginInstanceParams.push(item)
}) })

6
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/index.vue

@ -25,7 +25,7 @@
v-if="createWarningDialog" v-if="createWarningDialog"
:visible.sync="createWarningDialog" :visible.sync="createWarningDialog"
width="auto"> width="auto">
<m-create-warning-instance :item="item" :pulginInstance="pulginInstance" @onUpdate="onUpdate" @close="close"></m-create-warning-instance> <m-create-warning-instance :item="item" :pluginInstance="pluginInstance" @onUpdate="onUpdate" @close="close"></m-create-warning-instance>
</el-dialog> </el-dialog>
</template> </template>
</m-conditions> </m-conditions>
@ -86,7 +86,7 @@
isADMIN: store.state.user.userInfo.userType === 'ADMIN_USER', isADMIN: store.state.user.userInfo.userType === 'ADMIN_USER',
createWarningDialog: false, createWarningDialog: false,
item: {}, item: {},
pulginInstance: [] pluginInstance: []
} }
}, },
mixins: [listUrlParamHandle], mixins: [listUrlParamHandle],
@ -114,7 +114,7 @@
}, },
_create (item) { _create (item) {
this.getPlugins({ pluginType: 'ALERT' }).then(res => { this.getPlugins({ pluginType: 'ALERT' }).then(res => {
this.pulginInstance = res this.pluginInstance = res
}).catch(e => { }).catch(e => {
this.$message.error(e.msg) this.$message.error(e.msg)
}) })

2
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -400,6 +400,8 @@ export default {
'Please select a notification group': 'Please select a notification group', 'Please select a notification group': 'Please select a notification group',
Recipient: 'Recipient', Recipient: 'Recipient',
Cc: 'Cc', Cc: 'Cc',
receivers: 'receivers',
receiverCcs: 'receiverCcs',
'Whether it is a complement process?': 'Whether it is a complement process?', 'Whether it is a complement process?': 'Whether it is a complement process?',
'Schedule date': 'Schedule date', 'Schedule date': 'Schedule date',
'Mode of execution': 'Mode of execution', 'Mode of execution': 'Mode of execution',

2
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -400,6 +400,8 @@ export default {
'Please select a notification group': '请选择通知组', 'Please select a notification group': '请选择通知组',
Recipient: '收件人', Recipient: '收件人',
Cc: '抄送人', Cc: '抄送人',
receivers: '收件人',
receiverCcs: '抄送人',
'Whether it is a complement process?': '是否补数', 'Whether it is a complement process?': '是否补数',
'Schedule date': '调度日期', 'Schedule date': '调度日期',
'Mode of execution': '执行方式', 'Mode of execution': '执行方式',

Loading…
Cancel
Save