Merge remote-tracking branch 'origin/master'

This commit is contained in:
paidaxing444 2020-05-29 11:39:27 +08:00
commit b261072d4d
2 changed files with 78 additions and 37 deletions

View File

@ -6,7 +6,7 @@
<el-option
v-for="item in taskOptions"
:key="item.code"
:label="item.taskLable"
:label="item.taskLable"
:value="item.taskLable"
/>
</el-select>
@ -101,7 +101,7 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -137,10 +137,10 @@
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
accept=".jpg,.png"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" >
<i v-else class="el-icon-plus avatar-uploader-icon" ></i>
accept=".jpg, .png"
>
<img width="100%" v-if="imageUrl" :src="imageUrl" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-form-item label="视频" prop="video">
@ -156,8 +156,18 @@
</template>
<script>
import { listStandard, getStandard, delStandard, addStandard, updateStandard, exportStandard } from "@/api/benyi/dayflow/biaozhun/standard";
import { listDayflowtask, getDayflowtask } from "@/api/benyi/dayflow/dayflowtask";
import {
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";
export default {
@ -166,7 +176,6 @@ export default {
return {
//
imageUrl: "",
dialogVisible: false,
//
loading: true,
//
@ -182,7 +191,7 @@ export default {
//
taskOptions: [],
//
defaultTaskName: '',
defaultTaskName: "",
//
title: "",
//
@ -210,7 +219,7 @@ export default {
rules: {
sname: [
{ required: true, message: "标准名称不能为空", trigger: "blur" }
],
]
},
//
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload",
@ -226,7 +235,6 @@ export default {
this.getTaskList();
},
methods: {
/**上传照片 */
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
console.log(res);
@ -237,16 +245,11 @@ export default {
}
},
beforeAvatarUpload(file) {
const isJPG = file.type === "image/jpeg";
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG) {
this.$message.error("上传图片只能是 JPG 格式!");
}
if (!isLt2M) {
this.$message.error("上传图片大小不能超过 2MB!");
}
return isJPG && isLt2M;
return isLt2M;
},
/**查询任务名称详细 */
getDayflowtask(taskId) {
@ -254,7 +257,7 @@ export default {
this.queryParams.taskLable = response.data.taskLable;
this.defaultTaskName = response.data.taskLable;
this.getList();
})
});
},
/** 查询一日流程标准列表 */
getList() {
@ -269,7 +272,7 @@ export default {
getTaskList() {
listDayflowtask().then(response => {
this.taskOptions = response.rows;
})
});
},
//
cancel() {
@ -308,9 +311,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.sid)
this.single = selection.length!=1
this.multiple = !selection.length
this.ids = selection.map(item => item.sid);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -327,7 +330,6 @@ export default {
const sid = row.sid || this.ids;
getStandard(sid).then(response => {
this.form = response.data;
console.log(process.env.VUE_APP_BASE_API + response.data.picture);
if (response.data.picture) {
this.imageUrl = process.env.VUE_APP_BASE_API + response.data.picture;
}
@ -339,6 +341,7 @@ export default {
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
console.log(this.form.imageUrl);
if (this.form.sid != undefined) {
updateStandard(this.form).then(response => {
if (response.code === 200) {
@ -366,30 +369,66 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const sids = row.sid || this.ids;
this.$confirm('是否确认删除一日流程标准编号为"' + sids + '"的数据项?', "警告", {
this.$confirm(
'是否确认删除一日流程标准编号为"' + sids + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}
)
.then(function() {
return delStandard(sids);
}).then(() => {
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function() {});
})
.catch(function() {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有一日流程标准数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
this.$confirm("是否确认导出所有一日流程标准数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(function() {
return exportStandard(queryParams);
}).then(response => {
})
.then(response => {
this.download(response.msg);
}).catch(function() {});
})
.catch(function() {});
}
}
};
</script>
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>

View File

@ -39,7 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<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>
<select id="selectBySchoolcalendarClassList" parameterType="BySchoolcalendarClass" resultMap="BySchoolcalendarClassResult">