|
@@ -124,7 +124,7 @@
|
|
prop="publish_scope"
|
|
prop="publish_scope"
|
|
width="100"
|
|
width="100"
|
|
></el-table-column>
|
|
></el-table-column>
|
|
- <el-table-column fixed="right" label="操作" prop width="300">
|
|
|
|
|
|
+ <el-table-column fixed="right" label="操作" prop width="370">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button @click="handleClick(scope.row)" type="text"
|
|
<el-button @click="handleClick(scope.row)" type="text"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
@@ -147,6 +147,9 @@
|
|
<el-button @click="handleDiscount(scope.row)" type="text"
|
|
<el-button @click="handleDiscount(scope.row)" type="text"
|
|
>激活码</el-button
|
|
>激活码</el-button
|
|
>
|
|
>
|
|
|
|
+ <el-button type="text" @click="handleCreatLink(scope.row)"
|
|
|
|
+ >生成链接</el-button
|
|
|
|
+ >
|
|
<el-button @click="handleDel(scope.row)" type="text"
|
|
<el-button @click="handleDel(scope.row)" type="text"
|
|
>删除</el-button
|
|
>删除</el-button
|
|
>
|
|
>
|
|
@@ -165,6 +168,16 @@
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
></el-pagination>
|
|
></el-pagination>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div
|
|
|
|
+ id="temporaryLinks"
|
|
|
|
+ style="
|
|
|
|
+ height: 0;
|
|
|
|
+ width: 1200px;
|
|
|
|
+ opacity: 0;
|
|
|
|
+ z-index: -1;
|
|
|
|
+ word-break: break-all;
|
|
|
|
+ "
|
|
|
|
+ ></div>
|
|
</div>
|
|
</div>
|
|
<el-dialog
|
|
<el-dialog
|
|
:before-close="handleClose"
|
|
:before-close="handleClose"
|
|
@@ -582,6 +595,52 @@ export default {
|
|
handleDiscount(row) {
|
|
handleDiscount(row) {
|
|
this.$router.push("/discountCodeList?bookId=" + row.id);
|
|
this.$router.push("/discountCodeList?bookId=" + row.id);
|
|
},
|
|
},
|
|
|
|
+ // 生成临时链接
|
|
|
|
+ handleCreatLink(row) {
|
|
|
|
+ var date1 = new Date();
|
|
|
|
+ var date2 = new Date(date1);
|
|
|
|
+ date2.setDate(date1.getDate() + 30);
|
|
|
|
+ let endtime = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate()
|
|
|
|
+ getContentFile('login_control-CreateValidDateEncryptionString', {
|
|
|
|
+ end_date: endtime,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ let link =
|
|
|
|
+ "https://" +
|
|
|
|
+ window.location.host +
|
|
|
|
+ "/GCLS-Book/#/BookBrowsing?bookId=" +
|
|
|
|
+ row.id+"&encryption="+res.encryption_string;
|
|
|
|
+ document.getElementById("temporaryLinks").innerHTML = link;
|
|
|
|
+ var doc = document,
|
|
|
|
+ text = doc.getElementById("temporaryLinks"),
|
|
|
|
+ range,
|
|
|
|
+ selection;
|
|
|
|
+ if (doc.body.createTextRange) {
|
|
|
|
+ range = doc.body.createTextRange();
|
|
|
|
+ range.moveToElementText(text);
|
|
|
|
+ range.select();
|
|
|
|
+ } else if (window.getSelection) {
|
|
|
|
+ selection = window.getSelection();
|
|
|
|
+ range = doc.createRange();
|
|
|
|
+ range.selectNodeContents(text);
|
|
|
|
+ selection.removeAllRanges();
|
|
|
|
+ selection.addRange(range);
|
|
|
|
+ }
|
|
|
|
+ document.execCommand("copy");
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "复制成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ window.getSelection().removeAllRanges();
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "生成失败,请稍后重试",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ },
|
|
// 新建教材
|
|
// 新建教材
|
|
handleAdd() {
|
|
handleAdd() {
|
|
this.titleEdit = "新建教材";
|
|
this.titleEdit = "新建教材";
|
|
@@ -1004,4 +1063,4 @@ export default {
|
|
.el-dialog {
|
|
.el-dialog {
|
|
font-size: 0;
|
|
font-size: 0;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|