提交 3ed3e1bd authored 作者: coderBryanFu's avatar coderBryanFu

feat:更新数据资源库,系统整体更新

上级 8d534f1e
......@@ -117,13 +117,13 @@
</div>
</div>
</div>
<div class="data-main-box-main-content">
<div class="data-main-box-main-content" v-loading="loading" element-loading-text="数据加载中,请稍候...">
<el-table ref="tableRef" :data="tableData" row-key="id" @selection-change="handleSelectionChange"
@select="handleSelect" @select-all="handleSelectAll" style="width: 100%" :row-style="{ height: '52px' }">
<el-table-column type="selection" width="40" />
<el-table-column label="法案名称" width="455">
<template #default="scope">
<span class="title-item text-compact-bold" @click="handleClickToDetail(scope.row)">{{ scope.row.title
<span class="title-item text-compact-bold" @click="handleClickToDetail(scope.row)">{{ scope.row.originalTitle
}}</span>
</template>
</el-table-column>
......@@ -875,13 +875,14 @@ const fetchTableData = async () => {
activeChart.value = curDemensionItem.chartTypeList[0]
curChartData.value = curDemensionItem.data
})
loading.value = false
} catch (error) {
console.error(error);
} finally {
loading.value = false
}
// tableData.value = res.data
// total.value = res.total
// 数据加载后,回显已选中的行
nextTick(() => {
......@@ -897,12 +898,7 @@ const allData = ref([])
// 获取筛选条件下全部表格数据
const fetchAllData = async () => {
let statusParam = null
if (selectedStatus.value !== '全部阶段') {
statusParam = statusList.value.filter(item => {
return item.name === selectedStatus.value
})[0].id
}
loading.value = true
const params = {
page: 1,
size: 9999,
......@@ -927,7 +923,10 @@ const fetchAllData = async () => {
}
} catch (error) {
console.error(error);
ElMessage.error('加载全部数据出错!')
} finally {
loading.value = false
}
}
......@@ -1002,8 +1001,6 @@ const handleSelectAllChange = async () => {
if (totalNum.value > 10000) {
isShowAllDataMaxLengthTip.value = true
}
loading.value = true
await fetchAllData()
handleSelectAllPage()
allData.value.forEach(row => {
......@@ -1011,7 +1008,6 @@ const handleSelectAllChange = async () => {
selectedMap.value.set(row.id, row)
}
})
loading.value = false
} else {
handleClearAll()
}
......
......@@ -130,7 +130,8 @@
<el-table-column type="selection" width="40" />
<el-table-column label="政令名称" width="720">
<template #default="scope">
<span class="title-item text-compact-bold" @click="handleClickToDetail(scope.row)">{{ scope.row.originalTitle
<span class="title-item text-compact-bold" @click="handleClickToDetail(scope.row)">{{
scope.row.originalTitle
}}</span>
</template>
</el-table-column>
......@@ -727,8 +728,8 @@ const fetchTableData = async () => {
// keyword: '',
type: 2, // type 1= 法案 2= 政令 3 =智库 4=智库报告 5=实体清单【制裁记录】 6= 人物 7= 机构 8=新闻 9= 社媒
domains: selectedArea.value === '全部领域' ? null : [selectedArea.value],
proposedDateStart: customTime.value[0]?customTime.value[0]:null,
proposedDateEnd: customTime.value[1]?customTime.value[1]:null,
proposedDateStart: customTime.value[0] ? customTime.value[0] : null,
proposedDateEnd: customTime.value[1] ? customTime.value[1] : null,
organizationName: selectedIns.value === '全部机构' ? null : selectedIns.value,
decreeType: selectedDecreeType.value === '全部类型' ? null : selectedDecreeType.value,
isInvolveCn: isInvolveCn.value ? 'Y' : null,
......@@ -774,12 +775,14 @@ const fetchTableData = async () => {
activeChart.value = curDemensionItem.chartTypeList[0]
curChartData.value = curDemensionItem.data
})
loading.value = false
} catch (error) {
console.error(error);
} finally {
loading.value = false
}
// tableData.value = res.data
// total.value = res.total
// 数据加载后,回显已选中的行
nextTick(() => {
......@@ -963,7 +966,7 @@ const initParam = () => {
customTime.value = JSON.parse(route.query.selectedDate)
}
selectedIns.value = route.query.orgnizationName? route.query.orgnizationName : '全部机构'
selectedIns.value = route.query.orgnizationName ? route.query.orgnizationName : '全部机构'
isInvolveCn.value = route.query.isInvolveCn ? true : false
......@@ -1022,7 +1025,7 @@ const handleOrgClick = item => {
// 导出
const handleExport = () => {
if(!selectedCount.value) {
if (!selectedCount.value) {
ElMessage.warning('请选择至少一项数据!')
return
}
......@@ -1349,6 +1352,4 @@ onMounted(async () => {
// :deep(.el-table__header th:first-child) {
// background-color: #e6f7ff;
// color: #1890ff;
// }
</style>
\ No newline at end of file
// }</style>
\ No newline at end of file
......@@ -87,6 +87,7 @@ import Icon11 from "./assets/icons/sider-icon11.svg";
import { useRouter, useRoute } from "vue-router";
import useTagsViewStore from "@/stores/tagsView.js";
import { ElMessage } from "element-plus";
const router = useRouter();
const route = useRoute();
......@@ -392,8 +393,11 @@ const timer = ref(null);
// 关闭当前标签页
const handleCloseCurTab = (tab, index) => {
if(tagsViewStore.visitedViews.length === 1) {
ElMessage.warning('至少保留一个标签页')
return
}
let activeTab;
if (!tab.active) {
tagsViewStore.delView(tab);
} else {
......
......@@ -661,6 +661,7 @@ const fetchTableData = async () => {
// isSelectedAll.value = false
// selectedMap.value.clear()
// 调用接口获取数据...
loading.value = true
const params = {
page: currentPage.value,
size: pageSize.value,
......@@ -712,7 +713,11 @@ const fetchTableData = async () => {
activeChart.value = curDemensionItem.chartTypeList[0];
curChartData.value = curDemensionItem.data;
});
} catch (error) { }
} catch (error) {
console.error(error);
} finally {
loading.value = false
}
// tableData.value = res.data
// total.value = res.total
......@@ -970,9 +975,9 @@ const handleExport = () => {
};
onMounted(async () => {
handleGetThinkTankList();
initParam();
await handleGetThinkTankList();
initParam();
// 初始化
await fetchTableData();
});
......
......@@ -3665,7 +3665,7 @@ onBeforeUnmount(() => {
top: 11px;
right: 31px;
display: flex;
gap: 2px;
gap: 8px;
}
}
......@@ -3809,13 +3809,14 @@ onBeforeUnmount(() => {
}
.box6-select-box {
width: 240px;
width: 248px;
height: 28px;
position: absolute;
top: 12px;
top: 8px;
right: 25px;
display: flex;
gap: 2px
justify-content: flex-end;
gap: 8px;
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论