修改
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<p class="tip">{{$t('Parameterconfiguration')}}</p>
|
||||
<el-form-item label="服务IP" prop="serverIp">
|
||||
<el-input placeholder="请输入服务IP" v-model="dataForm.serverIp" id="ip" @focus="show" data-layout="normal"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('SchedulingIP')" prop="ip">
|
||||
<el-input :placeholder="$t('PleaseIP')" v-model="dataForm.ip" id="ip" @focus="show" data-layout="normal"></el-input>
|
||||
</el-form-item>
|
||||
@@ -33,16 +36,21 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapActions } from 'vuex'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dataForm: {
|
||||
selectedLanguage: '',
|
||||
serverIp: '',
|
||||
ip: '',
|
||||
wifi: ''
|
||||
},
|
||||
dataRule: {
|
||||
serverIp: [
|
||||
{ required: true, message: '服务IP不能为空', trigger: 'blur' }
|
||||
],
|
||||
ip: [
|
||||
{ required: true, message: this.$t('Schedulingnotempty'), trigger: 'blur' }
|
||||
],
|
||||
@@ -64,13 +72,25 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['serverUrl']),
|
||||
},
|
||||
watch: {
|
||||
serverUrl (newVal) {
|
||||
if (newVal) {
|
||||
this.dataForm.serverIp = newVal
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['setServerUrl']),
|
||||
init () {
|
||||
if (this.$i18n.locale === 'zh-cn') {
|
||||
this.dataForm.selectedLanguage = 'zh-cn'
|
||||
} else if (this.$i18n.locale === 'en-us') {
|
||||
this.dataForm.selectedLanguage = 'en-us'
|
||||
}
|
||||
this.dataForm.serverIp = this.serverUrl
|
||||
this.dialogVisible = true
|
||||
},
|
||||
exitUser () {
|
||||
@@ -82,6 +102,7 @@ export default {
|
||||
this.visible = false
|
||||
this.$i18n.locale = this.dataForm.selectedLanguage
|
||||
window.localStorage.setItem('locale', this.dataForm.selectedLanguage)
|
||||
this.setServerUrl(this.dataForm.serverIp)
|
||||
},
|
||||
handleClose (done) {
|
||||
this.visible = false
|
||||
|
||||
Reference in New Issue
Block a user