master
lion 1 month ago
parent 38d3442a8f
commit d0fbe268ef

@ -9,7 +9,7 @@ import { useUnsavedChangesGuard } from '../../composables/useUnsavedChangesGuard
import { listTableRowIndex } from '../../utils/listTableRowIndex'
/** 主列表列宽约 1174px勿用全局 3220 撑宽列 */
const ACTIVITY_LIST_SCROLL_X = 1520
const ACTIVITY_LIST_SCROLL_X = 1570
type Venue = {
id: number
@ -1056,6 +1056,12 @@ async function removeActivity(row: Activity) {
>
<a-option v-for="v in venues" :key="v.id" :value="v.id">{{ v.name }}</a-option>
</a-select>
<a-select v-model="filters.reservation_type" allow-clear placeholder="报名方式" style="width: 140px">
<a-option value="phone">电话预约</a-option>
<a-option value="wechat_mp">公众号预约</a-option>
<a-option value="offline_visit">线下预约</a-option>
<a-option value="none">无需预约</a-option>
</a-select>
<a-select v-model="filters.is_active" allow-clear placeholder="上架状态" style="width: 130px">
<a-option value="1">上架</a-option>
<a-option value="0">下架</a-option>
@ -1065,12 +1071,6 @@ async function removeActivity(row: Activity) {
<a-option value="ongoing">进行中</a-option>
<a-option value="ended">已结束</a-option>
</a-select>
<a-select v-model="filters.reservation_type" allow-clear placeholder="报名方式" style="width: 140px">
<a-option value="phone">电话预约</a-option>
<a-option value="wechat_mp">公众号预约</a-option>
<a-option value="offline_visit">线下预约</a-option>
<a-option value="none">无需预约</a-option>
</a-select>
<a-select v-model="filters.audit_status" allow-clear placeholder="审核状态" style="width: 130px">
<a-option value="approved">已通过</a-option>
<a-option value="pending">待审核</a-option>
@ -1103,7 +1103,7 @@ async function removeActivity(row: Activity) {
:ellipsis="true"
:tooltip="true"
/>
<a-table-column title="活动日期" :width="200" :min-width="160" :ellipsis="true" :tooltip="true">
<a-table-column title="活动日期" :width="240" :min-width="200" :ellipsis="true" :tooltip="true">
<template #cell="{ record }">{{ formatActivityTableDateRange(record as Activity) }}</template>
</a-table-column>
<a-table-column title="场馆" :width="180" :min-width="120" :ellipsis="true" :tooltip="true">
@ -1144,7 +1144,7 @@ async function removeActivity(row: Activity) {
/>
</template>
</a-table-column>
<a-table-column title="操作" :width="340" :min-width="320" fixed="right" align="left">
<a-table-column title="操作" :width="320" :min-width="300" fixed="right" align="left">
<template #cell="{ record }">
<a-space wrap :size="4" justify="start">
<a-button type="text" @click="openEdit(record)"></a-button>

@ -9,7 +9,7 @@ import { listTableRowIndex } from '../../utils/listTableRowIndex'
import { resolvePublicMediaUrl } from '../../utils/mediaUrl'
/** 与本表列宽匹配;勿用全局 LIST_TABLE_SCROLL_X(3220),否则列会被撑宽 */
const TICKET_GRAB_LIST_SCROLL_X = 1540
const TICKET_GRAB_LIST_SCROLL_X = 1418
type GalleryItem = { type: 'image' | 'video'; url: string }
@ -1191,14 +1191,7 @@ onMounted(async () => {
<a-tag :color="record.is_active ? 'green' : 'gray'">{{ record.is_active ? '上架' : '下架' }}</a-tag>
</template>
</a-table-column>
<a-table-column title="审核" :width="72">
<template #cell="{ record }">
<a-tag v-if="record.audit_status === 'pending'" color="orangered"></a-tag>
<a-tag v-else-if="record.audit_status === 'rejected'" color="red">驳回</a-tag>
<a-tag v-else color="green">通过</a-tag>
</template>
</a-table-column>
<a-table-column title="操作" :width="348" :min-width="320" fixed="right" align="left">
<a-table-column title="操作" :width="298" :min-width="270" fixed="right" align="left">
<template #cell="{ record }">
<a-space :size="2" class="tg-list-actions" align="start">
<a-button type="text" size="small" @click="openEdit(record)"></a-button>

@ -1,14 +1,13 @@
<script setup lang="ts">
import { nextTick, onMounted, reactive, ref } from 'vue'
import { useRoute } from 'vue-router'
import { Message } from '@arco-design/web-vue'
import { http } from '../../api/http'
import RichEditorField from '../../components/RichEditorField.vue'
import { listTableRowIndex } from '../../utils/listTableRowIndex'
import { resolvePublicMediaUrl } from '../../utils/mediaUrl'
/** 主列表列宽约 1950px */
const VENUE_LIST_SCROLL_X = 2230
/** 主列表横向滚动宽度(与各列宽之和大致对齐) */
const VENUE_LIST_SCROLL_X = 2110
type DictItem = {
id: number
@ -82,8 +81,6 @@ const pickedPoint = ref<{ lat: number; lng: number; address: string } | null>(nu
const DEFAULT_CENTER = { lat: 31.299379, lng: 120.585315 } //
const modalBodyStyle = { maxHeight: '70vh', overflow: 'auto' }
const route = useRoute()
//
const formErrors = reactive<Record<string, string>>({
name: '',
@ -124,7 +121,6 @@ const filters = reactive({
/** 预约方式富文本是否已填写all=不限 */
is_active: '' as '' | '1' | '0',
is_included_in_stats: '' as '' | '1' | '0',
audit_status: '' as '' | 'approved' | 'pending' | 'rejected',
})
const pagination = reactive({
@ -248,20 +244,6 @@ function isSuperAdmin() {
return currentUser.value?.full_admin_access === true
}
function auditStatusLabel(s?: string | null) {
if (s === 'pending') return '待审核'
if (s === 'rejected') return '已退回'
if (s === 'approved') return '已通过'
return '-'
}
function auditStatusColor(s?: string | null) {
if (s === 'pending') return 'orangered'
if (s === 'rejected') return 'red'
if (s === 'approved') return 'green'
return 'gray'
}
async function approveVenue(row: Venue) {
try {
await http.post(`/venues/${row.id}/audit/approve`)
@ -405,7 +387,6 @@ async function loadRows() {
appointment_type: filters.appointment_type || undefined,
is_active: filters.is_active || undefined,
is_included_in_stats: filters.is_included_in_stats || undefined,
audit_status: filters.audit_status || undefined,
},
})
rows.value = data
@ -906,11 +887,6 @@ async function onBeforeOk() {
onMounted(async () => {
await loadMe()
const q = route.query.audit_status
const audit = Array.isArray(q) ? q[0] : q
if (audit === 'pending' || audit === 'approved' || audit === 'rejected') {
filters.audit_status = audit
}
await Promise.all([
loadRows(),
loadDistricts(),
@ -951,11 +927,6 @@ onMounted(async () => {
<a-option value="1">上架</a-option>
<a-option value="0">下架</a-option>
</a-select>
<a-select v-model="filters.audit_status" allow-clear placeholder="审核状态" style="width: 130px">
<a-option value="approved">已通过</a-option>
<a-option value="pending">待审核</a-option>
<a-option value="rejected">已退回</a-option>
</a-select>
<a-button type="primary" @click="onSearch"></a-button>
<a-button type="primary" @click="openCreate"></a-button>
<!-- <a-button v-if="isSuperAdmin()" @click="exportVenues"></a-button> -->
@ -1021,14 +992,6 @@ onMounted(async () => {
<a-tag :color="record.is_active ? 'green' : 'gray'">{{ record.is_active ? '上架' : '下架' }}</a-tag>
</template>
</a-table-column>
<a-table-column title="审核状态" :width="120">
<template #cell="{ record }">
<a-tooltip v-if="record.audit_status === 'rejected' && record.audit_remark" :content="record.audit_remark">
<a-tag :color="auditStatusColor(record.audit_status)">{{ auditStatusLabel(record.audit_status) }}</a-tag>
</a-tooltip>
<a-tag v-else :color="auditStatusColor(record.audit_status)">{{ auditStatusLabel(record.audit_status) }}</a-tag>
</template>
</a-table-column>
<a-table-column title="操作" :width="220" fixed="right" align="left">
<template #cell="{ record }">
<a-space wrap justify="start">

Loading…
Cancel
Save