界面优化

This commit is contained in:
“wanyongkang”
2024-04-22 16:40:23 +08:00
parent 543f335f35
commit 165f982540
6 changed files with 117 additions and 7 deletions

View File

@@ -110,7 +110,7 @@
<tr style="color:red">
<td><input type="checkbox" class="selectAccount" value="@item.Account" a-status="@(item.Status)" a-pid="@(item.ProductId)" a-connectCount="@item.ConnectCount" a-aType="@item.AccountType" style="width: 0.4rem;height: 0.4rem;" /></td>
<td>@item.ProductName/@item.PackageName</td>
<td>@item.Account<br>@item.Pwd</td>
<td>@item.Account <a style="cursor:pointer;" v-on:click="copyText('@item.Account')">复制</a><br>@item.Pwd <a style="cursor:pointer;" v-on:click="copyText('@item.Pwd')">复制</a></td>
<td>
<button type="button" class="btnXq toDetail"
a-Id="@item.Id"
@@ -526,6 +526,31 @@
this.getProducts();
},
methods: {
copyText(text) {
// 检查浏览器是否支持 Clipboard API
if (!navigator.clipboard) {
// 如果不支持,则使用传统的 document.execCommand("copy") 方式
const textArea = document.createElement("textarea");
textArea.value = text;
textArea.style.position = "fixed";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
document.execCommand("copy");
document.body.removeChild(textArea);
return;
}
// 使用 Clipboard API 复制内容到剪切板
navigator.clipboard.writeText(text).then(
function() {
console.log("复制成功");
},
function() {
console.log("复制失败");
}
);
},
change_ip(account_id,package,account,old_ip){
this.province_city = [];
let data = {