You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.1 KiB

@extends('laravel-generator::layout')
@section('content')
<div class="box-header">
<el-header id="content-header">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item><a href="{{ route('home.config.index') }}">配置管理</a></el-breadcrumb-item>
<el-breadcrumb-item>@{{ form.id?'编辑':'添加' }}</el-breadcrumb-item>
</el-breadcrumb>
</el-header>
<el-main>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item>
<el-button type="primary" @click="onSubmit('form')" :loading="submitLoading">确定</el-button>
</el-form-item>
</el-form>
</el-main>
</div>
@endsection
@section('js')
<script>
var vm = new Vue({
el: '#app',
data: function(){
return {
submitLoading:false,
form:@json($config),
rules: {
},
}
},
methods: {
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
this.submitLoading=true;
this.doPost('{{ route('home.config.update') }}',this.form).then(res=>{
this.submitLoading=false;
if(res.errcode==0){
this.$message.success('操作成功!');
window.location.href='{{ route('home.config.index') }}';
}else{
this.$message.error(res.msg);
}
});
} else {
console.log('sub error');
return false;
}
});
},
},
mounted(){
}
});
</script>
@endsection