12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109 |
- <template>
- <div class="content">
- <a-card :bordered="false" :body-style="{padding:0}">
- <div class="step1" v-if="flag">
- <a-divider>SEO月报生成及下载</a-divider>
- <a-form
- ref="formRef"
- :model="formState"
- :rules="rules"
- :label-col="labelCol"
- :wrapper-col="wrapperCol"
- style="width: 80%"
- >
- <a-button type="primary" @click="handleEdit" preIcon="ant-design:edit-outlined"
- class="btn3">修改话术
- </a-button>
- <SeoPdfExportModal @register="registerModal" @success="handleSuccess"></SeoPdfExportModal>
- <a-form-item label="站点名称" name="siteName">
- <a-select
- label-in-value
- v-model:value="formState.siteName"
- placeholder="请选择站点"
- showSearch
- style="width: 100%"
- :options="siteOptions"
- :filter-option="filterOption"
- @change="handleChange"
- :field-names="{ label: 'name', value: 'code' }"
- ></a-select>
- </a-form-item>
- <a-form-item label="客户名称" name="customerName">
- <a-input placeholder="请输入客户名称" v-model:value="formState.customerName"
- allowClear></a-input>
- </a-form-item>
- <a-form-item label="查询时间" name="range">
- <a-date-picker v-model:value="formState.range"
- :disabled-date="disabledDate"
- placeholder="请选择月份"
- style="width: 100%;"
- format="YYYY-MM"
- picker="month" />
- </a-form-item>
- <a-form-item style="text-align: center" :wrapper-col="{ span: 20, offset: 4 }">
- <a-button @click="onSubmit" type="primary" preIcon="ant-design:search-outlined">查询
- </a-button>
- <a-button @click="resetForm" type="default" preIcon="ant-design:reload-outlined"
- style="margin-left: 8px">
- 重置
- </a-button>
- </a-form-item>
- </a-form>
- </div>
- <div class="step2" v-if="!flag">
- <a-spin :spinning="infoLoading">
- <section class="top">
- <h1>{{ formState.customerName }} - SEO月度报告
- <a-button type="default" @click="handleEdit" preIcon="ant-design:edit-outlined"
- class="btn6">修改话术
- </a-button>
- <a-button type="primary" preIcon="ant-design:file-pdf" @click="handleExportPdf"
- class="btn1">导出pdf
- </a-button>
- <a-button type="default" preIcon="ant-design:reload" @click="goBack" class="btn2">
- 返回
- </a-button>
- </h1>
- <p style='margin-top: 15px'>
- 生成周期:{{ dayjs(formState.range).startOf("month").format("YYYY-MM-DD")
- }}至{{ dayjs(formState.range).endOf("month").format("YYYY-MM-DD")
- }}</p>
- </section>
- <section class="s1">
- <p class="p1" style="font-size: 15px;margin-top: 15px">
- 尊敬的【{{ formState.siteName.label
- }}】:</p>
- <p class="p1" style="text-indent: 28px">
- 我非常高兴向您呈上{{ dayjs(formState.range).format("YYYY-MM")
- }}月的SEO月报,为您提供网站在SEO中的详尽数据和分析。作为您的SEO团队,一直努力追求卓越的结果,以确保您的在线业务能够获得更大的曝光度和持续增长.</p>
- <p class="p1" style="text-indent: 28px">
- 在过去的一个月里,我们积极地致力于提升您的网站的可见性和排名,并进行了一系列优化策略的实施。具体细节请参考以下报告细节。</p>
- <h2 class="title mb">当月优化总结<span class="red">*</span></h2>
- <p class="tips" style="margin: -10px 0 10px;">
- 在过去的1个月里,我们致力于为您的网站进行全面的SEO优化工作。通过对关键词排名、网站结构、内容优化以及用户体验等方面的深入分析和优化,以下是我们的SEO优化总结:</p>
- <div class="num-suffix">
- <a-textarea :style="detailInfo.thisMonth.length > 1000 ? 'border-color:red':''"
- auto-size placeholder="请输入"
- v-model:value="detailInfo.thisMonth"></a-textarea>
- <span :style="detailInfo.thisMonth.length > 1000 ? 'color:red':''"
- class="suffix-self">
- {{ detailInfo.thisMonth.length }}/1000
- </span>
- </div>
- <h2 class="title mb">下月优化计划<span class="red">*</span></h2>
- <p class="tips" style="margin: -10px 0 10px;">
- 感谢您对我们的SEO优化工作的信任。在下个月,我们计划继续改进和优化您的网站,以进一步提升其在搜索引擎中的表现。以下是我们的下月优化计划:</p>
- <div class="num-suffix">
- <a-textarea :style="detailInfo.nextMonth.length > 1000 ? 'border-color:red':''"
- auto-size placeholder="请输入"
- v-model:value="detailInfo.nextMonth"></a-textarea>
- <span :style="detailInfo.nextMonth.length > 1000 ? 'color:red':''"
- class="suffix-self">
- {{ detailInfo.nextMonth.length }}/1000
- </span>
- </div>
- <p class="tips" style="margin: 10px 0 10px;">
- 我们将按照以上优化计划,不断努力提升您的网站在搜索引擎中的表现。如果您有任何疑问或需要进一步讨论,请随时与我们联系。感谢您的合作,我们期待着实现更大的SEO成功!</p>
- </section>
- <section class="s2">
- <h2 class="title mb">网站流量</h2>
- <p class="tips" style="margin: -5px 0 5px;">
- 在本月的SEO月报中,我们会向您展示关于网站流量数据及其他相关的数据,如页面浏览量、跳出率、平均访问时长等,以帮助您更全面地了解网站流量情况和用户行为。这些数据将以图表、表格或其他可视化方式呈现,以便您更直观地理解和分析。</p>
- <p class="tips">以下是一些关键的流量指标和相应的数据展示:</p>
- <a-row class="r5-1">
- <a-col :span="24">
- <area-chart v-if="coreDataChart.x.length > 0"
- :dataSource="coreDataChart"></area-chart>
- <a-empty v-else style="float: right;width: 100%;margin-top: 110px;"></a-empty>
- </a-col>
- <a-col :span="24">
- <div class="item">
- <p><img src="@/assets/pdfExport/uvicon.svg" />访客数(UV)</p>
- <p>{{ statistics.averageVisit }}</p>
- </div>
- <div class="item">
- <p><img src="@/assets/pdfExport/pvicon.svg" />浏览量(PV)</p>
- <p>{{ 0 }}</p>
- </div>
- <div class="item">
- <p><img src="@/assets/pdfExport/unReadEnquiryNum.svg" />日均访问量</p>
- <p>{{ statistics.averageVisit }}</p>
- </div>
- <div class="item">
- <p><img src="@/assets/pdfExport/keywordsrank3.svg" />平均访问时长</p>
- <p>{{ statistics.averageVisitDuration }}</p>
- </div>
- <div class="item">
- <p><img src="@/assets/pdfExport/conversionRate.svg" />平均访问页面数</p>
- <p>{{ statistics.averageVisitPage }}</p>
- </div>
- </a-col>
- </a-row>
- <h2 class="title mb">最多访问TOP10</h2>
- <a-row>
- <a-col :span="24">
- <a-table
- :columns="mostAccessColumns"
- :data-source="mostAccessDatasource"
- size="middle"
- :pagination="false">
- <template #bodyCell="{ column, text }">
- <template v-if="column.key ==='pagePathSlot' ">
- <a-popover>
- <template slot="content">
- {{ text }}
- </template>
- <a :href="text" target="_blank">
- <div
- style="width: 700px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
- {{ text }}
- </div>
- </a>
- </a-popover>
- </template>
- <template v-if="column.key ==='centerSlot' ">
- <span style="margin-left: 20px;">{{ text }}</span>
- </template>
- <template v-if="column.key ==='avgTimeOnPageSlot' ">
- <span style="margin-left: 30px;">{{ text }} s</span>
- </template>
- </template>
- </a-table>
- </a-col>
- </a-row>
- </section>
- <section class="s3">
- <h2 class="title mb">网站排名</h2>
- <p class="tips" style="margin: -5px 0 5px;">
- 在本月的SEO月报中,我们向您展示关于您网站排名的部分数据。因关键词排名数据量较大且实时变化,这边仅展示前50个关键词排名细节,您可登录后台查看全部数据。以下是一些的排名指标和相应的数据展示:</p>
- <a-row
- v-if="appointKeywordNum == null && longTailKeywordNum == null">
- <a-col>
- <a-empty style="padding-top: 50px" />
- </a-col>
- </a-row>
- <a-row type="flex">
- <a-col :span="3" v-if="appointKeywordNum">
- <div class="item">
- <img src="@/assets/pdfExport/zhidingci.svg" />
- <p>指定词</p>
- <p>{{ appointKeywordNum }}</p>
- </div>
- </a-col>
- <a-col :span="longTailKeywordNum ? 9 : 21"
- v-if="appointKeywordNum">
- <div class="wrap">
- <p class="t1">指定词排名</p>
- <div class="content">
- <div class="d1"><img src="@/assets/pdfExport/NO1.svg" />1-10位</div>
- <div class="d2">{{ rankInfo.appointKeyword.firstNum }}个
- </div>
- </div>
- <div class="content">
- <div class="d1"><img src="@/assets/pdfExport/NO2.svg" />11-30位</div>
- <div class="d2">{{ rankInfo.appointKeyword.secondNum }}个
- </div>
- </div>
- <div class="content">
- <div class="d1"><img src="@/assets/pdfExport/NO3.svg" />31-100位</div>
- <div class="d2">{{ rankInfo.appointKeyword.thirdType }}个
- </div>
- </div>
- </div>
- </a-col>
- <a-col :span="3" v-if="longTailKeywordNum">
- <div class="item">
- <img src="@/assets/pdfExport/changweici.svg" />
- <p>关键词</p>
- <p>{{ longTailKeywordNum }}</p>
- </div>
- </a-col>
- <a-col :span="appointKeywordNum ? 9 : 21" v-if="longTailKeywordNum">
- <div class="wrap">
- <p class="t1">关键词排名</p>
- <div class="content">
- <div class="d1"><img src="../../../assets/seo/NO1.svg" />1-10位</div>
- <div class="d2">{{ rankInfo.longTailKeyword.firstNum }}个
- </div>
- </div>
- <div class="content">
- <div class="d1"><img src="@/assets/pdfExport/NO2.svg" />11-30位</div>
- <div class="d2">{{ rankInfo.longTailKeyword.secondNum }}个
- </div>
- </div>
- <div class="content">
- <div class="d1"><img src="@/assets/pdfExport/NO3.svg" />31-100位</div>
- <div class="d2">{{ rankInfo.longTailKeyword.thirdType }}个
- </div>
- </div>
- </div>
- </a-col>
- <a-col :span="24" v-if="appointKeywordsList.length > 0">
- <h2 class="title mb">指定词排名列表</h2>
- <a-table
- ref="table"
- size="middle"
- :scroll="{x:true}"
- :columns="appointKeywordPageListColumns"
- :pagination="ipagination"
- :dataSource="appointKeywordsList"
- >
- <template #bodyCell="{ column, record, index, text }">
- <template v-if="column.key === 'rowIndex'">
- {{ index + 1 }}
- </template>
- <template class="tag" v-if="column.key === 'lastRank'">
- {{ record.lastRank }}
- </template>
- <template v-if="column.key === 'positionUrl'">
- <a :href="text" target="_blank">{{ text }}</a>
- </template>
- </template>
- </a-table>
- </a-col>
- <a-col :span="24" v-if="longTailKeywordsList.length > 0">
- <h2 class="title mb">关键词排名列表</h2>
- <a-table
- ref="table"
- size="middle"
- :scroll="{x:true}"
- :columns="longTailPageListColumns"
- :pagination="ipagination"
- :dataSource="longTailKeywordsList"
- >
- <template #bodyCell="{ column, record, index, text }">
- <template v-if="column.key ==='rowIndex'">
- {{ index + 1 }}
- </template>
- <template class="tag" v-if="column.key ==='lastRank'">
- {{ record.lastRank }}
- </template>
- <template v-if="column.key ==='positionUrl'">
- <a :href="text" target="_blank">{{ text }}</a>
- </template>
- </template>
- </a-table>
- </a-col>
- </a-row>
- </section>
- <section class="s4">
- <h2 class="title mb">网站外链</h2>
- <a-row>
- <a-col :span="24">
- <div class="item">
- <p>外链总数</p>
- <a-input placeholder="请输入" v-model="detailInfo.outlink1" />
- </div>
- <div class="item">
- <p>外链域</p>
- <a-input placeholder="请输入" v-model="detailInfo.outlink2" />
- </div>
- <div class="item">
- <p>外链发布数</p>
- <a-input placeholder="请输入" v-model="detailInfo.outlink3" />
- </div>
- </a-col>
- </a-row>
- <a-row :gutter="12">
- <a-col :span="12">
- <p class="sub-title">外链总数趋势</p>
- <a-col :span="24" style="margin: 10px 0px">
- <j-upload bizPath="seopdf/image" :multiple="false" :returnUrl="false" v-model:file-list="detailInfo.outLinkImg"/>
- </a-col>
- <div class="img-wrap">
- <template v-if="detailInfo.outLinkImg.length > 0">
- <img class="img" :src="detailInfo.outLinkImg[0].url "/>
- </template>
- <a-empty v-else>
- <span slot="description">请上传图片</span>
- </a-empty>
- </div>
- <div v-if="detailInfo.outLinkImg.length > 0">
- <a-textarea
- :style="detailInfo.outLinkImgDetail1.length > 1000 ? 'border-color:red':''"
- auto-size placeholder="请输入"
- v-model="detailInfo.outLinkImgDetail1"></a-textarea>
- <span :style="detailInfo.outLinkImgDetail1.length > 1000 ? 'color:red':''"
- class="suffix-self">
- {{ detailInfo.outLinkImgDetail1.length }}/1000
- </span>
- </div>
- </a-col>
- <a-col :span="12">
- <p class="sub-title">外链变化趋势</p>
- <a-col :span="24" style="margin: 10px 0px">
- <j-upload bizPath="seopdf/image" :returnUrl="true" :multiple="false" v-model:file-list="detailInfo.outLinkImg2"/>
- </a-col>
- <div class="img-wrap">
- <template v-if="detailInfo.outLinkImg2.length > 0">
- <img class="img" :src="detailInfo.outLinkImg2[0].url" />
- </template>
- <a-empty v-else>
- <span slot="description">请上传图片</span>
- </a-empty>
- </div>
- <div v-if="detailInfo.outLinkImg2.length > 0">
- <a-textarea
- :style="detailInfo.outLinkImgDetail2.length > 1000 ? 'border-color:red':''"
- auto-size placeholder="请输入"
- v-model="detailInfo.outLinkImgDetail2"></a-textarea>
- <span :style="detailInfo.outLinkImgDetail2.length > 1000 ? 'color:red':''"
- class="suffix-self">
- {{ detailInfo.outLinkImgDetail2.length }}/1000
- </span>
- </div>
- </a-col>
- </a-row>
- </section>
- <section class="s5">
- <h2 class="title mb">结语</h2>
- <p style="text-indent: 28px">
- 我们深知SEO是一个持续的过程,需要不断地监测、调整和改进。通过本月报告,我们与您分享我们的工作成果,并提供专业的建议和策略,以进一步提升您的网站在搜索引擎中的表现。</p>
- <p style="text-indent: 28px">
- 我们期待帮助您更好地理解和利用SEO对您的业务带来的巨大潜力。如果您对报告中的任何内容有疑问或需要进一步的解释,我们将随时为您提供支持和指导。</p>
- <p style="text-indent: 28px">
- 感谢您对我们的信任和合作。我们将继续竭尽全力,为您的网站取得更大的成功。</p>
- <p style="text-indent: 28px">祝您生意兴隆!</p>
- <p class="right">诚挚的问候</p>
- <p class="right">SEO团队</p>
- <p class="tips">
- 注:本次报告的SEO数据仅反映一段时间内的网站表现,但要注意数据的可变性和动态性,建议结合长期趋势和综合指标来评估网站SEO的整体表现。</p>
- </section>
- </a-spin>
- </div>
- </a-card>
- </div>
- </template>
- <script setup lang="ts">
- import { onMounted, reactive, ref } from "vue";
- import { getAction, postAction } from "/@/api/manage/manage";
- import dayjs from "dayjs";
- import SeoPdfExportModal from "@/views/adweb/seo/components/SeoPdfExportModal.vue";
- import { useModal } from "@/components/Modal";
- //注册model
- const [registerModal, { openModal }] = useModal();
- import { useMessage } from "@/hooks/web/useMessage";
- import AreaChart from "@/views/adweb/data/chart/areaChart.vue";
- import { JUpload } from "@/components/Form/src/jeecg/components/JUpload";
- import { PageEnum } from "@/enums/pageEnum";
- import { router } from "@/router";
- const fileList = ref([]);
- const appointKeywordPageListColumns = ref([
- {
- title: "序号",
- dataIndex: "rowIndex",
- key: "rowIndex",
- width: 100,
- align: "center",
- fixed: "left",
- },
- {
- title: "关键词",
- dataIndex: "keywords",
- key: "keywords",
- fixed: "left",
- width: 300
- },
- {
- title: "网址",
- dataIndex: "positionUrl",
- key: "positionUrl",
- fixed: "left",
- width: 600
- },
- {
- title: "排名",
- dataIndex: "lastRank",
- key: "lastRank",
- width: 100,
- }
- ]);
- const longTailPageListColumns = ref([
- {
- title: "序号",
- dataIndex: "rowIndex",
- key: "rowIndex",
- width: 100,
- align: "center",
- fixed: "left",
- },
- {
- title: "关键词",
- dataIndex: "keywords",
- key: "keywords",
- fixed: "left",
- width: 300
- },
- {
- title: "网址",
- dataIndex: "positionUrl",
- key: "positionUrl",
- fixed: "left",
- width: 600
- },
- {
- title: "排名",
- dataIndex: "lastRank",
- key: "lastRank",
- width: 100,
- }
- ]);
- const { createMessage } = useMessage();
- /**
- * 编辑事件
- */
- function handleEdit(record: Recordable) {
- openModal(true, {
- record,
- isUpdate: true,
- showFooter: true
- });
- }
- /**
- * 成功回调
- */
- function handleSuccess() {
- }
- const formState = reactive({
- siteName: ref(undefined),
- customerName: ref(undefined),
- range: ref(undefined)
- });
- const formRef = ref();
- const rules = ref({
- siteName: [
- { required: true, message: "请选择站点", trigger: "change" }
- ],
- customerName: [
- { required: true, message: "请输入客户名称", trigger: "blur" }
- ],
- range: [
- { required: true, message: "请选择查询时间范围", trigger: "change" }
- ]
- });
- const labelCol = ref({ span: 6 });
- const wrapperCol = ref({ span: 18 });
- const flag = ref(true);
- const siteOptions = ref([]);
- const handleChange = (value: string) => {
- formState.customerName = value.label;
- };
- const filterOption = (input: string, option: any) => {
- return option.name.toLowerCase().indexOf(input.toLowerCase()) >= 0;
- };
- const getSiteOption = () => {
- getAction("/adweb/adwebSite/getSiteListByUid", {}).then(function(res) {
- if (res.code == 200) {
- siteOptions.value = res.result;
- }
- });
- };
- const disabledDate = (current) => {
- return current > dayjs().subtract(1, "months");
- };
- const onSubmit = () => {
- formRef.value.validate().then(() => {
- flag.value = false;
- getInfo();
- getMostAccessList();
- getComprehenInfo();
- getRankInfo();
- getSeoMonthPlanContent();
- }).catch(error => {
- return false;
- });
- };
- const infoLoading = ref(false);
- const coreDataChart = ref({
- x: [],
- pv: [],
- uv: [],
- enquiry: []
- });
- const statistics = ref({
- uv: 0,
- pv: 0,
- averageVisit: 0,
- averageVisitDuration: 0,
- averageVisitPage: 0,
- bounceRate: "0%",
- conversionRate: "0%"
- });
- const mostAccessDatasource = ref([]);
- const appointKeywordsList = ref([]);
- const longTailKeywordsList = ref([]);
- const ipagination = ref({
- pageSize: 50
- });
- const getInfo = () => {
- let queryParam = {
- siteCode: formState.siteName.value,
- start: dayjs(formState.range).startOf("month").format("YYYY-MM-DD"),
- end: dayjs(formState.range).endOf("month").format("YYYY-MM-DD")
- };
- infoLoading.value = true;
- try {
- getAction("/dmp-data/site-overview/stats", queryParam).then(function(res) {
- if (!res.result) {
- coreDataChart.value = {
- x: [],
- uv: [],
- pv: [],
- enquiry: []
- };
- statistics.value = {
- uv: 0,
- pv: 0,
- averageVisit: 0,
- averageVisitDuration: 0,
- averageVisitPage: 0,
- bounceRate: "0%",
- conversionRate: "0%"
- };
- infoLoading.value = false;
- return;
- }
- const r = res.result.dailyStats;
- const x = [], pv = [], uv = [], enquiry = [];
- if (r != null && r.length > 0) {
- for (let item of r) {
- x.push(item.date);
- pv.push(item.pageViews);
- uv.push(item.totalUsers);
- enquiry.push(item.enquires);
- }
- }
- coreDataChart.value.x = x;
- coreDataChart.value.pv = pv;
- coreDataChart.value.uv = uv;
- coreDataChart.value.enquiry = enquiry;
- statistics.value.uv = res.result.totalUsers;
- statistics.value.pv = res.result.pageViews;
- statistics.value.averageVisit = res.result.dailyTotalUsers;
- statistics.value.averageVisitDuration = res.result.avgTimeOnPage;
- statistics.value.averageVisitPage = res.result.pageViewsPerSession;
- statistics.value.bounceRate = res.result.bounceRate;
- statistics.value.conversionRate = res.result.enquiryConversionRate;
- infoLoading.value = false;
- });
- } catch (error) {
- console.error(error);
- }
- };
- // 最多访问TOP10列表
- const mostAccessColumns = ref([
- {
- title: "来源",
- dataIndex: "pagePath",
- scopedSlots: {
- customRender: "pagePathSlot"
- }
- },
- {
- title: "浏览量(PV)",
- dataIndex: "pageViews",
- defaultSortOrder: "descend",
- sorter: (a, b) => a.pageViews - b.pageViews,
- width: 160,
- scopedSlots: {
- customRender: "centerSlot"
- }
- },
- {
- title: "浏览量占比",
- dataIndex: "pvProportion",
- width: 160,
- scopedSlots: {
- customRender: "centerSlot"
- }
- }
- ]);
- const getMostAccessList = async () => {
- try {
- let queryParam = {
- siteCode: formState.siteName.value,
- limit: 10,
- start: dayjs(formState.range).startOf("month").format("YYYY-MM-DD"),
- end: dayjs(formState.range).endOf("month").format("YYYY-MM-DD")
- };
- const res = await getAction("/dmp-data/page-path/stats", queryParam);
- if (res.code == 200) {
- mostAccessDatasource.value = res.result;
- } else {
- mostAccessDatasource.value = [];
- }
- } catch (error) {
- console.error(error);
- }
- };
- const appointKeywordNum = ref(null);
- const longTailKeywordNum = ref(null);
- const getComprehenInfo = async () => {
- let d = {
- siteCode: formState.siteName.value
- };
- await getAction("/seo/seoKeywordsRank/comprehensiveInfo", d).then(res => {
- if (res.code == 200) {
- appointKeywordNum.value = res.result.appointKeywordNum;
- longTailKeywordNum.value = res.result.longTailKeywordNum;
- }
- });
- };
- const detailInfo = ref({
- thisMonth: "",
- nextMonth: "",
- outlink1: "",
- outlink2: "",
- outlink3: "",
- outLinkImg: [],
- outLinkImg2: [],
- outLinkImgDetail1: "",
- outLinkImgDetail2: ""
- });
- const rankInfo = ref({
- appointKeyword: ref({}),
- longTailKeyword: ref({})
- });
- //获取三个list的数据
- const getRankInfo = () => {
- let d = {
- siteCode: formState.siteName.value
- };
- getAction("/seo/seoKeywordsRank/getRankInfo", d).then(res => {
- if (res.code == 200) {
- rankInfo.value.appointKeyword = res.result.appointKeyword;
- rankInfo.value.longTailKeyword = res.result.longTailKeyword;
- }
- });
- let d2 = {
- siteCode: formState.siteName.value,
- exportMonth: formState.range.format("YYYY-MM")
- };
- getAction("seo/seoMonthPdf/getSeoKeywordsRank", d2).then(res => {
- if (res.code == 200) {
- appointKeywordsList.value = res.result.appointKeywordsInfoList;
- longTailKeywordsList.value = res.result.longTailKeywordsInfoList;
- }
- });
- };
- const getSeoMonthPlanContent = () => {
- getAction("/seo/seoMonthPdf/getSeoMonthPlanContent", {}).then(function(res) {
- detailInfo.value.thisMonth = res.result.currentMonthPlan;
- detailInfo.value.nextMonth = res.result.nextMonthPlan;
- });
- };
- function handleExportPdf() {
- const data = {
- customerName: formState.customerName,
- monthStr: dayjs(formState.range).format('YYYY-MM'),
- detailInfo: detailInfo.value,
- rankInfo: rankInfo.value,
- appointKeywordNum: appointKeywordNum.value,
- longTailKeywordNum: longTailKeywordNum.value,
- appointKeywordsList: appointKeywordsList.value,
- longTailKeywordsList: longTailKeywordsList.value,
- coreDataChart: coreDataChart.value,
- statistics: statistics.value,
- mostAccessDatasource: mostAccessDatasource.value
- };
- // Store data in localStorage
- localStorage.setItem('pdfExportData', JSON.stringify(data));
- // Open the Pdf page in a new tab
- const url = router.resolve({
- name: 'Pdf'
- }).href;
- window.open(url, '_blank');
- }
- function goBack() {
- // Clear localStorage data
- localStorage.removeItem('pdfExportData');
-
- flag.value = true;
- coreDataChart.value.x = [];
- coreDataChart.value.pv = [];
- coreDataChart.value.uv = [];
- detailInfo.value.thisMonth = '';
- detailInfo.value.nextMonth = '';
- detailInfo.value.outlink1 = '';
- detailInfo.value.outlink2 = '';
- detailInfo.value.outlink3 = '';
- detailInfo.value.outLinkImg = [];
- detailInfo.value.outLinkImg2 = [];
- detailInfo.value.outLinkImgDetail1 = '';
- detailInfo.value.outLinkImgDetail2 = '';
- formState.siteName = undefined;
- formState.customerName = '';
- appointKeywordsList.value = [];
- longTailKeywordsList.value = [];
- formState.range = dayjs().subtract(1, "months");
- }
- const resetForm = () => {
- formRef.value.resetFields();
- };
- onMounted(() => {
- getSiteOption();
- });
- </script>
- <style scoped lang="less">
- .content {
- /deep/ .ant-table-pagination.ant-pagination {
- display: none;
- }
- .tip {
- color: #666;
- }
- .ant-card {
- /deep/ .ant-card-body {
- .step1 {
- min-height: 90vh;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 720px;
- margin: 0 auto;
- flex-direction: column;
- .ant-form-item {
- margin-bottom: 15px;
- }
- }
- }
- }
- .btn3 {
- position: fixed;
- right: 100px;
- top: 180px;
- z-index: 999;
- }
- .step2 {
- padding: 24px;
- }
- .top {
- text-align: center;
- h1 {
- font-size: 27px;
- font-weight: 500;
- line-height: 1;
- margin: 0;
- }
- p {
- font-size: 14px;
- color: #333;
- }
- .btn1 {
- position: fixed;
- right: 150px;
- top: 180px;
- z-index: 999;
- }
- .btn2 {
- position: fixed;
- right: 50px;
- top: 180px;
- z-index: 999;
- }
- .btn4 {
- position: fixed;
- right: 265px;
- top: 180px;
- z-index: 999;
- }
- .btn6 {
- position: fixed;
- right: 265px;
- top: 180px;
- z-index: 999;
- }
- }
- .title {
- border-left: 4px solid #544beb;
- line-height: 1;
- padding-left: 5px;
- margin: 40px 0 0;
- &.mb {
- margin-bottom: 20px;
- }
- .red {
- color: red;
- position: relative;
- top: 4px;
- left: 4px;
- }
- }
- .s1 {
- .p1 {
- color: #333;
- font-size: 15px;
- }
- textarea {
- min-height: 170px;
- }
- .num-suffix {
- position: relative;
- .suffix-self {
- position: absolute;
- right: 10px;
- bottom: 10px;
- }
- }
- }
- .s2 {
- .r5-1 {
- .item {
- width: 18%;
- margin: 40px 1% 0;
- float: left;
- padding: 20px;
- box-shadow: 3px 2px 10px -6px #544beb;
- border-radius: 10px;
- p {
- text-align: center;
- font-size: 15px;
- &:nth-child(2) {
- font-size: 20px;
- font-weight: 600;
- }
- img {
- width: 20px;
- margin-top: -5px;
- margin-right: 10px;
- }
- }
- }
- .fr {
- float: right;
- line-height: 2;
- span {
- margin-right: 30px;
- i {
- display: inline-block;
- width: 25px;
- height: 3px;
- background: #544BEB;
- position: relative;
- top: -4px;
- margin-right: 20px;
- }
- &:last-child i {
- background: #F0B358;
- }
- }
- }
- }
- }
- .s3 {
- .item {
- padding: 20px;
- height: 100%;
- border-radius: 10px;
- text-align: center;
- img {
- width: 80px;
- margin: 20px auto;
- }
- p {
- text-align: center;
- font-size: 15px;
- }
- }
- .wrap {
- padding: 20px;
- background: #fff;
- border-radius: 10px;
- margin-bottom: 10px;
- .t1 {
- color: #000;
- font-size: 14px;
- font-weight: 500;
- }
- .content {
- display: block;
- overflow: hidden;
- line-height: 1;
- border-bottom: 1px solid #ddd;
- padding: 20px 0;
- &:last-child {
- border-bottom: none;
- padding-bottom: 0;
- }
- .d1 {
- float: left;
- width: 50%;
- line-height: 25px;
- color: #000;
- img {
- width: 15px;
- margin: -4px 5px 0 0;
- }
- }
- .d2 {
- float: right;
- width: 50%;
- text-align: right;
- &.d3 {
- span {
- color: #000;
- }
- }
- a {
- font-size: 25px;
- font-weight: 500;
- }
- }
- }
- }
- }
- .s4 {
- .item {
- width: 32.33%;
- margin: 0 0.5%;
- border: 1px solid #e6e6e6;
- float: left;
- padding: 10px;
- border-radius: 10px;
- p {
- font-weight: 600;
- font-size: 15px;
- text-align: center;
- margin-bottom: 5px;
- }
- input {
- border: none;
- border-bottom: 1px solid #d9d9d9;
- border-radius: 0;
- text-align: center;
- &:focus {
- box-shadow: none;
- }
- }
- }
- .sub-title {
- font-size: 19px;
- color: #333;
- padding: 0 0 0 10px;
- border-left: 4px solid #544beb;
- line-height: 1;
- padding-left: 5px;
- margin: 20px 0 5px 0;
- }
- .img-wrap {
- height: 340px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- border: 1px solid #d9d9d9;
- border-radius: 5px;
- .img {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- }
- textarea.ant-input {
- margin: 10px 0 0;
- min-height: 80px;
- }
- .suffix-self {
- position: absolute;
- right: 10px;
- bottom: 10px;
- }
- }
- .s5 {
- p {
- font-size: 15px;
- color: #333;
- &.right {
- text-align: right;
- padding-right: 50px;
- }
- &.tips {
- color: #999;
- }
- }
- }
- }
- </style>
|