1、月计划自动生成子项 2、微型课程 复制

This commit is contained in:
zhanglipeng 2021-09-06 11:33:39 +08:00
parent 3d35107e24
commit 284602e4ac
3 changed files with 78 additions and 21 deletions

View File

@ -36,8 +36,18 @@
size="mini" size="mini"
icon="el-icon-printer" icon="el-icon-printer"
@click="prints" @click="prints"
v-show="enable"
>打印</el-button >打印</el-button
> >
<el-button
type="primary"
plain
size="mini"
icon="el-icon-document-copy"
@click="copy(note)"
v-show="enable"
>复制</el-button
>
<div class="pad-left" v-html="note" ref="printMe"></div> <div class="pad-left" v-html="note" ref="printMe"></div>
</div> </div>
</el-card> </el-card>
@ -48,11 +58,14 @@
<script> <script>
import { treeselect, getMicrocourse } from "@/api/benyi/microcourse"; import { treeselect, getMicrocourse } from "@/api/benyi/microcourse";
//
import Clipboard from "clipboard";
export default { export default {
name: "Microcoursestudy", name: "Microcoursestudy",
data() { data() {
return { return {
enable: false,
// //
name: undefined, name: undefined,
// id // id
@ -107,6 +120,7 @@ export default {
}, },
getMicrocourseDetails() { getMicrocourseDetails() {
getMicrocourse(this.id).then((response) => { getMicrocourse(this.id).then((response) => {
this.enable = true;
this.title1 = response.data.title; this.title1 = response.data.title;
this.note = response.data.contents; this.note = response.data.contents;
}); });
@ -116,6 +130,32 @@ export default {
//console.log(this.$refs.printMe); //console.log(this.$refs.printMe);
this.$print(this.$refs.printMe); this.$print(this.$refs.printMe);
}, },
copy(data) {
let url = this.filter(data);
let oInput = document.createElement("input");
oInput.value = url;
document.body.appendChild(oInput);
oInput.select(); // ;
//console.log(oInput.value);
document.execCommand("Copy"); //
this.$message({
message: "复制成功",
type: "success",
});
oInput.remove();
},
//html
filter: function (html) {
return html
.replace(/<(?:.|\n)*?>/gm, "")
.replace(/(&rdquo;)/g, '"')
.replace(/&ldquo;/g, '"')
.replace(/&mdash;/g, "-")
.replace(/&nbsp;/g, "")
.replace(/&gt;/g, ">")
.replace(/&lt;/g, "<")
.replace(/<[\w\s"':=\/]*/, "");
},
}, },
}; };
</script> </script>
@ -160,20 +200,20 @@ export default {
line-height: 40px; line-height: 40px;
} }
// //
div { // div {
-webkit-touch-callout: none; // -webkit-touch-callout: none;
-webkit-user-select: none; // -webkit-user-select: none;
-khtml-user-select: none; // -khtml-user-select: none;
-moz-user-select: none; // -moz-user-select: none;
-ms-user-select: none; // -ms-user-select: none;
user-select: none; // user-select: none;
} // }
.el-tree { .el-tree {
min-width: 100%; min-width: 100%;
display: inline-block; display: inline-block;
} }
.tree { .tree {
overflow:auto; overflow: auto;
max-height: 600px; max-height: 600px;
} }
</style> </style>

View File

@ -466,9 +466,14 @@ export default {
this.open = true; this.open = true;
this.title = "填充主题整合周计划明细"; this.title = "填充主题整合周计划明细";
let arrTime = []; let arrTime = [];
if (response.data.starttime == null) {
} else {
arrTime.push(response.data.starttime); arrTime.push(response.data.starttime);
arrTime.push(response.data.endtime); arrTime.push(response.data.endtime);
}
this.form.starttime = arrTime; this.form.starttime = arrTime;
if (activityid == null) {
} else {
var activityid = response.data.activityid.split(";"); var activityid = response.data.activityid.split(";");
var array = []; var array = [];
//console.log(arr); //console.log(arr);
@ -479,6 +484,7 @@ export default {
} }
}); });
this.themeactivityList = array; this.themeactivityList = array;
}
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */

View File

@ -173,6 +173,17 @@ public class ByThemeMonthplanController extends BaseController {
byThemeMonthplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId()); byThemeMonthplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
byThemeMonthplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合月计划" + "(" + sdf.format(byThemeMonthplan.getMonth()) + ")"); byThemeMonthplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合月计划" + "(" + sdf.format(byThemeMonthplan.getMonth()) + ")");
// 默认创建4个周内容项如果当前月份5个周 那么由用户自己删
ByThemeMonthplanitem byThemeMonthplanitem=null;
for(int i=1;i<5;i++){
byThemeMonthplanitem=new ByThemeMonthplanitem();
byThemeMonthplanitem.setId(schoolCommon.getUuid());
byThemeMonthplanitem.setMpid(uuid);
byThemeMonthplanitem.setZc(Long.valueOf(i));
byThemeonthplanitemService.insertByThemeMonthplanitem(byThemeMonthplanitem);
}
return toAjax(byThemeMonthplanService.insertByThemeMonthplan(byThemeMonthplan)); return toAjax(byThemeMonthplanService.insertByThemeMonthplan(byThemeMonthplan));
} }
} else { } else {