From f0abcd22f40c6a0293db0be0cb2fdd49c4d70f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E5=86=A0=E5=AD=A6?= <1109935898@qq.com> Date: Wed, 9 Oct 2024 16:29:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=8F=A3=E5=91=B3?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=B4=9E=E5=AF=9F=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/DataAnalyse/insight/Index.vue | 58 +-- .../insight/SharedInsightReport.vue | 12 +- src/views/DataAnalyse/insight/api.js | 14 +- .../insight/components/InsightEmpty.vue | 8 +- .../insight/components/InsightShare.vue | 167 +++++--- .../insight/components/Section.vue | 6 +- .../insight/components/SharedAccess.vue | 47 +- .../insight/components/SharedExpired.vue | 10 +- .../insight/components/SharedInvalid.vue | 10 +- src/views/DataAnalyse/insight/consts.js | 5 +- .../DataAnalyse/insight/report/Report.vue | 62 ++- .../insight/report/components/SmallTable.vue | 65 +-- .../insight/report/components/StyledTable.vue | 403 ++++++++++-------- .../insight/report/components/WordCloud.vue | 95 ++--- .../insight/report/section/CoreConclusion.vue | 47 +- .../report/section/DecisionIndicators.vue | 211 ++++----- .../report/section/OtherKeyIndicators.vue | 27 +- .../insight/report/section/Overview.vue | 56 ++- .../ProjectNameAndDecisionCriteria.vue | 49 ++- .../insight/report/section/TestingConcept.vue | 30 +- .../insight/report/section/TestingTaste.vue | 123 ++++++ .../conceptDiagnosis/ConceptDiagnosis.vue | 155 ------- .../section/diagnosis/ConceptDiagnosis.vue | 170 ++++++++ .../PeopleDislike.vue | 10 +- .../PeopleLike.vue | 201 +++++---- .../ProductImage.vue | 28 +- .../section/diagnosis/TasteDiagnosis.vue | 140 ++++++ .../style.scss | 13 +- 28 files changed, 1328 insertions(+), 894 deletions(-) create mode 100644 src/views/DataAnalyse/insight/report/section/TestingTaste.vue delete mode 100644 src/views/DataAnalyse/insight/report/section/conceptDiagnosis/ConceptDiagnosis.vue create mode 100644 src/views/DataAnalyse/insight/report/section/diagnosis/ConceptDiagnosis.vue rename src/views/DataAnalyse/insight/report/section/{conceptDiagnosis => diagnosis}/PeopleDislike.vue (86%) rename src/views/DataAnalyse/insight/report/section/{conceptDiagnosis => diagnosis}/PeopleLike.vue (63%) rename src/views/DataAnalyse/insight/report/section/{conceptDiagnosis => diagnosis}/ProductImage.vue (70%) create mode 100644 src/views/DataAnalyse/insight/report/section/diagnosis/TasteDiagnosis.vue rename src/views/DataAnalyse/insight/report/section/{conceptDiagnosis => diagnosis}/style.scss (90%) diff --git a/src/views/DataAnalyse/insight/Index.vue b/src/views/DataAnalyse/insight/Index.vue index 862b9c4a..596ce64d 100644 --- a/src/views/DataAnalyse/insight/Index.vue +++ b/src/views/DataAnalyse/insight/Index.vue @@ -3,16 +3,13 @@ import { onBeforeUnmount, ref } from 'vue' import { useRoute } from 'vue-router' import { message, Modal } from 'ant-design-vue' - import InsightEmpty from './components/InsightEmpty.vue' import InsightShare from './components/InsightShare.vue' import Report from './report/Report.vue' - import { editInsightReport, getInsightReport, checkReportStatus, updateInsightReport } from './api' - const route = useRoute() const sn = route.query.sn || '' @@ -26,11 +23,10 @@ const report = ref({}) const saving = ref(0) const saveParams = ref({}) - getReport(true) async function getReport(fullLoading) { - if(loading.value) { + if (loading.value) { return } loading.value = true @@ -51,17 +47,20 @@ async function getReport(fullLoading) { } function initSaveParams() { - const totalData = report.value.chatVOS?.find?.((data) => data.type.startsWith('决策指标-总体')) || {} + const totalData = + report.value.chatVOS?.find?.((data) => data.type.startsWith('决策指标-总体')) || {} const headersFirstIndex = totalData.headerVOS?.[0]?.dataIndex || '' - const standardRow = totalData.dataVOS?.find?.((record) => record[headersFirstIndex] === '是否通过概念行动标准') || {} + const standardRow = + totalData.dataVOS?.find?.((record) => + ['是否通过概念行动标准', '是否通过口味行动标准'].includes(record[headersFirstIndex]) + ) || {} const actions = {} Object.keys(standardRow).forEach((key) => { - if(standardRow[key] !== '是否通过概念行动标准') { + if (!['是否通过概念行动标准', '是否通过口味行动标准'].includes(standardRow[key])) { actions[key] = standardRow[key] } }) - const params = { id: report.value.id, decisionCriteria: report.value.decisionIndicators, // 决策标准 @@ -74,7 +73,7 @@ function initSaveParams() { actions // 是否通过行动标准 1 是 2 否 } - Object.keys(params).forEach((key) => saveParams.value[key] = params[key]) + Object.keys(params).forEach((key) => (saveParams.value[key] = params[key])) } async function onInitReport() { @@ -82,7 +81,7 @@ async function onInitReport() { const params = { surveySn: sn } const data = await updateInsightReport(params).catch((e) => e) - if(!data?.data?.code) { + if (!data?.data?.code) { await getReport(false) } @@ -104,7 +103,7 @@ function onUpdateReport() { } async function onConfirmUpdateReport() { - if(updating.value) { + if (updating.value) { return } updating.value = true @@ -115,11 +114,10 @@ async function onConfirmUpdateReport() { await getReport() } - async function editReport(evt) { saving.value += 1 - Object.keys(evt || {}).forEach((key) => saveParams.value[key] = evt[key]) + Object.keys(evt || {}).forEach((key) => (saveParams.value[key] = evt[key])) await editInsightReport(saveParams.value).catch(() => '') saving.value -= 1 @@ -137,15 +135,19 @@ function mergeReport(params) { report.value.cityLevelQuotaHidden = params.cityLevelQuota_Hidden // 购买意愿-省市等级 是否隐藏 1是 2否 const total = report.value?.chatVOS?.find?.((data) => data.type.startsWith('决策指标-总体')) - if(total && params.actions) { - const result = total.dataVOS?.find?.((data) => '是否通过概念行动标准' === data[total.headerVOS?.[0]?.dataIndex]) || {} - Object.keys(params.actions).forEach((key) => result[key] = params.actions[key]) + if (total && params.actions) { + const result = + total.dataVOS?.find?.((data) => + ['是否通过概念行动标准', '是否通过口味行动标准'].includes( + data[total.headerVOS?.[0]?.dataIndex] + ) + ) || {} + Object.keys(params.actions).forEach((key) => (result[key] = params.actions[key])) } } - function startLooping() { - if(!timer) { + if (!timer) { return } stopLooping() @@ -161,7 +163,6 @@ function stopLooping() { onBeforeUnmount(stopLooping) - async function getReportStatus() { const params = { sn, @@ -176,7 +177,7 @@ async function getReportStatus() { // 2=有新的报告产生,已完成,需要重新请求报告展示接口 // 3=老报告的词云更新完了,需要重新请求报告展示接口 - switch(data?.data?.code) { + switch (data?.data?.code) { case 0: updating.value = false break @@ -195,19 +196,18 @@ async function getReportStatus() {