修复检测

This commit is contained in:
2026-06-14 00:45:18 +08:00
parent 1bed46e11b
commit 26b5e94023
5 changed files with 405 additions and 29 deletions
@@ -22,8 +22,10 @@ const remarkText = ref("");
const remarkDialogVisible = ref(false);
const platformDialogVisible = ref(false);
const unavailableDialogVisible = ref(false);
const usableDialogVisible = ref(false);
const unextractDialogVisible = ref(false);
const platformForm = reactive({ platform: "local" });
const usableForm = reactive({ usable: 1 });
const TYPE_MAP = {
account: { label: "账号密码", type: "success" },
@@ -82,6 +84,12 @@ watch(
(row) => {
remarkText.value = row?.remark || "";
platformForm.platform = row?.extractedPlatform || "local";
const raw = row?.isUsed;
if (raw === null || raw === undefined || raw === "") {
usableForm.usable = 1;
} else {
usableForm.usable = Number(raw) === 0 ? 0 : 1;
}
},
{ immediate: true },
);
@@ -107,6 +115,26 @@ function onSetUnavailable() {
unavailableDialogVisible.value = false;
}
function openUsableDialog() {
const raw = props.row?.isUsed;
if (raw === null || raw === undefined || raw === "") {
usableForm.usable = 1;
} else {
usableForm.usable = Number(raw) === 0 ? 0 : 1;
}
usableDialogVisible.value = true;
}
function onUpdateUsable() {
if (!props.row?.id) return;
emit("detail-action", {
action: "usable",
id: props.row.id,
usable: usableForm.usable,
});
usableDialogVisible.value = false;
}
function onUpdatePlatform() {
if (!props.row?.id) return;
emit("detail-action", {
@@ -299,6 +327,9 @@ function copyAll() {
</div>
</div>
<div class="copy-actions">
<el-button type="success" plain @click="openUsableDialog">
改可用状态
</el-button>
<el-button
type="danger"
plain
@@ -334,6 +365,28 @@ function copyAll() {
</div>
</el-dialog>
<el-dialog
v-model="usableDialogVisible"
title="改可用状态"
width="420px"
append-to-body
>
<el-form label-width="84px">
<el-form-item label="可用状态">
<el-radio-group v-model="usableForm.usable">
<el-radio :value="1">可用</el-radio>
<el-radio :value="0">不可用</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="usableDialogVisible = false">取消</el-button>
<el-button type="primary" :loading="saveLoading" @click="onUpdateUsable">
确认修改
</el-button>
</template>
</el-dialog>
<el-dialog
v-model="unavailableDialogVisible"
title="改不可用"