|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
/*
|
|
|
|
|
* @Author: your name
|
|
|
|
|
* @Date: 2021-10-27 15:29:37
|
|
|
|
|
* @LastEditTime: 2021-10-27 19:37:22
|
|
|
|
|
* @LastEditTime: 2021-10-28 10:36:57
|
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
|
* @Description: In User Settings Edit
|
|
|
|
|
* @FilePath: /data-show/src/views/IndustryDataExport/tableEvent.js
|
|
|
|
@ -13,7 +13,7 @@ function rowSelection(that) {
|
|
|
|
|
that.selectedRowKeys = selectedRowKeys.toString();
|
|
|
|
|
that.selectedRows = selectedRows;
|
|
|
|
|
that.secIds = selectedRowKeys;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// onSelect: (record, selected, selectedRows) => {
|
|
|
|
|
// console.log(record, selected, selectedRows);
|
|
|
|
@ -23,7 +23,7 @@ function rowSelection(that) {
|
|
|
|
|
// },
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
import {getExcel} from "@/api/comm"
|
|
|
|
|
import { getExcel } from "@/api/comm"
|
|
|
|
|
export default {
|
|
|
|
|
// 初始化页面
|
|
|
|
|
initDoc() {
|
|
|
|
@ -69,8 +69,12 @@ export default {
|
|
|
|
|
onChange(val, type) {
|
|
|
|
|
this.noClick = true;
|
|
|
|
|
if (type === "quDao") {
|
|
|
|
|
this.qdIndeterminate = !!this.quDao.length && this.quDao.length < this.plainOptions.length;
|
|
|
|
|
this.qdCheckAll = this.quDao.length === this.plainOptions.length;
|
|
|
|
|
this.form.sQuDao = this.quDao.toString();
|
|
|
|
|
} else if (type === "qingGan") {
|
|
|
|
|
this.qgIndeterminate = !!this.qingGan.length && this.qingGan.length < this.plainOptions3.length;
|
|
|
|
|
this.qgCheckAll = this.qingGan.length === this.plainOptions3.length;
|
|
|
|
|
this.doFormQS(this.qingGan);
|
|
|
|
|
}
|
|
|
|
|
this.form.iPageIndex = 1;
|
|
|
|
@ -83,18 +87,18 @@ export default {
|
|
|
|
|
fileTypeChange(val = []) {
|
|
|
|
|
let obj = {};
|
|
|
|
|
this.plainOptions4.forEach(ele => {
|
|
|
|
|
if(val.includes(ele.value)) {
|
|
|
|
|
obj[ele.value] = 1;
|
|
|
|
|
} else {
|
|
|
|
|
obj[ele.value] = 0;
|
|
|
|
|
}
|
|
|
|
|
if (val.includes(ele.value)) {
|
|
|
|
|
obj[ele.value] = 1;
|
|
|
|
|
} else {
|
|
|
|
|
obj[ele.value] = 0;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.execlForm.sField = JSON.stringify(obj);
|
|
|
|
|
},
|
|
|
|
|
// 导出弹框
|
|
|
|
|
handlerExport() {
|
|
|
|
|
this.getToExcelField(this.form.sType, this.form.token).then(() => {
|
|
|
|
|
this.execlForm.sFileName = this.form.sBrand+'洞察-'+ this.getDatetimeSs();
|
|
|
|
|
this.execlForm.sFileName = this.form.sBrand + '洞察-' + this.getDatetimeSs();
|
|
|
|
|
this.execlForm.sCheckedIds = this.secIds.toString();
|
|
|
|
|
this.execlForm.iNum = this.secIds.length;
|
|
|
|
|
this.modalObj.visible = true;
|
|
|
|
@ -178,22 +182,61 @@ export default {
|
|
|
|
|
// 导出时将对象合并
|
|
|
|
|
mergeForm() {
|
|
|
|
|
let wKey = ['action', 'iPageIndex', 'iPageSize'];
|
|
|
|
|
for(let key in this.form) {
|
|
|
|
|
if(!wKey.includes(key)) {
|
|
|
|
|
for (let key in this.form) {
|
|
|
|
|
if (!wKey.includes(key)) {
|
|
|
|
|
this.execlForm[key] = this.form[key]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 导出数据
|
|
|
|
|
exportExcel() {
|
|
|
|
|
if(this.execlForm.iNum) {
|
|
|
|
|
if (this.execlForm.iNum) {
|
|
|
|
|
this.mergeForm();
|
|
|
|
|
getExcel(this.execlForm).then(() => {
|
|
|
|
|
this.$notification.open({
|
|
|
|
|
message: `数据生成中`,
|
|
|
|
|
description: '请前往个人中心查看下载进度',
|
|
|
|
|
placement:'bottomRight',
|
|
|
|
|
});
|
|
|
|
|
placement: 'bottomRight',
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 点击渠道全部的效果
|
|
|
|
|
onCheckAllChangeQd(e) {
|
|
|
|
|
let arr = [];
|
|
|
|
|
this.plainOptions.forEach(ele => {
|
|
|
|
|
let value = ele.value;
|
|
|
|
|
arr.push(value)
|
|
|
|
|
})
|
|
|
|
|
Object.assign(this, {
|
|
|
|
|
quDao: e.target.checked ? arr : [],
|
|
|
|
|
qdIndeterminate: false,
|
|
|
|
|
qdCheckAll: e.target.checked,
|
|
|
|
|
});
|
|
|
|
|
this.form.sQuDao = this.quDao.toString();
|
|
|
|
|
this.form.iPageIndex = 1;
|
|
|
|
|
this.pagination.current = 1;
|
|
|
|
|
Promise.all([this.getList(), this.getTable()]).then(() => {
|
|
|
|
|
this.noClick = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 点击调性全部的方法
|
|
|
|
|
onCheckAllChangeQg(e) {
|
|
|
|
|
let arr = [];
|
|
|
|
|
this.plainOptions3.forEach(ele => {
|
|
|
|
|
let value = ele.value;
|
|
|
|
|
arr.push(value)
|
|
|
|
|
})
|
|
|
|
|
Object.assign(this, {
|
|
|
|
|
qingGan: e.target.checked ? arr : [],
|
|
|
|
|
qgIndeterminate: false,
|
|
|
|
|
qgCheckAll: e.target.checked,
|
|
|
|
|
});
|
|
|
|
|
this.doFormQS(this.qingGan);
|
|
|
|
|
this.form.iPageIndex = 1;
|
|
|
|
|
this.pagination.current = 1;
|
|
|
|
|
Promise.all([this.getList(), this.getTable()]).then(() => {
|
|
|
|
|
this.noClick = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|