完善测试建表并统一前端格式
This commit is contained in:
@@ -37,7 +37,12 @@ import { useAdminSessionStore } from '@/stores/adminSession'
|
||||
const adminSession = useAdminSessionStore()
|
||||
const loading = ref(false)
|
||||
const qrcodes = ref<ChatQrCode[]>([])
|
||||
const stats = ref<QrCodeStats>({ unused_count: 0, used_count: 0, disabled_count: 0, total_count: 0 })
|
||||
const stats = ref<QrCodeStats>({
|
||||
unused_count: 0,
|
||||
used_count: 0,
|
||||
disabled_count: 0,
|
||||
total_count: 0,
|
||||
})
|
||||
const canManageQrCodes = computed(() => adminSession.hasPermission('qrcode:manage'))
|
||||
|
||||
const currentPage = ref(1)
|
||||
@@ -136,7 +141,9 @@ const editStatusOptions = computed(() =>
|
||||
const maxBatchUploadCount = 20
|
||||
const uploading = computed(() => uploadPendingCount.value > 0)
|
||||
const uploadBusy = computed(() => uploading.value || uploadSaving.value)
|
||||
const uploadedImageCountText = computed(() => `${uploadedImages.value.length}/${maxBatchUploadCount}`)
|
||||
const uploadedImageCountText = computed(
|
||||
() => `${uploadedImages.value.length}/${maxBatchUploadCount}`
|
||||
)
|
||||
const renameLoadingIds = ref(new Set<number>())
|
||||
const selectedRows = ref<ChatQrCode[]>([])
|
||||
const selectedCount = computed(() => selectedRows.value.length)
|
||||
@@ -228,7 +235,12 @@ function parseGroupNameFromOcrText(text: string) {
|
||||
return !excludedPatterns.some(pattern => pattern.test(line))
|
||||
})
|
||||
|
||||
return candidates.find(line => line.includes('群')) || candidates.find(line => /[-—]/.test(line)) || candidates[0] || ''
|
||||
return (
|
||||
candidates.find(line => line.includes('群')) ||
|
||||
candidates.find(line => /[-—]/.test(line)) ||
|
||||
candidates[0] ||
|
||||
''
|
||||
)
|
||||
}
|
||||
|
||||
const ocrConcurrencyLimit = 4
|
||||
@@ -333,10 +345,6 @@ async function handleFileUpload(options: { file: File }) {
|
||||
}
|
||||
}
|
||||
|
||||
function imagePreviewSources() {
|
||||
return uploadedImages.value.map(item => item.url).filter(Boolean)
|
||||
}
|
||||
|
||||
function removeImage(index: number) {
|
||||
const [removed] = uploadedImages.value.splice(index, 1)
|
||||
if (removed?.previewUrl) {
|
||||
@@ -377,9 +385,7 @@ async function submitUpload() {
|
||||
}
|
||||
uploadSaving.value = true
|
||||
try {
|
||||
const expiresAt = uploadForm.expires_at
|
||||
? new Date(uploadForm.expires_at).toISOString()
|
||||
: null
|
||||
const expiresAt = uploadForm.expires_at ? new Date(uploadForm.expires_at).toISOString() : null
|
||||
const items: CreateQrCodePayload[] = uploadedImages.value.map(img => ({
|
||||
image_url: img.url,
|
||||
group_name: img.groupName,
|
||||
@@ -832,12 +838,7 @@ onMounted(reloadAll)
|
||||
:image-style="{ width: '52px', height: '52px', borderRadius: '6px' }"
|
||||
:preview-src-list="[img.url]"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
class="uploaded-local-preview"
|
||||
:src="img.previewUrl"
|
||||
alt=""
|
||||
/>
|
||||
<img v-else class="uploaded-local-preview" :src="img.previewUrl" alt="" />
|
||||
<button
|
||||
class="uploaded-remove"
|
||||
type="button"
|
||||
@@ -872,7 +873,11 @@ onMounted(reloadAll)
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="uploadForm.note" placeholder="如:7月企微群A(统一备注,适用于同一批次)" maxlength="50" />
|
||||
<el-input
|
||||
v-model="uploadForm.note"
|
||||
placeholder="如:7月企微群A(统一备注,适用于同一批次)"
|
||||
maxlength="50"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="过期时间">
|
||||
<el-date-picker
|
||||
@@ -932,10 +937,20 @@ onMounted(reloadAll)
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="群名">
|
||||
<el-input v-model="editForm.group_name" placeholder="企业微信群名" maxlength="64" clearable />
|
||||
<el-input
|
||||
v-model="editForm.group_name"
|
||||
placeholder="企业微信群名"
|
||||
maxlength="64"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="企微改名">
|
||||
<el-switch v-model="editForm.wecom_renamed" inline-prompt active-text="已改" inactive-text="未改" />
|
||||
<el-switch
|
||||
v-model="editForm.wecom_renamed"
|
||||
inline-prompt
|
||||
active-text="已改"
|
||||
inactive-text="未改"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="editForm.note" placeholder="如:7月企微群A" maxlength="50" />
|
||||
|
||||
Reference in New Issue
Block a user