|
|
@ -89,7 +89,7 @@ |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
|
<template #footer> |
|
|
|
<div class="dialog-footer"> |
|
|
|
<div class="dialog-footer"> |
|
|
|
<el-button @click="aboutContent" type="success" style="margin-right: 30px;font-size: 15px" plain>关于我们</el-button> |
|
|
|
<el-link href="" target="_blank" style="margin-right: 30px;font-size: 19px">关于我们</el-link> |
|
|
|
<el-button type="primary" @click="addNewsContentConfirm"> |
|
|
|
<el-button type="primary" @click="addNewsContentConfirm"> |
|
|
|
提交 |
|
|
|
提交 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
@ -202,19 +202,6 @@ |
|
|
|
</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"> |
|
|
@ -226,8 +213,7 @@ 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' |
|
|
@ -240,7 +226,6 @@ 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([]) |
|
|
|
//存取文章列表信息 |
|
|
|
//存取文章列表信息 |
|
|
@ -256,7 +241,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({ |
|
|
@ -327,7 +312,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,'查询新闻') |
|
|
|
console.log(essay.value,'essay') |
|
|
|
} |
|
|
|
} |
|
|
|
//新闻删除 |
|
|
|
//新闻删除 |
|
|
|
const deleteNewsList = async (id)=>{ |
|
|
|
const deleteNewsList = async (id)=>{ |
|
|
@ -398,26 +383,6 @@ 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> |
|
|
@ -531,6 +496,7 @@ const editConfirm =async ()=>{ |
|
|
|
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; /* 文本居中 */ |
|
|
@ -538,6 +504,6 @@ const editConfirm =async ()=>{ |
|
|
|
} |
|
|
|
} |
|
|
|
.dialog-footer{ |
|
|
|
.dialog-footer{ |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
justify-content: flex-end; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |