|
|
|
|
@ -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">
|
|
|
|
|
|