|
|
@@ -2,7 +2,7 @@
|
|
|
<div>
|
|
|
<el-container style="height: 100vh;">
|
|
|
<el-header height="45px" style="background-color: #fafafa; padding: 0 10px;">
|
|
|
- <soft-header ref="headerRef" @update-soft="updateSoft()" @login-url="loginUrl" @clear-cache="clearCache"></soft-header>
|
|
|
+ <soft-header ref="headerRef" @update-soft="updateSoft()" @export-file="exportRow" @login-url="loginUrl" @clear-cache="clearCache"></soft-header>
|
|
|
</el-header>
|
|
|
|
|
|
<el-main ref="el-main" style="background-color: #fafafa;">
|
|
|
@@ -270,7 +270,9 @@
|
|
|
loginBrowser: null, // 登录用的浏览器实例
|
|
|
pauseFlag: true, //暂停中止标志
|
|
|
addLoading: false,
|
|
|
- allLoading: false
|
|
|
+ allLoading: false,
|
|
|
+
|
|
|
+ downloadRow: '',
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -506,16 +508,13 @@
|
|
|
message: '提取任务已停止执行'
|
|
|
});
|
|
|
},
|
|
|
+ // 试用导出链接的回调方法
|
|
|
+ exportRow(flag){
|
|
|
+ let row = this.downloadRow;
|
|
|
+ this.exportPageLinks(row, flag);
|
|
|
+ },
|
|
|
//导出全部链接
|
|
|
- exportLinks(){
|
|
|
- let authority = this.$refs.headerRef.authority.isAuthority;
|
|
|
- if(!authority){
|
|
|
- this.$notify.warning({
|
|
|
- title: '提示',
|
|
|
- message: '导出全部链接功能需开通会员'
|
|
|
- });
|
|
|
- return false;
|
|
|
- }
|
|
|
+ exportLinks(flag){
|
|
|
let allRows = {
|
|
|
title: '商品链接汇总',
|
|
|
urls: [],
|
|
|
@@ -548,15 +547,24 @@
|
|
|
allUrls = allUrls.concat(this[listNameArr[index]+'List'][i].urls);
|
|
|
}
|
|
|
allRows.urls = allUrls;
|
|
|
- this.exportPageLinks(allRows);
|
|
|
setTimeout(() => {
|
|
|
this.allLoading = false;
|
|
|
}, 2000)
|
|
|
+ this.exportPageLinks(allRows);
|
|
|
}
|
|
|
},
|
|
|
// 导出单页链接
|
|
|
- exportPageLinks(row){
|
|
|
+ exportPageLinks(row, flag){
|
|
|
let authority = this.$refs.headerRef.authority.isAuthority;
|
|
|
+ if (!authority && !flag) { // 非会员点击转换弹出提示框
|
|
|
+ this.$refs.headerRef.memberModel = true;
|
|
|
+ this.$refs.headerRef.isClick = true;
|
|
|
+ this.downloadRow = row;
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ this.$refs.headerRef.memberModel = false;
|
|
|
+ }
|
|
|
+
|
|
|
row.loading = true;
|
|
|
let filename = row.title + '-' + this.$utils.formatFileTime() +'.xlsx';
|
|
|
let sheet1 = [['序号','商品ID','商品标题','商品链接','价格','销量','店铺名称','店铺地址','首图地址']];
|