|
@@ -14,13 +14,24 @@
|
|
|
分享链接
|
|
|
</div>
|
|
|
<div class="url">
|
|
|
- <el-tooltip :content="origin" placement="top" effect="dark">
|
|
|
- <!-- content to trigger tooltip here -->
|
|
|
+ <el-input
|
|
|
+ class="sc_fu_input"
|
|
|
+ style="color: black"
|
|
|
+ disabled
|
|
|
+ v-model="origin"
|
|
|
+ >
|
|
|
+ <template slot="append"
|
|
|
+ ><div class="sc_fu_copyBtn" @click.stop="copy()">
|
|
|
+ 复制链接
|
|
|
+ </div></template
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <!-- <el-tooltip :content="origin" placement="top" effect="dark">
|
|
|
<span>{{ origin }}</span>
|
|
|
</el-tooltip>
|
|
|
<span @click="copy" :data-clipboard-text="copyText" class="tag-read"
|
|
|
>复制链接</span
|
|
|
- >
|
|
|
+ > -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="qrcode_box">
|
|
@@ -33,13 +44,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="btn_box">
|
|
|
- <button
|
|
|
+ <!-- <button
|
|
|
class="c_pub_button_confirm tag-read2"
|
|
|
@click="copy2"
|
|
|
:data-clipboard-text="copyText2"
|
|
|
>
|
|
|
复制信息
|
|
|
- </button>
|
|
|
+ </button> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -104,17 +115,36 @@ export default {
|
|
|
link.click();
|
|
|
},
|
|
|
copy() {
|
|
|
- this.copyText = `https://beta.cloud.cocorobo.cn/aigpt/#/classroom_observation_board?tid=${this.tid}`;
|
|
|
- var clipboard = new Clipboard(".tag-read");
|
|
|
- clipboard.on("success", e => {
|
|
|
- this.$message.success("复制成功");
|
|
|
- console.log("复制成功");
|
|
|
- clipboard.destroy(); // 释放内存
|
|
|
- });
|
|
|
- clipboard.on("error", e => {
|
|
|
- console.log("不支持复制,该浏览器不支持自动复制");
|
|
|
- clipboard.destroy(); // 释放内存
|
|
|
- });
|
|
|
+ const input = document.createElement("input");
|
|
|
+ // 设置 display为none会导致无法复制
|
|
|
+ // input.style.display = "none";
|
|
|
+ // 所以只能用其他方法隐藏
|
|
|
+ input.style.opacity = 0;
|
|
|
+ // 为了不影响布局
|
|
|
+ input.style.position = "fixed";
|
|
|
+ input.style.left = "-100%";
|
|
|
+ input.style.top = "-100%";
|
|
|
+ input.value = this.origin;
|
|
|
+ document.body.appendChild(input);
|
|
|
+ input.select();
|
|
|
+ const success = document.execCommand("copy");
|
|
|
+ document.body.removeChild(input);
|
|
|
+ if (!success) {
|
|
|
+ return this.$message.error("复制失败");
|
|
|
+ } else {
|
|
|
+ return this.$message.success("复制成功");
|
|
|
+ }
|
|
|
+ // this.copyText = `https://beta.cloud.cocorobo.cn/aigpt/#/classroom_observation_board?tid=${this.tid}`;
|
|
|
+ // var clipboard = new Clipboard(".tag-read");
|
|
|
+ // clipboard.on("success", e => {
|
|
|
+ // this.$message.success("复制成功");
|
|
|
+ // console.log("复制成功");
|
|
|
+ // clipboard.destroy(); // 释放内存
|
|
|
+ // });
|
|
|
+ // clipboard.on("error", e => {
|
|
|
+ // console.log("不支持复制,该浏览器不支持自动复制");
|
|
|
+ // clipboard.destroy(); // 释放内存
|
|
|
+ // });
|
|
|
},
|
|
|
copy2() {
|
|
|
let url = 'https://beta.cloud.cocorobo.cn/#/classroomObservation';
|
|
@@ -331,4 +361,19 @@ export default {
|
|
|
cursor: pointer;
|
|
|
color: #0061ff;
|
|
|
}
|
|
|
+
|
|
|
+.sc_fu_input /deep/.el-input__inner {
|
|
|
+ color: black !important;
|
|
|
+ cursor: text !important;
|
|
|
+}
|
|
|
+
|
|
|
+.sc_fu_input >>> .el-input__inner {
|
|
|
+ color: black !important;
|
|
|
+ cursor: text !important;
|
|
|
+}
|
|
|
+
|
|
|
+.sc_fu_copyBtn {
|
|
|
+ color: black;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
</style>
|