import{b as t}from"./system.1703796278973.js";import{B as c,L as s,T as r}from"./comm.1703796278973.js";import{M as v}from"./index.17037962789732.js";import{d as _,k as f,l as T,r as y,o as k,x as w,b as A,u as L}from"./vue.1703796278973.js";const C={ptzStart:(o,e,a)=>`${c}/media/device/${o}/${e}/live.${a}?:X_Access_Token=${s.get(r)}`,queryDetail:(o,e)=>t.post(`/media/device/${o}/channel/_query`,e),queryRecordLocal:(o,e,a)=>t.post(`/media/device/${o}/${e}/records/in-local`,a),downloadRecord:(o,e,a)=>t.post(`/media/device/${o}/${e}/_record`,a),playbackLocal:(o,e,a,l,d,i=1)=>`${c}/media/device/${o}/${e}/playback.${a}?:X_Access_Token=${s.get(r)}&startTime=${l}&endTime=${d}&speed=${i}`,playbackControl:(o,e)=>t.post(`/media/device/${o}/${e}/stream-control`),recordsInServer:(o,e,a)=>t.post(`/media/device/${o}/${e}/records/in-server`,a),recordsInServerFiles:(o,e,a)=>t.post(`/media/device/${o}/${e}/records/in-server/files`,a),playbackStart:o=>`${c}/record/${o}.mp4?:X_Access_Token=${s.get(r)}`,downLoadFile:o=>`${c}/record/${o}.mp4?download=true&:X_Access_Token=${s.get(r)}`},h=_({__name:"iconNode",props:{type:null,item:null,onCloudView:null,onDownLoad:null},setup(o){var m;const e=o,a=f((m=e.item)!=null&&m.isServer?2:0),l=n=>n===0?"CloudDownloadOutlined":n===2?"EyeOutlined":"LoadingOutlined",d=T(()=>e.type==="local"?l(a.value):"DownloadOutlined"),i=n=>{a.value=1,C.downloadRecord(n.deviceId,n.channelId,{local:!1,downloadSpeed:4,startTime:n.startTime,endTime:n.endTime}).then(p=>{p.status===200&&v.success("操作成功。上传云端需要一定时间，请稍后查看云端数据"),a.value=p.status===200?2:0}).catch(()=>{a.value=0})},u=()=>{e.type==="local"?a.value===2?e.onCloudView(e.item.startTime,e.item.endTime):a.value===0&&i(e.item):e.onDownLoad()};return(n,p)=>{const $=y("AIcon");return k(),w("a",{onClick:u},[A($,{type:L(d)},null,8,["type"])])}}});export{h as _,C as p};
