1、月计划自动生成子项 2、微型课程 复制
This commit is contained in:
parent
3d35107e24
commit
284602e4ac
@ -36,8 +36,18 @@
|
||||
size="mini"
|
||||
icon="el-icon-printer"
|
||||
@click="prints"
|
||||
v-show="enable"
|
||||
>打印</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>
|
||||
</el-card>
|
||||
@ -48,11 +58,14 @@
|
||||
|
||||
<script>
|
||||
import { treeselect, getMicrocourse } from "@/api/benyi/microcourse";
|
||||
// 点击复制
|
||||
import Clipboard from "clipboard";
|
||||
|
||||
export default {
|
||||
name: "Microcoursestudy",
|
||||
data() {
|
||||
return {
|
||||
enable: false,
|
||||
// 主题整合名称
|
||||
name: undefined,
|
||||
// 主题整合id
|
||||
@ -107,6 +120,7 @@ export default {
|
||||
},
|
||||
getMicrocourseDetails() {
|
||||
getMicrocourse(this.id).then((response) => {
|
||||
this.enable = true;
|
||||
this.title1 = response.data.title;
|
||||
this.note = response.data.contents;
|
||||
});
|
||||
@ -116,6 +130,32 @@ export default {
|
||||
//console.log(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(/(”)/g, '"')
|
||||
.replace(/“/g, '"')
|
||||
.replace(/—/g, "-")
|
||||
.replace(/ /g, "")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/</g, "<")
|
||||
.replace(/<[\w\s"':=\/]*/, "");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -160,20 +200,20 @@ export default {
|
||||
line-height: 40px;
|
||||
}
|
||||
// 禁止复制
|
||||
div {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
// div {
|
||||
// -webkit-touch-callout: none;
|
||||
// -webkit-user-select: none;
|
||||
// -khtml-user-select: none;
|
||||
// -moz-user-select: none;
|
||||
// -ms-user-select: none;
|
||||
// user-select: none;
|
||||
// }
|
||||
.el-tree {
|
||||
min-width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
.tree {
|
||||
overflow:auto;
|
||||
overflow: auto;
|
||||
max-height: 600px;
|
||||
}
|
||||
</style>
|
@ -466,9 +466,14 @@ export default {
|
||||
this.open = true;
|
||||
this.title = "填充主题整合周计划明细";
|
||||
let arrTime = [];
|
||||
if (response.data.starttime == null) {
|
||||
} else {
|
||||
arrTime.push(response.data.starttime);
|
||||
arrTime.push(response.data.endtime);
|
||||
}
|
||||
this.form.starttime = arrTime;
|
||||
if (activityid == null) {
|
||||
} else {
|
||||
var activityid = response.data.activityid.split(";");
|
||||
var array = [];
|
||||
//console.log(arr);
|
||||
@ -479,6 +484,7 @@ export default {
|
||||
}
|
||||
});
|
||||
this.themeactivityList = array;
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
@ -173,6 +173,17 @@ public class ByThemeMonthplanController extends BaseController {
|
||||
byThemeMonthplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||
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));
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user