chengkun
2025-09-15 17e42d4e0fa95c7af0173be4ef4768eeb6090d5f
app/admin/view/blog/index.html
@@ -25,30 +25,34 @@
                    <el-card>
                        <template #header>
                            <div class="card-header">
                                <span>文章列表</span>
                                <span>文章列表({{listCount}})</span>
                                &emsp;
                                <el-link href="/admin/blog/add.html" type="primary" class="header_add_btn" icon="CirclePlusFilled" :underline="false">添加</el-link>
                            </div>
                        </template>
                        <el-table :data="list" :tree-props="{children: 'children'}" row-key="id" default-expand-all border style="width: 100%" ref="tableRef">
                        <el-table :data="blogList" :tree-props="{children: 'children'}" row-key="id" default-expand-all border style="width: 100%" ref="tableRef">
                            <el-table-column label="名称" prop="title"></el-table-column>
                            <!-- <el-table-column label="菜单索引" prop="menu_index"></el-table-column> -->
                            <el-table-column label="添加时间" prop="create_time" width="150">
                                <template #default="scope">
                                   {{formatDate(scope.row['create_time'])}}
                                    {{formatDate(scope.row['create_time'])}}
                                </template>
                            </el-table-column>
                            <el-table-column label="状态" width="150" align="center">
                                <template #default="scope">
                                    <el-switch v-model="scope.row.show_menu" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ccc" :active-value="1" :inactive-value="0" inline-prompt active-text="发布" inactive-text="下架" @change="updateShowMenu(scope.row)" />
                                    <el-switch v-model="scope.row.status" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ccc" :active-value="1" :inactive-value="0" inline-prompt active-text="发布" inactive-text="未发布" @change="changeBlogStatus(scope.row.id)" />
                                </template>
                            </el-table-column>
                            <el-table-column label="操作选项" fixed="right" width="150" :align="alignValue(200)">
                                <template #default="scope">
                                    <el-button icon="edit" type="primary" @click="Edit(scope.row)"></el-button>
                                    <el-button icon="edit" type="primary" @click="editBlog(scope.row.id)" circle></el-button>
                                    <el-button icon="Delete" type="danger" @click="deleteBlog(scope.row.id)" circle></el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                        <div style="text-align: right;margin-top: 15px">
                            <el-pagination background @current-change="getBlogList" layout="prev, pager, next" :page-size="searchForm.limit" hide-on-single-page="true" :total="listCount"></el-pagination>
                        </div>
                    </el-card>
                </el-main>
                <el-footer></el-footer>