chunk-56a1f7a4.03ce2a5c.js 16 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-56a1f7a4"],{"0353":function(t,e,a){"use strict";var r=a("6bf8"),n=RegExp.prototype.exec,i=String.prototype.replace,o=n,l="lastIndex",s=function(){var t=/a/,e=/b*/g;return n.call(t,"a"),n.call(e,"a"),0!==t[l]||0!==e[l]}(),c=void 0!==/()??/.exec("")[1],u=s||c;u&&(o=function(t){var e,a,o,u,d=this;return c&&(a=new RegExp("^"+d.source+"$(?!\\s)",r.call(d))),s&&(e=d[l]),o=n.call(d,t),s&&o&&(d[l]=d.global?o.index+o[0].length:e),c&&o&&o.length>1&&i.call(o[0],a,(function(){for(u=1;u<arguments.length-2;u++)void 0===arguments[u]&&(o[u]=void 0)})),o}),t.exports=o},"129d":function(t,e,a){"use strict";a("b94e")},1663:function(t,e,a){var r=a("212e"),n=a("3ab0");t.exports=function(t){return function(e,a){var i,o,l=String(n(e)),s=r(a),c=l.length;return s<0||s>=c?t?"":void 0:(i=l.charCodeAt(s),i<55296||i>56319||s+1===c||(o=l.charCodeAt(s+1))<56320||o>57343?t?l.charAt(s):i:t?l.slice(s,s+2):o-56320+(i-55296<<10)+65536)}}},3044:function(t,e,a){},"30ac":function(t,e,a){"use strict";a("3044")},"43ec":function(t,e,a){"use strict";var r=a("1663")(!0);t.exports=function(t,e,a){return e+(a?r(t,e).length:1)}},"6bf8":function(t,e,a){"use strict";var r=a("a86f");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"804d":function(t,e,a){var r=a("9cff"),n=a("cea2"),i=a("839a")("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==n(t))}},"856d":function(t,e,a){"use strict";a.r(e);var r=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"},on:{change:function(e){return t.getData()}},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:{clearable:"",placeholder:"请输入选手名字/代码",size:"mini"},on:{clear:function(e){return t.getData()}},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:{clearable:"",placeholder:"请选择比赛分组",size:"mini"},on:{clear:function(e){return t.getData()},change:function(e){return t.getData()}},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",{staticStyle:{"margin-left":"10px"},attrs:{"label-width":"10"}},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.getData}},[t._v("筛选")]),a("el-button",{attrs:{type:"normal",size:"mini"},on:{click:function(e){t.queryParams={},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),a("el-col",{attrs:{span:4}},[a("el-form-item",{staticStyle:{"margin-left":"10px"},attrs:{"label-width":"10"}},[a("el-button",{attrs:{icon:"el-icon-download",type:"primary",size:"mini"},on:{click:t.downloadExcel}},[t._v("导出Excel")])],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:"55vh"}},[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:"持股日期",width:"150"}}),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:"总盈亏",width:"100"}}),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,r){return a("p",{key:r},[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,r){return a("p",{key:r},[t._v("\n "+t._s(e.name)+"\n ")])}))}}])}),a("el-table-column",{attrs:{prop:"ctime",label:"创建时间",width:"160"}}),a("el-table-column",{attrs:{prop:"date",label:"操作",fixed:"right",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(a){return t.edit(e.row.id)}}},[t._v("编辑")]),a("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(a){return t.del(e.row.id)}}},[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:{filterable:"",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,r){return a("div",{key:r,staticStyle:{"margin-bottom":"5px"}},[a("el-input",{staticStyle:{width:"48%",display:"inline-block"},attrs:{placeholder:"请输入股票名称"},model:{value:e.name,callback:function(a){t.$set(e,"name",a)},expression:"item.name"}}),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(r,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:"is_markt"}},[a("el-switch",{model:{value:t.form.is_markt,callback:function(e){t.$set(t.form,"is_markt",e)},expression:"form.is_markt"}})],1),a("el-form-item",{attrs:{label:"股票截图",prop:"today_stock_img"}},[t._l(t.form.today_stock_img,(function(e,r){return a("div",{key:r,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(r,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)},n=[],i=(a("a450"),a("fc02"),a("9973")),o={components:{Page:i["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"}],is_markt:[{required:!1,message:"请选择",trigger:"change"}]},matchList:[],playerList:[],groupList:[],stockList:[]}},methods:{downloadExcel:function(){var t=this;this.$api.downloadRecords(this.queryParams).then((function(e){var a=document.createElement("a"),r=new Blob([e.data],{type:"application/vnd.ms-excel,charset=UTF-8"}),n=URL.createObjectURL(r),i=decodeURIComponent(e.headers["content-disposition"].split("=")[1]);console.log(i),a.download="参赛数据",a.style.display="none",a.href=n,document.body.appendChild(a),a.click(),document.body.removeChild(a),t.download_loading=!1}))},del:function(t){var e=this;this.$confirm("确定删除吗?","提示",{type:"warning"}).then((function(){e.$api.delRecord({id:t}).then((function(t){e.$message({message:"删除成功",type:"success"}),e.getData()}))}))},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}))},edit:function(t){var e=this;this.title="编辑数据",this.$api.getRecordInfo({id:t}).then((function(t){e.form=t.data.data,e.open=!0}))},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){if(e){if(t.form.today_stock.length<=0)return void t.msgError("请添加股票");if(!t.form.today_stock[0].name||!t.form.today_stock[0].fund)return void t.msgError("请选择股票并输入资金额");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}))}},l=o,s=(a("30ac"),a("4ac2")),c=Object(s["a"])(l,r,n,!1,null,null,null);e["default"]=c.exports},9973:function(t,e,a){"use strict";var r=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}})},n=[],i={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(){}},o=i,l=(a("129d"),a("4ac2")),s=Object(l["a"])(o,r,n,!1,null,null,null);e["a"]=s.exports},a450:function(t,e,a){var r=a("bb8b").f,n=Function.prototype,i=/^\s*function ([^ (]*)/,o="name";o in n||a("26df")&&r(n,o,{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(t){return""}}})},b94e:function(t,e,a){},bf73:function(t,e,a){"use strict";var r=a("0353");a("e99b")({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},c46f:function(t,e,a){"use strict";a("bf73");var r=a("84e8"),n=a("065d"),i=a("0926"),o=a("3ab0"),l=a("839a"),s=a("0353"),c=l("species"),u=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),d=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var a="ab".split(t);return 2===a.length&&"a"===a[0]&&"b"===a[1]}();t.exports=function(t,e,a){var p=l(t),f=!i((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),m=f?!i((function(){var e=!1,a=/a/;return a.exec=function(){return e=!0,null},"split"===t&&(a.constructor={},a.constructor[c]=function(){return a}),a[p](""),!e})):void 0;if(!f||!m||"replace"===t&&!u||"split"===t&&!d){var g=/./[p],h=a(o,p,""[t],(function(t,e,a,r,n){return e.exec===s?f&&!n?{done:!0,value:g.call(e,a,r)}:{done:!0,value:t.call(a,e,r)}:{done:!1}})),y=h[0],b=h[1];r(String.prototype,t,y),n(RegExp.prototype,p,2==e?function(t,e){return b.call(t,this,e)}:function(t){return b.call(t,this)})}}},f417:function(t,e,a){"use strict";var r=a("d445"),n=RegExp.prototype.exec;t.exports=function(t,e){var a=t.exec;if("function"===typeof a){var i=a.call(t,e);if("object"!==typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return n.call(t,e)}},fc02:function(t,e,a){"use strict";var r=a("804d"),n=a("a86f"),i=a("1b0b"),o=a("43ec"),l=a("201c"),s=a("f417"),c=a("0353"),u=a("0926"),d=Math.min,p=[].push,f="split",m="length",g="lastIndex",h=4294967295,y=!u((function(){RegExp(h,"y")}));a("c46f")("split",2,(function(t,e,a,u){var b;return b="c"=="abbc"[f](/(b)*/)[1]||4!="test"[f](/(?:)/,-1)[m]||2!="ab"[f](/(?:ab)*/)[m]||4!="."[f](/(.?)(.?)/)[m]||"."[f](/()()/)[m]>1||""[f](/.?/)[m]?function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!r(t))return a.call(n,t,e);var i,o,l,s=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),d=0,f=void 0===e?h:e>>>0,y=new RegExp(t.source,u+"g");while(i=c.call(y,n)){if(o=y[g],o>d&&(s.push(n.slice(d,i.index)),i[m]>1&&i.index<n[m]&&p.apply(s,i.slice(1)),l=i[0][m],d=o,s[m]>=f))break;y[g]===i.index&&y[g]++}return d===n[m]?!l&&y.test("")||s.push(""):s.push(n.slice(d)),s[m]>f?s.slice(0,f):s}:"0"[f](void 0,0)[m]?function(t,e){return void 0===t&&0===e?[]:a.call(this,t,e)}:a,[function(a,r){var n=t(this),i=void 0==a?void 0:a[e];return void 0!==i?i.call(a,n,r):b.call(String(n),a,r)},function(t,e){var r=u(b,t,this,e,b!==a);if(r.done)return r.value;var c=n(t),p=String(this),f=i(c,RegExp),m=c.unicode,g=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(y?"y":"g"),v=new f(y?c:"^(?:"+c.source+")",g),_=void 0===e?h:e>>>0;if(0===_)return[];if(0===p.length)return null===s(v,p)?[p]:[];var k=0,x=0,w=[];while(x<p.length){v.lastIndex=y?x:0;var $,q=s(v,y?p:p.slice(x));if(null===q||($=d(l(v.lastIndex+(y?0:x)),p.length))===k)x=o(p,x,m);else{if(w.push(p.slice(k,x)),w.length===_)return w;for(var z=1;z<=q.length-1;z++)if(w.push(q[z]),w.length===_)return w;x=k=$}}return w.push(p.slice(k)),w}]}))}}]);
  2. //# sourceMappingURL=chunk-56a1f7a4.03ce2a5c.js.map