更新
This commit is contained in:
parent
ae00d633fb
commit
f4f5bd3037
@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, reactive, ref, watch } from "vue";
|
import { computed, reactive, ref, watch, onBeforeUnmount } from "vue";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -15,9 +15,21 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
hasPrev: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
hasNext: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["update:modelValue", "save-remark", "detail-action"]);
|
const emit = defineEmits(["update:modelValue", "save-remark", "detail-action", "prev", "next"]);
|
||||||
const remarkText = ref("");
|
const remarkText = ref("");
|
||||||
const remarkDialogVisible = ref(false);
|
const remarkDialogVisible = ref(false);
|
||||||
const platformDialogVisible = ref(false);
|
const platformDialogVisible = ref(false);
|
||||||
@ -184,6 +196,29 @@ function copyAll() {
|
|||||||
if (props.row?.token) parts.push(`Token:${props.row.token}`);
|
if (props.row?.token) parts.push(`Token:${props.row.token}`);
|
||||||
copyText(parts.join("\n"), "已复制完整账号信息");
|
copyText(parts.join("\n"), "已复制完整账号信息");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleKeyDown(e) {
|
||||||
|
if (e.key === "ArrowLeft" && props.hasPrev && !props.loading) {
|
||||||
|
emit("prev");
|
||||||
|
} else if (e.key === "ArrowRight" && props.hasNext && !props.loading) {
|
||||||
|
emit("next");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
window.addEventListener("keydown", handleKeyDown);
|
||||||
|
} else {
|
||||||
|
window.removeEventListener("keydown", handleKeyDown);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
window.removeEventListener("keydown", handleKeyDown);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -209,7 +244,25 @@ function copyAll() {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div v-if="row" class="detail-body">
|
<div v-if="row" class="detail-body" v-loading="loading">
|
||||||
|
<!-- Prev/Next Navigation Buttons -->
|
||||||
|
<div
|
||||||
|
class="nav-btn prev-btn"
|
||||||
|
:class="{ 'is-disabled': !hasPrev || loading }"
|
||||||
|
title="上一个 (Left Arrow)"
|
||||||
|
@click="hasPrev && !loading && emit('prev')"
|
||||||
|
>
|
||||||
|
<el-icon><ArrowLeft /></el-icon>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="nav-btn next-btn"
|
||||||
|
:class="{ 'is-disabled': !hasNext || loading }"
|
||||||
|
title="下一个 (Right Arrow)"
|
||||||
|
@click="hasNext && !loading && emit('next')"
|
||||||
|
>
|
||||||
|
<el-icon><ArrowRight /></el-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="info-grid">
|
<div class="info-grid">
|
||||||
<div class="info-card">
|
<div class="info-card">
|
||||||
<div class="info-label">ID</div>
|
<div class="info-label">ID</div>
|
||||||
@ -331,13 +384,13 @@ function copyAll() {
|
|||||||
<el-button type="success" plain @click="openUsableDialog">
|
<el-button type="success" plain @click="openUsableDialog">
|
||||||
改可用状态
|
改可用状态
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<!-- <el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
plain
|
plain
|
||||||
@click="unavailableDialogVisible = true"
|
@click="unavailableDialogVisible = true"
|
||||||
>
|
>
|
||||||
改不可用
|
改不可用
|
||||||
</el-button>
|
</el-button> -->
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
@ -474,18 +527,20 @@ function copyAll() {
|
|||||||
:deep(.pool-detail-dialog) {
|
:deep(.pool-detail-dialog) {
|
||||||
max-width: calc(100vw - 28px);
|
max-width: calc(100vw - 28px);
|
||||||
border-radius: 18px;
|
border-radius: 18px;
|
||||||
overflow: hidden;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.pool-detail-dialog .el-dialog__header) {
|
:deep(.pool-detail-dialog .el-dialog__header) {
|
||||||
padding: 18px 22px;
|
padding: 18px 60px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border-bottom: 1px solid #eef0f5;
|
border-bottom: 1px solid #eef0f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.pool-detail-dialog .el-dialog__body) {
|
:deep(.pool-detail-dialog .el-dialog__body) {
|
||||||
padding: 18px 22px 22px;
|
padding: 18px 60px 22px;
|
||||||
background: #f6f8fb;
|
background: #f6f8fb;
|
||||||
|
border-bottom-left-radius: 18px;
|
||||||
|
border-bottom-right-radius: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-tag) {
|
:deep(.el-tag) {
|
||||||
@ -531,6 +586,7 @@ function copyAll() {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 14px;
|
gap: 14px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-card,
|
.section-card,
|
||||||
@ -542,28 +598,76 @@ function copyAll() {
|
|||||||
|
|
||||||
.info-grid {
|
.info-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||||
gap: 12px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-card {
|
.info-card {
|
||||||
border-radius: 14px;
|
border-radius: 10px;
|
||||||
padding: 14px;
|
padding: 8px 12px;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-label {
|
.info-label {
|
||||||
color: #909399;
|
color: #909399;
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-value {
|
.info-value {
|
||||||
color: #303133;
|
color: #303133;
|
||||||
font-size: 14px;
|
font-size: 13px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
min-height: 20px;
|
min-height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Navigation buttons styles */
|
||||||
|
.nav-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #edf0f6;
|
||||||
|
box-shadow: 0 4px 12px rgba(31, 41, 55, 0.08);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 100;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-btn:hover:not(.is-disabled) {
|
||||||
|
background: #409eff;
|
||||||
|
color: #fff;
|
||||||
|
border-color: #409eff;
|
||||||
|
box-shadow: 0 6px 16px rgba(64, 158, 255, 0.35);
|
||||||
|
transform: translateY(-50%) scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-btn.is-disabled {
|
||||||
|
opacity: 0.3;
|
||||||
|
cursor: not-allowed;
|
||||||
|
background: #f5f7fa;
|
||||||
|
color: #c0c4cc;
|
||||||
|
border-color: #e4e7ed;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prev-btn {
|
||||||
|
left: -110px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-btn {
|
||||||
|
right: -110px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-card {
|
.section-card {
|
||||||
@ -624,11 +728,11 @@ function copyAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.pool-detail-dialog .el-dialog__header) {
|
:deep(.pool-detail-dialog .el-dialog__header) {
|
||||||
padding: 14px 14px;
|
padding: 14px 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.pool-detail-dialog .el-dialog__body) {
|
:deep(.pool-detail-dialog .el-dialog__body) {
|
||||||
padding: 12px;
|
padding: 12px 44px 16px;
|
||||||
max-height: 76vh;
|
max-height: 76vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
@ -643,12 +747,26 @@ function copyAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.info-grid {
|
.info-grid {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy-actions .el-button,
|
.copy-actions .el-button,
|
||||||
.section-head .el-button {
|
.section-head .el-button {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-btn {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prev-btn {
|
||||||
|
left: -36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-btn {
|
||||||
|
right: -36px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -88,6 +88,7 @@ const total = ref(0);
|
|||||||
const selectedRows = ref([]);
|
const selectedRows = ref([]);
|
||||||
const detailRow = ref(null);
|
const detailRow = ref(null);
|
||||||
const detailRemarkSaving = ref(false);
|
const detailRemarkSaving = ref(false);
|
||||||
|
const detailLoading = ref(false);
|
||||||
const probeLoadingId = ref(null);
|
const probeLoadingId = ref(null);
|
||||||
const batchProbeDialogVisible = ref(false);
|
const batchProbeDialogVisible = ref(false);
|
||||||
const batchProbePhase = ref("running");
|
const batchProbePhase = ref("running");
|
||||||
@ -188,7 +189,11 @@ function handleSelectionChange(rows) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openDetail(row) {
|
function openDetail(row) {
|
||||||
loading.value = true;
|
if (detailVisible.value) {
|
||||||
|
detailLoading.value = true;
|
||||||
|
} else {
|
||||||
|
loading.value = true;
|
||||||
|
}
|
||||||
getAccountPoolDetail(moduleKey, row.id)
|
getAccountPoolDetail(moduleKey, row.id)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.code !== 200) {
|
if (res?.code !== 200) {
|
||||||
@ -200,6 +205,7 @@ function openDetail(row) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
detailLoading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,6 +317,26 @@ async function refreshDetailRow(id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const currentIndex = computed(() => {
|
||||||
|
if (!detailRow.value || !tableData.value.length) return -1;
|
||||||
|
return tableData.value.findIndex((item) => item.id === detailRow.value.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
const hasPrev = computed(() => currentIndex.value > 0);
|
||||||
|
const hasNext = computed(() => currentIndex.value > -1 && currentIndex.value < tableData.value.length - 1);
|
||||||
|
|
||||||
|
function handlePrevDetail() {
|
||||||
|
if (hasPrev.value) {
|
||||||
|
openDetail(tableData.value[currentIndex.value - 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleNextDetail() {
|
||||||
|
if (hasNext.value) {
|
||||||
|
openDetail(tableData.value[currentIndex.value + 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleDetailAction(payload) {
|
async function handleDetailAction(payload) {
|
||||||
if (!payload?.id || !payload?.action) return;
|
if (!payload?.id || !payload?.action) return;
|
||||||
detailRemarkSaving.value = true;
|
detailRemarkSaving.value = true;
|
||||||
@ -1098,13 +1124,13 @@ function closeBatchProbeDialog() {
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="accessToken失效时间" width="190" align="center">
|
<el-table-column label="accessToken失效时间" width="190" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag :type="accessTokenExpireTagType(row.accessTokenExpireStatus)" size="small">
|
<el-tag :type="accessTokenExpireTagType(row.accessTokenExpireStatus)" size="small">
|
||||||
{{ row.accessTokenExpireText || "-" }}
|
{{ row.accessTokenExpireText || "-" }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column>
|
||||||
<el-table-column label="提取平台" width="120">
|
<el-table-column label="提取平台" width="120">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag
|
<el-tag
|
||||||
@ -1169,6 +1195,11 @@ function closeBatchProbeDialog() {
|
|||||||
v-model="detailVisible"
|
v-model="detailVisible"
|
||||||
:row="detailRow"
|
:row="detailRow"
|
||||||
:save-loading="detailRemarkSaving"
|
:save-loading="detailRemarkSaving"
|
||||||
|
:has-prev="hasPrev"
|
||||||
|
:has-next="hasNext"
|
||||||
|
:loading="detailLoading"
|
||||||
|
@prev="handlePrevDetail"
|
||||||
|
@next="handleNextDetail"
|
||||||
@save-remark="handleSaveRemark"
|
@save-remark="handleSaveRemark"
|
||||||
@detail-action="handleDetailAction"
|
@detail-action="handleDetailAction"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user