|
|
@ -89,7 +89,7 @@ |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
|
<template #footer> |
|
|
|
<div class="dialog-footer"> |
|
|
|
<div class="dialog-footer"> |
|
|
|
<el-link href="" target="_blank" style="margin-right: 30px;font-size: 19px">关于我们</el-link> |
|
|
|
<el-button @click="aboutContent" type="success" style="margin-right: 30px;font-size: 15px" plain>关于我们</el-button> |
|
|
|
<el-button type="primary" @click="addNewsContentConfirm"> |
|
|
|
<el-button type="primary" @click="addNewsContentConfirm"> |
|
|
|
提交 |
|
|
|
提交 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
@ -202,6 +202,19 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-drawer> |
|
|
|
</el-drawer> |
|
|
|
|
|
|
|
<!-- 关于我们文章--> |
|
|
|
|
|
|
|
<el-drawer v-model="aboutContentDrawer" title="I am the title" :with-header="false"> |
|
|
|
|
|
|
|
<span>关于我们</span> |
|
|
|
|
|
|
|
<el-divider/> |
|
|
|
|
|
|
|
<el-form-item label="发布时间" label-width="100px"> |
|
|
|
|
|
|
|
<el-input v-model="aboutEssay.updateTime" autocomplete="off" readonly disabled/> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="文章内容" label-width="100px"> |
|
|
|
|
|
|
|
<textarea v-model="aboutEssay.content" style="width: 100%;height: 75vh"></textarea> |
|
|
|
|
|
|
|
<!-- <el-input class="brief_text" type="textarea" /> --> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-button @click="editConfirm" style="margin-left:45vh" type="primary" round>提交修改</el-button> |
|
|
|
|
|
|
|
</el-drawer> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
@ -213,7 +226,8 @@ import { |
|
|
|
editStatus, |
|
|
|
editStatus, |
|
|
|
queryEssay, |
|
|
|
queryEssay, |
|
|
|
deleteEssay, |
|
|
|
deleteEssay, |
|
|
|
editEssay |
|
|
|
editEssay, |
|
|
|
|
|
|
|
queryEssayById |
|
|
|
} from "@/api/user/news.js" |
|
|
|
} from "@/api/user/news.js" |
|
|
|
import {ref,onMounted} from 'vue'; |
|
|
|
import {ref,onMounted} from 'vue'; |
|
|
|
import {ElButton,ElDrawer, ElMessageBox, ElMessage} from 'element-plus' |
|
|
|
import {ElButton,ElDrawer, ElMessageBox, ElMessage} from 'element-plus' |
|
|
@ -226,6 +240,7 @@ const drawer = ref(false) |
|
|
|
const nowColumnId = ref() |
|
|
|
const nowColumnId = ref() |
|
|
|
const nowCategoryName = ref('') |
|
|
|
const nowCategoryName = ref('') |
|
|
|
const addFormVisible = ref(false) |
|
|
|
const addFormVisible = ref(false) |
|
|
|
|
|
|
|
const aboutContentDrawer = ref(false) |
|
|
|
//存取栏目信息 |
|
|
|
//存取栏目信息 |
|
|
|
const column =ref([]) |
|
|
|
const column =ref([]) |
|
|
|
//存取文章列表信息 |
|
|
|
//存取文章列表信息 |
|
|
@ -241,7 +256,7 @@ const nowTimeNewsData = ref({}) |
|
|
|
//新闻详细信息获取 |
|
|
|
//新闻详细信息获取 |
|
|
|
const newViews = (listObject)=> { |
|
|
|
const newViews = (listObject)=> { |
|
|
|
nowTimeNewsData.value = { ...listObject } |
|
|
|
nowTimeNewsData.value = { ...listObject } |
|
|
|
console.log(nowTimeNewsData,'当前新闻数据') |
|
|
|
// console.log(nowTimeNewsData,'当前新闻数据') |
|
|
|
} |
|
|
|
} |
|
|
|
//栏目 |
|
|
|
//栏目 |
|
|
|
const form = ref({ |
|
|
|
const form = ref({ |
|
|
@ -312,7 +327,7 @@ const EssayList = async (id)=>{ |
|
|
|
if (essay.value.length > 0) { |
|
|
|
if (essay.value.length > 0) { |
|
|
|
newViews(essay.value[0]); // 显示第一条新闻 |
|
|
|
newViews(essay.value[0]); // 显示第一条新闻 |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(essay.value,'essay') |
|
|
|
// console.log(essay.value,'查询新闻') |
|
|
|
} |
|
|
|
} |
|
|
|
//新闻删除 |
|
|
|
//新闻删除 |
|
|
|
const deleteNewsList = async (id)=>{ |
|
|
|
const deleteNewsList = async (id)=>{ |
|
|
@ -383,6 +398,26 @@ const addNewsContentConfirm = async (id)=>{ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//关于我们文章 |
|
|
|
|
|
|
|
const aboutEssay = ref('') |
|
|
|
|
|
|
|
const aboutContent = async (essay_id)=>{ |
|
|
|
|
|
|
|
aboutContentDrawer.value = true |
|
|
|
|
|
|
|
const responseEssay = await queryEssayById('1') |
|
|
|
|
|
|
|
aboutEssay.value = responseEssay.data |
|
|
|
|
|
|
|
console.log(aboutEssay.value,'关于我们文章') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//关于我们修改提交 |
|
|
|
|
|
|
|
const editConfirm =async ()=>{ |
|
|
|
|
|
|
|
await editEssay({ |
|
|
|
|
|
|
|
id:aboutEssay.value.id, |
|
|
|
|
|
|
|
content:aboutEssay.value.content |
|
|
|
|
|
|
|
}).then(()=>{ |
|
|
|
|
|
|
|
ElMessage({ |
|
|
|
|
|
|
|
message:'添加成功', |
|
|
|
|
|
|
|
type:'success' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
<style scoped> |
|
|
@ -496,7 +531,6 @@ const addNewsContentConfirm = async (id)=>{ |
|
|
|
justify-content: space-between; /* 主轴上平均分配剩余空间 */ |
|
|
|
justify-content: space-between; /* 主轴上平均分配剩余空间 */ |
|
|
|
align-items: center; /* 交叉轴上居中对齐 */ |
|
|
|
align-items: center; /* 交叉轴上居中对齐 */ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.card-header span { |
|
|
|
.card-header span { |
|
|
|
flex: 1; /* 使 span 占用可用空间,实现居中效果 */ |
|
|
|
flex: 1; /* 使 span 占用可用空间,实现居中效果 */ |
|
|
|
text-align: center; /* 文本居中 */ |
|
|
|
text-align: center; /* 文本居中 */ |
|
|
@ -504,6 +538,6 @@ const addNewsContentConfirm = async (id)=>{ |
|
|
|
} |
|
|
|
} |
|
|
|
.dialog-footer{ |
|
|
|
.dialog-footer{ |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: flex-end; |
|
|
|
justify-content: space-between; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |