|
@@ -20,14 +20,27 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" :icon="Search" @click="onSearchHandle">查询</el-button>
|
|
|
- <el-button type="primary" :icon="UploadFilled" @click="onAddEditorHandle()"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-hasPermi="['adm:notice:add']"
|
|
|
+ :icon="UploadFilled"
|
|
|
+ @click="onAddEditorHandle()"
|
|
|
>新增</el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="tableBox">
|
|
|
- <el-table :data="tableData" style="width: 100%">
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ style="width: 100%; height: 100%"
|
|
|
+ :style="{ height: tableHeight + 'px' }"
|
|
|
+ :header-cell-style="{
|
|
|
+ background: '#E5F0FB',
|
|
|
+ color: '#233755',
|
|
|
+ height: '50px'
|
|
|
+ }"
|
|
|
+ >
|
|
|
<el-table-column type="index" label="序号" width="100" />
|
|
|
<el-table-column prop="title" label="标题">
|
|
|
<template #default="scope">
|
|
@@ -46,17 +59,24 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="发布时间" prop="createTime" width="200" />
|
|
|
<el-table-column label="阅读次数" prop="readNum" width="100" />
|
|
|
- <el-table-column label="操作" width="180" align="left">
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ width="180"
|
|
|
+ align="left"
|
|
|
+ v-hasPermi="['adm:notice:edit', 'adm:notice:del']"
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
|
<div class="operationBox">
|
|
|
- <span @click="onAddEditorHandle(scope.row.id)">编辑</span>
|
|
|
+ <span @click="onAddEditorHandle(scope.row.id)" v-hasPermi="['adm:notice:edit']">
|
|
|
+ 编辑
|
|
|
+ </span>
|
|
|
<el-popconfirm
|
|
|
title="确定要删除该条数据?"
|
|
|
width="180px"
|
|
|
@confirm="deleteHandle(scope.row)"
|
|
|
>
|
|
|
<template #reference>
|
|
|
- <span>删除</span>
|
|
|
+ <span v-hasPermi="['adm:notice:del']">删除</span>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
</div>
|
|
@@ -107,7 +127,7 @@ const formData = ref<{
|
|
|
title: '',
|
|
|
readType: 2
|
|
|
})
|
|
|
-const queryArticleByPage = async (): Promise<void> => {
|
|
|
+const queryListByPage = async (): Promise<void> => {
|
|
|
const urlApi = `/adm/noticeAndLearn/query/page`
|
|
|
const sendData = {
|
|
|
pageNo: pageNo.value,
|
|
@@ -132,13 +152,13 @@ const deleteHandle = async (row): Promise<void> => {
|
|
|
message: '删除成功.',
|
|
|
type: 'success'
|
|
|
})
|
|
|
- queryArticleByPage()
|
|
|
+ queryListByPage()
|
|
|
}
|
|
|
}
|
|
|
-queryArticleByPage()
|
|
|
+queryListByPage()
|
|
|
const onSearchHandle = (): void => {
|
|
|
pageNo.value = 1
|
|
|
- queryArticleByPage()
|
|
|
+ queryListByPage()
|
|
|
}
|
|
|
const onAddEditorHandle = (idStr = null): void => {
|
|
|
if (idStr) {
|
|
@@ -158,23 +178,29 @@ const toLookDetail = (row: any): void => {
|
|
|
}
|
|
|
const handleCurrentChange = (page: number): void => {
|
|
|
pageNo.value = page
|
|
|
- queryArticleByPage()
|
|
|
+ queryListByPage()
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.newsSetting {
|
|
|
- margin-top: 20px;
|
|
|
- height: calc(100% - 20px);
|
|
|
+ height: 100%;
|
|
|
background-color: #fff;
|
|
|
border-radius: 20px;
|
|
|
padding: 20px;
|
|
|
position: relative;
|
|
|
- > .title {
|
|
|
- padding-bottom: 20px;
|
|
|
- font-size: 20px;
|
|
|
- }
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
> .tableBox {
|
|
|
+ width: 100%;
|
|
|
+ overflow-y: auto;
|
|
|
+ flex-grow: 1;
|
|
|
+ height: 0px;
|
|
|
+ }
|
|
|
+ > .pageBox {
|
|
|
+ padding-top: 15px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
}
|
|
|
:deep {
|
|
|
.el-table th.el-table__cell {
|
|
@@ -182,11 +208,6 @@ const handleCurrentChange = (page: number): void => {
|
|
|
color: #4c525b;
|
|
|
}
|
|
|
}
|
|
|
- > .pageBox {
|
|
|
- padding: 20px 0px 10px 0px;
|
|
|
- display: flex;
|
|
|
- justify-content: right;
|
|
|
- }
|
|
|
.line-primary {
|
|
|
text-decoration: none;
|
|
|
color: #4c525b;
|