Files
yes.blog/Yes.Blog/Areas/Admin/Pages/Category/Index.cshtml
2025-04-30 09:51:36 +08:00

112 lines
2.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@page
@model Yes.Blog.Areas.Admin.Pages.Category.IndexModel
@{
}
<template x-data x-if="$store.errorMessage">
<div class="alert alert-danger" x-show="$store.errorMessage" x-transition x-text="$store.errorMessage"></div>
</template>
<div class="header">
<h1 class="page-title">
文章分类
<a class="btn btn-default btn-xs" asp-page="./Add">
<i class="fa fa-plus"></i> 添加分类
</a>
</h1>
<ul class="breadcrumb">
<li>
<a asp-page="/Index">管理中心</a>
</li>
<li class="active">文章分类</li>
</ul>
</div>
<div class="main-content" x-data="data">
<table class="table">
<thead>
<tr>
<th>编号</th>
<th>分类名</th>
<th>缩略名</th>
<th>排序</th>
<th style="width: 65px;"></th>
</tr>
</thead>
<tbody>
<template x-for="(item,index) in items" :key="index">
<tr>
<td x-text="item.id"></td>
<td x-text="item.name"></td>
<td x-text="item.slug"></td>
<td x-text="item.sort"></td>
<td>
<a :href="`category/detail?id=${item.id}`">
<i class="fa fa-pencil"></i>
</a>
<a href="javascript:;" role="button" x-on:click="showModal = true;deleteId=item.id;">
<i class="fa fa-trash-o"></i>
</a>
</td>
</tr>
</template>
<template x-if="items.length==0 && !loading">
<tr>
<td align="center" colspan="10">还没有任何分类!</td>
</tr>
</template>
<template x-if="loading">
<tr>
<td colspan="10" style="text-align:center;">
<div class="loading-container">
<div class="loading"></div>
</div>
</td>
</tr>
</template>
</tbody>
</table>
<div x-show.transition.opacity="showModal" class="modal fade in" id="myModal" tabindex="-1" x-cloak>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button x-on:click="showModal = false" type="button" class="close" data-dismiss="modal">×</button>
<h3 id="myModalLabel">删除操作确认</h3>
</div>
<div class="modal-body">
<p class="error-text">
<i class="fa fa-warning modal-icon"></i>确认要删除这个分类吗?
<br>操作后不可恢复.
</p>
</div>
<div class="modal-footer">
<button x-on:click="showModal = false" class="btn btn-default" data-dismiss="modal">取消</button>
<button x-on:click="showModal = false; confirmAction()" class="btn btn-danger" data-dismiss="modal">确认</button>
</div>
</div>
</div>
</div>
<partial name="_Footer" />
</div>
@section Scripts {
<script src="~/admin/js/category/index.js" asp-append-version="true"></script>
}