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

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

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