chunk-320700bc.c2ad1ebe.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-320700bc"],{1447:function(t,e,a){"use strict";var n=a("04c2"),i=a("203c"),l=a("db2f"),o=a("62f1"),r=a("ed14"),s=a("d5f7"),c=a("8dda"),u=a("00c3"),d=a("56ce"),h=TypeError,f=d((function(){[].keys().reduce((function(){}),void 0)})),m=!f&&c("reduce",h);n({target:"Iterator",proto:!0,real:!0,forced:f||m},{reduce:function(t){o(this);try{l(t)}catch(d){s(this,"throw",d)}var e=arguments.length<2,a=e?void 0:arguments[1];if(m)return u(m,this,e?[t]:[t,a]);var n=r(this),c=0;if(i(n,(function(n){e?(e=!1,a=n):a=t(a,n,c),c++}),{IS_RECORD:!0}),e)throw new h("Reduce of empty iterator with no initial value");return a}})},"308d":function(t,e,a){},"55e5":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"new-app-container layout-vertical"},[a("YMTableSearch",{attrs:{loading:t.loading,"search-form":t.searchForm},on:{onValueChange:t.onValueChange,submit:t.onSubmit},scopedSlots:t._u([{key:"extra",fn:function(){},proxy:!0}])}),a("div",{staticClass:"toolbar"},[a("div",{staticClass:"segmented-control"},t._l(t.timeOptions,(function(e){return a("div",{key:e.value,staticClass:"segmented-item",class:{active:t.timeFilter===e.value},on:{click:function(a){return t.handleTimeFilter(e.value)}}},[t._v(" "+t._s(e.label)+" ")])})),0),a("div",{staticClass:"batch-actions"},[a("el-button",{attrs:{type:"warning",size:"small"},on:{click:t.handleBatchState}},[t._v("批量修改状态")]),a("el-button",{attrs:{type:"success",size:"small"},on:{click:t.handleBatchOnline}},[t._v("批量上架")]),a("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.handleBatchOffline}},[t._v("批量下架")])],1)]),a("YMTable",{ref:"table",attrs:{"table-key":4,index:!0,selection:!0,"table-options":t.tableOptions,columns:t.columns,"rows-actions":t.rowsActions,"show-summary":!1,apis:t.apis,loading:t.loading,"custom-loading":t.customLoading,"custom-style":{height:"calc(100vh - 270px)"}}}),a("Dialog",{ref:"dialog",attrs:{dialogActions:{title:"修改比赛状态",width:"400px"}},on:{confirm:t.submitStateEdit}},[a("template",{slot:"content"},[a("el-form",{attrs:{"label-width":"100px"}},[a("el-form-item",{attrs:{label:"比赛状态",rules:[{required:!0,message:"请选择比赛状态"}]}},[a("el-select",{staticStyle:{width:"100%"},model:{value:t.form.state,callback:function(e){t.$set(t.form,"state",e)},expression:"form.state"}},t._l(t.validStateOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1)],1)],2)],1)},i=[],l=a("b797"),o=a("639f"),r=(a("b15b"),a("e491"),a("b138"),a("865d"),a("8f26"),a("1447"),a("209c"),a("6d35"),a("0401"),a("7acf"),a("9039")),s=a("7e1e"),c=[{value:0,label:"未开始"},{value:1,label:"进行中"},{value:2,label:"已完成"},{value:3,label:"延期"},{value:4,label:"取消"},{value:"",label:"全部"}],u=[{value:1,label:"上架"},{value:0,label:"下架"},{value:"",label:"全部"}],d=[{value:1,label:"已加锁"},{value:0,label:"未加锁"},{value:"",label:"全部"}],h={name:"SportListError",components:{Dialog:r["a"]},data:function(){var t=this;return{timer:null,loading:!1,customLoading:!0,queryData:{},currentSearchParams:{},timeFilter:"today",timeOptions:[{label:"昨日",value:"yesterday"},{label:"今日",value:"today"},{label:"本周",value:"week"},{label:"本月",value:"month"}],form:{id:[],state:null},validStateOptions:c.filter((function(t){return""!==t.value})),searchForm:[{label:"赛事ID",type:"input",prop:"data_id",clearable:!0,placeholder:"请输入"},{label:"主队名称",type:"input",prop:"home_team",clearable:!0,placeholder:"请输入主队"},{label:"客队名称",type:"input",prop:"guest_team",clearable:!0,placeholder:"请输入客队"},{label:"上架状态",type:"select",prop:"status",clearable:!0,options:u},{label:"锁定状态",type:"select",prop:"is_locked",clearable:!0,options:d},{label:"比赛时间",type:"daterange",prop:"timeRange",clearable:!0,valueFormat:"yyyy-MM-dd"}],columns:[{label:"赛事ID",prop:"data_id",width:"80"},{label:"联赛名称",prop:"league",width:"150",link:!0,click:function(e){t.$router.push({name:"EventDetail",query:{id:e.id}})}},{label:"对阵信息 (主队 VS 客队)",prop:"match_info",width:"380",html:!0,method:function(t){var e=t.home_team_logo||"",a=t.guest_team_logo||"";return'\n <div style="display: flex; align-items: center; justify-content: center; width: 100%;">\n <div style="flex: 1; text-align: right; display: flex; align-items: center; justify-content: flex-end;">\n <span style="margin-right: 8px;">'.concat(t.home_team,'</span>\n <img src="').concat(e,'" style="width: 24px; height: 24px; object-fit: contain;" onerror="this.style.display=\'none\'">\n </div>\n <div style="padding: 0 10px; color: #909399; font-weight: bold; font-size: 12px;">VS</div>\n <div style="flex: 1; text-align: left; display: flex; align-items: center;">\n <img src="').concat(a,'" style="width: 24px; height: 24px; object-fit: contain;" onerror="this.style.display=\'none\'">\n <span style="margin-left: 8px;">').concat(t.guest_team,"</span>\n </div>\n </div>\n ")}},{label:"比赛状态",prop:"state",width:"100",html:!0,method:function(t){var e={0:{text:"未开始",color:"#909399"},1:{text:"进行中",color:"#409EFF"},2:{text:"已完成",color:"#67C23A"},3:{text:"延期",color:"#E6A23C"},4:{text:"取消",color:"#F56C6C"}},a=e[t.state]||{text:"未知",color:"#303133"};return'<span style="color: '.concat(a.color,'; font-weight: bold;">').concat(a.text,"</span>")}},{label:"赔率玩法",prop:"odds",html:!0,method:function(t){return t.odds&&t.odds.length>0?'<span class="el-tag el-tag--success el-tag--small el-tag--light">有</span>':'<span class="el-tag el-tag--info el-tag--small el-tag--light">无</span>'}},{label:"上架状态",prop:"status",width:"90",html:!0,method:function(t){return 1===t.status?'<span class="el-tag el-tag--success el-tag--small el-tag--light">已上架</span>':'<span class="el-tag el-tag--info el-tag--small el-tag--light">已下架</span>'}},{label:"加锁状态",prop:"is_locked",width:"90",html:!0,method:function(t){return 1===t.is_locked?'<span style="color: #F56C6C;"><i class="el-icon-lock"></i> 已加锁</span>':'<span style="color: #909399;"><i class="el-icon-unlock"></i> 未加锁</span>'}},{label:"进行时长",prop:"fixture_status",width:"100",html:!0,method:function(t){var e="";return t.fixture_status&&(e=t.fixture_status.elapsed),e?'<span style="color: #E6A23C; font-weight: bold;"><i class="el-icon-timer"></i> '.concat(e,"</span>"):"--"}},{label:"直播中进行时长",prop:"odd_fixture_status",width:"100",html:!0,method:function(t){var e=JSON.parse(t.odd_fixture_status||"null"),a="";return e&&(a=e.seconds),a?'<span style="color: #E6A23C; font-weight: bold;"><i class="el-icon-timer"></i> '.concat(a,"</span>"):"--"}},{label:"比分 (半场/全场)",prop:"score",minWidth:"120",html:!0,method:function(t){var e=t.half_score||"-",a=t.score||"-";return'<span style="color: #409EFF; font-weight: bold;">'.concat(e," / ").concat(a,"</span>")}},{label:"比赛时间",prop:"game_time",minWidth:"160"}],rowsActions:[{key:"viewDetail",label:"查看详情",html:!0,method:function(e){t.$router.push({name:"EventDetail",query:{id:e.id}})}},{key:"viewInfo",label:"对比赛事信息",html:!0,method:function(e){t.$router.push({name:"EventInformationIndex",query:{data_id:e.data_id}})}},{key:"changeState",label:"修改状态",html:!0,method:function(e){t.form={id:[e.id],state:e.state},t.$refs.dialog.open()}},{key:"toggleStatus",vIF:function(t){return 1===t.status},label:"下架",method:function(e){var a=1===e.status?0:1,n=1===a?"上架":"下架";t.quickEditAPI(e,{status:a},n,"status")}},{key:"toggleStatus1",vIF:function(t){return 0===t.status},label:"上架",method:function(e){var a=1===e.status?0:1,n=1===a?"上架":"下架";t.quickEditAPI(e,{status:a},n,"status")}}],apis:{list:{url:"sport/list",dataParam:"data.data",resultParam:"data",init:!1}},tableOptions:{add:{show:!1},edit:{show:!1},delete:{show:!1}}}},mounted:function(){var t=this;this.onSubmit(),this.timer=setInterval((function(){t.onSubmit(),t.customLoading=!1}),5e3)},destroyed:function(){clearInterval(this.timer)},methods:{onValueChange:function(t){},getTimeRange:function(t){var e,a,n=new Date,i=n.getFullYear(),l=n.getMonth(),o=n.getDate(),r=n.getDay()||7,s=function(t){var e=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return"".concat(e,"-").concat(a,"-").concat(n)};switch(t){case"yesterday":var c=new Date(n.getTime()-864e5);e=s(c),a=s(c);break;case"today":e=s(n),a=s(n);break;case"week":e=s(new Date(i,l,o-r+1)),a=s(n);break;case"month":e=s(new Date(i,l,1)),a=s(n);break}return[e,a]},handleTimeFilter:function(t){this.timeFilter=t,this.onSubmit(this.currentSearchParams)},onSubmit:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.currentSearchParams=Object(o["a"])({},t);var e=Object(o["a"])(Object(o["a"])({},this.currentSearchParams),{},{error:1});if(e.timeRange&&2===e.timeRange.length)e.start_time=e.timeRange[0],e.end_time=e.timeRange[1],this.timeFilter="";else if(this.timeFilter){var a=this.getTimeRange(this.timeFilter),n=Object(l["a"])(a,2),i=n[0],r=n[1];e.start_time=i,e.end_time=r}else e.start_time=void 0,e.end_time=void 0;delete e.timeRange;var s=Object.keys(e).reduce((function(t,a){return""!==e[a]&&null!==e[a]&&void 0!==e[a]&&(t[a]=e[a]),t}),{});this.queryData=s,this.$refs.table&&this.$refs.table.getList(this.queryData)},submitStateEdit:function(){var t=this;if(null===this.form.state)return this.$message.warning("请选择比赛状态");this.loading=!0,Object(s["ob"])({id:this.form.id,state:this.form.state}).then((function(){t.$message.success("比赛状态修改成功"),t.$refs.dialog.close(),t.onSubmit(t.queryData)})).catch((function(){t.$message.error("比赛状态修改失败")})).finally((function(){t.loading=!1}))},quickEditAPI:function(t,e,a,n){var i=this,l="确认要对该赛事执行【".concat(a,"】操作吗?");"下架"===a&&(l+="(注意:该操作会将款退回)"),this.$confirm(l,"操作提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){i.loading=!0;var n=Object(o["a"])({id:[t.id]},e);Object(s["ob"])(n).then((function(){i.$message.success("".concat(a,"成功")),i.onSubmit(i.queryData)})).catch((function(){i.$message.error("".concat(a,"失败"))})).finally((function(){i.loading=!1}))})).catch((function(){}))},getSelectionIds:function(){var t;return(null===(t=this.$refs.table)||void 0===t?void 0:t.selectionList)||[]},handleBatchState:function(){var t=this.getSelectionIds();if(!t.length)return this.$message.warning("请先选择数据");this.form={id:t,state:null},this.$refs.dialog.open()},handleBatchOnline:function(){var t=this.getSelectionIds();if(!t.length)return this.$message.warning("请先选择数据");this.batchRequest(t,{status:1},"批量上架")},handleBatchOffline:function(){var t=this.getSelectionIds();if(!t.length)return this.$message.warning("请先选择数据");this.batchRequest(t,{status:0},"批量下架")},handleBatchLock:function(){var t=this.getSelectionIds();if(!t.length)return this.$message.warning("请先选择数据");this.batchRequest(t,{is_locked:1},"批量加锁")},handleBatchUnlock:function(){var t=this.getSelectionIds();if(!t.length)return this.$message.warning("请先选择数据");this.batchRequest(t,{is_locked:0},"批量解锁")},batchRequest:function(t,e,a){var n=this,i="确认要执行【".concat(a,"】操作吗?");"批量下架"===a&&(i+="(注意:该操作会将款退回)"),this.$confirm(i,"操作提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){n.loading=!0,Object(s["ob"])(Object(o["a"])({id:t},e)).then((function(){n.$message.success("".concat(a,"成功")),n.onSubmit(n.queryData)})).catch((function(){n.$message.error("".concat(a,"失败"))})).finally((function(){n.loading=!1}))})).catch((function(){}))}}},f=h,m=(a("da90"),a("1805")),g=Object(m["a"])(f,n,i,!1,null,"2b89b26c",null);e["default"]=g.exports},"865d":function(t,e,a){"use strict";var n=a("04c2"),i=a("f370").left,l=a("d1da"),o=a("4de2"),r=a("c3c0"),s=!r&&o>79&&o<83,c=s||!l("reduce");n({target:"Array",proto:!0,forced:c},{reduce:function(t){var e=arguments.length;return i(this,t,e,e>1?arguments[1]:void 0)}})},b797:function(t,e,a){"use strict";function n(t){if(Array.isArray(t))return t}a.d(e,"a",(function(){return r}));a("530a"),a("502c"),a("2d6c"),a("b138"),a("0401"),a("b3c4"),a("e7bb");function i(t,e){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var n,i,l,o,r=[],s=!0,c=!1;try{if(l=(a=a.call(t)).next,0===e){if(Object(a)!==a)return;s=!1}else for(;!(s=(n=l.call(a)).done)&&(r.push(n.value),r.length!==e);s=!0);}catch(t){c=!0,i=t}finally{try{if(!s&&null!=a["return"]&&(o=a["return"](),Object(o)!==o))return}finally{if(c)throw i}}return r}}var l=a("a8f2");a("0f5d");function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,e){return n(t)||i(t,e)||Object(l["a"])(t,e)||o()}},da90:function(t,e,a){"use strict";a("308d")},f370:function(t,e,a){"use strict";var n=a("db2f"),i=a("9bf4"),l=a("71cd"),o=a("57ad"),r=TypeError,s="Reduce of empty array with no initial value",c=function(t){return function(e,a,c,u){var d=i(e),h=l(d),f=o(d);if(n(a),0===f&&c<2)throw new r(s);var m=t?f-1:0,g=t?-1:1;if(c<2)while(1){if(m in h){u=h[m],m+=g;break}if(m+=g,t?m<0:f<=m)throw new r(s)}for(;t?m>=0:f>m;m+=g)m in h&&(u=a(u,h[m],m,d));return u}};t.exports={left:c(!1),right:c(!0)}}}]);