|
|
@ -1,25 +1,37 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* @Author: your name
|
|
|
|
* @Author: your name
|
|
|
|
* @Date: 2021-10-27 15:29:37
|
|
|
|
* @Date: 2021-10-27 15:29:37
|
|
|
|
* @LastEditTime: 2021-11-19 14:04:51
|
|
|
|
* @LastEditTime: 2021-11-21 16:36:03
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
* @Description: In User Settings Edit
|
|
|
|
* @Description: In User Settings Edit
|
|
|
|
* @FilePath: /data-show/src/views/IndustryDataExport/tableEvent.js
|
|
|
|
* @FilePath: /data-show/src/views/IndustryDataExport/tableEvent.js
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
import moment from "moment";
|
|
|
|
import moment from "moment";
|
|
|
|
function rowSelection(that) {
|
|
|
|
export function rowSelection() {
|
|
|
|
return {
|
|
|
|
let a = null;
|
|
|
|
|
|
|
|
if (!this.form.token) {
|
|
|
|
|
|
|
|
a = null
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
a = {
|
|
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
|
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
|
|
that.selectedRowKeys = selectedRowKeys.toString();
|
|
|
|
this.sk = selectedRowKeys;
|
|
|
|
that.selectedRows = selectedRows;
|
|
|
|
this.selectedRowKeys = selectedRowKeys.toString();
|
|
|
|
that.secIds = selectedRowKeys;
|
|
|
|
this.selectedRows = selectedRows;
|
|
|
|
|
|
|
|
this.secIds = selectedRowKeys;
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// onSelect: (record, selected, selectedRows) => {
|
|
|
|
onSelect:(record, selected) => {
|
|
|
|
// },
|
|
|
|
if(!selected) {
|
|
|
|
// onSelectAll: (selected, selectedRows, changeRows) => {
|
|
|
|
this.tableAll = false;
|
|
|
|
// },
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
selectedRowKeys: this.sk,
|
|
|
|
|
|
|
|
onSelectAll: () => {
|
|
|
|
|
|
|
|
this.tableAll = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return a
|
|
|
|
}
|
|
|
|
}
|
|
|
|
import { getExcel } from "@/api/comm"
|
|
|
|
import { getExcel } from "@/api/comm"
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
@ -66,9 +78,7 @@ export default {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.gValue = 0;
|
|
|
|
this.gValue = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.form.token) {
|
|
|
|
|
|
|
|
this.rowSelection = rowSelection(this);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
this.getTable();
|
|
|
|
this.getTable();
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -107,8 +117,8 @@ export default {
|
|
|
|
handlerExport() {
|
|
|
|
handlerExport() {
|
|
|
|
this.getToExcelField(this.form.sType, this.form.token).then(() => {
|
|
|
|
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.sCheckedIds = this.tableAll ? '' : this.secIds.toString();
|
|
|
|
this.execlForm.iNum = this.secIds.length;
|
|
|
|
this.execlForm.iNum = this.tableAll ? this.totalNum : this.secIds.length;
|
|
|
|
this.modalObj.visible = true;
|
|
|
|
this.modalObj.visible = true;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -199,7 +209,15 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 导出数据
|
|
|
|
// 导出数据
|
|
|
|
exportExcel() {
|
|
|
|
exportExcel() {
|
|
|
|
if (this.execlForm.iNum) {
|
|
|
|
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) {
|
|
|
|
this.mergeForm();
|
|
|
|
this.mergeForm();
|
|
|
|
getExcel(this.execlForm).then(() => {
|
|
|
|
getExcel(this.execlForm).then(() => {
|
|
|
|
this.$notification.open({
|
|
|
|
this.$notification.open({
|
|
|
@ -207,6 +225,7 @@ export default {
|
|
|
|
description: '请前往个人中心查看下载进度',
|
|
|
|
description: '请前往个人中心查看下载进度',
|
|
|
|
placement: 'bottomRight',
|
|
|
|
placement: 'bottomRight',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.modalObj.visible = false;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|