|
@@ -77,7 +77,12 @@
|
|
|
</el-col>
|
|
|
<el-col :span="3">
|
|
|
<el-form-item style="margin-left:10px;" label-width="10">
|
|
|
- <el-button icon="el-icon-download" type="primary" @click="downloadExcel" size="mini">导出Excel</el-button>
|
|
|
+ <el-button icon="el-icon-download" type="primary" @click="downloadExcel" size="mini">导出分组</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="3">
|
|
|
+ <el-form-item style="margin-left:10px;" label-width="10">
|
|
|
+ <el-button icon="el-icon-download" type="primary" @click="downloadAll" size="mini">导出全部</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="3">
|
|
@@ -98,13 +103,13 @@
|
|
|
<el-table :data="list" height='55vh' style="width: 100%;margin-top:10px;" v-loading='loading'>
|
|
|
<el-table-column prop="group_rank" label="排名"/>
|
|
|
<el-table-column prop="username" label="选手"/>
|
|
|
- <el-table-column prop="usercode" label="选手">
|
|
|
+ <el-table-column prop="usercode" label="代码">
|
|
|
<template slot-scope="scope">
|
|
|
<div style="text-decoration:underline" @click="pushPlayer(scope.row.usercode)">{{scope.row.usercode}}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="stock_date" label="持股日期" width="150"/>
|
|
|
- <el-table-column>
|
|
|
+ <el-table-column label="图片">
|
|
|
<template slot-scope="scope">
|
|
|
<el-image
|
|
|
:src="scope.row.today_stock_img[0]"
|
|
@@ -363,7 +368,8 @@ export default {
|
|
|
{id:1,name:"是"}
|
|
|
],
|
|
|
open2:false,
|
|
|
- form2:{}
|
|
|
+ form2:{},
|
|
|
+ index:0,
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -394,21 +400,63 @@ export default {
|
|
|
},
|
|
|
downloadExcel(){
|
|
|
this.loading = true
|
|
|
+ for(var i=0;i<this.groupList.length;i++){
|
|
|
+ var item = this.groupList[i];
|
|
|
+ if(item.id == this.queryParams.groupId){
|
|
|
+ this.queryParams.groupName = item.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.$api.downloadRecords(this.queryParams).then((res)=>{
|
|
|
var elink = document.createElement('a');
|
|
|
let blob=new Blob([res.data], {type: 'application/vnd.ms-excel,charset=UTF-8'});
|
|
|
let objUrl=URL.createObjectURL(blob);
|
|
|
let file_name=decodeURIComponent(res.headers['content-disposition'].split('=')[1]);
|
|
|
console.log(file_name)
|
|
|
- elink.download = "参赛数据";
|
|
|
+ elink.download = this.queryParams.stock_date + this.queryParams.groupName;
|
|
|
+ elink.style.display = 'none';
|
|
|
+ elink.href = objUrl;
|
|
|
+ document.body.appendChild(elink);
|
|
|
+ elink.click();
|
|
|
+ document.body.removeChild(elink);
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ downloadAll(){
|
|
|
+ this.index = 0;
|
|
|
+ this.startDownload();
|
|
|
+ },
|
|
|
+
|
|
|
+ startDownload(){
|
|
|
+ if(this.index >= this.groupList.length){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var item = this.groupList[this.index++];
|
|
|
+ this.downloadGroup(item.id,item.name);
|
|
|
+ },
|
|
|
+
|
|
|
+ downloadGroup(gid,gname){
|
|
|
+ this.queryParams.groupId = gid;
|
|
|
+ this.queryParams.groupName = gname;
|
|
|
+ this.$api.downloadRecords(this.queryParams).then((res)=>{
|
|
|
+ var elink = document.createElement('a');
|
|
|
+ let blob=new Blob([res.data], {type: 'application/vnd.ms-excel,charset=UTF-8'});
|
|
|
+ let objUrl=URL.createObjectURL(blob);
|
|
|
+ let file_name=decodeURIComponent(res.headers['content-disposition'].split('=')[1]);
|
|
|
+ elink.download = this.queryParams.stock_date + gname;
|
|
|
elink.style.display = 'none';
|
|
|
elink.href = objUrl;
|
|
|
document.body.appendChild(elink);
|
|
|
elink.click();
|
|
|
document.body.removeChild(elink);
|
|
|
this.loading = false;
|
|
|
+
|
|
|
+ this.startDownload();
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
del(row) {
|
|
|
this.$confirm("确定删除吗?", "提示", {
|
|
|
type: "warning",
|
|
@@ -440,6 +488,14 @@ export default {
|
|
|
this.loading = false;
|
|
|
})
|
|
|
},
|
|
|
+ loadGroupList(){
|
|
|
+ this.loading = true;
|
|
|
+ this.queryParams.is_active = 1;
|
|
|
+ this.$api.getGroupList(this.queryParams).then(res=>{
|
|
|
+ this.groupList=res.data.data;
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
edit(row){
|
|
|
this.title = "编辑数据"
|
|
|
this.$api.getRecordInfo({id:row.id,match_id:row.match_id}).then(res=>{
|
|
@@ -562,13 +618,12 @@ export default {
|
|
|
this.matchList=res.data.data
|
|
|
this.queryParams.match_id = this.matchList[0].id
|
|
|
this.getData()
|
|
|
+ this.loadGroupList()
|
|
|
})
|
|
|
this.$api.getPlayerList().then(res=>{
|
|
|
this.playerList=res.data.data
|
|
|
})
|
|
|
- this.$api.getGroupList().then(res=>{
|
|
|
- this.groupList=res.data.data
|
|
|
- })
|
|
|
+
|
|
|
this.$api.getStockList().then(res=>{
|
|
|
this.stockList=res.data.data
|
|
|
})
|