|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<!--
|
|
|
|
|
* @Author: xw
|
|
|
|
|
* @Date: 2021-10-11 14:11:04
|
|
|
|
|
* @LastEditTime: 2021-10-22 10:16:54
|
|
|
|
|
* @LastEditTime: 2021-10-22 16:15:09
|
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
|
* @Description: 行业数据导出
|
|
|
|
|
* @FilePath: /data-show/src/views/IndustryDataExport/index.vue
|
|
|
|
@ -16,18 +16,18 @@
|
|
|
|
|
<div class="ide-d1">
|
|
|
|
|
<div class="ide-d1-dd1">
|
|
|
|
|
<span class="s1">时间:</span>
|
|
|
|
|
<v-tab-group :style="{ background: 'transparent' }" :btns="['24小时', '近7天', '近30天', '自定义时间']"></v-tab-group>
|
|
|
|
|
<a-range-picker :size="$vuiSize" valueFormat="YYYY-MM-DD" v-if="sTimeType === selVal" @change="handlerChangeTime">
|
|
|
|
|
<v-tab-group :style="{ background: 'transparent' }" :btns="btnTimes" @change="handlerTime"></v-tab-group>
|
|
|
|
|
<a-range-picker style="margin-left: 12px" :size="$vuiSize" valueFormat="YYYY-MM-DD" v-if="form.sTimeType === selVal" @change="handlerChangeTime">
|
|
|
|
|
<a-icon slot="suffixIcon" type="calendar" />
|
|
|
|
|
</a-range-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ide-d1-dd1" style="margin-top: 24px">
|
|
|
|
|
<span class="s1">渠道:</span>
|
|
|
|
|
<a-checkbox-group v-model="quDao" :options="plainOptions" @change="onChange" />
|
|
|
|
|
<a-checkbox-group v-model="quDao" :disabled="noClick" :options="plainOptions" @change="(val) => onChange(val, 'quDao')" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ide-d1-dd1" style="margin-top: 24px">
|
|
|
|
|
<span class="s1">情感:</span>
|
|
|
|
|
<a-checkbox-group v-model="qingGan" :options="plainOptions1" @change="onChange" />
|
|
|
|
|
<a-checkbox-group v-model="qingGan" :options="plainOptions1" @change="(val) => onChange(val, 'qingGan')" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ide-d1-dd1" style="margin-top: 24px">
|
|
|
|
|
<span class="s1">负面等级:</span>
|
|
|
|
@ -35,13 +35,14 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ide-d2">
|
|
|
|
|
<span class="s1">共计<span class="ss1">10119</span>条数据,已选中<span class="ss1">0</span>条数据</span>
|
|
|
|
|
<a-button type="primary" @click="handlerExport">导出数据</a-button>
|
|
|
|
|
<span class="s1">共计<span class="ss1">{{totalNum}}</span>条数据</span>
|
|
|
|
|
<!-- <span class="s1">共计<span class="ss1">{{totalNum}}</span>条数据,已选中<span class="ss1">0</span>条数据</span> -->
|
|
|
|
|
<!-- <a-button type="primary" @click="handlerExport">导出数据</a-button> -->
|
|
|
|
|
</div>
|
|
|
|
|
<v-table :columns="columns" :data="tbData"></v-table>
|
|
|
|
|
<v-table :columns="columns" :data="tbData" :loading="tableLoading" :pagination="pagination" @change="handlerPage"></v-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<v-modal :title="modalObj.title" :visible.sync="modalObj.visible" :eleStyle="{ width: '1200px', height: '531px' }">
|
|
|
|
|
<!-- <v-modal :title="modalObj.title" :visible.sync="modalObj.visible" :eleStyle="{ width: '1200px', height: '531px' }">
|
|
|
|
|
<div slot="body" style="padding: 0px 24px 24px 24px">
|
|
|
|
|
<a-form :label-col="{ span: 2 }" :wrapper-col="{ span: 8 }">
|
|
|
|
|
<a-form-item label="文件名称">
|
|
|
|
@ -58,12 +59,13 @@
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
</v-modal>
|
|
|
|
|
</v-modal> -->
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getQuDao, getQingGan, getCrisis } from "@/api/comm";
|
|
|
|
|
import { getQuDao, getQingGan, getCrisis, getTwoTime } from "@/api/comm";
|
|
|
|
|
import { getListHome } from "@/api/home";
|
|
|
|
|
export default {
|
|
|
|
|
name: "IndustryDataExport",
|
|
|
|
|
data() {
|
|
|
|
@ -72,79 +74,91 @@ export default {
|
|
|
|
|
qingGan: [],
|
|
|
|
|
crisis: [],
|
|
|
|
|
value3: [],
|
|
|
|
|
selVal: 4,
|
|
|
|
|
form: {
|
|
|
|
|
sStartTime: "",
|
|
|
|
|
sEndTime: "",
|
|
|
|
|
sQingGan: "",
|
|
|
|
|
sCrisis: "",
|
|
|
|
|
isSourcetype: [],
|
|
|
|
|
sTimeType: "",
|
|
|
|
|
iPageIndex: 1,
|
|
|
|
|
iPageSize: 20,
|
|
|
|
|
},
|
|
|
|
|
modalObj: {
|
|
|
|
|
title: "导出选项",
|
|
|
|
|
visible: false,
|
|
|
|
|
},
|
|
|
|
|
btnTimes: [],
|
|
|
|
|
timesSel: [],
|
|
|
|
|
plainOptions: [],
|
|
|
|
|
plainOptions1: [],
|
|
|
|
|
plainOptions2: [],
|
|
|
|
|
plainOptions3: [
|
|
|
|
|
{ label: "检测方案名称", value: "1" },
|
|
|
|
|
{ label: "标题", value: "2" },
|
|
|
|
|
{ label: "倾向性", value: "3" },
|
|
|
|
|
{ label: "发布媒体", value: "3" },
|
|
|
|
|
{ label: "链接地址", value: "4" },
|
|
|
|
|
{ label: "关键字", value: "5" },
|
|
|
|
|
{ label: "媒体类别", value: "6" },
|
|
|
|
|
{ label: "发表类型", value: "7" },
|
|
|
|
|
{ label: "作者", value: "8" },
|
|
|
|
|
{ label: "检测时间", value: "9" },
|
|
|
|
|
{ label: "发布时间", value: "10" },
|
|
|
|
|
{ label: "字数", value: "11" },
|
|
|
|
|
{ label: "浏览数", value: "12" },
|
|
|
|
|
{ label: "回复数", value: "13" },
|
|
|
|
|
{ label: "主体词词频", value: "14" },
|
|
|
|
|
{ label: "摘要", value: "15" },
|
|
|
|
|
{ label: "转载数", value: "16" },
|
|
|
|
|
{ label: "博文类型", value: "17" },
|
|
|
|
|
{ label: "博主粉丝数", value: "18" },
|
|
|
|
|
{ label: "阅读状态", value: "19" },
|
|
|
|
|
{ label: "点赞数", value: "20" },
|
|
|
|
|
{ label: "风险指数", value: "21" },
|
|
|
|
|
{ label: "影响力", value: "22" },
|
|
|
|
|
{ label: "分类标签", value: "23" },
|
|
|
|
|
{ label: "收藏数", value: "24" },
|
|
|
|
|
{ label: "分享数", value: "25" },
|
|
|
|
|
{ label: "原文标题", value: "26" },
|
|
|
|
|
],
|
|
|
|
|
plainOptions3: [],
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
title: "标题及内容",
|
|
|
|
|
dataIndex: "a",
|
|
|
|
|
key: "a",
|
|
|
|
|
dataIndex: "title",
|
|
|
|
|
key: "title",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "来源",
|
|
|
|
|
dataIndex: "address",
|
|
|
|
|
key: "address",
|
|
|
|
|
dataIndex: "source",
|
|
|
|
|
key: "source",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "作者",
|
|
|
|
|
dataIndex: "age",
|
|
|
|
|
key: "age",
|
|
|
|
|
dataIndex: "user_author",
|
|
|
|
|
key: "user_author",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "发布时间",
|
|
|
|
|
dataIndex: "d",
|
|
|
|
|
key: "d",
|
|
|
|
|
dataIndex: "sourcetime",
|
|
|
|
|
key: "sourcetime",
|
|
|
|
|
width: 200,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
pagination: {
|
|
|
|
|
total: 0,
|
|
|
|
|
current: 1,
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
},
|
|
|
|
|
tbData: [],
|
|
|
|
|
tableLoading: false,
|
|
|
|
|
noClick: false,
|
|
|
|
|
totalNum: 0,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
Promise.all([this.getQuDao(),this.getQingGan(), this.getCrisis()])
|
|
|
|
|
Promise.all([
|
|
|
|
|
this.getQuDao(),
|
|
|
|
|
this.getQingGan(),
|
|
|
|
|
this.getCrisis(),
|
|
|
|
|
this.getTime(),
|
|
|
|
|
]).then(() => {
|
|
|
|
|
this.getTable();
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onChange() {},
|
|
|
|
|
onChange(val, type) {
|
|
|
|
|
switch (type) {
|
|
|
|
|
case "quDao":
|
|
|
|
|
this.noClick = true;
|
|
|
|
|
this.getTable().then(() => {
|
|
|
|
|
this.noClick = false;
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
case "qingGan":
|
|
|
|
|
this.noClick = true;
|
|
|
|
|
this.form.sQingGan = this.qingGan.toString();
|
|
|
|
|
this.getTable().then(() => {
|
|
|
|
|
this.noClick = false;
|
|
|
|
|
});
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handlerExport() {
|
|
|
|
|
this.modalObj.visible = true;
|
|
|
|
|
},
|
|
|
|
@ -152,6 +166,88 @@ export default {
|
|
|
|
|
handlerBack() {
|
|
|
|
|
this.$router.go(-1);
|
|
|
|
|
},
|
|
|
|
|
// 改变时间的选项
|
|
|
|
|
handlerTime(n) {
|
|
|
|
|
let ele = this.timesSel[n];
|
|
|
|
|
this.form.sTimeType = ele.key;
|
|
|
|
|
if (ele.key != this.selVal) {
|
|
|
|
|
this.getData();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 选择时间的效果
|
|
|
|
|
handlerChangeTime(val) {
|
|
|
|
|
this.form.sStartTime = val[0];
|
|
|
|
|
this.form.sEndTime = val[1];
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
handlerPage(p) {
|
|
|
|
|
let iPageIndex = p.current;
|
|
|
|
|
this.form.iPageIndex = iPageIndex;
|
|
|
|
|
this.pagination.current = iPageIndex;
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
// 获取表格数据
|
|
|
|
|
getTable() {
|
|
|
|
|
this.tableLoading = true;
|
|
|
|
|
this.getData(0).then((res) => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.totalNum = res.totalNum;
|
|
|
|
|
this.pagination.total = res.totalNum;
|
|
|
|
|
let arr = [];
|
|
|
|
|
data.forEach((ele) => {
|
|
|
|
|
let _source = ele._source;
|
|
|
|
|
arr.push(_source);
|
|
|
|
|
});
|
|
|
|
|
this.tbData = arr;
|
|
|
|
|
this.tableLoading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 获取渠道数据
|
|
|
|
|
getList() {
|
|
|
|
|
this.getData(1).then((res) => {
|
|
|
|
|
let data = res.data1;
|
|
|
|
|
let arr = [...this.plainOptions];
|
|
|
|
|
for(let i =0;i<data.length;i++) {
|
|
|
|
|
arr[i].label = this.plainOptions[i].label +'('+ data[i]+')';
|
|
|
|
|
}
|
|
|
|
|
this.plainOptions = arr;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 获取后台数据
|
|
|
|
|
getData(isSourcetype) {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
let obj = Object.assign({}, this.form);
|
|
|
|
|
obj.isSourcetype = isSourcetype;
|
|
|
|
|
getListHome(obj)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
resolve(res);
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
reject(false);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 获取时间选项
|
|
|
|
|
getTime() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
getTwoTime()
|
|
|
|
|
.then((res) => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.timesSel = data;
|
|
|
|
|
this.form.sTimeType = this.timesSel[0].key;
|
|
|
|
|
let arr = [];
|
|
|
|
|
data.forEach((ele) => {
|
|
|
|
|
let value = ele.value;
|
|
|
|
|
arr.push(value);
|
|
|
|
|
});
|
|
|
|
|
this.btnTimes = arr;
|
|
|
|
|
resolve(data);
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
reject(false);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 获取渠道
|
|
|
|
|
getQuDao() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
@ -198,7 +294,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 获取负面等级
|
|
|
|
|
getCrisis() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
getCrisis()
|
|
|
|
|
.then((res) => {
|
|
|
|
|
let data = res.data;
|
|
|
|
@ -217,7 +313,7 @@ export default {
|
|
|
|
|
reject(false);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|