数据结构优化
This commit is contained in:
@@ -17,6 +17,15 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex gap-3">
|
||||
<button
|
||||
v-if="isEditing"
|
||||
type="button"
|
||||
class="admin-btn-secondary"
|
||||
@click="openAccessLogModal"
|
||||
title="查看访问记录"
|
||||
>
|
||||
📊 访问记录
|
||||
</button>
|
||||
<button type="button" class="admin-btn-secondary" @click="handleCancel">
|
||||
取消
|
||||
</button>
|
||||
@@ -159,6 +168,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Access Log Modal -->
|
||||
<AccessLogModal
|
||||
v-if="isEditing"
|
||||
v-model:isOpen="isAccessLogModalOpen"
|
||||
:postId="route.params.id ? parseInt(route.params.id as string) : null"
|
||||
:postTitle="form.title || '文章'"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -172,6 +189,7 @@ import 'md-editor-v3/lib/style.css'
|
||||
import { useToast } from '../../composables/useToast'
|
||||
import { createPost, updatePost, fetchPost, fetchCategories, fetchColumns, fetchTags, Tag } from '../../services/api'
|
||||
import CustomSelect from '../../components/CustomSelect.vue'
|
||||
import AccessLogModal from '../../components/admin/AccessLogModal.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@@ -188,6 +206,12 @@ const isSubmitting = ref(false)
|
||||
const isEditing = computed(() => !!route.params.id)
|
||||
const errors = reactive<Record<string, string>>({})
|
||||
|
||||
// Access log modal state
|
||||
const isAccessLogModalOpen = ref(false)
|
||||
const openAccessLogModal = () => {
|
||||
isAccessLogModalOpen.value = true
|
||||
}
|
||||
|
||||
// Data sources
|
||||
const categories = ref<{value: number, label: string}[]>([])
|
||||
const columns = ref<{value: number, label: string}[]>([])
|
||||
|
||||
Reference in New Issue
Block a user