12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3913f55c"],{"129d":function(t,e,a){"use strict";a("b94e")},3044:function(t,e,a){},"30ac":function(t,e,a){"use strict";a("3044")},"856d":function(t,e,a){"use strict";a.r(e);var l=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("section",{staticClass:"content data"},[a("h4",[t._v("数据统计")]),a("el-divider"),a("el-form",{staticClass:"filter-form",attrs:{"label-width":"80px"}},[a("el-row",[a("el-col",{attrs:{span:4}},[a("el-form-item",{attrs:{label:"比赛名称",prop:"match_id"}},[a("el-select",{attrs:{placeholder:"请选择比赛",size:"mini"},model:{value:t.queryParams.match_id,callback:function(e){t.$set(t.queryParams,"match_id",e)},expression:"queryParams.match_id"}},t._l(t.matchList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)],1),a("el-col",{attrs:{span:4}},[a("el-form-item",{attrs:{label:"选手名字"}},[a("el-input",{attrs:{placeholder:"请输入选手名字/代码",size:"mini"},model:{value:t.queryParams.username,callback:function(e){t.$set(t.queryParams,"username",e)},expression:"queryParams.username"}})],1)],1),a("el-col",{attrs:{span:4}},[a("el-form-item",{attrs:{label:"比赛日期"}},[a("el-date-picker",{attrs:{type:"date",placeholder:"选择日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",size:"mini"},model:{value:t.queryParams.date,callback:function(e){t.$set(t.queryParams,"date",e)},expression:"queryParams.date"}})],1)],1),a("el-col",{attrs:{span:4}},[a("el-form-item",{attrs:{label:"比赛分组"}},[a("el-select",{attrs:{placeholder:"请选择比赛分组",size:"mini"},model:{value:t.queryParams.groupId,callback:function(e){t.$set(t.queryParams,"groupId",e)},expression:"queryParams.groupId"}},t._l(t.groupList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)],1),a("el-col",{attrs:{span:4}},[a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.getData}},[t._v("筛选")]),a("el-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:t.handleAdd}},[t._v("上传数据")])],1)],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%","margin-top":"10px"},attrs:{data:t.list,height:"39vh"}},[a("el-table-column",{attrs:{prop:"rank",label:"排名"}}),a("el-table-column",{attrs:{prop:"username",label:"选手"}}),a("el-table-column",{attrs:{prop:"stock_date",label:"持股日期"}}),a("el-table-column",{attrs:{prop:"init_fund",label:"初始资产"}}),a("el-table-column",{attrs:{prop:"yesterday_fund",label:"昨日资产"}}),a("el-table-column",{attrs:{prop:"today_fund",label:"今日资产"}}),a("el-table-column",{attrs:{prop:"today_income",label:"今日盈亏"}}),a("el-table-column",{attrs:{prop:"total_income",label:"总盈亏"}}),a("el-table-column",{attrs:{prop:"date",label:"今日持股",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.today_stock,(function(e,l){return a("p",{key:l},[t._v("\n "+t._s(e.name)+"\n ")])}))}}])}),a("el-table-column",{attrs:{prop:"date",label:"昨日持股",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.yesterday_stock,(function(e,l){return a("p",{key:l},[t._v("\n "+t._s(e.name)+"\n ")])}))}}])}),a("el-table-column",{attrs:{prop:"ctime",label:"创建时间"}}),a("el-table-column",{attrs:{prop:"date",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(a){t.title="编辑数据",t.open=!0,t.form=e.row}}},[t._v("编辑")])]}}])})],1),a("Page",{ref:"pageButton",attrs:{current:t.form.page,page_size:t.form.page_size,total:t.total},on:{pageChange:t.gopage}}),a("el-dialog",{attrs:{title:t.title,visible:t.open,width:"500px","append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[a("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"赛事名称",prop:"match_id"}},[a("el-select",{attrs:{placeholder:"请选择比赛"},model:{value:t.form.match_id,callback:function(e){t.$set(t.form,"match_id",e)},expression:"form.match_id"}},t._l(t.matchList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"参赛选手",prop:"player_id"}},[a("el-select",{attrs:{placeholder:"请选择用户代码"},model:{value:t.form.player_id,callback:function(e){t.$set(t.form,"player_id",e)},expression:"form.player_id"}},t._l(t.playerList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.username,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"持仓日期",prop:"stock_date"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"选择日期",format:"yyyy-MM-dd","value-format":"yyyy-MM-dd"},model:{value:t.form.stock_date,callback:function(e){t.$set(t.form,"stock_date",e)},expression:"form.stock_date"}})],1),a("el-form-item",{attrs:{label:"今日资产",prop:"today_fund"}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入今日资产"},model:{value:t.form.today_fund,callback:function(e){t.$set(t.form,"today_fund",e)},expression:"form.today_fund"}},[a("template",{slot:"append"},[t._v("万元")])],2)],1),a("el-form-item",{attrs:{label:"股票名称",prop:"today_stock"}},[t._l(t.form.today_stock,(function(e,l){return a("div",{key:l,staticStyle:{"margin-bottom":"5px"}},[a("el-select",{staticStyle:{width:"48%",display:"inline-block"},attrs:{filterable:"",placeholder:"请选择股票"},model:{value:e.name,callback:function(a){t.$set(e,"name",a)},expression:"item.name"}},t._l(t.stockList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.label,value:t.label}})})),1),t._v("\n "),a("el-input",{staticStyle:{width:"39%"},attrs:{clearable:"",placeholder:"资金"},model:{value:e.fund,callback:function(a){t.$set(e,"fund",a)},expression:"item.fund"}},[a("template",{slot:"append"},[t._v("万元")])],2),a("i",{staticClass:"el-icon-circle-close del",staticStyle:{"margin-top":"5px"},on:{click:function(e){return t.form.today_stock.splice(l,1)}}})],1)})),a("el-button",{attrs:{type:"primary",size:"small",plain:""},on:{click:t.addCode}},[t._v("新增股票")])],2),a("el-form-item",{attrs:{label:"股票截图",prop:"today_stock_img"}},[t._l(t.form.today_stock_img,(function(e,l){return a("div",{key:l,staticClass:"imgs"},[a("img",{attrs:{width:"150",src:e,alt:""}}),a("i",{staticClass:"el-icon-circle-close del",on:{click:function(e){return t.form.today_stock_img.splice(l,1)}}})])})),a("el-upload",{staticClass:"upload-demo",attrs:{"show-file-list":!1,"on-success":t.handleSuccess,action:"/api/admin/uploadfile"}},[a("el-button",{attrs:{size:"small",type:"primary",plain:""}},[t._v("上传股票截图")])],1)],2)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 定")]),a("el-button",{on:{click:function(e){t.open=!1}}},[t._v("取 消")])],1)],1)],1)},o=[],r=a("9973"),i={components:{Page:r["a"]},data:function(){return{loading:!1,queryParams:{match_id:0,page:1},form:{},list:[{},{}],total:0,title:"新增用户",open:!1,rules:{match_id:[{required:!0,message:"请选择比赛",trigger:"change"}],player_id:[{required:!0,message:"请输入用户代码",trigger:"blur"}],stock_date:[{required:!0,message:"请选择持仓日期",trigger:"blur"}],today_fund:[{required:!0,message:"请输入今日资产",trigger:"blur"}],today_stock:[{required:!0,message:"请输入今日资产",trigger:"blur"}],today_stock_img:[{required:!0,message:"请输入股票截图",trigger:"blur"}]},matchList:[],playerList:[],groupList:[],stockList:[]}},methods:{gopage:function(t){t&&(this.queryParams.page_size=t),this.queryParams.page=this.$refs.pageButton.page,this.getData()},getData:function(){var t=this;this.loading=!0,this.$api.getPlayerRecord(this.queryParams).then((function(e){t.list=e.data.data.list,t.total=e.data.data.total,t.loading=!1}))},handleAdd:function(){this.open=!0,this.title="新增数据",this.form={today_stock:[{code:"",name:"",fund:""}],today_stock_img:[]}},addCode:function(){this.form.today_stock.push({code:"",name:"",fund:""})},handleSuccess:function(t,e){console.log(t),this.form.today_stock_img.push(t.data.url)},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){e&&(null!=t.form.id?t.$api.editRecord(t.form).then((function(e){0==e.data.code?(t.msgSuccess("修改成功"),t.open=!1,t.getData()):t.msgError(e.data.message)})):t.$api.addRecord(t.form).then((function(e){0==e.data.code?(t.msgSuccess("新增成功"),t.open=!1,t.getData()):t.msgError(e.data.message)})))}))}},created:function(){var t=this;this.$api.getMatchList().then((function(e){t.matchList=e.data.data,t.queryParams.match_id=t.matchList[0].id,t.getData()})),this.$api.getPlayerList().then((function(e){t.playerList=e.data.data})),this.$api.getGroupList().then((function(e){t.groupList=e.data.data})),this.$api.getStockList().then((function(e){t.stockList=e.data.data}))}},s=i,n=(a("30ac"),a("4ac2")),c=Object(n["a"])(s,l,o,!1,null,null,null);e["default"]=c.exports},9973:function(t,e,a){"use strict";var l=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-pagination",{attrs:{background:"","page-size":t.page_size?t.page_size:20,"current-page":t.current,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"total,sizes,prev, pager, next",total:t.total},on:{"current-change":t.getData,"size-change":t.handleSizeChange}})},o=[],r={data:function(){return{page:1}},props:{total:"",page_size:"",current:""},methods:{getData:function(t){this.page=t,this.$emit("pageChange")},handleSizeChange:function(t){this.$emit("pageChange",t)}},created:function(){}},i=r,s=(a("129d"),a("4ac2")),n=Object(s["a"])(i,l,o,!1,null,null,null);e["a"]=n.exports},b94e:function(t,e,a){}}]);
- //# sourceMappingURL=chunk-3913f55c.590ca500.js.map
|