更新前端
This commit is contained in:
parent
f25aaaa028
commit
1b78ad1626
@ -50,3 +50,11 @@ export function updateAccountPoolRemark(module, data) {
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function replenishAccountPool(module, data) {
|
||||||
|
return request({
|
||||||
|
url: `${base(module)}/replenish`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, reactive, watch } from 'vue';
|
import { computed, reactive, watch } from "vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
@ -8,35 +8,35 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
mode: {
|
mode: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'single', // single | batch
|
default: "single", // single | batch
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'submit']);
|
const emit = defineEmits(["update:modelValue", "submit"]);
|
||||||
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
type: 'account', // account | tk | account_tk
|
type: "tk", // account | tk | account_tk
|
||||||
account: '',
|
account: "",
|
||||||
password: '',
|
password: "",
|
||||||
token: '',
|
token: "",
|
||||||
batchText: '',
|
batchText: "",
|
||||||
remark: '',
|
remark: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const isBatch = computed(() => props.mode === 'batch');
|
const isBatch = computed(() => props.mode === "batch");
|
||||||
|
|
||||||
const dialogTitle = computed(() => {
|
const dialogTitle = computed(() => {
|
||||||
return isBatch.value ? '批量添加账号' : '添加账号';
|
return isBatch.value ? "批量添加账号" : "添加账号";
|
||||||
});
|
});
|
||||||
|
|
||||||
const formatExample = computed(() => {
|
const formatExample = computed(() => {
|
||||||
if (form.type === 'account') {
|
if (form.type === "account") {
|
||||||
return 'account,password';
|
return "account,password";
|
||||||
}
|
}
|
||||||
if (form.type === 'account_tk') {
|
if (form.type === "account_tk") {
|
||||||
return 'account,password,token';
|
return "account,password,token";
|
||||||
}
|
}
|
||||||
return 'token';
|
return "token";
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@ -44,20 +44,20 @@ watch(
|
|||||||
(visible) => {
|
(visible) => {
|
||||||
if (!visible) return;
|
if (!visible) return;
|
||||||
resetForm();
|
resetForm();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
emit('update:modelValue', false);
|
emit("update:modelValue", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
form.type = 'account';
|
form.type = "tk";
|
||||||
form.account = '';
|
form.account = "";
|
||||||
form.password = '';
|
form.password = "";
|
||||||
form.token = '';
|
form.token = "";
|
||||||
form.batchText = '';
|
form.batchText = "";
|
||||||
form.remark = '';
|
form.remark = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseBatchRows() {
|
function parseBatchRows() {
|
||||||
@ -70,32 +70,32 @@ function parseBatchRows() {
|
|||||||
const errors = [];
|
const errors = [];
|
||||||
|
|
||||||
rows.forEach((line, index) => {
|
rows.forEach((line, index) => {
|
||||||
if (form.type === 'account') {
|
if (form.type === "account") {
|
||||||
const [account, password] = line.split(',').map((x) => (x || '').trim());
|
const [account, password] = line.split(",").map((x) => (x || "").trim());
|
||||||
if (!account || !password) {
|
if (!account || !password) {
|
||||||
errors.push(`第 ${index + 1} 行格式错误,应为 account,password`);
|
errors.push(`第 ${index + 1} 行格式错误,应为 account,password`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parsed.push({
|
parsed.push({
|
||||||
type: 'account',
|
type: "account",
|
||||||
account,
|
account,
|
||||||
password,
|
password,
|
||||||
token: '',
|
token: "",
|
||||||
remark: form.remark,
|
remark: form.remark,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (form.type === 'account_tk') {
|
if (form.type === "account_tk") {
|
||||||
const [account, password, token] = line
|
const [account, password, token] = line
|
||||||
.split(',')
|
.split(",")
|
||||||
.map((x) => (x || '').trim());
|
.map((x) => (x || "").trim());
|
||||||
if (!account || !password || !token) {
|
if (!account || !password || !token) {
|
||||||
errors.push(`第 ${index + 1} 行格式错误,应为 account,password,token`);
|
errors.push(`第 ${index + 1} 行格式错误,应为 account,password,token`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parsed.push({
|
parsed.push({
|
||||||
type: 'account_tk',
|
type: "account_tk",
|
||||||
account,
|
account,
|
||||||
password,
|
password,
|
||||||
token,
|
token,
|
||||||
@ -105,9 +105,9 @@ function parseBatchRows() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parsed.push({
|
parsed.push({
|
||||||
type: 'tk',
|
type: "tk",
|
||||||
account: '',
|
account: "",
|
||||||
password: '',
|
password: "",
|
||||||
token: line,
|
token: line,
|
||||||
remark: form.remark,
|
remark: form.remark,
|
||||||
});
|
});
|
||||||
@ -118,18 +118,18 @@ function parseBatchRows() {
|
|||||||
|
|
||||||
function handleSubmit() {
|
function handleSubmit() {
|
||||||
if (!isBatch.value) {
|
if (!isBatch.value) {
|
||||||
if (form.type === 'account') {
|
if (form.type === "account") {
|
||||||
if (!form.account || !form.password) {
|
if (!form.account || !form.password) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emit('submit', {
|
emit("submit", {
|
||||||
mode: 'single',
|
mode: "single",
|
||||||
rows: [
|
rows: [
|
||||||
{
|
{
|
||||||
type: 'account',
|
type: "account",
|
||||||
account: form.account.trim(),
|
account: form.account.trim(),
|
||||||
password: form.password.trim(),
|
password: form.password.trim(),
|
||||||
token: '',
|
token: "",
|
||||||
remark: form.remark.trim(),
|
remark: form.remark.trim(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -138,15 +138,15 @@ function handleSubmit() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (form.type === 'account_tk') {
|
if (form.type === "account_tk") {
|
||||||
if (!form.account || !form.password || !form.token) {
|
if (!form.account || !form.password || !form.token) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emit('submit', {
|
emit("submit", {
|
||||||
mode: 'single',
|
mode: "single",
|
||||||
rows: [
|
rows: [
|
||||||
{
|
{
|
||||||
type: 'account_tk',
|
type: "account_tk",
|
||||||
account: form.account.trim(),
|
account: form.account.trim(),
|
||||||
password: form.password.trim(),
|
password: form.password.trim(),
|
||||||
token: form.token.trim(),
|
token: form.token.trim(),
|
||||||
@ -159,13 +159,13 @@ function handleSubmit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!form.token) return;
|
if (!form.token) return;
|
||||||
emit('submit', {
|
emit("submit", {
|
||||||
mode: 'single',
|
mode: "single",
|
||||||
rows: [
|
rows: [
|
||||||
{
|
{
|
||||||
type: 'tk',
|
type: "tk",
|
||||||
account: '',
|
account: "",
|
||||||
password: '',
|
password: "",
|
||||||
token: form.token.trim(),
|
token: form.token.trim(),
|
||||||
remark: form.remark.trim(),
|
remark: form.remark.trim(),
|
||||||
},
|
},
|
||||||
@ -179,8 +179,8 @@ function handleSubmit() {
|
|||||||
if (errors.length || parsed.length === 0) {
|
if (errors.length || parsed.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emit('submit', {
|
emit("submit", {
|
||||||
mode: 'batch',
|
mode: "batch",
|
||||||
rows: parsed,
|
rows: parsed,
|
||||||
});
|
});
|
||||||
closeDialog();
|
closeDialog();
|
||||||
@ -198,19 +198,27 @@ function handleSubmit() {
|
|||||||
<el-form label-width="96px">
|
<el-form label-width="96px">
|
||||||
<el-form-item label="账号类型">
|
<el-form-item label="账号类型">
|
||||||
<el-radio-group v-model="form.type">
|
<el-radio-group v-model="form.type">
|
||||||
|
<el-radio value="tk">Token</el-radio>
|
||||||
<el-radio value="account">账号密码</el-radio>
|
<el-radio value="account">账号密码</el-radio>
|
||||||
<el-radio value="account_tk">账号密码+Token</el-radio>
|
<el-radio value="account_tk">账号密码+Token</el-radio>
|
||||||
<el-radio value="tk">Token</el-radio>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<template v-if="!isBatch">
|
<template v-if="!isBatch">
|
||||||
<template v-if="form.type === 'account' || form.type === 'account_tk'">
|
<template v-if="form.type === 'account' || form.type === 'account_tk'">
|
||||||
<el-form-item label="账号">
|
<el-form-item label="账号">
|
||||||
<el-input v-model="form.account" placeholder="请输入账号" clearable />
|
<el-input
|
||||||
|
v-model="form.account"
|
||||||
|
placeholder="请输入账号"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="密码">
|
<el-form-item label="密码">
|
||||||
<el-input v-model="form.password" placeholder="请输入密码" clearable />
|
<el-input
|
||||||
|
v-model="form.password"
|
||||||
|
placeholder="请输入密码"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="form.type === 'account_tk'" label="Token">
|
<el-form-item v-if="form.type === 'account_tk'" label="Token">
|
||||||
<el-input
|
<el-input
|
||||||
|
|||||||
49
src/views/accountpool/cursor/components/replenish.vue
Normal file
49
src/views/accountpool/cursor/components/replenish.vue
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: { type: Boolean, default: false },
|
||||||
|
loading: { type: Boolean, default: false },
|
||||||
|
type: { type: String, default: 'tk' },
|
||||||
|
platform: { type: String, default: 'local' },
|
||||||
|
remark: { type: String, default: '' },
|
||||||
|
platformMap: { type: Object, default: () => ({}) },
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue', 'update:type', 'update:platform', 'update:remark', 'confirm']);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:model-value="modelValue"
|
||||||
|
title="补号"
|
||||||
|
width="420px"
|
||||||
|
@update:model-value="(v) => emit('update:modelValue', v)"
|
||||||
|
>
|
||||||
|
<el-form label-width="84px">
|
||||||
|
<el-form-item label="账号类型">
|
||||||
|
<el-select :model-value="type" style="width: 100%" @update:model-value="(v) => emit('update:type', v)">
|
||||||
|
<el-option label="Token" value="tk" />
|
||||||
|
<el-option label="账号密码" value="account" />
|
||||||
|
<el-option label="账号密码+Token" value="account_tk" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提取平台">
|
||||||
|
<el-select :model-value="platform" style="width: 100%" @update:model-value="(v) => emit('update:platform', v)">
|
||||||
|
<el-option v-for="(v, k) in platformMap" :key="k" :value="k" :label="v.label" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input
|
||||||
|
:model-value="remark"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
placeholder="提取备注(可选)"
|
||||||
|
@update:model-value="(v) => emit('update:remark', v)"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="emit('update:modelValue', false)">取消</el-button>
|
||||||
|
<el-button type="warning" :loading="loading" @click="emit('confirm')">确认补号</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
@ -1,27 +1,19 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
<<<<<<< Updated upstream
|
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
|
||||||
import { ElMessage } from 'element-plus';
|
|
||||||
import Edit from './components/edit.vue';
|
|
||||||
import DetailDialog from './components/detail.vue';
|
|
||||||
import ExtractDialog from './components/extract.vue';
|
|
||||||
=======
|
|
||||||
import { computed, onMounted, reactive, ref, watch } from "vue";
|
import { computed, onMounted, reactive, ref, watch } from "vue";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import Edit from "./components/edit.vue";
|
import Edit from "./components/edit.vue";
|
||||||
>>>>>>> Stashed changes
|
import DetailDialog from "./components/detail.vue";
|
||||||
|
import ExtractDialog from "./components/extract.vue";
|
||||||
|
import ReplenishDialog from "./components/replenish.vue";
|
||||||
import {
|
import {
|
||||||
addAccountPool,
|
addAccountPool,
|
||||||
batchAddAccountPool,
|
batchAddAccountPool,
|
||||||
extractAccountPool,
|
extractAccountPool,
|
||||||
getAccountPoolDetail,
|
getAccountPoolDetail,
|
||||||
getAccountPoolList,
|
getAccountPoolList,
|
||||||
<<<<<<< Updated upstream
|
|
||||||
updateAccountPoolRemark,
|
updateAccountPoolRemark,
|
||||||
} from '@/api/accountPool';
|
replenishAccountPool,
|
||||||
=======
|
|
||||||
} from "@/api/accountPool";
|
} from "@/api/accountPool";
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
|
||||||
const moduleKey = "cursor";
|
const moduleKey = "cursor";
|
||||||
|
|
||||||
@ -31,6 +23,10 @@ const editMode = ref("single");
|
|||||||
const detailVisible = ref(false);
|
const detailVisible = ref(false);
|
||||||
const extractVisible = ref(false);
|
const extractVisible = ref(false);
|
||||||
const extractTargetRow = ref(null);
|
const extractTargetRow = ref(null);
|
||||||
|
const batchExtractVisible = ref(false);
|
||||||
|
const batchExtractForm = reactive({ platform: "local", remark: "" });
|
||||||
|
const replenishVisible = ref(false);
|
||||||
|
const replenishForm = reactive({ type: "tk", platform: "local", remark: "" });
|
||||||
const apiDocVisible = ref(false);
|
const apiDocVisible = ref(false);
|
||||||
|
|
||||||
const query = reactive({
|
const query = reactive({
|
||||||
@ -40,14 +36,9 @@ const query = reactive({
|
|||||||
const activeTypeTab = ref("all");
|
const activeTypeTab = ref("all");
|
||||||
|
|
||||||
const extractForm = reactive({
|
const extractForm = reactive({
|
||||||
<<<<<<< Updated upstream
|
|
||||||
platform: 'local',
|
|
||||||
type: 'account',
|
|
||||||
remark: '',
|
|
||||||
=======
|
|
||||||
platform: "local",
|
platform: "local",
|
||||||
type: "account",
|
type: "account",
|
||||||
>>>>>>> Stashed changes
|
remark: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
@ -97,17 +88,12 @@ function openAddDialog(mode = "single") {
|
|||||||
editVisible.value = true;
|
editVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
=======
|
|
||||||
function nowText() {
|
function nowText() {
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
const p = (v) => String(v).padStart(2, "0");
|
const p = (v) => String(v).padStart(2, "0");
|
||||||
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
||||||
d.getHours(),
|
|
||||||
)}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
async function saveRows(rows) {
|
async function saveRows(rows) {
|
||||||
if (!rows.length) return;
|
if (!rows.length) return;
|
||||||
if (rows.length === 1) {
|
if (rows.length === 1) {
|
||||||
@ -150,8 +136,6 @@ function openDetail(row) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
=======
|
|
||||||
function openExtractDialog() {
|
function openExtractDialog() {
|
||||||
extractTargetRow.value = null;
|
extractTargetRow.value = null;
|
||||||
extractForm.platform = "local";
|
extractForm.platform = "local";
|
||||||
@ -159,12 +143,11 @@ function openExtractDialog() {
|
|||||||
extractVisible.value = true;
|
extractVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
function openExtractByRow(row) {
|
function openExtractByRow(row) {
|
||||||
extractTargetRow.value = row;
|
extractTargetRow.value = row;
|
||||||
extractForm.platform = "local";
|
extractForm.platform = "local";
|
||||||
extractForm.type = row.type;
|
extractForm.type = row.type;
|
||||||
extractForm.remark = row.remark || '';
|
extractForm.remark = row.remark || "";
|
||||||
extractVisible.value = true;
|
extractVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +163,7 @@ async function handleExtract() {
|
|||||||
id: target.id,
|
id: target.id,
|
||||||
type: target.type,
|
type: target.type,
|
||||||
platform: extractForm.platform,
|
platform: extractForm.platform,
|
||||||
remark: extractForm.remark || '',
|
remark: extractForm.remark || "",
|
||||||
});
|
});
|
||||||
if (res?.code !== 200) {
|
if (res?.code !== 200) {
|
||||||
ElMessage.error(res?.msg || "提取失败");
|
ElMessage.error(res?.msg || "提取失败");
|
||||||
@ -188,6 +171,8 @@ async function handleExtract() {
|
|||||||
}
|
}
|
||||||
ElMessage.success("提取成功");
|
ElMessage.success("提取成功");
|
||||||
extractVisible.value = false;
|
extractVisible.value = false;
|
||||||
|
const row = normalizeRow(res.data || {});
|
||||||
|
navigator.clipboard.writeText(rowToText(row)).catch(() => {});
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@ -200,12 +185,12 @@ async function handleSaveRemark(payload) {
|
|||||||
try {
|
try {
|
||||||
const res = await updateAccountPoolRemark(moduleKey, payload);
|
const res = await updateAccountPoolRemark(moduleKey, payload);
|
||||||
if (res?.code !== 200) {
|
if (res?.code !== 200) {
|
||||||
ElMessage.error(res?.msg || '备注更新失败');
|
ElMessage.error(res?.msg || "备注更新失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ElMessage.success('备注已更新');
|
ElMessage.success("备注已更新");
|
||||||
if (detailRow.value?.id === payload.id) {
|
if (detailRow.value?.id === payload.id) {
|
||||||
detailRow.value = { ...detailRow.value, remark: payload.remark || '' };
|
detailRow.value = { ...detailRow.value, remark: payload.remark || "" };
|
||||||
}
|
}
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally {
|
} finally {
|
||||||
@ -218,23 +203,42 @@ function markExtractForSelected() {
|
|||||||
ElMessage.warning("请先选择数据");
|
ElMessage.warning("请先选择数据");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
batchExtractForm.platform = "local";
|
||||||
|
batchExtractForm.remark = "";
|
||||||
|
batchExtractVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleBatchExtract() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
Promise.all(
|
try {
|
||||||
selectedRows.value.map((row) =>
|
const results = await Promise.all(
|
||||||
extractAccountPool(moduleKey, {
|
selectedRows.value.map((row) =>
|
||||||
id: row.id,
|
extractAccountPool(moduleKey, {
|
||||||
type: row.type,
|
id: row.id,
|
||||||
platform: "local",
|
type: row.type,
|
||||||
}),
|
platform: batchExtractForm.platform,
|
||||||
),
|
remark: batchExtractForm.remark || "",
|
||||||
)
|
}),
|
||||||
.then(() => {
|
),
|
||||||
|
);
|
||||||
|
const succeeded = results
|
||||||
|
.filter((r) => r?.code === 200)
|
||||||
|
.map((r) => normalizeRow(r.data || {}));
|
||||||
|
const failCount = results.length - succeeded.length;
|
||||||
|
if (failCount > 0) {
|
||||||
|
ElMessage.warning(`${succeeded.length} 条成功,${failCount} 条失败`);
|
||||||
|
} else {
|
||||||
ElMessage.success("批量提取成功");
|
ElMessage.success("批量提取成功");
|
||||||
fetchList();
|
}
|
||||||
})
|
batchExtractVisible.value = false;
|
||||||
.finally(() => {
|
if (succeeded.length) {
|
||||||
loading.value = false;
|
const text = succeeded.map(rowToText).filter(Boolean).join("\n");
|
||||||
});
|
navigator.clipboard.writeText(text).catch(() => {});
|
||||||
|
}
|
||||||
|
fetchList();
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function typeText(type) {
|
function typeText(type) {
|
||||||
@ -420,6 +424,36 @@ function copyCardInfo(row) {
|
|||||||
ElMessage.success("已复制");
|
ElMessage.success("已复制");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function rowToText(row) {
|
||||||
|
const parts = [];
|
||||||
|
if (row.account) parts.push(row.account);
|
||||||
|
if (row.password) parts.push(row.password);
|
||||||
|
if (row.token) parts.push(row.token);
|
||||||
|
return parts.join(" / ");
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleReplenish() {
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
const res = await replenishAccountPool(moduleKey, {
|
||||||
|
type: replenishForm.type,
|
||||||
|
platform: replenishForm.platform,
|
||||||
|
remark: replenishForm.remark || "",
|
||||||
|
});
|
||||||
|
if (res?.code !== 200) {
|
||||||
|
ElMessage.error(res?.msg || "补号失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ElMessage.success("补号成功,已复制到剪贴板");
|
||||||
|
replenishVisible.value = false;
|
||||||
|
const row = normalizeRow(res.data || {});
|
||||||
|
navigator.clipboard.writeText(rowToText(row)).catch(() => {});
|
||||||
|
await fetchList();
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -451,6 +485,9 @@ function copyCardInfo(row) {
|
|||||||
<el-button @click="resetQuery">重置</el-button>
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-right">
|
<div class="toolbar-right">
|
||||||
|
<el-button type="warning" @click="replenishVisible = true"
|
||||||
|
>补号</el-button
|
||||||
|
>
|
||||||
<el-button type="primary" @click="openAddDialog('single')"
|
<el-button type="primary" @click="openAddDialog('single')"
|
||||||
>添加账号</el-button
|
>添加账号</el-button
|
||||||
>
|
>
|
||||||
@ -574,7 +611,6 @@ function copyCardInfo(row) {
|
|||||||
|
|
||||||
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
<DetailDialog
|
<DetailDialog
|
||||||
v-model="detailVisible"
|
v-model="detailVisible"
|
||||||
:row="detailRow"
|
:row="detailRow"
|
||||||
@ -593,53 +629,12 @@ function copyCardInfo(row) {
|
|||||||
@update:remark="(v) => (extractForm.remark = v)"
|
@update:remark="(v) => (extractForm.remark = v)"
|
||||||
@confirm="handleExtract"
|
@confirm="handleExtract"
|
||||||
/>
|
/>
|
||||||
=======
|
|
||||||
<el-dialog v-model="detailVisible" title="账号详情" width="560px">
|
|
||||||
<el-descriptions :column="1" border v-if="detailRow">
|
|
||||||
<el-descriptions-item label="ID">{{
|
|
||||||
detailRow.id
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="提取状态">
|
|
||||||
{{ detailRow.extracted ? "已提取" : "未提取" }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="提取平台">
|
|
||||||
<el-tag
|
|
||||||
v-if="detailRow.extractedPlatform"
|
|
||||||
:type="platformTagType(detailRow.extractedPlatform)"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ platformText(detailRow.extractedPlatform) }}
|
|
||||||
</el-tag>
|
|
||||||
<span v-else>-</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="账号类型">
|
|
||||||
{{ typeText(detailRow.type) }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="账号">
|
|
||||||
{{ detailRow.account || "-" }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="密码">
|
|
||||||
{{ detailRow.password || "-" }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="Token">
|
|
||||||
<span class="token-text">{{ detailRow.token || "-" }}</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="提取时间">
|
|
||||||
{{ detailRow.extractedAt || "-" }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="备注">
|
|
||||||
{{ detailRow.remark || "-" }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<el-dialog v-model="extractVisible" title="提取账号" width="420px">
|
<!-- 批量提取弹窗 -->
|
||||||
|
<el-dialog v-model="batchExtractVisible" title="批量提取" width="420px">
|
||||||
<el-form label-width="84px">
|
<el-form label-width="84px">
|
||||||
<el-form-item label="提取类型">
|
|
||||||
<el-input :model-value="typeText(extractForm.type)" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="提取平台">
|
<el-form-item label="提取平台">
|
||||||
<el-select v-model="extractForm.platform" style="width: 100%">
|
<el-select v-model="batchExtractForm.platform" style="width: 100%">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(v, k) in PLATFORM_MAP"
|
v-for="(v, k) in PLATFORM_MAP"
|
||||||
:key="k"
|
:key="k"
|
||||||
@ -648,15 +643,40 @@ function copyCardInfo(row) {
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input
|
||||||
|
v-model="batchExtractForm.remark"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
placeholder="提取备注(可选)"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="extractVisible = false">取消</el-button>
|
<el-button @click="batchExtractVisible = false">取消</el-button>
|
||||||
<el-button type="primary" :loading="loading" @click="handleExtract">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:loading="loading"
|
||||||
|
@click="handleBatchExtract"
|
||||||
|
>
|
||||||
确认提取
|
确认提取
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
<!-- 补号弹窗 -->
|
||||||
|
<ReplenishDialog
|
||||||
|
v-model="replenishVisible"
|
||||||
|
:loading="loading"
|
||||||
|
:type="replenishForm.type"
|
||||||
|
:platform="replenishForm.platform"
|
||||||
|
:remark="replenishForm.remark"
|
||||||
|
:platform-map="PLATFORM_MAP"
|
||||||
|
@update:type="(v) => (replenishForm.type = v)"
|
||||||
|
@update:platform="(v) => (replenishForm.platform = v)"
|
||||||
|
@update:remark="(v) => (replenishForm.remark = v)"
|
||||||
|
@confirm="handleReplenish"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 接口说明抽屉 -->
|
<!-- 接口说明抽屉 -->
|
||||||
<el-drawer
|
<el-drawer
|
||||||
@ -868,6 +888,35 @@ function copyCardInfo(row) {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.extract-result-item {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 6px 0;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result-label {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 44px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result-val {
|
||||||
|
flex: 1;
|
||||||
|
word-break: break-all;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token-val {
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
49
src/views/accountpool/kiro/components/replenish.vue
Normal file
49
src/views/accountpool/kiro/components/replenish.vue
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: { type: Boolean, default: false },
|
||||||
|
loading: { type: Boolean, default: false },
|
||||||
|
type: { type: String, default: 'tk' },
|
||||||
|
platform: { type: String, default: 'local' },
|
||||||
|
remark: { type: String, default: '' },
|
||||||
|
platformMap: { type: Object, default: () => ({}) },
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue', 'update:type', 'update:platform', 'update:remark', 'confirm']);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:model-value="modelValue"
|
||||||
|
title="补号"
|
||||||
|
width="420px"
|
||||||
|
@update:model-value="(v) => emit('update:modelValue', v)"
|
||||||
|
>
|
||||||
|
<el-form label-width="84px">
|
||||||
|
<el-form-item label="账号类型">
|
||||||
|
<el-select :model-value="type" style="width: 100%" @update:model-value="(v) => emit('update:type', v)">
|
||||||
|
<el-option label="Token" value="tk" />
|
||||||
|
<el-option label="账号密码" value="account" />
|
||||||
|
<el-option label="账号密码+Token" value="account_tk" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提取平台">
|
||||||
|
<el-select :model-value="platform" style="width: 100%" @update:model-value="(v) => emit('update:platform', v)">
|
||||||
|
<el-option v-for="(v, k) in platformMap" :key="k" :value="k" :label="v.label" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input
|
||||||
|
:model-value="remark"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
placeholder="提取备注(可选)"
|
||||||
|
@update:model-value="(v) => emit('update:remark', v)"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="emit('update:modelValue', false)">取消</el-button>
|
||||||
|
<el-button type="warning" :loading="loading" @click="emit('confirm')">确认补号</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
@ -1,27 +1,19 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
<<<<<<< Updated upstream
|
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import Edit from './components/edit.vue';
|
import Edit from './components/edit.vue';
|
||||||
import DetailDialog from './components/detail.vue';
|
import DetailDialog from './components/detail.vue';
|
||||||
import ExtractDialog from './components/extract.vue';
|
import ExtractDialog from './components/extract.vue';
|
||||||
=======
|
import ReplenishDialog from './components/replenish.vue';
|
||||||
import { computed, onMounted, reactive, ref, watch } from "vue";
|
|
||||||
import { ElMessage } from "element-plus";
|
|
||||||
import Edit from "./components/edit.vue";
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
import {
|
import {
|
||||||
addAccountPool,
|
addAccountPool,
|
||||||
batchAddAccountPool,
|
batchAddAccountPool,
|
||||||
extractAccountPool,
|
extractAccountPool,
|
||||||
getAccountPoolDetail,
|
getAccountPoolDetail,
|
||||||
getAccountPoolList,
|
getAccountPoolList,
|
||||||
<<<<<<< Updated upstream
|
|
||||||
updateAccountPoolRemark,
|
updateAccountPoolRemark,
|
||||||
|
replenishAccountPool,
|
||||||
} from '@/api/accountPool';
|
} from '@/api/accountPool';
|
||||||
=======
|
|
||||||
} from "@/api/accountPool";
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
|
||||||
const moduleKey = "krio";
|
const moduleKey = "krio";
|
||||||
|
|
||||||
@ -31,16 +23,16 @@ const editMode = ref("single");
|
|||||||
const detailVisible = ref(false);
|
const detailVisible = ref(false);
|
||||||
const extractVisible = ref(false);
|
const extractVisible = ref(false);
|
||||||
const extractTargetRow = ref(null);
|
const extractTargetRow = ref(null);
|
||||||
|
const batchExtractVisible = ref(false);
|
||||||
|
const batchExtractForm = reactive({ platform: 'local', remark: '' });
|
||||||
|
const replenishVisible = ref(false);
|
||||||
|
const replenishForm = reactive({ type: 'tk', platform: 'local', remark: '' });
|
||||||
const apiDocVisible = ref(false);
|
const apiDocVisible = ref(false);
|
||||||
|
|
||||||
const query = reactive({ keyword: "", status: "" });
|
const query = reactive({ keyword: "", status: "" });
|
||||||
const activeTypeTab = ref("all");
|
const activeTypeTab = ref("all");
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
const extractForm = reactive({ platform: 'local', type: 'account', remark: '' });
|
const extractForm = reactive({ platform: 'local', type: 'account', remark: '' });
|
||||||
=======
|
|
||||||
const extractForm = reactive({ platform: "local", type: "account" });
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
@ -136,25 +128,15 @@ async function handleExtract() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const target = extractTargetRow.value;
|
const target = extractTargetRow.value;
|
||||||
if (!target) {
|
if (!target) { ElMessage.warning("未找到提取目标"); return; }
|
||||||
ElMessage.warning("未找到提取目标");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const res = await extractAccountPool(moduleKey, {
|
const res = await extractAccountPool(moduleKey, {
|
||||||
<<<<<<< Updated upstream
|
|
||||||
id: target.id, type: target.type, platform: extractForm.platform, remark: extractForm.remark || '',
|
id: target.id, type: target.type, platform: extractForm.platform, remark: extractForm.remark || '',
|
||||||
=======
|
|
||||||
id: target.id,
|
|
||||||
type: target.type,
|
|
||||||
platform: extractForm.platform,
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
});
|
});
|
||||||
if (res?.code !== 200) {
|
if (res?.code !== 200) { ElMessage.error(res?.msg || "提取失败"); return; }
|
||||||
ElMessage.error(res?.msg || "提取失败");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ElMessage.success("提取成功");
|
ElMessage.success("提取成功");
|
||||||
extractVisible.value = false;
|
extractVisible.value = false;
|
||||||
|
const row = normalizeRow(res.data || {});
|
||||||
|
navigator.clipboard.writeText(rowToText(row)).catch(() => {});
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@ -176,27 +158,67 @@ async function handleSaveRemark(payload) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function markExtractForSelected() {
|
function markExtractForSelected() {
|
||||||
if (!selectedRows.value.length) {
|
if (!selectedRows.value.length) { ElMessage.warning("请先选择数据"); return; }
|
||||||
ElMessage.warning("请先选择数据");
|
batchExtractForm.platform = 'local';
|
||||||
return;
|
batchExtractForm.remark = '';
|
||||||
}
|
batchExtractVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleBatchExtract() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
Promise.all(
|
try {
|
||||||
selectedRows.value.map((row) =>
|
const results = await Promise.all(
|
||||||
extractAccountPool(moduleKey, {
|
selectedRows.value.map((row) =>
|
||||||
id: row.id,
|
extractAccountPool(moduleKey, {
|
||||||
type: row.type,
|
id: row.id, type: row.type,
|
||||||
platform: "local",
|
platform: batchExtractForm.platform,
|
||||||
}),
|
remark: batchExtractForm.remark || '',
|
||||||
),
|
}),
|
||||||
)
|
),
|
||||||
.then(() => {
|
);
|
||||||
|
const succeeded = results.filter((r) => r?.code === 200).map((r) => normalizeRow(r.data || {}));
|
||||||
|
const failCount = results.length - succeeded.length;
|
||||||
|
if (failCount > 0) {
|
||||||
|
ElMessage.warning(`${succeeded.length} 条成功,${failCount} 条失败`);
|
||||||
|
} else {
|
||||||
ElMessage.success("批量提取成功");
|
ElMessage.success("批量提取成功");
|
||||||
fetchList();
|
}
|
||||||
})
|
batchExtractVisible.value = false;
|
||||||
.finally(() => {
|
if (succeeded.length) {
|
||||||
loading.value = false;
|
const text = succeeded.map(rowToText).filter(Boolean).join('\n');
|
||||||
|
navigator.clipboard.writeText(text).catch(() => {});
|
||||||
|
}
|
||||||
|
fetchList();
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function rowToText(row) {
|
||||||
|
const parts = [];
|
||||||
|
if (row.account) parts.push(row.account);
|
||||||
|
if (row.password) parts.push(row.password);
|
||||||
|
if (row.token) parts.push(row.token);
|
||||||
|
return parts.join(' / ');
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleReplenish() {
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
const res = await replenishAccountPool(moduleKey, {
|
||||||
|
type: replenishForm.type,
|
||||||
|
platform: replenishForm.platform,
|
||||||
|
remark: replenishForm.remark || '',
|
||||||
});
|
});
|
||||||
|
if (res?.code !== 200) { ElMessage.error(res?.msg || '补号失败'); return; }
|
||||||
|
ElMessage.success('补号成功,已复制到剪贴板');
|
||||||
|
replenishVisible.value = false;
|
||||||
|
const row = normalizeRow(res.data || {});
|
||||||
|
navigator.clipboard.writeText(rowToText(row)).catch(() => {});
|
||||||
|
await fetchList();
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function typeText(type) {
|
function typeText(type) {
|
||||||
@ -409,6 +431,7 @@ function copyCardInfo(row) {
|
|||||||
<el-button @click="resetQuery">重置</el-button>
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-right">
|
<div class="toolbar-right">
|
||||||
|
<el-button type="warning" @click="replenishVisible = true">补号</el-button>
|
||||||
<el-button type="primary" @click="openAddDialog('single')"
|
<el-button type="primary" @click="openAddDialog('single')"
|
||||||
>添加账号</el-button
|
>添加账号</el-button
|
||||||
>
|
>
|
||||||
@ -532,7 +555,6 @@ function copyCardInfo(row) {
|
|||||||
|
|
||||||
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
<DetailDialog
|
<DetailDialog
|
||||||
v-model="detailVisible"
|
v-model="detailVisible"
|
||||||
:row="detailRow"
|
:row="detailRow"
|
||||||
@ -551,70 +573,38 @@ function copyCardInfo(row) {
|
|||||||
@update:remark="(v) => (extractForm.remark = v)"
|
@update:remark="(v) => (extractForm.remark = v)"
|
||||||
@confirm="handleExtract"
|
@confirm="handleExtract"
|
||||||
/>
|
/>
|
||||||
=======
|
|
||||||
<el-dialog v-model="detailVisible" title="账号详情" width="560px">
|
|
||||||
<el-descriptions :column="1" border v-if="detailRow">
|
|
||||||
<el-descriptions-item label="ID">{{
|
|
||||||
detailRow.id
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="账号类型">{{
|
|
||||||
typeText(detailRow.type)
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="账号">{{
|
|
||||||
detailRow.account || "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="密码">{{
|
|
||||||
detailRow.password || "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="Token">
|
|
||||||
<span class="token-text">{{ detailRow.token || "-" }}</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="提取状态">{{
|
|
||||||
detailRow.extracted ? "已提取" : "未提取"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="提取时间">{{
|
|
||||||
detailRow.extractedAt || "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="提取平台">
|
|
||||||
<el-tag
|
|
||||||
v-if="detailRow.extractedPlatform"
|
|
||||||
:type="platformTagType(detailRow.extractedPlatform)"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ platformText(detailRow.extractedPlatform) }}
|
|
||||||
</el-tag>
|
|
||||||
<span v-else>-</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="备注">{{
|
|
||||||
detailRow.remark || "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<el-dialog v-model="extractVisible" title="提取账号" width="420px">
|
<!-- 批量提取弹窗 -->
|
||||||
|
<el-dialog v-model="batchExtractVisible" title="批量提取" width="420px">
|
||||||
<el-form label-width="84px">
|
<el-form label-width="84px">
|
||||||
<el-form-item label="提取类型">
|
|
||||||
<el-input :model-value="typeText(extractForm.type)" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="提取平台">
|
<el-form-item label="提取平台">
|
||||||
<el-select v-model="extractForm.platform" style="width: 100%">
|
<el-select v-model="batchExtractForm.platform" style="width: 100%">
|
||||||
<el-option
|
<el-option v-for="(v, k) in PLATFORM_MAP" :key="k" :value="k" :label="v.label" />
|
||||||
v-for="(v, k) in PLATFORM_MAP"
|
|
||||||
:key="k"
|
|
||||||
:value="k"
|
|
||||||
:label="v.label"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="batchExtractForm.remark" type="textarea" :rows="3" placeholder="提取备注(可选)" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="extractVisible = false">取消</el-button>
|
<el-button @click="batchExtractVisible = false">取消</el-button>
|
||||||
<el-button type="primary" :loading="loading" @click="handleExtract"
|
<el-button type="primary" :loading="loading" @click="handleBatchExtract">确认提取</el-button>
|
||||||
>确认提取</el-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
<!-- 补号弹窗 -->
|
||||||
|
<ReplenishDialog
|
||||||
|
v-model="replenishVisible"
|
||||||
|
:loading="loading"
|
||||||
|
:type="replenishForm.type"
|
||||||
|
:platform="replenishForm.platform"
|
||||||
|
:remark="replenishForm.remark"
|
||||||
|
:platform-map="PLATFORM_MAP"
|
||||||
|
@update:type="(v) => (replenishForm.type = v)"
|
||||||
|
@update:platform="(v) => (replenishForm.platform = v)"
|
||||||
|
@update:remark="(v) => (replenishForm.remark = v)"
|
||||||
|
@confirm="handleReplenish"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 接口说明抽屉 -->
|
<!-- 接口说明抽屉 -->
|
||||||
<el-drawer
|
<el-drawer
|
||||||
@ -698,7 +688,6 @@ function copyCardInfo(row) {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
<<<<<<< Updated upstream
|
|
||||||
.account-pool-page { padding: 12px; }
|
.account-pool-page { padding: 12px; }
|
||||||
.card-header { display: flex; align-items: center; justify-content: space-between; }
|
.card-header { display: flex; align-items: center; justify-content: space-between; }
|
||||||
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
|
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
|
||||||
@ -717,111 +706,6 @@ function copyCardInfo(row) {
|
|||||||
.example-url-wrap { display: flex; align-items: center; gap: 8px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px; }
|
.example-url-wrap { display: flex; align-items: center; gap: 8px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px; }
|
||||||
.example-url { flex: 1; font-size: 12px; color: #409eff; word-break: break-all; }
|
.example-url { flex: 1; font-size: 12px; color: #409eff; word-break: break-all; }
|
||||||
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 12px 16px; border-radius: 6px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
|
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 12px 16px; border-radius: 6px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
|
||||||
=======
|
|
||||||
.account-pool-page {
|
|
||||||
padding: 12px;
|
|
||||||
}
|
|
||||||
.card-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.toolbar {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
.toolbar-left,
|
|
||||||
.toolbar-right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.w-260 {
|
|
||||||
width: 260px;
|
|
||||||
}
|
|
||||||
.w-140 {
|
|
||||||
width: 140px;
|
|
||||||
}
|
|
||||||
.type-tabs {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
.pagination-wrap {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-top: 14px;
|
|
||||||
}
|
|
||||||
.api-doc {
|
|
||||||
padding: 0 4px;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.doc-section {
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
.doc-title {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
color: #303133;
|
|
||||||
border-left: 3px solid #409eff;
|
|
||||||
padding-left: 8px;
|
|
||||||
}
|
|
||||||
.method-tag {
|
|
||||||
margin-right: 8px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.url-code {
|
|
||||||
background: #f5f7fa;
|
|
||||||
padding: 4px 10px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 13px;
|
|
||||||
color: #e6a23c;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
.example-item {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.example-label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #909399;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
.example-url-wrap {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
background: #f5f7fa;
|
|
||||||
padding: 6px 10px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
.example-url {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #409eff;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
.code-block {
|
|
||||||
background: #1e1e1e;
|
|
||||||
color: #d4d4d4;
|
|
||||||
padding: 12px 16px;
|
|
||||||
border-radius: 6px;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.6;
|
|
||||||
overflow-x: auto;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
word-break: break-all;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.token-text {
|
|
||||||
word-break: break-all;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
49
src/views/accountpool/windsurf/components/replenish.vue
Normal file
49
src/views/accountpool/windsurf/components/replenish.vue
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: { type: Boolean, default: false },
|
||||||
|
loading: { type: Boolean, default: false },
|
||||||
|
type: { type: String, default: 'tk' },
|
||||||
|
platform: { type: String, default: 'local' },
|
||||||
|
remark: { type: String, default: '' },
|
||||||
|
platformMap: { type: Object, default: () => ({}) },
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue', 'update:type', 'update:platform', 'update:remark', 'confirm']);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:model-value="modelValue"
|
||||||
|
title="补号"
|
||||||
|
width="420px"
|
||||||
|
@update:model-value="(v) => emit('update:modelValue', v)"
|
||||||
|
>
|
||||||
|
<el-form label-width="84px">
|
||||||
|
<el-form-item label="账号类型">
|
||||||
|
<el-select :model-value="type" style="width: 100%" @update:model-value="(v) => emit('update:type', v)">
|
||||||
|
<el-option label="Token" value="tk" />
|
||||||
|
<el-option label="账号密码" value="account" />
|
||||||
|
<el-option label="账号密码+Token" value="account_tk" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提取平台">
|
||||||
|
<el-select :model-value="platform" style="width: 100%" @update:model-value="(v) => emit('update:platform', v)">
|
||||||
|
<el-option v-for="(v, k) in platformMap" :key="k" :value="k" :label="v.label" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input
|
||||||
|
:model-value="remark"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
placeholder="提取备注(可选)"
|
||||||
|
@update:model-value="(v) => emit('update:remark', v)"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="emit('update:modelValue', false)">取消</el-button>
|
||||||
|
<el-button type="warning" :loading="loading" @click="emit('confirm')">确认补号</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
@ -1,27 +1,18 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
<<<<<<< Updated upstream
|
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import Edit from './components/edit.vue';
|
import Edit from './components/edit.vue';
|
||||||
import DetailDialog from './components/detail.vue';
|
import DetailDialog from './components/detail.vue';
|
||||||
import ExtractDialog from './components/extract.vue';
|
import ExtractDialog from './components/extract.vue';
|
||||||
=======
|
import ReplenishDialog from './components/replenish.vue';import {
|
||||||
import { computed, onMounted, reactive, ref, watch } from "vue";
|
|
||||||
import { ElMessage } from "element-plus";
|
|
||||||
import Edit from "./components/edit.vue";
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
import {
|
|
||||||
addAccountPool,
|
addAccountPool,
|
||||||
batchAddAccountPool,
|
batchAddAccountPool,
|
||||||
extractAccountPool,
|
extractAccountPool,
|
||||||
getAccountPoolDetail,
|
getAccountPoolDetail,
|
||||||
getAccountPoolList,
|
getAccountPoolList,
|
||||||
<<<<<<< Updated upstream
|
|
||||||
updateAccountPoolRemark,
|
updateAccountPoolRemark,
|
||||||
|
replenishAccountPool,
|
||||||
} from '@/api/accountPool';
|
} from '@/api/accountPool';
|
||||||
=======
|
|
||||||
} from "@/api/accountPool";
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
|
||||||
const moduleKey = "windsurf";
|
const moduleKey = "windsurf";
|
||||||
|
|
||||||
@ -31,16 +22,16 @@ const editMode = ref("single");
|
|||||||
const detailVisible = ref(false);
|
const detailVisible = ref(false);
|
||||||
const extractVisible = ref(false);
|
const extractVisible = ref(false);
|
||||||
const extractTargetRow = ref(null);
|
const extractTargetRow = ref(null);
|
||||||
|
const batchExtractVisible = ref(false);
|
||||||
|
const batchExtractForm = reactive({ platform: 'local', remark: '' });
|
||||||
|
const replenishVisible = ref(false);
|
||||||
|
const replenishForm = reactive({ type: 'tk', platform: 'local', remark: '' });
|
||||||
const apiDocVisible = ref(false);
|
const apiDocVisible = ref(false);
|
||||||
|
|
||||||
const query = reactive({ keyword: "", status: "" });
|
const query = reactive({ keyword: "", status: "" });
|
||||||
const activeTypeTab = ref("all");
|
const activeTypeTab = ref("all");
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
const extractForm = reactive({ platform: 'local', type: 'account', remark: '' });
|
const extractForm = reactive({ platform: 'local', type: 'account', remark: '' });
|
||||||
=======
|
|
||||||
const extractForm = reactive({ platform: "local", type: "account" });
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
@ -136,25 +127,15 @@ async function handleExtract() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const target = extractTargetRow.value;
|
const target = extractTargetRow.value;
|
||||||
if (!target) {
|
if (!target) { ElMessage.warning("未找到提取目标"); return; }
|
||||||
ElMessage.warning("未找到提取目标");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const res = await extractAccountPool(moduleKey, {
|
const res = await extractAccountPool(moduleKey, {
|
||||||
<<<<<<< Updated upstream
|
|
||||||
id: target.id, type: target.type, platform: extractForm.platform, remark: extractForm.remark || '',
|
id: target.id, type: target.type, platform: extractForm.platform, remark: extractForm.remark || '',
|
||||||
=======
|
|
||||||
id: target.id,
|
|
||||||
type: target.type,
|
|
||||||
platform: extractForm.platform,
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
});
|
});
|
||||||
if (res?.code !== 200) {
|
if (res?.code !== 200) { ElMessage.error(res?.msg || "提取失败"); return; }
|
||||||
ElMessage.error(res?.msg || "提取失败");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ElMessage.success("提取成功");
|
ElMessage.success("提取成功");
|
||||||
extractVisible.value = false;
|
extractVisible.value = false;
|
||||||
|
const row = normalizeRow(res.data || {});
|
||||||
|
navigator.clipboard.writeText(rowToText(row)).catch(() => {});
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@ -176,27 +157,67 @@ async function handleSaveRemark(payload) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function markExtractForSelected() {
|
function markExtractForSelected() {
|
||||||
if (!selectedRows.value.length) {
|
if (!selectedRows.value.length) { ElMessage.warning("请先选择数据"); return; }
|
||||||
ElMessage.warning("请先选择数据");
|
batchExtractForm.platform = 'local';
|
||||||
return;
|
batchExtractForm.remark = '';
|
||||||
}
|
batchExtractVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleBatchExtract() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
Promise.all(
|
try {
|
||||||
selectedRows.value.map((row) =>
|
const results = await Promise.all(
|
||||||
extractAccountPool(moduleKey, {
|
selectedRows.value.map((row) =>
|
||||||
id: row.id,
|
extractAccountPool(moduleKey, {
|
||||||
type: row.type,
|
id: row.id, type: row.type,
|
||||||
platform: "local",
|
platform: batchExtractForm.platform,
|
||||||
}),
|
remark: batchExtractForm.remark || '',
|
||||||
),
|
}),
|
||||||
)
|
),
|
||||||
.then(() => {
|
);
|
||||||
|
const succeeded = results.filter((r) => r?.code === 200).map((r) => normalizeRow(r.data || {}));
|
||||||
|
const failCount = results.length - succeeded.length;
|
||||||
|
if (failCount > 0) {
|
||||||
|
ElMessage.warning(`${succeeded.length} 条成功,${failCount} 条失败`);
|
||||||
|
} else {
|
||||||
ElMessage.success("批量提取成功");
|
ElMessage.success("批量提取成功");
|
||||||
fetchList();
|
}
|
||||||
})
|
batchExtractVisible.value = false;
|
||||||
.finally(() => {
|
if (succeeded.length) {
|
||||||
loading.value = false;
|
const text = succeeded.map(rowToText).filter(Boolean).join('\n');
|
||||||
|
navigator.clipboard.writeText(text).catch(() => {});
|
||||||
|
}
|
||||||
|
fetchList();
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function rowToText(row) {
|
||||||
|
const parts = [];
|
||||||
|
if (row.account) parts.push(row.account);
|
||||||
|
if (row.password) parts.push(row.password);
|
||||||
|
if (row.token) parts.push(row.token);
|
||||||
|
return parts.join(' / ');
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleReplenish() {
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
const res = await replenishAccountPool(moduleKey, {
|
||||||
|
type: replenishForm.type,
|
||||||
|
platform: replenishForm.platform,
|
||||||
|
remark: replenishForm.remark || '',
|
||||||
});
|
});
|
||||||
|
if (res?.code !== 200) { ElMessage.error(res?.msg || '补号失败'); return; }
|
||||||
|
ElMessage.success('补号成功,已复制到剪贴板');
|
||||||
|
replenishVisible.value = false;
|
||||||
|
const row = normalizeRow(res.data || {});
|
||||||
|
navigator.clipboard.writeText(rowToText(row)).catch(() => {});
|
||||||
|
await fetchList();
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function typeText(type) {
|
function typeText(type) {
|
||||||
@ -409,6 +430,7 @@ function copyCardInfo(row) {
|
|||||||
<el-button @click="resetQuery">重置</el-button>
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-right">
|
<div class="toolbar-right">
|
||||||
|
<el-button type="warning" @click="replenishVisible = true">补号</el-button>
|
||||||
<el-button type="primary" @click="openAddDialog('single')"
|
<el-button type="primary" @click="openAddDialog('single')"
|
||||||
>添加账号</el-button
|
>添加账号</el-button
|
||||||
>
|
>
|
||||||
@ -532,7 +554,6 @@ function copyCardInfo(row) {
|
|||||||
|
|
||||||
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
<DetailDialog
|
<DetailDialog
|
||||||
v-model="detailVisible"
|
v-model="detailVisible"
|
||||||
:row="detailRow"
|
:row="detailRow"
|
||||||
@ -551,70 +572,38 @@ function copyCardInfo(row) {
|
|||||||
@update:remark="(v) => (extractForm.remark = v)"
|
@update:remark="(v) => (extractForm.remark = v)"
|
||||||
@confirm="handleExtract"
|
@confirm="handleExtract"
|
||||||
/>
|
/>
|
||||||
=======
|
|
||||||
<el-dialog v-model="detailVisible" title="账号详情" width="560px">
|
|
||||||
<el-descriptions :column="1" border v-if="detailRow">
|
|
||||||
<el-descriptions-item label="ID">{{
|
|
||||||
detailRow.id
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="提取状态">{{
|
|
||||||
detailRow.extracted ? "已提取" : "未提取"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="提取平台">
|
|
||||||
<el-tag
|
|
||||||
v-if="detailRow.extractedPlatform"
|
|
||||||
:type="platformTagType(detailRow.extractedPlatform)"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ platformText(detailRow.extractedPlatform) }}
|
|
||||||
</el-tag>
|
|
||||||
<span v-else>-</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="账号类型">{{
|
|
||||||
typeText(detailRow.type)
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="账号">{{
|
|
||||||
detailRow.account || "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="密码">{{
|
|
||||||
detailRow.password || "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="Token">
|
|
||||||
<span class="token-text">{{ detailRow.token || "-" }}</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="提取时间">{{
|
|
||||||
detailRow.extractedAt || "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="备注">{{
|
|
||||||
detailRow.remark || "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<el-dialog v-model="extractVisible" title="提取账号" width="420px">
|
<!-- 批量提取弹窗 -->
|
||||||
|
<el-dialog v-model="batchExtractVisible" title="批量提取" width="420px">
|
||||||
<el-form label-width="84px">
|
<el-form label-width="84px">
|
||||||
<el-form-item label="提取类型">
|
|
||||||
<el-input :model-value="typeText(extractForm.type)" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="提取平台">
|
<el-form-item label="提取平台">
|
||||||
<el-select v-model="extractForm.platform" style="width: 100%">
|
<el-select v-model="batchExtractForm.platform" style="width: 100%">
|
||||||
<el-option
|
<el-option v-for="(v, k) in PLATFORM_MAP" :key="k" :value="k" :label="v.label" />
|
||||||
v-for="(v, k) in PLATFORM_MAP"
|
|
||||||
:key="k"
|
|
||||||
:value="k"
|
|
||||||
:label="v.label"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="batchExtractForm.remark" type="textarea" :rows="3" placeholder="提取备注(可选)" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="extractVisible = false">取消</el-button>
|
<el-button @click="batchExtractVisible = false">取消</el-button>
|
||||||
<el-button type="primary" :loading="loading" @click="handleExtract"
|
<el-button type="primary" :loading="loading" @click="handleBatchExtract">确认提取</el-button>
|
||||||
>确认提取</el-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
>>>>>>> Stashed changes
|
|
||||||
|
<!-- 补号弹窗 -->
|
||||||
|
<ReplenishDialog
|
||||||
|
v-model="replenishVisible"
|
||||||
|
:loading="loading"
|
||||||
|
:type="replenishForm.type"
|
||||||
|
:platform="replenishForm.platform"
|
||||||
|
:remark="replenishForm.remark"
|
||||||
|
:platform-map="PLATFORM_MAP"
|
||||||
|
@update:type="(v) => (replenishForm.type = v)"
|
||||||
|
@update:platform="(v) => (replenishForm.platform = v)"
|
||||||
|
@update:remark="(v) => (replenishForm.remark = v)"
|
||||||
|
@confirm="handleReplenish"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 接口说明抽屉 -->
|
<!-- 接口说明抽屉 -->
|
||||||
<el-drawer
|
<el-drawer
|
||||||
@ -698,7 +687,6 @@ function copyCardInfo(row) {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
<<<<<<< Updated upstream
|
|
||||||
.account-pool-page { padding: 12px; }
|
.account-pool-page { padding: 12px; }
|
||||||
.card-header { display: flex; align-items: center; justify-content: space-between; }
|
.card-header { display: flex; align-items: center; justify-content: space-between; }
|
||||||
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
|
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
|
||||||
@ -717,111 +705,6 @@ function copyCardInfo(row) {
|
|||||||
.example-url-wrap { display: flex; align-items: center; gap: 8px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px; }
|
.example-url-wrap { display: flex; align-items: center; gap: 8px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px; }
|
||||||
.example-url { flex: 1; font-size: 12px; color: #409eff; word-break: break-all; }
|
.example-url { flex: 1; font-size: 12px; color: #409eff; word-break: break-all; }
|
||||||
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 12px 16px; border-radius: 6px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
|
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 12px 16px; border-radius: 6px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
|
||||||
=======
|
|
||||||
.account-pool-page {
|
|
||||||
padding: 12px;
|
|
||||||
}
|
|
||||||
.card-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
.toolbar {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
.toolbar-left,
|
|
||||||
.toolbar-right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.w-260 {
|
|
||||||
width: 260px;
|
|
||||||
}
|
|
||||||
.w-140 {
|
|
||||||
width: 140px;
|
|
||||||
}
|
|
||||||
.type-tabs {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
.pagination-wrap {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-top: 14px;
|
|
||||||
}
|
|
||||||
.api-doc {
|
|
||||||
padding: 0 4px;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.doc-section {
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
.doc-title {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
color: #303133;
|
|
||||||
border-left: 3px solid #409eff;
|
|
||||||
padding-left: 8px;
|
|
||||||
}
|
|
||||||
.method-tag {
|
|
||||||
margin-right: 8px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.url-code {
|
|
||||||
background: #f5f7fa;
|
|
||||||
padding: 4px 10px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 13px;
|
|
||||||
color: #e6a23c;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
.example-item {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.example-label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #909399;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
.example-url-wrap {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
background: #f5f7fa;
|
|
||||||
padding: 6px 10px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
.example-url {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #409eff;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
.code-block {
|
|
||||||
background: #1e1e1e;
|
|
||||||
color: #d4d4d4;
|
|
||||||
padding: 12px 16px;
|
|
||||||
border-radius: 6px;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.6;
|
|
||||||
overflow-x: auto;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
word-break: break-all;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.token-text {
|
|
||||||
word-break: break-all;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
|
||||||
>>>>>>> Stashed changes
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user