修改教师班级名称bug&&标准图片上传
This commit is contained in:
parent
91b5936d90
commit
b94ba212f9
@ -139,7 +139,7 @@
|
|||||||
:before-upload="beforeAvatarUpload"
|
:before-upload="beforeAvatarUpload"
|
||||||
accept=".jpg, .png"
|
accept=".jpg, .png"
|
||||||
>
|
>
|
||||||
<img v-if="imageUrl" :src="imageUrl" class="avatar" >
|
<img v-if="imageUrl" :src="imageUrl" class="avatar" />
|
||||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -156,8 +156,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listStandard, getStandard, delStandard, addStandard, updateStandard, exportStandard } from "@/api/benyi/dayflow/biaozhun/standard";
|
import {
|
||||||
import { listDayflowtask, getDayflowtask } from "@/api/benyi/dayflow/dayflowtask";
|
listStandard,
|
||||||
|
getStandard,
|
||||||
|
delStandard,
|
||||||
|
addStandard,
|
||||||
|
updateStandard,
|
||||||
|
exportStandard
|
||||||
|
} from "@/api/benyi/dayflow/biaozhun/standard";
|
||||||
|
import {
|
||||||
|
listDayflowtask,
|
||||||
|
getDayflowtask
|
||||||
|
} from "@/api/benyi/dayflow/dayflowtask";
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -167,6 +177,8 @@ export default {
|
|||||||
//显示上传的图片,清空
|
//显示上传的图片,清空
|
||||||
imageUrl: "",
|
imageUrl: "",
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
file:"",
|
||||||
|
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -182,7 +194,7 @@ export default {
|
|||||||
// 任务名称集合
|
// 任务名称集合
|
||||||
taskOptions: [],
|
taskOptions: [],
|
||||||
// 默认任务名称
|
// 默认任务名称
|
||||||
defaultTaskName: '',
|
defaultTaskName: "",
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
@ -210,7 +222,7 @@ export default {
|
|||||||
rules: {
|
rules: {
|
||||||
sname: [
|
sname: [
|
||||||
{ required: true, message: "标准名称不能为空", trigger: "blur" }
|
{ required: true, message: "标准名称不能为空", trigger: "blur" }
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
// 上传的图片服务器地址
|
// 上传的图片服务器地址
|
||||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload",
|
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload",
|
||||||
@ -226,7 +238,7 @@ export default {
|
|||||||
this.getTaskList();
|
this.getTaskList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**上传照片 */
|
|
||||||
handleAvatarSuccess(res, file) {
|
handleAvatarSuccess(res, file) {
|
||||||
this.imageUrl = URL.createObjectURL(file.raw);
|
this.imageUrl = URL.createObjectURL(file.raw);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
@ -237,24 +249,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeAvatarUpload(file) {
|
beforeAvatarUpload(file) {
|
||||||
const isJPG = file.type === "image/jpeg";
|
|
||||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||||
|
|
||||||
if (!isJPG) {
|
|
||||||
this.$message.error("上传图片只能是 JPG 格式!");
|
|
||||||
}
|
|
||||||
if (!isLt2M) {
|
if (!isLt2M) {
|
||||||
this.$message.error("上传图片大小不能超过 2MB!");
|
this.$message.error("上传图片大小不能超过 2MB!");
|
||||||
}
|
}
|
||||||
return isJPG && isLt2M;
|
return isLt2M;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**查询任务名称详细 */
|
/**查询任务名称详细 */
|
||||||
getDayflowtask(taskId) {
|
getDayflowtask(taskId) {
|
||||||
getDayflowtask(taskId).then(response => {
|
getDayflowtask(taskId).then(response => {
|
||||||
this.queryParams.taskLable = response.data.taskLable;
|
this.queryParams.taskLable = response.data.taskLable;
|
||||||
this.defaultTaskName = response.data.taskLable;
|
this.defaultTaskName = response.data.taskLable;
|
||||||
this.getList();
|
this.getList();
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
/** 查询一日流程标准列表 */
|
/** 查询一日流程标准列表 */
|
||||||
getList() {
|
getList() {
|
||||||
@ -269,7 +277,7 @@ export default {
|
|||||||
getTaskList() {
|
getTaskList() {
|
||||||
listDayflowtask().then(response => {
|
listDayflowtask().then(response => {
|
||||||
this.taskOptions = response.rows;
|
this.taskOptions = response.rows;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
@ -308,9 +316,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.sid)
|
this.ids = selection.map(item => item.sid);
|
||||||
this.single = selection.length!=1
|
this.single = selection.length != 1;
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@ -327,10 +335,9 @@ export default {
|
|||||||
const sid = row.sid || this.ids;
|
const sid = row.sid || this.ids;
|
||||||
getStandard(sid).then(response => {
|
getStandard(sid).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
console.log(process.env.VUE_APP_BASE_API + response.data.picture);
|
|
||||||
if (response.data.picture) {
|
if (response.data.picture) {
|
||||||
this.imageUrl = process.env.VUE_APP_BASE_API + response.data.picture;
|
this.imageUrl = process.env.VUE_APP_BASE_API + response.data.picture;
|
||||||
}
|
};
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改标准";
|
this.title = "修改标准";
|
||||||
});
|
});
|
||||||
@ -339,6 +346,7 @@ export default {
|
|||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
console.log(this.form.imageUrl);
|
||||||
if (this.form.sid != undefined) {
|
if (this.form.sid != undefined) {
|
||||||
updateStandard(this.form).then(response => {
|
updateStandard(this.form).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@ -366,29 +374,39 @@ export default {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const sids = row.sid || this.ids;
|
const sids = row.sid || this.ids;
|
||||||
this.$confirm('是否确认删除一日流程标准编号为"' + sids + '"的数据项?', "警告", {
|
this.$confirm(
|
||||||
|
'是否确认删除一日流程标准编号为"' + sids + '"的数据项?',
|
||||||
|
"警告",
|
||||||
|
{
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(function() {
|
}
|
||||||
|
)
|
||||||
|
.then(function() {
|
||||||
return delStandard(sids);
|
return delStandard(sids);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
}).catch(function() {});
|
})
|
||||||
|
.catch(function() {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm('是否确认导出所有一日流程标准数据项?', "警告", {
|
this.$confirm("是否确认导出所有一日流程标准数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(function() {
|
})
|
||||||
|
.then(function() {
|
||||||
return exportStandard(queryParams);
|
return exportStandard(queryParams);
|
||||||
}).then(response => {
|
})
|
||||||
|
.then(response => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
}).catch(function() {});
|
})
|
||||||
|
.catch(function() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectBySchoolcalendarClassVo">
|
<sql id="selectBySchoolcalendarClassVo">
|
||||||
select id, name, type, classid, xnxq, deptId, activitytime, activityendtime, stylecolor, createuserid, createtime from by_schoolcalendar_class
|
select s.id, s.name, s.type, s.classid, s.xnxq, s.deptId, s.activitytime, s.activityendtime, s.stylecolor, s.createuserid, s.createtime,
|
||||||
|
c.bjmc
|
||||||
|
from by_schoolcalendar_class s, by_class c
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectBySchoolcalendarClassList" parameterType="BySchoolcalendarClass" resultMap="BySchoolcalendarClassResult">
|
<select id="selectBySchoolcalendarClassList" parameterType="BySchoolcalendarClass" resultMap="BySchoolcalendarClassResult">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user