PageSourceSearch

https://zhycit.com/assets/InformationFlow-CcT5N0HA.js

js zhycit.com collected 2026-10-02 01:51:57 UTC 5,682 bytes, 1 lines download raw bytes

1import{v as e,_ as s,D as t}from"./index-B7uERBFw.js";import{o as l,n as a,t as o,J as n,z as i,F as r,B as d,x as c,q as m,H as h,N as g,A as p}from"./vue-vendor-PK9IXOjP.js";import"./highlight-vendor-o4p8UI1u.js";import"./utils-vendor-C1xG6aki.js";import"./misc-vendor-DUXn5T4b.js";import"./grid-vendor-DAJcd0nu.js";const u=new class extends e{constructor(){super("MsgDatabase"),this.version(1).stores({msg:"id, listenerId, roomId, talkerId, text, timestamp,toId, type"}),this.msg=this.table("msg")}async getAllList(){try{return(await this.msg.toArray()).reverse()}catch(e){throw e}}add(e){7===e.type&&this.msg.add(e)}async removeAll(){return await this.checkResult.clear()}},f="/assets/10-fTFP1Yea.svg",b={class:"page-content"},v={class:"card shadow h-100"},w={class:"card-header border-bottom d-flex justify-content-between align-items-center p-2"},y={class:"dropdown-menu dropdown-menu-end min-w-auto"},M={key:0,class:"card-body p-2 overflow-scroll justify-content-between"},x={class:"mb-1 flex-grow-1"},I={class:"fw-bold me-2"},k=["onClick"],S={key:1},A={key:2,class:"alert alert-warning alert-dismissible fade show alert-custom",role:"alert"},C={key:1,class:"card-body p-4"},j={key:2,id:"collapseComment",class:"card-footer fixed-bottom"},N={class:"d-flex mt-3"};const B=s({data:()=>({messages:[],connect:!1,inputMessage:"",selectedIndex:null,currentMsg:null,showSendDiv:!1,showAlert:!1,notifyMsg:""}),computed:{isConnected(){return this.store.isConnected}},watch:{isConnected(e){this.connect=e,e&&this.store.sendMessage(JSON.stringify({cmd:"startWx"}))},messages(){return this.getAllMsg()},selectedIndex(e){null!==e?(this.$refs[e][0].scrollIntoView({behavior:"smooth",block:"start"}),this.preventScroll()):this.allowScroll()}},created(){null===this.store.socket?this.store.connect("ws://10.211.55.3:59033/"):this.getAllMsg()},mounted(){setTimeout(()=>{this.connect&&this.getAllMsg()},1e3)},methods:{getUserNameById(e){const s=t.getItem("contactList",[]).find(s=>s.id===e);if(s)return s.name||""},getFriendById:e=>t.getItem("contactList",[]).find(s=>s.id===e),getRoomNameById(e){const s=t.getItem("roomList",[]).find(s=>s.id===e);return s?s.topic:null},getAllMsg(){u.getAllList().then(e=>(this.messages=e,this.messages))},handleItemClick(e){this.selectedIndex=e.id,this.currentMsg=e,this.showSendDiv=!0,document.body.style.overflow="hidden"},sendMessage(){if(0===this.inputMessage.trim().length)return void this.showAlerts("请输入要发送的信息");if(!this.isConnected||!this.store)return this.showAlerts("微信链接失败,无法发送信息"),void(this.inputMessage="");const{roomId:e="",talkerId:s}=this.currentMsg,t=this.inputMessage.trim();e?this.sendRoomMessage(e,s,t):this.sendPrivateMessage(s,t),this.inputMessage=""},sendRoomMessage(e,s,t){const l=this.getFriendById(s);if(!l)return;const a={cmd:"exec",args:{api:"puppet?.messageSendText",params:l.friend?[s,t]:[e,`${t} @${l.name}`,[s]]}};this.sendMsg(JSON.stringify(a))},sendPrivateMessage(e,s){const t={cmd:"exec",args:{api:"puppet.messageSendText",params:[e,s]}};this.sendMsg(JSON.stringify(t))},preventScroll(){this.isScrollable=!1,document.body.style.overflow="hidden"},allowScroll(){this.isScrollable=!0,document.body.style.overflow=""},handleScroll(e){this.isScrollable||(e.preventDefault(),e.stopPropagation())},showAlerts(e){this.showAlert=!0,this.notifyMsg=e,setTimeout(()=>{this.showAlert=!1},3e3)},sendMsg(e){this.store.sendMessage(e)},clearMsg(){u.removeAll()}}},[["render",function(e,s,t,u,B,D){return l(),a("div",b,[o("div",v,[o("div",w,[s[6]||(s[6]=o("h5",{class:"card-header-title"},"信息流",-1)),s[7]||(s[7]=o("a",{class:"btn btn-link p-0 mb-0 dropdown","data-bs-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}," 设置 ",-1)),o("ul",y,[o("li",null,[o("a",{class:"dropdown-item",onClick:s[0]||(s[0]=n((...e)=>D.clearMsg&&D.clearMsg(...e),["prevent"]))},[...s[5]||(s[5]=[o("i",{class:"fas fa-fw fa-times"},null,-1),i(" 清除消息 ",-1)])])])])]),D.isConnected?(l(),a("div",M,[B.messages?(l(),a("div",{key:0,class:"message-list",onScroll:s[1]||(s[1]=(...e)=>D.handleScroll&&D.handleScroll(...e))},[(l(!0),a(r,null,d(B.messages,e=>(l(),a("div",{key:e.id,ref_for:!0,ref:e.id,class:p(["message-item",{highlighted:B.selectedIndex===e.id},"d-sm-flex justify-content-between align-items-center pb-2 pt-2 border-bottom"])},[o("h6",x,[o("span",I,c(null!==D.getRoomNameById(e.roomId)?D.getRoomNameById(e.roomId)+" --":"")+" "+c(D.getUserNameById(e.talkerId)
1)+": ",1),i(" "+c(e.text),1)]),o("a",{class:"btn btn-sm btn-light mb-0 flex-shrink-0",onClick:s=>D.handleItemClick(e)},"回复信息",8,k)],2))),128))],32)):(l(),a("div",S,[...s[8]||(s[8]=[o("div",{class:"col-12 text-center"},[o("img",{src:f,class:"h-200px h-md-300px mb-3",alt:""}),o("h2",null,"信息为空")],-1)])])),B.showAlert?(l(),a("div",A,[i(c(B.notifyMsg)+" ",1),o("button",{type:"button",class:"btn-close","data-bs-dismiss":"alert","aria-label":"Close",onClick:s[2]||(s[2]=e=>B.showAlert=!1)})])):m("",!0)])):(l(),a("div",C,[...s[9]||(s[9]=[o("div",{class:"col-12 text-center"},[o("img",{src:f,class:"h-200px h-md-300px mb-3",alt:""}),o("h2",null,"微信未链接")],-1)])])),B.showSendDiv?(l(),a("div",j,[o("div",N,[h(o("textarea",{"onUpdate:modelValue":s[3]||(s[3]=e=>B.inputMessage=e),class:"form-control mb-0",placeholder:"请输入要回复的信息...",rows:"2",spellcheck:"false"},null,512),[[g,B.inputMessage]]),o("button",{class:"btn btn-sm btn-primary-soft ms-2 px-4 mb-0 flex-shrink-0",onClick:s[4]||(s[4]=(...e)=>D.sendMessage&&D.sendMessage(...e))},[...s[10]||(s[10]=[o("i",{class:"fas fa-paper-plane fs-5"},null,-1)])])])])):m("",!0)])])}],["__scopeId","data-v-d977bf10"]]);export{B as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.