提交 32381f85 authored 作者: 张烨's avatar 张烨

Merge remote-tracking branch 'origin/pre' into zy-dev

流水线 #395 已通过 于阶段
in 1 分 43 秒
const baseUrl = `http://8.140.26.4:9085`
const outImgbaseUrl = `http://8.140.26.4:10017/out/img` // 写报图片URL
\ No newline at end of file
......@@ -16,7 +16,7 @@ export function getBillIndustry(params) {
return request({
method: 'GET',
url: `/api/BillOverview/billIndustry/${params.year}`,
params: { status: params.status }
params: { stageName: params.stageName }
})
}
......
......@@ -12,6 +12,7 @@ export function search(data) {
})
}
// 智库列表
export function getThinkTankList() {
return request({
method: 'GET',
......@@ -19,9 +20,50 @@ export function getThinkTankList() {
})
}
// 立法阶段
export function getStatusList() {
return request({
method: 'GET',
url: `/temporarySearch/search-info/dBillStage`,
})
}
// 省名字列表
export function getProvinceList() {
return request({
method: 'GET',
url: `/temporarySearch/search-info/all-provinceName`,
})
}
// 国家列表
export function getCountryList() {
return request({
method: 'GET',
url: `/temporarySearch/search-info/all-countryName`,
})
}
// 实体类型
export function getEntityTypes() {
return request({
method: 'GET',
url: `/temporarySearch/search-info/entityTypes`,
})
}
// 物项类别
export function getMaterialCategory() {
return request({
method: 'GET',
url: `/temporarySearch/search-info/all-materialCategory`,
})
}
// 商业管制清单-管控原因
export function getControlReason() {
return request({
method: 'GET',
url: `/temporarySearch/search-info/all-controlReason`,
})
}
\ No newline at end of file
......@@ -123,7 +123,7 @@ export function getSanctionsInfoCount() {
* sanReason: string
* }[]>}
*/
export function getSanctionProcess(sanTypeIds = "1", pageNum = 1, pageSize = 10, isCn = false) {
export function getSanctionProcess(sanTypeIds = ["1"], pageNum = 1, pageSize = 10, isCn = false) {
return request200(
request({
method: "POST",
......
<template>
<p class="p-regular-rereg">
<span class="text-regular" v-for="(segment, index) in processedText" :key="index">
<span v-if="segment.isEntity" @click="$emit('onEntityClick', segment.entity)" class="entity-link">
<span
v-if="segment.isEntity"
@click="$emit('onEntityClick', segment.entity)"
:class="['entity-link', { 'keyword-highlight': segment.isKeywordHit }]"
>
{{ segment.entity?.text_span }}
<img :src="SearchIcon" :width="10" :height="10" alt="search" />
</span>
<span v-else>
{{ segment.text }}
<span :class="{ 'keyword-highlight': segment.isKeywordHit }">{{ segment.text }}</span>
</span>
</span>
</p>
......@@ -20,6 +24,7 @@ export interface ProcessedTextSegment {
text: string;
isEntity: boolean;
entity?: TextEntity;
isKeywordHit?: boolean;
}
const props = defineProps({
text: {
......@@ -29,15 +34,42 @@ const props = defineProps({
entities: {
type: Array<TextEntity>,
default: () => []
},
highlight: {
type: String,
default: ""
}
});
const emit = defineEmits(["onEntityClick"]);
// 处理后的文本段
const processedText = ref<ProcessedTextSegment[]>([]);
const normalizeKeyword = (value: unknown) => String(value ?? "").trim();
const getKeywordMatches = (text: string, keyword: string) => {
if (!keyword) return [{ text, isKeywordHit: false }];
const lowerText = text.toLowerCase();
const lowerKeyword = keyword.toLowerCase();
if (!lowerKeyword) return [{ text, isKeywordHit: false }];
const parts: Array<{ text: string; isKeywordHit: boolean }> = [];
let start = 0;
while (start < text.length) {
const index = lowerText.indexOf(lowerKeyword, start);
if (index === -1) {
parts.push({ text: text.slice(start), isKeywordHit: false });
break;
}
if (index > start) {
parts.push({ text: text.slice(start, index), isKeywordHit: false });
}
parts.push({ text: text.slice(index, index + keyword.length), isKeywordHit: true });
start = index + keyword.length;
}
return parts.filter(part => part.text);
};
// 处理文本,识别并替换实体
const processText = () => {
console.log("props.entities.length", props.entities.length);
if (!props.text || !props.entities) {
// console.log('props.text', props.entities.length)
processedText.value = [{ text: "", isEntity: false }];
......@@ -46,6 +78,7 @@ const processText = () => {
const result = [];
let currentPosition = 0;
const keyword = normalizeKeyword(props.highlight);
// 按实体文本长度排序,优先匹配长文本
const sortedEntities = [...props.entities].sort((a, b) => b.text_span.length - a.text_span.length);
......@@ -61,7 +94,8 @@ const processText = () => {
// 如果当前位置是实体,添加到结果
result.push({
isEntity: true,
entity: { ...entity }
entity: { ...entity },
isKeywordHit: keyword ? entityText.toLowerCase().includes(keyword.toLowerCase()) : false
});
currentPosition = endPosition;
matched = true;
......@@ -82,18 +116,26 @@ const processText = () => {
if (nextEntityStart > currentPosition) {
const plainText = props.text.substring(currentPosition, nextEntityStart);
const parts = getKeywordMatches(plainText, keyword);
parts.forEach(part => {
result.push({
text: plainText,
isEntity: false
text: part.text,
isEntity: false,
isKeywordHit: part.isKeywordHit
});
});
currentPosition = nextEntityStart;
} else {
// 没有更多实体,添加剩余文本
const remainingText = props.text.substring(currentPosition);
if (remainingText) {
const parts = getKeywordMatches(remainingText, keyword);
parts.forEach(part => {
result.push({
text: remainingText,
isEntity: false
text: part.text,
isEntity: false,
isKeywordHit: part.isKeywordHit
});
});
}
currentPosition = props.text.length;
......@@ -106,6 +148,7 @@ const processText = () => {
// 监听文本和实体变化
watch(() => props.text, processText);
watch(() => props.entities, processText, { deep: true });
watch(() => props.highlight, processText);
// 初始化处理
onMounted(processText);
......@@ -113,6 +156,11 @@ onMounted(processText);
<style lang="scss" scoped>
@use "@/styles/common.scss";
.keyword-highlight {
background: rgba(255, 199, 0, 0.35);
border-radius: 2px;
}
.entity-link {
color: var(--color-primary-100);
&:hover {
......
......@@ -33,7 +33,7 @@ const financeRoutes = [
},
// V2.0单条制裁详情-实体清单原文
{
path: "/exportControl/origin",
path: "/finance/origin",
name: "financeEntityListOrigin",
component: () => import("@/views/finance/singleSanction/originPage/index.vue")
// meta: {
......
......@@ -12,6 +12,7 @@ const useTagsViewStore = defineStore('tags-view', {
this.addCachedView(view)
},
addVisitedView(view) {
this.visitedViews = localStorage.getItem('visitedViews') && JSON.parse(localStorage.getItem('visitedViews')) || []
this.visitedViews.forEach(item => {
item.active = false
})
......@@ -23,8 +24,8 @@ const useTagsViewStore = defineStore('tags-view', {
...view,
title: view.meta?.title || '未命名'
})
localStorage.setItem('visitedViews', JSON.stringify(this.visitedViews))
} else {
this.visitedViews.forEach(v => {
if (v.path === view.path) {
v.active = true
......@@ -49,7 +50,7 @@ const useTagsViewStore = defineStore('tags-view', {
if (index !== -1) {
this.visitedViews.splice(index, 1)
}
localStorage.setItem('visitedViews', JSON.stringify(this.visitedViews))
resolve([...this.visitedViews])
})
},
......@@ -64,6 +65,13 @@ const useTagsViewStore = defineStore('tags-view', {
}
},
loadVisitedViewFromLocalStorage() {
const saved = localStorage.getItem('visitedViews')
if (saved) {
this.items = JSON.parse(saved)
}
},
// 关闭其他/右侧/全部
delOthersViews(view) {
......
......@@ -485,7 +485,6 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
// ========== AI 生成报文 SSE(更新报文内容 + 执行步骤) ==========
async fetchReportData(params) {
console.log(">")
if (this.abortController) this.abortController.abort();
this.abortController = new AbortController();
// this.processLog = '';
......@@ -511,7 +510,8 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
lastFlushedIndex = 0;
if (this.reportContent.includes('./out/img')) {
this.reportContent = this.reportContent.replaceAll('./out/img', 'http://172.19.21.9:8003/out/img');
this.reportContent = this.reportContent.replaceAll('./out/img', outImgbaseUrl);
// console.log(reportContent)
}
};
......@@ -571,7 +571,6 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
streamBuffer += str;
updateFlushIndexByBoundary();
flushToReport(false);
console.log(streamBuffer,456)
console.log(msgData,'data')
} else {
// 结束时把剩余内容强制 flush
......@@ -663,7 +662,6 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
};
await this.fetchReportData(params);
} else {
console.log(10101010101010)
// 政令模板需要先解析PDF
if (this.curTempTitle === '政令') {
if (this.uploadFileList.length === 0) {
......
......@@ -93,7 +93,7 @@
<div class="item">
<div class="item-left">法案进展:</div>
<div class="item-right2">
<div class="tag" v-for="(val, idx) in getReversedProgress(item.progress)" :key="`${item.billId}-${val}-${idx}`" :style="{ zIndex: item.progress.length - idx }">{{ val }}</div>
<div class="tag" v-for="(val, idx) in item.progress" :key="`${item.billId}-${val}-${idx}`" :style="{ zIndex: item.progress.length - idx }">{{ val }}</div>
</div>
</div>
</div>
......@@ -458,8 +458,6 @@ const handleClickAvatar = async member => {
} catch (error) {}
};
const getReversedProgress = progress => (Array.isArray(progress) ? [...progress].reverse() : []);
const handleClickCommitteeBill = bill => {
if (!bill?.billId) return;
props.onClickToDetail({
......
......@@ -373,7 +373,8 @@ const committeeTimeRange = ref("近一月");
const committeeTimeOptions = [
{ label: "近一周", value: "近一周" },
{ label: "近一月", value: "近一月" },
{ label: "近一年", value: "近一年" }
{ label: "近一年", value: "近一年" },
{label:"全部时间", value: "全部时间"}
];
const committeeCardList = ref([]);
......@@ -1029,14 +1030,15 @@ const handleBox6 = async () => {
// 涉华领域分布
const box9ChartData = ref([]);
const box9selectetedTime = ref("2025");
// 立法状态下拉:提出法案、众议院通过、参议院通过、解决分歧、完成立法
// v-model 存储的是接口需要的 status 值
const box9LegislativeStatus = ref("提案");
// 立法状态下拉:提出法案、众议院通过、参议院通过、解决分歧、呈交总统、完成立法
// v-model 存储的是接口需要的 status 值(直接作为接口参数)
const box9LegislativeStatus = ref("提出法案");
const box9LegislativeStatusList = ref([
{ label: "提出法案", value: "提案" },
{ label: "提出法案", value: "提出法案" },
{ label: "众议院通过", value: "众议院通过" },
{ label: "参议院通过", value: "参议院通过" },
{ label: "解决分歧", value: "分歧已解决" },
{ label: "解决分歧", value: "解决分歧" },
{ label: "呈交总统", value: "呈交总统" },
{ label: "完成立法", value: "完成立法" }
]);
const box9YearList = ref([
......@@ -1063,18 +1065,39 @@ const box9YearList = ref([
]);
const box9HasData = ref(true);
let box9ChartInstance = null;
const BOX9_MAX_DOMAIN_COUNT = 7;
const BOX9_OTHER_DOMAIN_NAME = "其他";
const formatBox9DomainData = (list = []) => {
if (!Array.isArray(list) || list.length <= BOX9_MAX_DOMAIN_COUNT) {
return list;
}
const topDomainList = list.slice(0, BOX9_MAX_DOMAIN_COUNT);
const otherDomainCount = list.slice(BOX9_MAX_DOMAIN_COUNT).reduce((sum, item) => {
return sum + Number(item?.countBill || 0);
}, 0);
if (!otherDomainCount) {
return topDomainList;
}
return [
...topDomainList,
{
industryName: BOX9_OTHER_DOMAIN_NAME,
countBill: otherDomainCount
}
];
};
const getBox9Data = async () => {
chartLoading.value = { ...chartLoading.value, box6: true };
const params = {
year: box9selectetedTime.value,
status: box9LegislativeStatus.value
stageName: box9LegislativeStatus.value
};
try {
const res = await getBillIndustry(params);
console.log("box9-涉华法案领域分布", res.data);
if (res.code === 200 && res.data && res.data.length > 0) {
box9HasData.value = true;
box9ChartData.value = res.data;
box9ChartData.value = formatBox9DomainData(res.data);
} else {
box9HasData.value = false;
box9ChartData.value = [];
......@@ -1104,16 +1127,9 @@ const handleBox9Data = async () => {
const selectedIndex = box9LegislativeStatusList.value.findIndex(
item => item.value === box9LegislativeStatus.value
);
const arr = [
{ label: "提出法案", value: "提案" },
{ label: "众议院通过", value: "众议院通过" },
{ label: "参议院通过", value: "参议院通过" },
{ label: "解决分歧", value: "分歧已解决" },
{ label: "完成立法", value: "完成立法" }
]
const status = arr.filter(item => {
return item.value === box9LegislativeStatus.value
})[0].label
// 当前选中的立法状态中文名(直接等于接口传参值)
const statusItem = box9LegislativeStatusList.value[selectedIndex];
const status = statusItem ? statusItem.label : "";
const selectParam = {
moduleType: '国会法案',
key: 2,
......@@ -1272,13 +1288,14 @@ const getBox8ChartOption = stageList => {
const handleBox8Data = async () => {
chartLoading.value = { ...chartLoading.value, box8: true };
// 进展分布显示顺序:提出法案(对应进度“提案”)、众议院通过、参议院通过、分歧已解决(解决分歧)、完成立法
const stageOrder = ["提案", "众议院通过", "参议院通过", "分歧已解决", "完成立法"];
// 进展分布显示顺序:提出法案(对应进度“提案”)、众议院通过、参议院通过、解决分歧(对应进度“分歧已解决”)、呈交总统、完成立法
const stageOrder = ["提案", "众议院通过", "参议院通过", "分歧已解决", "呈交总统", "完成立法"];
const stageNameMap = {
提案: "提出法案",
众议院通过: "众议院通过",
参议院通过: "参议院通过",
分歧已解决: "解决分歧",
呈交总统: "呈交总统",
完成立法: "完成立法"
};
......
......@@ -1169,6 +1169,10 @@ onMounted(async () => {
<style lang="scss" scoped>
.wrap {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
direction: ltr;
justify-content: flex-start;
margin-bottom: 30px;
......@@ -1254,6 +1258,8 @@ onMounted(async () => {
.left {
margin-top: 16px;
width: 792px;
flex: 0 0 792px;
.box1 {
width: 792px;
......@@ -1651,6 +1657,7 @@ onMounted(async () => {
margin-left: 16px;
margin-top: 16px;
width: 792px;
flex: 0 0 792px;
height: 847px;
.box3 {
......
......@@ -131,6 +131,7 @@
<IntelligentEntityText
:text="term?.fynr || ''"
:entities="termsHighlight ? getTermEntities(term, 'cn') : []"
:highlight="searchKeyword"
@on-entity-click="e => gotoSearchResults(e.text_span, '')"
/>
</div>
......@@ -141,6 +142,7 @@
<IntelligentEntityText
:text="term?.ywnr || ''"
:entities="termsHighlight ? getTermEntities(term, 'en') : []"
:highlight="searchKeyword"
@on-entity-click="e => gotoSearchResults(e.text_span, '')"
/>
</div>
......@@ -343,6 +345,27 @@ const chart1ColorList = ref([...MUTICHARTCOLORS]);
const chart2ColorList = ref([...MUTICHARTCOLORS]);
const chart2Data = ref([]);
const DOMAIN_MAX_DISPLAY_COUNT = 7;
const DOMAIN_OTHER_NAME = "其他";
const formatDomainChartData = (list = []) => {
if (!Array.isArray(list) || list.length <= DOMAIN_MAX_DISPLAY_COUNT) {
return list;
}
const topDomainList = list.slice(0, DOMAIN_MAX_DISPLAY_COUNT);
const otherCount = list.slice(DOMAIN_MAX_DISPLAY_COUNT).reduce((sum, item) => {
return sum + Number(item?.value || 0);
}, 0);
if (!otherCount) {
return topDomainList;
}
return [
...topDomainList,
{
name: DOMAIN_OTHER_NAME,
value: otherCount
}
];
};
const aiPaneVisible = ref({
domain: false,
......@@ -737,12 +760,13 @@ const handleGetBillHyly = async () => {
.map(name => {
return { label: name, value: name };
});
chart2Data.value = res.data.map(item => {
const domainChartData = res.data.map(item => {
return {
name: item.hylymc,
value: item.countTk
};
});
chart2Data.value = formatDomainChartData(domainChartData);
aiPaneFetched.value = { ...aiPaneFetched.value, domain: false };
let chart2 = getPieChart(chart2Data.value, chart2ColorList.value);
......
......@@ -4,7 +4,7 @@
<div class="header-top">
<SelectBox :placeholder-name="areaPlaceHolder" select-title="科技领域" :select-list="areaList"
:select-name="selectedArea" @update:select-text="handleSelectArea" />
<SelectBox :placeholder-name="DatePlaceHolder" select-title="提时间" :select-list="dateList"
<SelectBox :placeholder-name="DatePlaceHolder" select-title="提时间" :select-list="dateList"
:select-name="selectedDate" :custom-time="customTime" @update:select-text="handleSelectDate"
@update:custom-time="handleCustomDate" />
<SelectBox v-if="isFolderAll" :placeholder-name="partyPlaceHolder" select-title="所属党派" :select-list="partyList"
......@@ -53,7 +53,7 @@
<ChartHeader :list="staticsDemensionList" @clickItem="handleClickDemensionItem">
<template #chart-header-right>
<el-select v-model="selectedTime" placeholder="选择时间" style="width: 150px"
v-show="curDemension === '提案时间'">
v-show="curDemension === '提案时间'" @change="handleChangeTime">
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
......@@ -123,7 +123,8 @@
<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.originalTitle
<span class="title-item text-compact-bold" @click="handleClickToDetail(scope.row)">{{
scope.row.originalTitle
}}</span>
</template>
</el-table-column>
......@@ -184,10 +185,20 @@ const handleSwitchChartData = () => {
const curDemensionItem = staticsDemensionList.value.filter(item => {
return item.name === curDemension.value
})[0]
timer1.value = setTimeout(() => {
// timer1.value = setTimeout(() => {
activeChart.value = curDemensionItem.chartTypeList[0]
if (curDemension.value === '提案时间') {
if (selectedTime.value === '按月度统计') {
curChartData.value = curDemensionItem.data
})
} else if (selectedTime.value === '按季度统计') {
curChartData.value = curDemensionItem.quatarData
} else {
curChartData.value = curDemensionItem.yearData
}
} else {
curChartData.value = curDemensionItem.data
}
// })
}
}
......@@ -206,10 +217,12 @@ const staticsDemensionList = ref([
dataY: []
},
quatarData: {
dataX: [],
dataY: []
},
yearData: {
dataX: [],
dataY: []
}
},
{
......@@ -273,11 +286,17 @@ const handleClickDemensionItem = (val) => {
curDemension.value = val.name
timer2.value = setTimeout(() => {
activeChart.value = val.chartTypeList[0]
if (curDemension.value === '发布时间' && selectedTime.value === '按年度统计') {
curChartData.value = val.yearData
} else if (curDemension.value === '发布时间' && selectedTime.value === '按季度统计') {
curChartData.value = val.quatarData
} else {
curChartData.value = val.data
}
})
}
const selectedTime = ref('按统计')
const selectedTime = ref('按年度统计')
const timeList = ref([
{
label: '按年度统计',
......@@ -293,6 +312,27 @@ const timeList = ref([
},
])
const handleChangeTime = value => {
let curChart = activeChart.value
activeChart.value = ''
if (value === '按月度统计') {
setTimeout(() => {
activeChart.value = curChart
curChartData.value = staticsDemensionList.value[0].data
})
} else if (value === '按季度统计') {
setTimeout(() => {
activeChart.value = curChart
curChartData.value = staticsDemensionList.value[0].quatarData
})
} else {
setTimeout(() => {
activeChart.value = curChart
curChartData.value = staticsDemensionList.value[0].yearData
})
}
}
// 激活的标签列表
const activeTagList = computed(() => {
const arr = []
......@@ -307,7 +347,7 @@ const activeTagList = computed(() => {
if (selectedDate.value === '自定义') {
arr.push(
{
tag: '提时间',
tag: '提时间',
name: customTime.value.join('至')
}
)
......@@ -372,7 +412,7 @@ const handleCloseCurTag = (tag, index) => {
case '科技领域':
selectedArea.value = '全部领域'
break
case '提时间':
case '提时间':
selectedDate.value = ''
break
case '所属党派':
......@@ -541,7 +581,7 @@ const handleSelectArea = (value) => {
selectedArea.value = value
}
// 提时间
// 提时间
const DatePlaceHolder = ref('请选择时间')
const selectedDate = ref('')
const dateList = ref([
......@@ -843,6 +883,14 @@ const fetchTableData = async () => {
dataX: Object.keys(res.data.aggregationsDate),
dataY: Object.values(res.data.aggregationsDate).map(value => Number(value))
}
staticsDemensionList.value[0].quatarData = {
dataX: Object.keys(res.data.aggregationsQuarter),
dataY: Object.values(res.data.aggregationsQuarter).map(value => Number(value))
}
staticsDemensionList.value[0].yearData = {
dataX: Object.keys(res.data.aggregationsYear),
dataY: Object.values(res.data.aggregationsYear).map(value => Number(value))
}
staticsDemensionList.value[1].data = Object.entries(res.data.aggregationsDomain).map(([key, value]) => ({
name: key,
value: Number(value)
......@@ -860,7 +908,7 @@ const fetchTableData = async () => {
value: Number(value)
}))
staticsDemensionList.value[5].data = Object.entries(res.data.aggregationsStatus).map(([key, value]) => ({
name: key === '1' ? '通过' : '提出',
name: key,
value: Number(value)
}))
}
......@@ -1083,10 +1131,10 @@ const initParam = () => {
const query = route.query;
if (Object.keys(query).length > 0) {
sessionStorage.setItem('routeQuery', JSON.stringify(query));
sessionStorage.setItem('countryRouteQuery', JSON.stringify(query));
}
} else {
const savedQuery = JSON.parse(sessionStorage.getItem('routeQuery') || '{}');
const savedQuery = JSON.parse(sessionStorage.getItem('countryRouteQuery') || '{}');
selectedArea.value = savedQuery.domains ? savedQuery.domains : '全部领域'
if (savedQuery.selectedDate && Array.isArray(JSON.parse(savedQuery.selectedDate)) && JSON.parse(savedQuery.selectedDate).length) {
selectedDate.value = '自定义'
......
......@@ -62,7 +62,9 @@ const getBarChart = (data) => {
type: 'bar',
data: data.dataY,
label: {
show: true,
position: 'top',
color: 'rgb(59, 65, 75)',
fontWeight: 'regular', // 文字加粗
......@@ -72,7 +74,7 @@ const getBarChart = (data) => {
return params.value
},
},
barWidth: 20,
barWidth: data.dataX.length < 60 ? 20 : 3,
itemStyle: {
color: function (params) {
return new echarts.graphic.LinearGradient(0, 1, 0, 0,
......
<template>
<div class="wrapper">
<div class="show" @click="handleSwitchShowAll">
<div v-if="isShowAllBtn" class="show" @click="handleSwitchShowAll">
<div class="text text-compact">{{ isShowAll ? '收起' : '展开全部' }}</div>
<div class="icon">
<img v-if="isShowAll" src="./arrow-up.svg" alt="">
......@@ -23,6 +23,10 @@ const props = defineProps({
isShowAll: {
type: Boolean,
default: false
},
isShowAllBtn: {
type: Boolean,
default: true
}
})
......
......@@ -53,6 +53,9 @@ const getLineChart = (dataX, dataY) => {
lineStyle: {
color: 'rgba(5, 95, 194, 1)'
},
label: {
show: true
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
......
import { MUTICHARTCOLORS } from "@/common/constant";
const getPieChart = (data) => {
const colorList = MUTICHARTCOLORS
let showData = data
if(data.length > 14) {
showData = data.slice(0,13)
let num = 0
data.slice(13,).forEach(item => {
num = num + item.value
})
showData = [...showData, {name: '其他', value: num}]
}
let option = {
color: colorList,
legend: {
show: false
},
series: [
{
type: 'pie',
......@@ -50,7 +62,7 @@ const getPieChart = (data) => {
labelLinePoints: points
};
},
data: data
data: showData
}]
}
return option
......
......@@ -89,4 +89,5 @@ const customTimeValue = computed({
.select-wrapper-custom {
width: 738px;
}
</style>
\ No newline at end of file
......@@ -197,7 +197,7 @@ const handleSwitchChartData = () => {
const curDemensionItem = staticsDemensionList.value.filter(item => {
return item.name === curDemension.value
})[0]
setTimeout(() => {
// setTimeout(() => {
activeChart.value = curDemensionItem.chartTypeList[0]
if (curDemension.value === '发布时间') {
if (selectedTime.value === '按月度统计') {
......@@ -210,7 +210,7 @@ const handleSwitchChartData = () => {
} else {
curChartData.value = curDemensionItem.data
}
})
// })
}
}
......@@ -289,7 +289,7 @@ const handleClickDemensionItem = (val) => {
}
// 时间图表 当前选择时间
const selectedTime = ref('按统计')
const selectedTime = ref('按年度统计')
// 时间图表-时间列表
const timeList = ref([
{
......
......@@ -92,6 +92,7 @@ import { ElMessage } from "element-plus";
const router = useRouter();
const route = useRoute();
const tagsViewStore = useTagsViewStore();
tagsViewStore.loadVisitedViewFromLocalStorage()
// 在路由全局守卫中处理
router.beforeEach((to, from, next) => {
......@@ -348,8 +349,7 @@ const handleSiderSecondItem = item => {
};
const openedTabList = computed(() => {
const arr = tagsViewStore.visitedViews;
return arr;
return tagsViewStore.visitedViews;
});
const handleClickTab = tab => {
......@@ -393,7 +393,7 @@ const timer = ref(null);
// 关闭当前标签页
const handleCloseCurTab = (tab, index) => {
if(tagsViewStore.visitedViews.length === 1) {
if (tagsViewStore.visitedViews.length === 1) {
ElMessage.warning('至少保留一个标签页')
return
}
......@@ -494,16 +494,17 @@ onMounted(() => {
siderList.value[3].isExpanded = true;
siderList.value[3].children[0].active = true;
break;
case "/dataLibrary/dataCommerceControlList":
case "/dataLibrary/dataEntityListEvent":
siderList.value[3].active = true;
siderList.value[3].isExpanded = true;
siderList.value[3].children[1].active = true;
break;
case "/dataLibrary/dataEntityListEvent":
case "/dataLibrary/dataCommerceControlList":
siderList.value[3].active = true;
siderList.value[3].isExpanded = true;
siderList.value[3].children[2].active = true;
break;
case "/dataLibrary/dataCommerceControlListEvent":
siderList.value[3].active = true;
siderList.value[3].isExpanded = true;
......@@ -586,6 +587,7 @@ onBeforeUnmount(() => {
if (timer.value) {
clearTimeout(timer.value);
}
localStorage.setItem('visitedViews', [])
});
</script>
......
......@@ -189,7 +189,7 @@ const handleSwitchChartData = () => {
const curDemensionItem = staticsDemensionList.value.filter(item => {
return item.name === curDemension.value;
})[0];
setTimeout(() => {
// setTimeout(() => {
activeChart.value = curDemensionItem.chartTypeList[0];
if (curDemension.value === "发布时间") {
if (selectedTime.value === "按月度统计") {
......@@ -202,7 +202,7 @@ const handleSwitchChartData = () => {
} else {
curChartData.value = curDemensionItem.data;
}
});
// });
}
};
......@@ -281,7 +281,7 @@ const handleClickDemensionItem = val => {
};
// 时间图表 当前选择时间
const selectedTime = ref("按统计");
const selectedTime = ref("按年度统计");
// 时间图表-时间列表
const timeList = ref([
{
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论