批量更新
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
@@ -28,9 +29,11 @@ function typeText(type) {
|
||||
const PLATFORM_MAP = {
|
||||
local: { label: '本地', type: 'info' },
|
||||
xianyu: { label: '闲鱼', type: 'warning' },
|
||||
taobao: { label: '淘宝', type: 'info' },
|
||||
pinduoduo: { label: '拼多多', type: 'danger' },
|
||||
jingdong: { label: '京东', type: 'primary' },
|
||||
douyin: { label: '抖音', type: 'success' },
|
||||
ziyoushangcheng: { label: '自有商城', type: 'warning' },
|
||||
};
|
||||
|
||||
const platformLabel = computed(() => {
|
||||
@@ -55,13 +58,37 @@ function onSaveRemark() {
|
||||
if (!props.row?.id) return;
|
||||
emit('save-remark', { id: props.row.id, remark: remarkText.value || '' });
|
||||
}
|
||||
|
||||
function copyAccountPassword() {
|
||||
const account = props.row?.account || '';
|
||||
const password = props.row?.password || '';
|
||||
if (!account && !password) {
|
||||
ElMessage.warning('暂无账号密码可复制');
|
||||
return;
|
||||
}
|
||||
navigator.clipboard.writeText(`${account}\n${password}`.trim()).then(() => {
|
||||
ElMessage.success('已复制账号+密码');
|
||||
});
|
||||
}
|
||||
|
||||
function copyToken() {
|
||||
const token = props.row?.token || '';
|
||||
if (!token) {
|
||||
ElMessage.warning('暂无 Token 可复制');
|
||||
return;
|
||||
}
|
||||
navigator.clipboard.writeText(token).then(() => {
|
||||
ElMessage.success('已复制 Token');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog
|
||||
class="pool-detail-dialog"
|
||||
:model-value="modelValue"
|
||||
title="账号详情"
|
||||
width="560px"
|
||||
width="90%"
|
||||
@update:model-value="(v) => emit('update:modelValue', v)"
|
||||
>
|
||||
<el-descriptions :column="1" border v-if="row">
|
||||
@@ -82,6 +109,12 @@ function onSaveRemark() {
|
||||
</el-tag>
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="复制">
|
||||
<div class="copy-actions">
|
||||
<el-button size="small" @click="copyAccountPassword">账号+密码</el-button>
|
||||
<el-button size="small" type="primary" @click="copyToken">Token</el-button>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">
|
||||
<div class="remark-edit-wrap">
|
||||
<el-input v-model="remarkText" type="textarea" :rows="3" placeholder="请输入备注" />
|
||||
@@ -106,4 +139,42 @@ function onSaveRemark() {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.copy-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.remark-edit-wrap .el-button {
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
:deep(.pool-detail-dialog) {
|
||||
max-width: 560px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
:deep(.pool-detail-dialog) {
|
||||
width: calc(100vw - 24px) !important;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
:deep(.pool-detail-dialog .el-dialog__body) {
|
||||
padding: 12px;
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
:deep(.pool-detail-dialog .el-descriptions__label) {
|
||||
width: 72px;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.remark-edit-wrap .el-button {
|
||||
width: 100%;
|
||||
align-self: stretch;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -37,9 +37,10 @@ function typeText(type) {
|
||||
|
||||
<template>
|
||||
<el-dialog
|
||||
class="pool-extract-dialog"
|
||||
:model-value="modelValue"
|
||||
title="提取账号"
|
||||
width="420px"
|
||||
width="90%"
|
||||
@update:model-value="(v) => emit('update:modelValue', v)"
|
||||
>
|
||||
<el-form label-width="84px">
|
||||
@@ -78,3 +79,35 @@ function typeText(type) {
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
:deep(.pool-extract-dialog) {
|
||||
max-width: 420px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
:deep(.pool-extract-dialog) {
|
||||
width: calc(100vw - 24px) !important;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
:deep(.pool-extract-dialog .el-dialog__body) {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
:deep(.pool-extract-dialog .el-form-item__label) {
|
||||
width: 74px !important;
|
||||
}
|
||||
|
||||
:deep(.pool-extract-dialog .el-dialog__footer .el-button) {
|
||||
width: calc(50% - 6px);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
:deep(.pool-extract-dialog .el-dialog__footer) {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
padding: 8px 12px 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user