<template> <el-dialog :visible.sync="visible" :title="dataForm.training" :close-on-click-modal="false" :close-on-press-escape="false"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px"> <el-form-item prop="accessRemark" :label="$t('algorithm.accessRemark1')"> <el-input v-model="dataForm.accessRemark" :placeholder="$t('algorithm.accessRemark2')"></el-input> </el-form-item> <el-form-item prop="algorithmType" :label="$t('algorithm.algorithmType1')"> <el-input v-model="dataForm.algorithmType"></el-input> </el-form-item> </el-form> <template slot="footer"> <el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button type="primary" @click="training()">{{ $t('confirm1') }}</el-button> </template> </el-dialog> </template> <script> export default { data () { return { visible: false, dataForm: { id: '', accessRemark: '', algorithmType: '', trainingURL:'/res/algorithm/training' } } }, computed: { dataRule () { return { accessRemark: [ { required: true, message: this.$t('validate.required'), trigger: 'blur' } ], algorithmType: [ { message: this.$t('validate.required'), trigger: 'blur' } ] } } }, methods: { init () { this.visible = true this.$nextTick(() => { this.$refs['dataForm'].resetFields() if (this.dataForm.id) { this.getInfo() } }) }, // 获取信息 getInfo () { this.$http.get(`/res/algorithm/${this.dataForm.id}`).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } this.dataForm = { ...this.dataForm, ...res.data } }).catch(() => {}) }, training(){ window.console.log(this.accessRemark) } } } </script> <style lang="scss"> .mod-res__algorithm { } </style>
不知道应该怎么获取