From aa8b0477197ba7757fe2d145ad6c2698e992b122 Mon Sep 17 00:00:00 2001 From: zx <604444282@qq.com> Date: Tue, 25 Jan 2022 16:03:17 +0800 Subject: [PATCH] zx --- src/api/ThemeAnalizeDec/index.js | 78 +++++++++++++++ src/views/ThemeAnalize/index.vue | 30 +++++- src/views/ThemeAnalize/tbEvent.js | 69 ++++++++----- src/views/ThemeBoard/VolumeArea/index.vue | 43 ++++++++ src/views/ThemeBoard/index.vue | 115 +++++++++++++++++++++- src/views/ThemeData/getApi.js | 36 ++++++- src/views/ThemeData/index.vue | 59 ++++++++++- src/views/ThemeData/tableEvent.js | 77 ++++++++++++++- 8 files changed, 473 insertions(+), 34 deletions(-) diff --git a/src/api/ThemeAnalizeDec/index.js b/src/api/ThemeAnalizeDec/index.js index b80bd3a..2bd7532 100644 --- a/src/api/ThemeAnalizeDec/index.js +++ b/src/api/ThemeAnalizeDec/index.js @@ -156,6 +156,19 @@ export function getSexMerge(params) { }) } +// 主题分析-区域分布 +export function getVolume(params) { + let obj = Object.assign({action: 'getVolume', sType: ''}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} + // 主题分析-区域分布 export function getRegion(params) { let obj = Object.assign({action: 'getRegion', sType: ''}, params) @@ -207,3 +220,68 @@ export function getRegionWeiBo(params) { } }) } + +// 主题分析-看板导出 +export function ToWord(params) { + let obj = Object.assign({action: 'ToWord', sType: 'ZhuTiFenXiBl'}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} + +// 主题分析-相似-列表数据 +export function getSimilarityData(params) { + let obj = Object.assign({action: 'getSimilarityData', sType: 'ZhuTiFenXiBl'}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} + +// 主题分析-相似-传播 +export function getDiffuse(params) { + let obj = Object.assign({action: 'getDiffuse', sType: 'ZhuTiFenXiBl'}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} + +// 主题分析-相似-获得数据 +export function getDataById(params) { + let obj = Object.assign({action: 'getDataById', sType: 'ZhuTiFenXiBl'}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} + +// 主题分析-相似-下载 +export function toExcel(params) { + let obj = Object.assign({action: 'toExcel', sType: 'ZhuTiFenXiBl'}, params) + return httpService({ + url: `/api/v6.ashx`, + method: 'post', + data: obj, + headers: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) +} \ No newline at end of file diff --git a/src/views/ThemeAnalize/index.vue b/src/views/ThemeAnalize/index.vue index e205223..86dd4c7 100644 --- a/src/views/ThemeAnalize/index.vue +++ b/src/views/ThemeAnalize/index.vue @@ -6,11 +6,36 @@ 返回事件洞察
- + - + +
+
+ 进行中 + 已完成 + + 编辑 + +
此操作将删除数据,是否继续?
+ 删除 +
+
+
+
+
+ {{item.name}} +
+
+
开始时间
{{item.startTime}}
+
结束时间
{{item.endTime}}
+
相关报道(条)
{{item.total}}
+
+
+
+
+
进行中 @@ -35,7 +60,6 @@
-
diff --git a/src/views/ThemeAnalize/tbEvent.js b/src/views/ThemeAnalize/tbEvent.js index e83d1fc..6460eb6 100644 --- a/src/views/ThemeAnalize/tbEvent.js +++ b/src/views/ThemeAnalize/tbEvent.js @@ -48,9 +48,8 @@ export default { token: this.getToken, Guids: guids }; - getSchemeDataByGuid(obj).then(res => { + getSchemeDataByGuid(obj).then(res => { let data = res.data; - console.log(data); this.addForm = data; this.doCombo(); this.doComboHigh(); @@ -124,6 +123,16 @@ export default { handlerTabs(activeTab) { this.addForm.DetailsData[0].IsAdvancedQuery = activeTab; }, + //切换主题 + handlerChangeTheme(n) { + if(n == 1) { + this.form.sType = 'former'; + } + if(n == 0) { + this.form.sType = 'now'; + }; + this.getNowData(); + }, //重置表单 reSet() { this.addForm = { @@ -145,27 +154,41 @@ export default { }, //前往详情页 toThemeData(guids) { - this.$router.push( - { - path: '/ThemeData', - query: { - action: "getList", - // sTimeType, - // sQuDao, - // sQingGan, - // iPageIndex, - // iPageSize, - token: this.getToken, - sType: "ZhuTiFenXiBl", - sGuid: guids, - // iGroupBy, - // isSourcetype, - // listType, - // website, - // iTimeType - }, - } - ) + let obj = { + token: this.getToken, + Guids: guids + }; + let sTime = ''; + let eTime = ''; + getSchemeDataByGuid(obj).then(res => { + let data = res.data; + sTime = data.StartTime; + eTime = data.EndTime; + this.$router.push( + { + path: '/ThemeData', + query: { + action: "getList", + // sTimeType, + // sQuDao, + // sQingGan, + // iPageIndex, + // iPageSize, + startTime: sTime, + endTime: eTime, + token: this.getToken, + sType: "ZhuTiFenXiBl", + sGuid: guids, + // iGroupBy, + // isSourcetype, + // listType, + // website, + // iTimeType + }, + } + ) + }) + }, //日期 calendarPriceRangeChange(date) { diff --git a/src/views/ThemeBoard/VolumeArea/index.vue b/src/views/ThemeBoard/VolumeArea/index.vue index 098beae..206ffd9 100644 --- a/src/views/ThemeBoard/VolumeArea/index.vue +++ b/src/views/ThemeBoard/VolumeArea/index.vue @@ -13,13 +13,56 @@ diff --git a/src/views/ThemeBoard/index.vue b/src/views/ThemeBoard/index.vue index bda74f9..be7f231 100644 --- a/src/views/ThemeBoard/index.vue +++ b/src/views/ThemeBoard/index.vue @@ -3,6 +3,7 @@
+ 下载 返回
@@ -54,6 +55,9 @@ import userArea from "./UserArea" //用户区域分布 import peopleGender from "./PeopleGender" //人群画像性别分析 import peopleAuthen from "./PeopleAuthen" //人群画像认证分析 import weiboAnalize from "./WeiboAnalize" //微博分析 +import {getVolumeTime,getList,getCoreDiffuse,getCoreWebsite,getSourcetypeTime,getHotWord, + getHottalk,getPositive,getNegative,getRegion,getSexMerge,getVAnalyze,getDiffuseZhuTi, + getRegionWeiBo,ToWord} from "@/api/ThemeAnalizeDec" export default { name: "ThemeBoard", components: { @@ -79,11 +83,38 @@ export default { }, form: { token: '' + }, + downloadForm: { + sType: 'ZhuTiFenXiBl', + sGuid: '', + sData: { + getSummarize: '', + getVolumeTime: {Msg: '',sBase64: ''}, + getList: [], + getCoreDiffuse: [], + getCoreWebsite: {Data: {}}, + getSourcetypeTime: {Msg: '',sBase64: ''}, + getHotWord: {Msg: '',sBase64: ''}, + getHottalk: {Msg: '',sBase64: ''}, + getAffections: {Msg: '',sBase64: ''}, + getPositive: {Msg: '',sBase64: ''}, + getNegative: {Msg: '',sBase64: ''}, + getVolume: {Data:{},sBase64: ''}, + getSex: {Msg: '',sBase64: ''}, //getSexMerge + getAttestation: {Msg: '',sBase64: ''}, //getSexMerge + getRegion: {Data:{},sBase64: ''}, + getVAnalyze: {Msg: '',Data:{},sBase64: ''}, + getCoreDiffuseWeiBo: [], + getDiffuse: {Data:{},sBase64: ''}, + getAffectionsWeiBo: {sBase64: ''}, + getRegionWeiBo: {Data:{},sBase64: ''}, + } } } }, created() { - this.form = this.$route.query; + this.form = Object.assign({},{token: this.getToken},this.$route.query) + this.downloadForm.sGuid = this.$route.query.sGuid; this.getTitleData(); }, methods: { @@ -94,12 +125,94 @@ export default { let obj = Object.assign({}, this.form); getSummarizeMerge(obj).then(res => { let data = res.data; + this.downloadForm.sData.getSummarize = data.Summarize; + this.downloadForm.sData.getAffections.Msg = data.AffectionsMsg; let o = { title: data.Summarize, content: data.AffectionsMsg }; this.themeObj = o }) + }, + goDownload() { + Promise.all([this.doData()]).then(() => { + let str = JSON.stringify(this.downloadForm); + let obj = { + token: this.getToken, + sType: 'ZhuTiFenXiBl', + sJson: str + } + ToWord(obj).then(res => { + let url = res.data; + this.$notification.open({ + message: `数据生成中`, + description: '请前往个人中心查看下载进度', + placement: 'bottomRight', + }); + window.location.href=url; + }) + }); + }, + doData() { + getVolumeTime(this.form).then(res => { + this.downloadForm.sData.getVolumeTime.Msg = res.msg; + }); + let o = { + iPageIndex: 1, + iPageSize: 20, + iTimeType: 0 + }; + let obj = Object.assign({},o,this.form); + getList(obj).then(res => { + this.downloadForm.sData.getList = res.data + }); + getCoreDiffuse(this.form).then(res => { + this.downloadForm.sData.getCoreDiffuse = res.data; + }); + getCoreWebsite(this.form).then(res => { + this.downloadForm.sData.getCoreWebsite.Data = res.data; + }); + getSourcetypeTime(this.form).then(res => { + this.downloadForm.sData.getSourcetypeTime.Msg = res.msg; + }); + getHotWord(this.form).then(res => { + this.downloadForm.sData.getHotWord.Msg = res.msg; + }); + getHottalk(this.form).then(res => { + this.downloadForm.sData.getHottalk.Msg = res.msg; + }); + getPositive(this.form).then(res => { + this.downloadForm.sData.getPositive.Msg = res.msg; + }); + getNegative(this.form).then(res => { + this.downloadForm.sData.getNegative.Msg = res.msg; + }); + getRegion(this.form).then(res => { + this.downloadForm.sData.getVolume.Data = res.data; + }); + getSexMerge(this.form).then(res => { + this.downloadForm.sData.getSex.Msg = res.data.sexMsg; + this.downloadForm.sData.getAttestation.Msg = res.data.attestationMsg; + }); + getRegion(this.form).then(res => { + this.downloadForm.sData.getRegion.Data = res.data; + }); + getVAnalyze(this.form).then(res => { + this.downloadForm.sData.getVAnalyze.Msg = res.data.getVAnalyzeMsg; + this.downloadForm.sData.getVAnalyze.Data = res.data.getVAnalyze; + }); + getDiffuseZhuTi(this.form).then(res => { + let dt = { + total: res.data.total, + sum: res.data.sum, + volume: res.data.volume, + }; + this.downloadForm.sData.getCoreDiffuseWeiBo = res.data.getCoreDiffuseWeiBo; + this.downloadForm.sData.getDiffuse.Data = dt; + }); + getRegionWeiBo(this.form).then(res => { + this.downloadForm.sData.getRegionWeiBo.Data = res.data; + }); } } } diff --git a/src/views/ThemeData/getApi.js b/src/views/ThemeData/getApi.js index 37f648b..8b6f781 100644 --- a/src/views/ThemeData/getApi.js +++ b/src/views/ThemeData/getApi.js @@ -1,4 +1,4 @@ -import { getQuDao, getQingGan, getTwoTime} from "@/api/comm"; +import { getQuDao, getQingGan, getTwoTime,getToExcelField} from "@/api/comm"; import {getList} from "@/api/ThemeAnalizeDec" export default { //获取表格数据 @@ -11,10 +11,12 @@ export default { this.pagination.total = res.totalNum; let arr = []; let ids = []; + let ssims = []; let ssk = [...this.sk]; data.forEach((ele) => { let _source = ele._source; let id = _source.id; + ssims.push(ele._source.ssid); ids.push(id); arr.push(_source); }); @@ -32,6 +34,10 @@ export default { this.tbData = arr; this.tableLoading = false; }) + }, + // 获取列表 + getListData() { + }, // 获取时间选项 getTime() { @@ -74,7 +80,7 @@ export default { }) .catch(() => { reject(false); - }); + }); }); }, // 获取情感 @@ -127,4 +133,30 @@ export default { }); this.form.sQingGan = qingGan.toString(); }, + // 获取导出字段 + getToExcelField(sType, token) { + return new Promise((resolve, reject) => { + getToExcelField({sType: sType, token: token}).then(res => { + let data = res.data; + let arr = []; + let arr1 = []; + data.forEach((ele) => { + if(ele.checked == 1) { + arr1.push(ele.field) + } + let obj = { + label: ele.name, + value: ele.field, + }; + arr.push(obj); + }); + this.checkedIds = arr1; + this.fileTypeChange(arr1); + this.plainOptions4 = arr; + resolve(arr); + }).catch(() => { + reject(false); + }) + }) + } } \ No newline at end of file diff --git a/src/views/ThemeData/index.vue b/src/views/ThemeData/index.vue index d957a9d..e8a0a38 100644 --- a/src/views/ThemeData/index.vue +++ b/src/views/ThemeData/index.vue @@ -40,9 +40,9 @@
- 共计{{totalNum}}条数据,已选中条数据 + 共计{{totalNum}}条数据,已选中{{tableAll ? totalNum : sk.length}}条数据
- 导出数据 + 导出数据 数据看板
@@ -59,6 +59,29 @@
+ +
+ + + + + + xlsx + + + + + + {{execlForm.iNum}}条 + + +
+
+
+
确定
+
+
+
@@ -73,7 +96,23 @@ export default { }, data() { return { + //-数据导出-// + plainOptions4: [], + modalObj: { + title: "导出选项", + visible: false, + }, + execlForm: { + action: "toExcel", + sFileName: "", + sCheckedIds: "", + iNum: 0, + sField: "", + }, + checkedIds: [], + // noClick: false, + tableAll: false, totalNum: 0, form: { action: 'getList', @@ -197,4 +236,20 @@ export default { } } } +.epor { + width: 100%; + height: 80px; + .epor-btn { + width: 480px; + height: 80px; + background-image: url("../../assets/images/comm/img_bbut.png"); + background-repeat: no-repeat; + background-size: cover; + text-align: center; + line-height: 80px; + color: #63aecc; + font-size: 28px; + cursor: pointer; + } +} \ No newline at end of file diff --git a/src/views/ThemeData/tableEvent.js b/src/views/ThemeData/tableEvent.js index 320851b..3b272a0 100644 --- a/src/views/ThemeData/tableEvent.js +++ b/src/views/ThemeData/tableEvent.js @@ -9,7 +9,6 @@ export function rowSelection() { this.selectedRowKeys = selectedRowKeys.toString(); this.selectedRows = selectedRows; this.secIds = selectedRowKeys; - }, onSelect:(record, selected) => { if(!selected) { @@ -29,6 +28,7 @@ export function rowSelection() { } import moment from "moment"; +import {toExcel} from "@/api/ThemeAnalizeDec"; export default { //---主页面---// @@ -36,7 +36,7 @@ export default { Promise.all([ this.getTime(), this.getQuDao(), - this.getQingGan() + this.getQingGan(), ]).then(() => { this.form.token = this.getToken; this.form.sGuid = this.$route.query.sGuid; @@ -49,7 +49,7 @@ export default { this.doFormQudao(qudao); this.doFormQS(series); - this.form.sTimeType = this.$route.query.sTimeType || '34'; + this.form.sTimeType = this.$route.query.sTimeType || '4'; this.form.sStartTime = this.$route.query.startTime || ""; this.form.sEndTime = this.$route.query.endTime || ""; if (this.form.sStartTime && this.form.sEndTime) { @@ -79,6 +79,8 @@ export default { token: this.getToken, website: this.form.website, sTitle: this.form.sTitle, + sStartTime: this.form.sStartTime, + sEndTime: this.form.sEndTime, sTimeType: this.form.sTimeType, sQuDao: this.form.sQuDao, sQingGan: this.form.sQingGan @@ -193,4 +195,73 @@ export default { this.pagination.current = iPageIndex; this.getTableData(); }, + //前往导出页面 + goOutput() { + this.getToExcelField(this.form.sType, this.form.token).then(() => { + if(!this.form.sBrand && !this.form.sSeriesName) { + this.execlForm.sFileName = "事件数据" + this.getDatetimeSs(); + } else { + this.execlForm.sFileName = this.form.sBrand + this.form.sSeriesName + this.getDatetimeSs(); + } + this.execlForm.sCheckedIds = this.tableAll ? '' : this.sk.toString(); + this.execlForm.iNum = this.tableAll ? this.totalNum : this.sk.length; + this.modalObj.visible = true; + }) + }, + // 导出数据 + exportExcel() { + if(this.execlForm.iNum === 0) { + this.$message.warning('请选择下载数据'); + return; + } + if(this.checkedIds.length === 0) { + this.$message.warning('请选择下载字段'); + return; + } + if (this.execlForm.iNum && this.checkedIds.length > 0) { + let o = { + token: this.getToken, + sTimeType: this.form.sTimeType, + sStartTime: this.form.sStartTime, + sEndTime: this.form.sEndTime, + sQuDao: this.form.sTimeType, + sQingGan: this.form.sQingGan, + sTitle: this.form.sTitle, + sTitleType: '1', + sGuid: this.form.sGuid, + iTimeType: this.form.sGuid, + website: this.form.website, + } + let eForm = Object.assign(o,this.execlForm); + toExcel(eForm).then(() => { + this.$notification.open({ + message: `数据生成中`, + description: '请前往个人中心查看下载进度', + placement: 'bottomRight', + }); + this.modalObj.visible = false; + }) + } + }, + // 导出时将对象合并 + mergeForm() { + let wKey = ['action', 'iPageIndex', 'iPageSize']; + for (let key in this.form) { + if (!wKey.includes(key)) { + this.execlForm[key] = this.form[key] + } + } + }, + // 选择导出接口 + fileTypeChange(val = []) { + let obj = {}; + this.plainOptions4.forEach(ele => { + if (val.includes(ele.value)) { + obj[ele.value] = 1; + } else { + obj[ele.value] = 0; + } + }); + this.execlForm.sField = JSON.stringify(obj); + }, } \ No newline at end of file