This commit is contained in:
2023-07-11 21:06:34 +08:00
parent a20de5c2f3
commit 92d102c346
3 changed files with 39 additions and 32 deletions

View File

@@ -77,7 +77,7 @@
<el-form-item>
<div style="display: flex;flex-direction: row;align-items: center;flex-wrap: nowrap;justify-content: flex-end">
<el-button @click="submit()" type="primary" style=";margin-top:10px">提交</el-button>
<el-button @click="submit('ruleForm')" type="primary" style=";margin-top:10px">提交</el-button>
</div>
</el-form-item>
</el-form>
@@ -122,30 +122,37 @@ export default {
openSubmit(){
this.dialogVisible=true;
},
submit(){
axios({
method: 'post',
// 请求的地址
url: 'http://localhost:8082/helloGithub_war_exploded/insertFileByAdmin',
// URL 中的查询参数
params: this.form,
}).then(function (res) {
if(res.data.code===200){
Vue.prototype.$notify({
title: '成功',
message: ('i', {style: 'color: teal'}, res.data.msg+'请等待审核'),
type: 'success',
offset: 50
});
}else{
Vue.prototype.$notify.error({
title: '错误',
message: res.data.msg,
offset: 50
});
}
submit(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
axios({
method: 'post',
// 请求的地址
url: 'http://localhost:8082/helloGithub_war_exploded/insertFileByAdmin',
// URL 中的查询参数
params: this.form,
}).then(function (res) {
if(res.data.code===200){
Vue.prototype.$notify({
title: '成功',
message: ('i', {style: 'color: teal'}, res.data.msg+'请等待审核'),
type: 'success',
offset: 50
});
}else{
Vue.prototype.$notify.error({
title: '错误',
message: res.data.msg,
offset: 50
});
}
})
}else{
return false;
}
})
},
goBack() {
window.history.go(-1);