提交代码

This commit is contained in:
wangchengming 2025-07-20 21:07:45 +08:00
parent ddabca2542
commit 1928ad7e58
3 changed files with 32 additions and 12 deletions

View File

@ -9,11 +9,11 @@
</div>
<!-- 组织架构图 -->
<div class="organization-list" v-loading="loading">
<div class="organization-list" v-loading="loading" v-if="tableData.length > 0">
<div class="organization-item" v-for="item in tableData">
<div class="fileContainer">
<img :src="baseUrl + item.organPic" />
<div class="optionBtns">
<div class="optionBtns" v-hasPermi="['databaseLibary:edit']">
<el-button type="primary" class="editIconBtn" v-hasPermi="['databaseLibary:edit']"
@click="handleEdit(item.id)">
<img :src="editIcon" class="editIconBtnicon" />
@ -29,11 +29,13 @@
</div>
<!-- 加载更多按钮 -->
<div class="moreoptionBtn">
<div class="moreoptionBtn" v-if="tableData.length > 0">
<el-button class="moreBtn" @click="handleLoadMore">
加载更多
</el-button>
</div>
<el-empty :image-size="200" v-if="tableData.length == 0" />
</div>
</template>
<script setup>
@ -63,10 +65,9 @@ const getBusEncyclopediaDatabasePageList = () => {
getBusEncyclopediaDatabasePage(queryParams.value).then(res => {
console.log('查询结果', res)
if (res.code == 200) {
if (res.data.list.length > 0) tableData.value = res.data.list
else {
tableData.value = res.data.list
if(queryParams.value.pageIndex > 1) queryParams.value.pageIndex = queryParams.value.pageIndex - 1
if (res.data.list.length > 0) tableData.value = tableData.value.concat(res.data.list)
else {
if (queryParams.value.pageIndex > 1) queryParams.value.pageIndex = queryParams.value.pageIndex - 1
proxy.$modal.msgSuccess("没有更多了")
}
}
@ -100,6 +101,7 @@ const handleEdit = (recordId) => {
//
defineExpose({
queryParams,
tableData,
getBusEncyclopediaDatabasePageList
})
</script>
@ -131,13 +133,14 @@ defineExpose({
.organization-container {
background: #ffffff;
border-radius: 6px;
}
.organization-list {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin: 20px;
padding: 20px;
}
.organization-item {

View File

@ -19,7 +19,7 @@
<div class="document-content" v-html="item.mainText"></div>
<div class="document-footer">
<span class="publish-date">发布于{{ item.createTime }}</span>
<div class="publish-btns">
<div class="publish-btns" v-hasPermi="['databaseLibary:edit']">
<el-button type="primary" class="editIconBtn" v-hasPermi="['databaseLibary:edit']" @click="handleEdit(item.id)">
<img :src="editIcon" class="editIconBtnicon" />
</el-button>
@ -65,9 +65,8 @@ const getBusEncyclopediaDatabasePageList = () => {
getBusEncyclopediaDatabasePage(queryParams.value).then(res => {
console.log('查询结果', res)
if (res.code == 200) {
if (res.data.list.length > 0) tableData.value = res.data.list
else {
tableData.value = res.data.list
if (res.data.list.length > 0) tableData.value = tableData.value.concat(res.data.list)
else {
if(queryParams.value.pageIndex > 1) queryParams.value.pageIndex = queryParams.value.pageIndex - 1
proxy.$modal.msgSuccess("没有更多了")
}
@ -106,6 +105,7 @@ const handleViewDetail = (recordId) => {
//
defineExpose({
queryParams,
tableData,
getBusEncyclopediaDatabasePageList
})
</script>

View File

@ -112,6 +112,11 @@ onMounted(() => {
getLast10Years();
getBusDependencyData();
nextTick(() => {
fileListRef.value.queryParams.category = activeOne.value == '全部' ? undefined : activeOne.value
fileListRef.value.queryParams.categoryTwo = activeTwo.value == '全部' ? undefined : activeTwo.value
fileListRef.value.queryParams.keyword = keyWord.value
fileListRef.value.queryParams.pageIndex = 1
fileListRef.value.tableData = []
fileListRef.value.getBusEncyclopediaDatabasePageList();
});
});
@ -155,6 +160,8 @@ const handleChoseOneType = (_type) => {
fileCardRef.value.queryParams.category = _type == '全部' ? undefined : _type
fileCardRef.value.queryParams.categoryTwo = undefined
fileCardRef.value.queryParams.keyword = undefined
fileCardRef.value.queryParams.pageIndex = 1
fileCardRef.value.tableData = []
fileCardRef.value.getBusEncyclopediaDatabasePageList();
});
} else {
@ -165,6 +172,8 @@ const handleChoseOneType = (_type) => {
fileListRef.value.queryParams.category = _type == '全部' ? undefined : _type
fileListRef.value.queryParams.categoryTwo = undefined
fileListRef.value.queryParams.keyword = undefined
fileListRef.value.queryParams.pageIndex = 1
fileListRef.value.tableData = []
fileListRef.value.getBusEncyclopediaDatabasePageList();
});
}
@ -179,6 +188,8 @@ const handleChoseTwoType = (_type) => {
fileCardRef.value.queryParams.category = activeOne.value == '全部' ? undefined : activeOne.value
fileCardRef.value.queryParams.categoryTwo = _type == '全部' ? undefined : _type
fileCardRef.value.queryParams.keyword = undefined
fileCardRef.value.queryParams.pageIndex = 1
fileCardRef.value.tableData = []
fileCardRef.value.getBusEncyclopediaDatabasePageList();
});
}
@ -188,6 +199,8 @@ const handleChoseTwoType = (_type) => {
fileListRef.value.queryParams.category = activeOne.value == '全部' ? undefined : activeOne.value
fileListRef.value.queryParams.categoryTwo = _type == '全部' ? undefined : _type
fileListRef.value.queryParams.keyword = undefined
fileListRef.value.queryParams.pageIndex = 1
fileListRef.value.tableData = []
fileListRef.value.getBusEncyclopediaDatabasePageList();
});
}
@ -201,6 +214,8 @@ const handleBlur = (event) => {
fileCardRef.value.queryParams.category = activeOne.value == '全部' ? undefined : activeOne.value
fileCardRef.value.queryParams.categoryTwo = activeTwo.value == '全部' ? undefined : activeTwo.value
fileCardRef.value.queryParams.keyword = event.target.value
fileCardRef.value.queryParams.pageIndex = 1
fileCardRef.value.tableData = []
fileCardRef.value.getBusEncyclopediaDatabasePageList();
});
}
@ -210,6 +225,8 @@ const handleBlur = (event) => {
fileListRef.value.queryParams.category = activeOne.value == '全部' ? undefined : activeOne.value
fileListRef.value.queryParams.categoryTwo = activeTwo.value == '全部' ? undefined : activeTwo.value
fileListRef.value.queryParams.keyword = event.target.value
fileListRef.value.queryParams.pageIndex = 1
fileListRef.value.tableData = []
fileListRef.value.getBusEncyclopediaDatabasePageList();
});
}