Files
sbnews/server/public/admin/assets/MatchLiveTable-CAjXQXjf.js
T

2 lines
7.8 KiB
JavaScript

import{i as J,M as G,K as H,L as Q,J as X,a2 as Y,D as Z,B as ee,h as le,C as te,N as ae}from"./element-plus-BluzIk5z.js";import{b as oe,f as ie}from"./index-CLy3qTQ5.js";import{m as re,c as ne,d as me,e as de,f as ue}from"./match-Chc8pNDp.js";import{d as pe,r as h,a0 as _e,w as se,aq as ce,c as fe,o as p,a as x,M as b,K as s,P as k,U as l,L as a,R as c,u as i,S as A,i as ye}from"./@vue-DjVelRet.js";import"./@element-plus-RuzzlbSF.js";import"./lodash-es-VsDguZh5.js";import"./dayjs-Mv9jwnDt.js";import"./@popperjs-D_chPuIy.js";import"./async-validator-9PlIezaS.js";import"./@ctrl-r5W6hzzQ.js";import"./normalize-wheel-es-BQoi3Ox2.js";import"./nprogress-DYbUr3Ql.js";import"./vue-router-DifUqGFW.js";import"./pinia-D1_qSsvX.js";import"./axios-DIsA03vz.js";import"./lodash-wrSAtCJj.js";import"./@vueuse-DbKvT5Ch.js";import"./css-color-function-DsMtFL6v.js";import"./balanced-match-BdS7OldZ.js";import"./color-DYO1E7y4.js";import"./clone-Ddk2tjDh.js";import"./color-convert-DsNsD289.js";import"./color-name-Dju3oUBS.js";import"./color-string-pUQDDJII.js";import"./ms-CzQ2E3wO.js";import"./vue-clipboard3-DXsJvHIW.js";import"./clipboard-DPX9bJ1T.js";import"./echarts-CXZcVnUo.js";import"./tslib-BDyQ-Jie.js";import"./zrender-DO4NV0px.js";import"./highlight.js--xG_hASo.js";import"./@highlightjs-DcY7_PRf.js";const he={class:"match-live-table px-4 py-3 bg-fill-light rounded"},ve={class:"flex items-center justify-between mb-3"},Xe=pe({__name:"MatchLiveTable",props:{matchId:{default:0}},setup(F){const u=F,v=h(!1),w=h([]),_=h(!1),f=h(!1),E=h(),o=_e({id:0,match_id:0,title:"",source_url:"",play_type:"stream",iframe_url:"",source_domain:"",play_url_m3u8:"",play_url_hd_m3u8:"",play_url_flv:"",play_url_hd_flv:"",fetch_status:"",last_fetch_at:""}),U={match_id:[{required:!0,message:"请输入赛事ID",trigger:"blur"}],title:[{required:!0,message:"请输入线路标题",trigger:"blur"}],source_url:[{required:!0,message:"请输入来源链接",trigger:"blur"}]},g=()=>{Object.assign(o,{id:0,match_id:u.matchId,title:"",source_url:"",play_type:"stream",iframe_url:"",source_domain:"",play_url_m3u8:"",play_url_hd_m3u8:"",play_url_flv:"",play_url_hd_flv:"",fetch_status:"",last_fetch_at:""})},M=e=>Array.isArray(e)?e:Array.isArray(e==null?void 0:e.lists)?e.lists:Array.isArray(e==null?void 0:e.data)?e.data:Array.isArray(e==null?void 0:e.list)?e.list:[],V=async()=>{v.value=!0;try{const e={page_no:1,page_size:200};u.matchId&&(e.match_id=u.matchId);const t=await re({...e});w.value=M(t)}finally{v.value=!1}},N=()=>{g(),_.value=!0},T=async e=>{f.value=!0;try{g();const t=await ne({id:e});Object.assign(o,{...o,...t,id:e,match_id:u.matchId||Number(t.match_id||0)}),_.value=!0}finally{f.value=!1}},B=async()=>{var e;await((e=E.value)==null?void 0:e.validate()),f.value=!0;try{const t={id:o.id,match_id:u.matchId||o.match_id,title:o.title,source_url:o.source_url};o.id?await me(t):await de(t),_.value=!1,V()}finally{f.value=!1}},S=async e=>{await ie.confirm("确定要删除该直播线路?"),await ue({id:e}),V()},I=e=>e==="html"?"网页播放":"视频流",D=e=>e===""||e===null||e===void 0?"未知":e===0||e==="0"||e==="pending"?"待抓取":e===1||e==="1"||e==="success"||e==="done"?"成功":e===2||e==="2"||e==="failed"||e==="error"?"失败":String(e),R=e=>e===0||e==="0"||e==="pending"?"warning":e===1||e==="1"||e==="success"||e==="done"?"success":e===2||e==="2"||e==="failed"||e==="error"?"danger":"info";return se(()=>u.matchId,()=>{g(),V()},{immediate:!0}),(e,t)=>{const q=oe,y=J,n=H,C=Q,z=X,$=Y,j=le,m=ee,d=te,P=Z,K=ae,L=ce("perms"),O=G;return p(),fe("div",he,[x("div",ve,[t[6]||(t[6]=x("div",{class:"text-base font-medium"},"直播线路",-1)),b((p(),s(y,{type:"primary",size:"small",onClick:N},{icon:a(()=>[l(q,{name:"el-icon-Plus"})]),default:a(()=>[t[5]||(t[5]=c(" 新增线路 "))]),_:1})),[[L,["match.matchLive/add"]]])]),b((p(),s(z,{data:i(w),size:"small"},{default:a(()=>[u.matchId?k("",!0):(p(),s(n,{key:0,label:"赛事ID",prop:"match_id","min-width":"90"})),l(n,{label:"标题",prop:"title","min-width":"140"}),l(n,{label:"线路类型","min-width":"100"},{default:a(({row:r})=>[l(C,{type:r.play_type==="html"?"warning":"success"},{default:a(()=>[c(A(I(r.play_type)),1)]),_:2},1032,["type"])]),_:1}),l(n,{label:"iframe/WebView",prop:"iframe_url","min-width":"220","show-overflow-tooltip":""}),l(n,{label:"来源域名",prop:"source_domain","min-width":"140","show-overflow-tooltip":""}),l(n,{label:"来源链接",prop:"source_url","min-width":"220","show-overflow-tooltip":""}),l(n,{label:"M3U8",prop:"play_url_m3u8","min-width":"220","show-overflow-tooltip":""}),l(n,{label:"高清M3U8",prop:"play_url_hd_m3u8","min-width":"220","show-overflow-tooltip":""}),l(n,{label:"FLV",prop:"play_url_flv","min-width":"220","show-overflow-tooltip":""}),l(n,{label:"高清FLV",prop:"play_url_hd_flv","min-width":"220","show-overflow-tooltip":""}),l(n,{label:"抓取状态","min-width":"120"},{default:a(({row:r})=>[l(C,{type:R(r.fetch_status)},{default:a(()=>[c(A(D(r.fetch_status)),1)]),_:2},1032,["type"])]),_:1}),l(n,{label:"最近抓取",prop:"last_fetch_at","min-width":"160"}),l(n,{label:"创建时间",prop:"create_time","min-width":"160"}),l(n,{label:"更新时间",prop:"update_time","min-width":"160"}),l(n,{label:"操作",width:"150",fixed:"right"},{default:a(({row:r})=>[b((p(),s(y,{type:"primary",link:"",onClick:W=>T(r.id)},{default:a(()=>t[7]||(t[7]=[c(" 编辑 ")])),_:2},1032,["onClick"])),[[L,["match.matchLive/edit"]]]),b((p(),s(y,{type:"danger",link:"",onClick:W=>S(r.id)},{default:a(()=>t[8]||(t[8]=[c(" 删除 ")])),_:2},1032,["onClick"])),[[L,["match.matchLive/delete"]]])]),_:1})]),_:1},8,["data"])),[[O,i(v)]]),!i(v)&&!i(w).length?(p(),s($,{key:0,description:"暂无直播线路"})):k("",!0),l(K,{modelValue:i(_),"onUpdate:modelValue":t[4]||(t[4]=r=>ye(_)?_.value=r:null),title:i(o).id?"编辑直播线路":"新增直播线路",width:"720px","destroy-on-close":""},{footer:a(()=>[l(y,{onClick:t[3]||(t[3]=r=>_.value=!1)},{default:a(()=>t[9]||(t[9]=[c("取消")])),_:1}),l(y,{type:"primary",loading:i(f),onClick:B},{default:a(()=>t[10]||(t[10]=[c("保存")])),_:1},8,["loading"])]),default:a(()=>[l(P,{ref_key:"editFormRef",ref:E,model:i(o),rules:U,"label-width":"110px"},{default:a(()=>[u.matchId?k("",!0):(p(),s(m,{key:0,label:"赛事ID",prop:"match_id"},{default:a(()=>[l(j,{modelValue:i(o).match_id,"onUpdate:modelValue":t[0]||(t[0]=r=>i(o).match_id=r),min:1,precision:0,"controls-position":"right",class:"w-full"},null,8,["modelValue"])]),_:1})),l(m,{label:"线路标题",prop:"title"},{default:a(()=>[l(d,{modelValue:i(o).title,"onUpdate:modelValue":t[1]||(t[1]=r=>i(o).title=r),placeholder:"请输入线路标题"},null,8,["modelValue"])]),_:1}),l(m,{label:"来源链接",prop:"source_url"},{default:a(()=>[l(d,{modelValue:i(o).source_url,"onUpdate:modelValue":t[2]||(t[2]=r=>i(o).source_url=r),placeholder:"请输入源站链接"},null,8,["modelValue"])]),_:1}),l(m,{label:"线路类型"},{default:a(()=>[l(d,{"model-value":I(i(o).play_type),readonly:""},null,8,["model-value"])]),_:1}),l(m,{label:"iframe/WebView"},{default:a(()=>[l(d,{"model-value":i(o).iframe_url,readonly:""},null,8,["model-value"])]),_:1}),l(m,{label:"M3U8"},{default:a(()=>[l(d,{"model-value":i(o).play_url_m3u8,readonly:""},null,8,["model-value"])]),_:1}),l(m,{label:"高清M3U8"},{default:a(()=>[l(d,{"model-value":i(o).play_url_hd_m3u8,readonly:""},null,8,["model-value"])]),_:1}),l(m,{label:"FLV"},{default:a(()=>[l(d,{"model-value":i(o).play_url_flv,readonly:""},null,8,["model-value"])]),_:1}),l(m,{label:"高清FLV"},{default:a(()=>[l(d,{"model-value":i(o).play_url_hd_flv,readonly:""},null,8,["model-value"])]),_:1}),l(m,{label:"抓取状态"},{default:a(()=>[l(d,{"model-value":D(i(o).fetch_status),readonly:""},null,8,["model-value"])]),_:1}),l(m,{label:"最近抓取"},{default:a(()=>[l(d,{"model-value":i(o).last_fetch_at,readonly:""},null,8,["model-value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}});export{Xe as default};