|
@@ -432,7 +432,7 @@ export default {
|
|
this.getRoles();
|
|
this.getRoles();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- getRoles(){
|
|
|
|
|
|
+ getRoles() {
|
|
DictsApi.roles({ platform: "teacher" }).then((res) => {
|
|
DictsApi.roles({ platform: "teacher" }).then((res) => {
|
|
this.metaData["roles"] = res.data;
|
|
this.metaData["roles"] = res.data;
|
|
});
|
|
});
|
|
@@ -480,25 +480,25 @@ export default {
|
|
};
|
|
};
|
|
this.dialogForm = form;
|
|
this.dialogForm = form;
|
|
this.$refs.dialog.open((cancel) => {
|
|
this.$refs.dialog.open((cancel) => {
|
|
- this.$refs["form"].validate((valid)=>{
|
|
|
|
- if(valid){
|
|
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
TeacherApi.edit(this.dialogForm).then((res) => {
|
|
TeacherApi.edit(this.dialogForm).then((res) => {
|
|
- if(res.mess="success"){
|
|
|
|
|
|
+ if ((res.mess = "success")) {
|
|
this.$message({
|
|
this.$message({
|
|
- type:"success",
|
|
|
|
- message:"修改成功!"
|
|
|
|
- })
|
|
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "修改成功!",
|
|
|
|
+ });
|
|
this.getList();
|
|
this.getList();
|
|
cancel();
|
|
cancel();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
Message({
|
|
Message({
|
|
- type:"error",
|
|
|
|
- message:res.message
|
|
|
|
- })
|
|
|
|
|
|
+ type: "error",
|
|
|
|
+ message: res.message,
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
});
|
|
});
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
@@ -583,8 +583,16 @@ export default {
|
|
.open((cancel) => {
|
|
.open((cancel) => {
|
|
var token = _this.Cookies.get("www-authenticate");
|
|
var token = _this.Cookies.get("www-authenticate");
|
|
_this.upHeader.Authorization = `Bearer ${token}`;
|
|
_this.upHeader.Authorization = `Bearer ${token}`;
|
|
- _this.$refs.upload.submit();
|
|
|
|
- console.log("点击提交按钮了");
|
|
|
|
|
|
+ if (_this.$refs.upload.uploadFiles.length > 0) {
|
|
|
|
+ _this.$refs.upload.submit();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "warning",
|
|
|
|
+ message: `请选择文件上传!`,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // console.log("点击提交按钮了");
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
console.log(this.$refs.span);
|
|
console.log(this.$refs.span);
|
|
@@ -597,11 +605,22 @@ export default {
|
|
handleSuccess(res, file) {
|
|
handleSuccess(res, file) {
|
|
if (res.mess == "success") {
|
|
if (res.mess == "success") {
|
|
this.$refs.dialog2.cancel();
|
|
this.$refs.dialog2.cancel();
|
|
-
|
|
|
|
- this.$message({
|
|
|
|
- type: "success",
|
|
|
|
- message: "上传成功!",
|
|
|
|
- });
|
|
|
|
|
|
+ if (res.data.errors.length > 0) {
|
|
|
|
+ this.$message({
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ type: "warning",
|
|
|
|
+ message: `
|
|
|
|
+ <div>成功:${res.data.success}个,失败:${res.data.fail}个</div>
|
|
|
|
+ ${res.data.errors.map((item) => {
|
|
|
|
+ return `<div>${item}</div>`;
|
|
|
|
+ }).join("")}`,
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "上传成功!",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
this.getList();
|
|
this.getList();
|
|
}
|
|
}
|
|
},
|
|
},
|