Compare commits
No commits in common. "dev" and "master" have entirely different histories.
@ -6,14 +6,7 @@ import { useRouterGuard } from './routerGuard/routerGuard'
|
|||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory('/'),
|
history: createWebHashHistory('/'),
|
||||||
routes: [...loginRoute, ...authRoute],
|
routes: [...loginRoute, ...authRoute]
|
||||||
scrollBehavior(to, from, savedPosition) {
|
|
||||||
if (savedPosition) {
|
|
||||||
return savedPosition
|
|
||||||
} else {
|
|
||||||
return { top: 0, behavior: 'smooth' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
useRouterGuard(router)
|
useRouterGuard(router)
|
||||||
|
|||||||
@ -23,15 +23,9 @@ const searchFromData = ref({
|
|||||||
timeRange: [],
|
timeRange: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
total: 0,
|
|
||||||
sort: 'desc'
|
sort: 'desc'
|
||||||
})
|
})
|
||||||
|
|
||||||
const onCurrentPageChange = (n) => {
|
|
||||||
searchFromData.value.page = n
|
|
||||||
getContentListData()
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSubmitSearch = () => {
|
const handleSubmitSearch = () => {
|
||||||
getContentListData()
|
getContentListData()
|
||||||
}
|
}
|
||||||
@ -44,7 +38,6 @@ const getContentListData = () => {
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 20200) {
|
if (res.code === 20200) {
|
||||||
blogList.value = res.data.list
|
blogList.value = res.data.list
|
||||||
searchFromData.value.total = res.data.total
|
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '获取内容列表失败',
|
message: '获取内容列表失败',
|
||||||
@ -227,9 +220,8 @@ const onEditorSubmit = (data) => {
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="searchFromData.title"
|
v-model="searchFromData.title"
|
||||||
placeholder="请输入标题"
|
placeholder="请输入标题"
|
||||||
style="width: 220px"
|
|
||||||
clearable
|
clearable
|
||||||
disabled
|
style="width: 220px"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="时间">
|
<el-form-item label="时间">
|
||||||
@ -242,11 +234,10 @@ const onEditorSubmit = (data) => {
|
|||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
clearable
|
clearable
|
||||||
disabled
|
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleSubmitSearch" disabled>搜索</el-button>
|
<el-button @click="handleSubmitSearch">搜索</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -255,7 +246,6 @@ const onEditorSubmit = (data) => {
|
|||||||
<el-table-column label="序号" type="index" align="center" width="90"></el-table-column>
|
<el-table-column label="序号" type="index" align="center" width="90"></el-table-column>
|
||||||
<el-table-column label="标题" prop="title" align="center" width="140"></el-table-column>
|
<el-table-column label="标题" prop="title" align="center" width="140"></el-table-column>
|
||||||
<el-table-column label="作者" prop="author" align="center" width="100"></el-table-column>
|
<el-table-column label="作者" prop="author" align="center" width="100"></el-table-column>
|
||||||
<el-table-column label="分类" prop="category" align="center" width="100"></el-table-column>
|
|
||||||
<el-table-column label="摘要" prop="summary" header-align="center"></el-table-column>
|
<el-table-column label="摘要" prop="summary" header-align="center"></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="发布日期"
|
label="发布日期"
|
||||||
@ -298,18 +288,6 @@ const onEditorSubmit = (data) => {
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<!-- 分页器 -->
|
|
||||||
<div class="list-pagination">
|
|
||||||
<el-pagination
|
|
||||||
layout="prev, pager, next"
|
|
||||||
prev-text="上一页"
|
|
||||||
next-text="下一页"
|
|
||||||
:page-size="searchFromData.size"
|
|
||||||
:current-page="searchFromData.page"
|
|
||||||
:total="searchFromData.total"
|
|
||||||
@update:current-page="onCurrentPageChange"
|
|
||||||
></el-pagination>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 编辑器dialog -->
|
<!-- 编辑器dialog -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
@ -335,11 +313,5 @@ const onEditorSubmit = (data) => {
|
|||||||
}
|
}
|
||||||
> .content-list {
|
> .content-list {
|
||||||
}
|
}
|
||||||
.list-pagination {
|
|
||||||
padding: 10px 40px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user