|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<!--
|
|
|
|
|
* @Author: your name
|
|
|
|
|
* @Date: 2021-10-18 10:56:38
|
|
|
|
|
* @LastEditTime: 2021-12-16 15:58:18
|
|
|
|
|
* @LastEditTime: 2021-12-16 16:06:28
|
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
|
* @Description: In User Settings Edit
|
|
|
|
|
* @FilePath: /data-show/src/views/EventComparison/eventRecommendationList/index.vue
|
|
|
|
@ -54,9 +54,9 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getUserBrand,getUserSeriesName, getEventType } from "@/api/comm";
|
|
|
|
|
import {getEventList} from "@/api/EventComparison"
|
|
|
|
|
import {arrDup} from "@/utils/gol/dataTool"
|
|
|
|
|
import { getUserBrand, getUserSeriesName, getEventType } from "@/api/comm";
|
|
|
|
|
import { getEventList } from "@/api/EventComparison";
|
|
|
|
|
import { arrDup } from "@/utils/gol/dataTool";
|
|
|
|
|
export default {
|
|
|
|
|
name: "eventRecommendationList",
|
|
|
|
|
data() {
|
|
|
|
@ -85,13 +85,11 @@ export default {
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
title: "事件类型",
|
|
|
|
|
width: 120,
|
|
|
|
|
dataIndex: "events_type",
|
|
|
|
|
key: "events_type",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "事件标题",
|
|
|
|
|
width: 630,
|
|
|
|
|
dataIndex: "events_title",
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
key: "events_title",
|
|
|
|
@ -109,31 +107,18 @@ export default {
|
|
|
|
|
{
|
|
|
|
|
title: "开始时间",
|
|
|
|
|
dataIndex: "minSourcetime",
|
|
|
|
|
width: 240,
|
|
|
|
|
key: "minSourcetime",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "文章篇数(篇)",
|
|
|
|
|
width: 120,
|
|
|
|
|
dataIndex: "events_count",
|
|
|
|
|
key: "events_count",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "传播周期(天)",
|
|
|
|
|
width: 120,
|
|
|
|
|
dataIndex: "days",
|
|
|
|
|
key: "days",
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// title: "信息条数(条)",
|
|
|
|
|
// dataIndex: "h",
|
|
|
|
|
// key: "h",
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// title: "传播人数(人)",
|
|
|
|
|
// dataIndex: "j",
|
|
|
|
|
// key: "j",
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
title: "操作",
|
|
|
|
|
key: "action",
|
|
|
|
@ -149,7 +134,7 @@ export default {
|
|
|
|
|
events_title: "",
|
|
|
|
|
minSourcetime: "",
|
|
|
|
|
events_count: "",
|
|
|
|
|
isDel: false
|
|
|
|
|
isDel: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
events_id: "",
|
|
|
|
@ -157,27 +142,27 @@ export default {
|
|
|
|
|
events_title: "",
|
|
|
|
|
minSourcetime: "",
|
|
|
|
|
events_count: "",
|
|
|
|
|
isDel: false
|
|
|
|
|
isDel: false,
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getQuDao();
|
|
|
|
|
this.getBrands();
|
|
|
|
|
this.getData()
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 获取后台数据
|
|
|
|
|
getData() {
|
|
|
|
|
this.formInline.token = this.getToken;
|
|
|
|
|
let obj = Object.assign({}, this.getCtime2, this.formInline);
|
|
|
|
|
getEventList(obj).then(res => {
|
|
|
|
|
getEventList(obj).then((res) => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
this.pagination.total = res.totalNum;
|
|
|
|
|
this.tbData = data;
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 获取品牌
|
|
|
|
|
getBrands() {
|
|
|
|
@ -188,7 +173,7 @@ export default {
|
|
|
|
|
getUserBrand(obj)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
let data = res.data;
|
|
|
|
|
let arr = arrDup(data, 'brandname')
|
|
|
|
|
let arr = arrDup(data, "brandname");
|
|
|
|
|
this.brands = arr;
|
|
|
|
|
resolve(true);
|
|
|
|
|
})
|
|
|
|
@ -207,30 +192,29 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 选择品牌
|
|
|
|
|
brandChange(val) {
|
|
|
|
|
if(val) {
|
|
|
|
|
if (val) {
|
|
|
|
|
this.getUserSeriesName(val);
|
|
|
|
|
} else {
|
|
|
|
|
this.models = [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 获取车型
|
|
|
|
|
getUserSeriesName(brandName) {
|
|
|
|
|
let obj = {
|
|
|
|
|
token: this.getToken,
|
|
|
|
|
sBrandName: brandName
|
|
|
|
|
}
|
|
|
|
|
getUserSeriesName(obj).then(res => {
|
|
|
|
|
sBrandName: brandName,
|
|
|
|
|
};
|
|
|
|
|
getUserSeriesName(obj).then((res) => {
|
|
|
|
|
let data = res.data || [];
|
|
|
|
|
this.models = data;
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 获取渠道
|
|
|
|
|
getQuDao() {
|
|
|
|
|
getEventType().then(res => {
|
|
|
|
|
getEventType().then((res) => {
|
|
|
|
|
let data = res.data || [];
|
|
|
|
|
this.quDaos = data;
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 分页
|
|
|
|
|
handlerPage(p) {
|
|
|
|
@ -249,38 +233,44 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 重置
|
|
|
|
|
handlerR() {
|
|
|
|
|
let obj = {
|
|
|
|
|
let obj = {
|
|
|
|
|
sBrand: undefined,
|
|
|
|
|
sQuDao: undefined,
|
|
|
|
|
sSeriesName: undefined,
|
|
|
|
|
sTitle: "",
|
|
|
|
|
iPageIndex: 1,
|
|
|
|
|
iPageSize: 20,
|
|
|
|
|
}
|
|
|
|
|
this.formInline = {...obj};
|
|
|
|
|
this.handlerSearch()
|
|
|
|
|
};
|
|
|
|
|
this.formInline = { ...obj };
|
|
|
|
|
this.handlerSearch();
|
|
|
|
|
},
|
|
|
|
|
// 添加的功能
|
|
|
|
|
handlerAdd(row) {
|
|
|
|
|
let x = this.chooseList.findIndex(ele => ele.events_id === row.events_id);
|
|
|
|
|
if(x != -1) return
|
|
|
|
|
let x = this.chooseList.findIndex(
|
|
|
|
|
(ele) => ele.events_id === row.events_id
|
|
|
|
|
);
|
|
|
|
|
if (x != -1) return;
|
|
|
|
|
let arr = [...this.chooseList];
|
|
|
|
|
let obj = Object.assign({}, row);
|
|
|
|
|
let n = this.chooseList.findIndex(ele => !ele.events_id);
|
|
|
|
|
let n = this.chooseList.findIndex((ele) => !ele.events_id);
|
|
|
|
|
obj.isDel = true;
|
|
|
|
|
arr[n] = {...obj};
|
|
|
|
|
arr[n] = { ...obj };
|
|
|
|
|
this.chooseList = arr;
|
|
|
|
|
this.$emit('change', this.chooseList);
|
|
|
|
|
this.$emit("change", this.chooseList);
|
|
|
|
|
},
|
|
|
|
|
// 开始对比
|
|
|
|
|
handlerBegin() {
|
|
|
|
|
if (
|
|
|
|
|
this.chooseList.length < 2 ||
|
|
|
|
|
this.getEComparison[0].events_id == "" ||
|
|
|
|
|
this.getEComparison[1].events_id == ""
|
|
|
|
|
) {
|
|
|
|
|
this.$message.warning("至少2个事件进行对比");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.setEComparison(this.chooseList);
|
|
|
|
|
this.$router.push({ path: "/eventComparison" });
|
|
|
|
|
},
|
|
|
|
|
// 开始对比
|
|
|
|
|
handlerBegin() {
|
|
|
|
|
if(this.chooseList.length < 2 || (this.getEComparison[0].events_id == "" || this.getEComparison[1].events_id == "")) {
|
|
|
|
|
this.$message.warning('至少2个事件进行对比');
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.setEComparison(this.chooseList);
|
|
|
|
|
this.$router.push({path: '/eventComparison'})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|