|
@@ -1,9 +1,20 @@
|
|
|
<template>
|
|
<template>
|
|
|
<PagingTable url="/ocrRecord/favorite" :query="query" ref="table">
|
|
<PagingTable url="/ocrRecord/favorite" :query="query" ref="table">
|
|
|
<template #filter>
|
|
<template #filter>
|
|
|
- <ElInput
|
|
|
|
|
|
|
+ <ElSelect
|
|
|
|
|
+ v-if="isAdmin"
|
|
|
class="!w-52"
|
|
class="!w-52"
|
|
|
- placeholder="请输入"
|
|
|
|
|
|
|
+ v-model="query.channel"
|
|
|
|
|
+ placeholder="请选择渠道"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @change="table.refresh(true)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <ElOption label="全部渠道" value="" />
|
|
|
|
|
+ <ElOption v-for="item in channelOptions" :key="item" :label="item" :value="item" />
|
|
|
|
|
+ </ElSelect>
|
|
|
|
|
+ <ElInput
|
|
|
|
|
+ class="!w-52 ml-2"
|
|
|
|
|
+ placeholder="请输入设备号"
|
|
|
clearable
|
|
clearable
|
|
|
v-model="query.deviceId"
|
|
v-model="query.deviceId"
|
|
|
@keyup.enter="table.refresh(true)"
|
|
@keyup.enter="table.refresh(true)"
|
|
@@ -12,6 +23,7 @@
|
|
|
<ElButton :icon="Search" @click="table.refresh(true)" />
|
|
<ElButton :icon="Search" @click="table.refresh(true)" />
|
|
|
</template>
|
|
</template>
|
|
|
</ElInput>
|
|
</ElInput>
|
|
|
|
|
+ <ElButton :icon="Refresh" @click="table.refresh(true)" circle />
|
|
|
</template>
|
|
</template>
|
|
|
<ElTableColumn prop="id" label="#" width="80" />
|
|
<ElTableColumn prop="id" label="#" width="80" />
|
|
|
<ElTableColumn prop="channel" label="渠道" width="150" />
|
|
<ElTableColumn prop="channel" label="渠道" width="150" />
|
|
@@ -54,57 +66,32 @@
|
|
|
|
|
|
|
|
<ElTableColumn label="详细" align="center">
|
|
<ElTableColumn label="详细" align="center">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <div style="display: flex; justify-content: center; align-items: center; width: 100%">
|
|
|
|
|
- <div v-if="row.detail" style="text-align: center">
|
|
|
|
|
- <div v-for="(value, key) in JSON.parse(row.detail)" :key="key">
|
|
|
|
|
- <strong
|
|
|
|
|
- style="
|
|
|
|
|
- margin-left: 3px;
|
|
|
|
|
- background-color: #f56c6c;
|
|
|
|
|
- padding: 2px 4px;
|
|
|
|
|
- border-radius: 5px;
|
|
|
|
|
- flex-grow: 1;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- white-space: nowrap;
|
|
|
|
|
- "
|
|
|
|
|
- >{{ key }}</strong
|
|
|
|
|
- >
|
|
|
|
|
- <span
|
|
|
|
|
- style="
|
|
|
|
|
- background-color: #e0f7fa;
|
|
|
|
|
- color: #00796b;
|
|
|
|
|
- padding: 5px 10px;
|
|
|
|
|
- border-radius: 5px;
|
|
|
|
|
- white-space: nowrap;
|
|
|
|
|
- margin-left: 3px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- "
|
|
|
|
|
- @click="copyText(value.address)"
|
|
|
|
|
- :title="'点击复制地址: ' + value.address"
|
|
|
|
|
- >{{ value.address }}</span
|
|
|
|
|
- >
|
|
|
|
|
- <span
|
|
|
|
|
- style="
|
|
|
|
|
- background-color: #f1f8e9;
|
|
|
|
|
- color: #388e3c;
|
|
|
|
|
- padding: 5px 10px;
|
|
|
|
|
- border-radius: 5px;
|
|
|
|
|
- white-space: nowrap;
|
|
|
|
|
- margin-left: 3px;
|
|
|
|
|
- "
|
|
|
|
|
- >{{ value.balance }}</span
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <div class="detail-container">
|
|
|
|
|
+ <div v-if="row.detail" class="detail-content">
|
|
|
|
|
+ <div class="detail-item">
|
|
|
|
|
+ <div class="detail-left">
|
|
|
|
|
+ <div v-for="(value, key) in JSON.parse(row.detail)" :key="key" class="detail-row">
|
|
|
|
|
+ <strong class="detail-key">{{ key }}</strong>
|
|
|
|
|
+ <span
|
|
|
|
|
+ class="detail-address"
|
|
|
|
|
+ @click="copyText(value.address)"
|
|
|
|
|
+ :title="'点击复制地址: ' + value.address"
|
|
|
|
|
+ >{{ value.address }}</span
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="detail-balance">{{ value.balance }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="detail-right">
|
|
|
|
|
+ <ElButton
|
|
|
|
|
+ :icon="Refresh"
|
|
|
|
|
+ :loading="row._loading"
|
|
|
|
|
+ circle
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @click="updateDetail(row)"
|
|
|
|
|
+ ></ElButton>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div style="margin-left: 20px">
|
|
|
|
|
- <ElButton
|
|
|
|
|
- :icon="Refresh"
|
|
|
|
|
- :loading="row._loading"
|
|
|
|
|
- circle
|
|
|
|
|
- size="small"
|
|
|
|
|
- @click="updateDetail(row)"
|
|
|
|
|
- ></ElButton>
|
|
|
|
|
- </div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</ElTableColumn>
|
|
</ElTableColumn>
|
|
@@ -152,7 +139,7 @@
|
|
|
</EditDialog>
|
|
</EditDialog>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { inject, ref } from 'vue'
|
|
|
|
|
|
|
+import { inject, ref, onMounted } from 'vue'
|
|
|
import PagingTable from '@/components/PagingTable.vue'
|
|
import PagingTable from '@/components/PagingTable.vue'
|
|
|
import { useTimeFormatter } from '@/utils/formatter'
|
|
import { useTimeFormatter } from '@/utils/formatter'
|
|
|
import { Check, Edit, Plus, Search, Refresh, Star, StarOff, Heart, HeartBroken, DropletFilled } from '@vicons/tabler'
|
|
import { Check, Edit, Plus, Search, Refresh, Star, StarOff, Heart, HeartBroken, DropletFilled } from '@vicons/tabler'
|
|
@@ -169,6 +156,16 @@ const model = ref({})
|
|
|
const { showEditDialog } = setupEditDialog(model)
|
|
const { showEditDialog } = setupEditDialog(model)
|
|
|
const { copy } = useClipboard({ legacy: true })
|
|
const { copy } = useClipboard({ legacy: true })
|
|
|
const isAdmin = inject('isAdminAndOperator')
|
|
const isAdmin = inject('isAdminAndOperator')
|
|
|
|
|
+const channelOptions = ref([])
|
|
|
|
|
+
|
|
|
|
|
+onMounted(async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const response = await http.post('/ocrChannel/names')
|
|
|
|
|
+ channelOptions.value = response.data || []
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('获取渠道列表失败:', error)
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
function formatRecord(record) {
|
|
function formatRecord(record) {
|
|
|
return record
|
|
return record
|
|
@@ -264,3 +261,104 @@ async function handleFavoriteClick(row) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+.detail-container {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-content {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-item {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-left {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ gap: 4px;
|
|
|
|
|
+ padding-right: 8px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-row {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 4px;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-right {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ margin-top: 24px; /* 调整这个值来对齐第二行 */
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-key {
|
|
|
|
|
+ background-color: #f56c6c;
|
|
|
|
|
+ padding: 2px 4px;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-address {
|
|
|
|
|
+ background-color: #e0f7fa;
|
|
|
|
|
+ color: #00796b;
|
|
|
|
|
+ padding: 2px 4px;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-balance {
|
|
|
|
|
+ background-color: #f1f8e9;
|
|
|
|
|
+ color: #388e3c;
|
|
|
|
|
+ padding: 2px 4px;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+@media (max-width: 768px) {
|
|
|
|
|
+ .detail-item {
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .detail-left {
|
|
|
|
|
+ padding-right: 0;
|
|
|
|
|
+ margin-bottom: 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .detail-row {
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ gap: 4px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .detail-key,
|
|
|
|
|
+ .detail-address,
|
|
|
|
|
+ .detail-balance {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .detail-right {
|
|
|
|
|
+ margin-top: 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|