mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-24 07:55:06 +08:00
v3.8.0 新增通用方法简化模态/缓存使用
This commit is contained in:
@ -429,14 +429,10 @@ export default {
|
||||
// 用户状态修改
|
||||
handleStatusChange(row) {
|
||||
let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "停用";
|
||||
this.$confirm('确认要"' + text + '""' + row.username + '"用户吗?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
this.$modal.confirm('确认要"' + text + '""' + row.username + '"用户吗?').then(function() {
|
||||
return changeUserStatus(row.id, row.status);
|
||||
}).then(() => {
|
||||
this.msgSuccess(text + "成功");
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
}).catch(function() {
|
||||
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
|
||||
: CommonStatusEnum.ENABLE;
|
||||
@ -510,7 +506,7 @@ export default {
|
||||
cancelButtonText: "取消"
|
||||
}).then(({ value }) => {
|
||||
resetUserPwd(row.id, value).then(response => {
|
||||
this.msgSuccess("修改成功,新密码是:" + value);
|
||||
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
@ -542,13 +538,13 @@ export default {
|
||||
if (valid) {
|
||||
if (this.form.id !== undefined) {
|
||||
updateUser(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addUser(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@ -563,7 +559,7 @@ export default {
|
||||
userId: this.form.id,
|
||||
roleIds: this.form.roleIds,
|
||||
}).then(response => {
|
||||
this.msgSuccess("分配角色成功");
|
||||
this.$modal.msgSuccess("分配角色成功");
|
||||
this.openRole = false;
|
||||
this.getList();
|
||||
});
|
||||
@ -572,15 +568,11 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$confirm('是否确认删除用户编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
this.$modal.confirm('是否确认删除用户编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delUser(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
@ -589,11 +581,7 @@ export default {
|
||||
this.dateRange[0] ? this.dateRange[0] + ' 00:00:00' : undefined,
|
||||
this.dateRange[1] ? this.dateRange[1] + ' 23:59:59' : undefined,
|
||||
]);
|
||||
this.$confirm('是否确认导出所有用户数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$modal.confirm('是否确认导出所有用户数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportUser(queryParams);
|
||||
}).then(response => {
|
||||
@ -619,7 +607,7 @@ export default {
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
if (response.code !== 0) {
|
||||
this.msgError(response.msg)
|
||||
this.$modal.msgError(response.msg)
|
||||
return;
|
||||
}
|
||||
this.upload.open = false;
|
||||
|
@ -57,7 +57,7 @@ export default {
|
||||
if (valid) {
|
||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(
|
||||
response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ export default {
|
||||
// 上传预处理
|
||||
beforeUpload(file) {
|
||||
if (file.type.indexOf("image/") == -1) {
|
||||
this.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
|
||||
this.$modal.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
|
||||
} else {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
@ -128,7 +128,7 @@ export default {
|
||||
this.open = false;
|
||||
// this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
|
||||
store.commit('SET_AVATAR', resp.data);
|
||||
this.msgSuccess("修改成功");
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
});
|
||||
});
|
||||
|
@ -62,7 +62,7 @@ export default {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
updateUserProfile(this.user).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -68,7 +68,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
socialBind(type, code, state).then(resp => {
|
||||
this.msgSuccess("绑定成功");
|
||||
this.$modal.msgSuccess("绑定成功");
|
||||
this.$router.replace('/user/profile');
|
||||
// 调用父组件, 刷新
|
||||
this.getUser();
|
||||
@ -87,7 +87,7 @@ export default {
|
||||
},
|
||||
unbind(socialUser) {
|
||||
socialUnbind(socialUser.type, socialUser.unionId).then(resp => {
|
||||
this.msgSuccess("解绑成功");
|
||||
this.$modal.msgSuccess("解绑成功");
|
||||
socialUser.unionId = undefined;
|
||||
});
|
||||
},
|
||||
|
Reference in New Issue
Block a user