Files
qiaoqiaoyun/dist/js/CommentPanel-4027e3d7.js
2025-07-09 23:02:05 +08:00

2 lines
28 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var Ne=Object.defineProperty,je=Object.defineProperties;var De=Object.getOwnPropertyDescriptors;var be=Object.getOwnPropertySymbols;var Ae=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable;var ke=(t,l,n)=>l in t?Ne(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,ue=(t,l)=>{for(var n in l||(l={}))Ae.call(l,n)&&ke(t,n,l[n]);if(be)for(var n of be(l))$e.call(l,n)&&ke(t,n,l[n]);return t},me=(t,l)=>je(t,De(l));var D=(t,l,n)=>new Promise((e,k)=>{var w=a=>{try{m(n.next(a))}catch(c){k(c)}},y=a=>{try{m(n.throw(a))}catch(c){k(c)}},m=a=>a.done?e(a.value):Promise.resolve(a.value).then(w,y);m((n=n.apply(t,l)).next())});import{q as Ee,a7 as fe,k as Ie,j as Oe,l as W,e as pe,H,a as Re,ap as Pe}from"./index-831af9dd.js";import{d as Fe,f as I,r as Ve,I as Se,w as le,a3 as ae,a4 as se,a5 as o,V as i,a6 as u,af as O,ai as p,a7 as h,F as R,am as Q,ak as B,ae as P,k as r,E as A,a8 as X,W as V,e as _e,q as we,at as ze,au as Ke,A as qe,c as Le,o as Ye,h as ve}from"./vue-vendor-24c7dc61.js";import{T as Z,aO as ge,bf as he,b7 as ye,b8 as ce,a$ as Ce,bg as We,b3 as Ge,bh as Je,bi as Qe,r as Xe,aC as Ze,a_ as et}from"./antd-vue-vendor-0d72f01e.js";import{U as tt}from"./UserSelectModal-d78c1490.js";import{B as ot}from"./index-1c3affea.js";import{u as de,g as Te,a as Me,l as nt,b as xe,d as lt,q as at,f as st,c as it,e as ct,h as dt}from"./useComment-c2ce47e3.js";import{b as rt,p as ut,d as mt,g as _t}from"./FileList.api-9749c044.js";import{_ as ft}from"./JUpload-76e119c7.js";const pt=Fe({name:"SelectFileModal",inheritAttrs:!1,components:{BasicModal:ot},emits:["selected","register"],setup(t,{emit:l}){const n=I([]),e=Ee(),{getBackground:k,isImage:w,getImageAsBackground:y,viewImage:m,getImageTypeIcon:a}=de(),{userInfo:c}=fe(),f=I([]),d=I("");let L="";const v=Ve({url:"",id:"",name:"",type:""});function M(_){return D(this,null,function*(){const F="/eoa/files/getFileList";let b=d.value;_&&(b=_),b||(b=L);let E={userId:c.id,delFlag:0,searchType:"list",parentId:b};const U=yield Ie.get({url:F,params:E},{isTransformResponse:!1});let K=[];if(U.success){let g=U.result.records;for(let j of g)K.push({id:j.id,name:j.fileName,url:j.url,type:j.fileType})}f.value=K})}function s(){return D(this,null,function*(){let _={fileName:"我的文件",fileType:"folder",izFolder:"1",izRootFolder:"1",parentId:"",storeType:"manage",downCount:0,readCount:0,createBy:c.username,delFlag:"0"};const F="/eoa/files/generateMyFile";L=(yield Ie.put({url:F,params:_},{joinParamsToUrl:!0,isTransformResponse:!1})).result.id,M(L)})}function T(){f.value=[{id:"myfile",name:"我的文件",type:"folder"},{id:"sharefile",name:"共享文件",type:"folder"}]}const[z,{closeModal:N}]=Oe(()=>{T()});function G(){l("selected",Se(v)),N()}const x=I([]);x.value=[];function $(_){let b=f.value.filter(U=>U.id==_.key)[0],E=x.value;b.type==="folder"?(E.push({title:b.name,level:E.length,id:b.id,rootType:b.rootType}),x.value=E,d.value=b.id,n.value=[]):Object.keys(v).map(U=>{v[U]=b[U]})}function q(_){let F=x.value;if(_&&_.id){d.value=_.id;let b=_.level;F.splice(b+1,F.length-b-1)}else d.value="",F=[],T();x.value=F,n.value=[]}const J=I(0);J.value=window.innerHeight-300,le(d,()=>{if(!d.value)return;let _=!0;if(d.value=="sharefile")_=!1,S();else if(d.value=="myfile")_=!1,s();else{let F=x.value.filter(b=>b.id==d.value);F.length>0&&(F[0].rootType=="share"?(_=!1,C(d.value)):F[0].rootType=="share2"&&(_=!1,ne(d.value)))}_===!0&&M()});function ne(_){return D(this,null,function*(){const F=yield rt({fileId:_,userId:c.id});let b=[];if(F.success){let E={parentId:_,delFlag:0,pageNo:1,pageSize:999,searchType:"list",userId:c.id};const U=yield ut(E);if(U.success&&U.result&&U.result.records)for(let K of U.result.records)b.push({id:K.id,name:K.fileName,url:K.url,type:K.fileType})}f.value=[...b]})}function C(_){return D(this,null,function*(){let F={tenantId:_,userId:c.id};const b=yield mt(F);let E=[];if(b.success&&b.result)for(let U of b.result)E.push({id:U.fileId,name:U.fileName,type:"folder",rootType:"share2"});f.value=[...E]})}function S(){return D(this,null,function*(){const _=yield _t();let F=[];if(_.success&&_.result&&_.result.list)for(let b of _.result.list)F.push({id:b.id,name:b.name,type:"folder",rootType:"share"});F.push({id:"个人",name:"个人",type:"folder",rootType:"share"}),f.value=[...F]})}return{maxHeight:J,onSelectFile:$,dirList:x,attrs:e,registerModal:z,onOk:G,loadFile:M,getImageAsBackground:y,getBackground:k,isImage:w,myFileList:f,getImageTypeIcon:a,onChangeDir:q,selectedKeys:n}}});const vt=t=>(ae("data-v-398c7ed4"),t=t(),se(),t),gt={style:{display:"flex","flex-direction":"column"}},ht=vt(()=>o("div",null," 选择文件 ",-1)),yt={class:"file-dir-list"},Ct=["onClick"],bt={style:{display:"flex","flex-direction":"row","align-items":"center"}},kt={style:{"margin-left":"10px"}};function It(t,l,n,e,k,w){const y=i("Icon"),m=i("a-menu-item"),a=i("a-menu"),c=i("a-empty"),f=i("BasicModal");return u(),O(f,{onRegister:t.registerModal,width:"500px",onOk:t.onOk,draggable:!1},{title:p(()=>[o("div",gt,[ht,o("div",yt,[o("span",{onClick:l[0]||(l[0]=()=>t.onChangeDir(""))}," 全部文件 "),(u(!0),h(R,null,Q(t.dirList,d=>(u(),h("span",{onClick:()=>t.onChangeDir(d),style:{"margin-left":"2px"}}," /"+B(d.title),9,Ct))),256))])])]),default:p(()=>[o("div",{class:"file-list",style:P({height:t.maxHeight+"px"})},[t.myFileList&&t.myFileList.length>0?(u(),O(a,{key:0,onSelect:t.onSelectFile,selectedKeys:t.selectedKeys,"onUpdate:selectedKeys":l[1]||(l[1]=d=>t.selectedKeys=d)},{default:p(()=>[(u(!0),h(R,null,Q(t.myFileList,d=>(u(),O(m,{key:d.id},{default:p(()=>[o("div",bt,[d.type=="folder"?(u(),O(y,{key:0,icon:"ant-design:folder-open-outlined",style:{"font-size":"32px",color:"rgb(253, 202, 7)"}})):d.type=="image"?(u(),h("div",{key:1,class:"content-icon",style:P({background:"url("+t.getImageTypeIcon()+") no-repeat"})},null,4)):(u(),h("div",{key:2,class:"content-icon",style:P({background:"url("+t.getBackground(d)+") no-repeat"})},null,4)),o("div",kt,B(d.name),1)])]),_:2},1024))),128))]),_:1},8,["onSelect","selectedKeys"])):(u(),O(c,{key:1,description:"没有文件"}))],4)]),_:1},8,["onRegister","onOk"])}const Ue=W(pt,[["render",It],["__scopeId","data-v-398c7ed4"]]),wt={name:"UploadChunk",components:{Tooltip:Z,UploadOutlined:ge,FolderOutlined:he,DownloadOutlined:ye,PaperClipOutlined:ce,DeleteOutlined:Ce,SelectFileModal:Ue},props:{visible:{type:Boolean,default:!1}},emits:["select"],setup(t,{emit:l}){const{selectFileList:n,beforeUpload:e,handleRemove:k,getBackground:w,isImage:y,getImageSrc:m,viewImage:a}=de(),[c,{openModal:f}]=pe();function d(){return Se(n.value)}function L(){n.value=[]}le(()=>n.value,s=>{if(s&&s.length>0){let T=s[0].name;T&&l("select",T)}});function v(){f(!0,{})}function M(s){let T=n.value;T.push(me(ue({},s),{exist:!0})),n.value=T}return{selectFileList:n,beforeUpload:e,handleRemove:k,getBackground:w,getUploadFileList:d,clear:L,isImage:y,getImageSrc:m,viewImage:a,registerModel:c,showFileModal:v,onSelectFileOk:M}}};const ee=t=>(ae("data-v-472c5482"),t=t(),se(),t),Ft={key:0},St={class:"j-icon"},Lt={class:"inner-button"},Tt={class:"j-icon"},Mt={key:0,class:"selected-file-warp"},xt={class:"selected-file-list"},Ut={class:"item"},Ht={class:"complex"},Bt={class:"content"},Nt={key:0,class:"content-top",style:{height:"100%"}},jt={class:"content-top"},Dt=["title"],At=["onClick"],$t={class:"text"},Et={class:"buttons"},Ot={class:"opt-icon"},Rt=ee(()=>o("div",{class:"item empty"},null,-1)),Pt=ee(()=>o("div",{class:"item empty"},null,-1)),Vt=ee(()=>o("div",{class:"item empty"},null,-1)),zt=ee(()=>o("div",{class:"item empty"},null,-1)),Kt=ee(()=>o("div",{class:"item empty"},null,-1)),qt=ee(()=>o("div",{class:"item empty"},null,-1));function Yt(t,l,n,e,k,w){const y=i("upload-outlined"),m=i("a-upload"),a=i("folder-outlined"),c=i("a-alert"),f=i("delete-outlined"),d=i("Tooltip"),L=i("SelectFileModal");return u(),h(R,null,[n.visible?(u(),h("div",Ft,[r(c,{type:"info",class:"jeecg-comment-files",style:{margin:"0"}},{message:p(()=>[o("span",St,[r(m,{multiple:"","file-list":e.selectFileList,"onUpdate:fileList":l[0]||(l[0]=v=>e.selectFileList=v),showUploadList:!1,"before-upload":e.beforeUpload},{default:p(()=>[o("span",Lt,[r(y),A("上传")])]),_:1},8,["file-list","before-upload"])]),o("span",Tt,[o("span",{class:"inner-button",onClick:l[1]||(l[1]=(...v)=>e.showFileModal&&e.showFileModal(...v))},[r(a),A("从文件库选择")])])]),_:1}),e.selectFileList&&e.selectFileList.length>0?(u(),h("div",Mt,[o("div",xt,[(u(!0),h(R,null,Q(e.selectFileList,v=>(u(),h("div",Ut,[o("div",Ht,[o("div",Bt,[e.isImage(v)?(u(),h("div",Nt,[o("div",{class:"content-image",style:P({height:"100%",backgroundImage:"url("+e.getImageSrc(v)+")"})},null,4)])):(u(),h(R,{key:1},[o("div",jt,[o("div",{class:"content-icon",style:P({background:"url("+e.getBackground(v)+") no-repeat"})},null,4)]),o("div",{class:"content-bottom",title:v.name},[o("span",null,B(v.name),1)],8,Dt)],64))]),o("div",{class:X(["layer",{"layer-image":e.isImage(v)}])},[o("div",{class:"next",onClick:M=>e.viewImage(v)},[o("div",$t,B(v.name),1)],8,At),o("div",Et,[o("div",Ot,[r(d,{title:"删除"},{default:p(()=>[r(f,{onClick:M=>e.handleRemove(v)},null,8,["onClick"])]),_:2},1024)])])],2)])]))),256)),Rt,Pt,Vt,A(),zt,Kt,qt])])):V("",!0)])):V("",!0),r(L,{onRegister:e.registerModel,onSelected:e.onSelectFileOk},null,8,["onRegister","onSelected"])],64)}const Wt=W(wt,[["render",Yt],["__scopeId","data-v-472c5482"]]);const Gt={categories:{recent:"最常用的",smileys:"表情选择",people:"人物&身体",nature:"动物&自然",foods:"食物&饮料",activity:"活动",places:"旅行&地点",objects:"物品",symbols:"符号",flags:"旗帜"}},Jt={name:"MyComment",components:{UserAddOutlined:We,Tooltip:Z,UserSelectModal:tt,PaperClipOutlined:ce,UploadChunk:Wt,SmileOutlined:Ge},props:{inner:H.bool.def(!1),inputFocus:{type:Boolean,default:!1}},emits:["cancel","comment"],setup(t,{emit:l}){const n=I(!1),e=I(),[k,{openModal:w,closeModal:y}]=pe(),m=I(!1),a=I("");function c(){let g=a.value;if(!g&&g!=="0")f.value=!0;else{m.value=!0;let j=[];n.value==!0&&(j=e.value.getUploadFileList()),l("comment",g,j),setTimeout(()=>{m.value=!1},350)}}const f=I(!1);le(a,()=>{let g=a.value;!g&&g!=="0"?f.value=!0:f.value=!1});function d(){l("cancel")}const L=I();le(()=>t.inputFocus,g=>{g==!0&&(a.value="",n.value==!0&&(e.value.clear(),n.value=!1))},{deep:!0,immediate:!0});function v(){w(!0,{isUpdate:!1})}function M(g){if(g&&g.length>0){const{realname:j,username:Y}=g[0];if(j&&Y){let re=`${j}[${Y}]`,ie=a.value;ie?ie.endsWith("@")?a.value=ie+re+" ":a.value="@"+re+" "+ie+" ":a.value="@"+re,S.value=!1,L.value.focus(),b.value=!0}}y()}function s(){}le(()=>a.value,g=>{g&&g.endsWith("@")&&v()});const T=I();function z(g){let j=a.value||"";j+=g,a.value=j,T.value.click()}const N=I(!1);function G(g){let j=a.value||"",Y=g.colons;Y.indexOf("::")>0&&(Y=Y.substring(0,Y.indexOf(":")+1)),a.value=j+Y,N.value=!1,F()}const x={width:"490px"};function $(g){g.preventDefault(),g.stopPropagation(),N.value=!1,b.value=!0}function q(g){g.preventDefault(),g.stopPropagation(),N.value=!N.value}const J=Te(),{getHtml:ne}=Me(J),C=_e(()=>{let g=a.value;return g?ne(g):"请输入你的评论可以@成员"}),S=I(!1);function _(g){g.preventDefault(),g.stopPropagation(),S.value=!1,L.value.focus(),b.value=!0}function F(){S.value=!0}const b=I(!1),E=_e(()=>!(a.value.length>0));function U(){a.value.length==0&&(b.value=!1,n.value=!1)}function K(g){a.value.length==0&&(a.value=g)}return{myComment:a,sendComment:c,noComment:d,disabledButton:f,buttonLoading:m,commentRef:L,registerModal:k,openSelectUser:v,setValue:M,handleCommentChange:s,uploadRef:e,uploadVisible:n,onSelectEmoji:z,optionsName:Gt,emojiButton:T,emojiIndex:J,showEmoji:G,pickerStyles:x,visibleEmoji:N,handleClickBlank:$,handleShowEmoji:q,commentHtml:C,showHtml:S,handleClickHtmlShower:_,handleBlur:F,commentActive:b,noConent:E,changeActive:U,selectFirstFile:K}}};const Qt=["innerHTML"],Xt={key:0,class:"comment-buttons"},Zt={style:{cursor:"pointer"}},eo={title:"表情",style:{display:"inline-block"}},to={style:{position:"relative"}},oo={key:0},no=o("span",null,null,-1);function lo(t,l,n,e,k,w){const y=i("user-add-outlined"),m=i("Tooltip"),a=i("PaperClipOutlined"),c=i("SmileOutlined"),f=i("a-button"),d=i("upload-chunk"),L=i("UserSelectModal"),v=i("Picker"),M=i("a-modal");return u(),h(R,null,[o("div",{class:X({"comment-active":e.commentActive}),style:{border:"1px solid #eee",margin:"0",position:"relative"},onClick:l[6]||(l[6]=(...s)=>e.handleClickBlank&&e.handleClickBlank(...s))},[we(o("textarea",{ref:"commentRef","onUpdate:modelValue":l[0]||(l[0]=s=>e.myComment=s),onKeyup:l[1]||(l[1]=ze((...s)=>e.sendComment&&e.sendComment(...s),["enter"])),onInput:l[2]||(l[2]=(...s)=>e.handleCommentChange&&e.handleCommentChange(...s)),onBlur:l[3]||(l[3]=(...s)=>e.handleBlur&&e.handleBlur(...s)),class:"comment-content",rows:3,placeholder:"请输入你的评论可以@成员"},null,544),[[Ke,e.myComment]]),o("div",{class:X(["comment-content comment-html-shower",{"no-content":e.noConent,"top-div":e.showHtml,"bottom-div":e.showHtml==!1}]),innerHTML:e.commentHtml,onClick:l[4]||(l[4]=(...s)=>e.handleClickHtmlShower&&e.handleClickHtmlShower(...s))},null,10,Qt),e.commentActive?(u(),h("div",Xt,[o("div",Zt,[r(m,{title:"选择@用户"},{default:p(()=>[r(y,{onClick:e.openSelectUser},null,8,["onClick"])]),_:1}),r(m,{title:"上传附件"},{default:p(()=>[r(a,{onClick:l[5]||(l[5]=s=>e.uploadVisible=!e.uploadVisible)})]),_:1}),o("span",eo,[r(c,{ref:"emojiButton",onClick:e.handleShowEmoji},null,8,["onClick"]),we(o("div",to,null,512),[[qe]])])]),e.commentActive?(u(),h("div",oo,[n.inner?(u(),O(f,{key:0,onClick:e.noComment,style:{"margin-right":"10px"}},{default:p(()=>[A("取消")]),_:1},8,["onClick"])):V("",!0),r(f,{type:"primary",onClick:e.sendComment,loading:e.buttonLoading,disabled:e.disabledButton},{default:p(()=>[A(" ")]),_:1},8,["onClick","loading","disabled"])])):V("",!0)])):V("",!0),r(d,{ref:"uploadRef",visible:e.uploadVisible,onSelect:e.selectFirstFile},null,8,["visible","onSelect"])],2),r(L,{rowKey:"username",onRegister:e.registerModal,onSelected:e.setValue,multi:!1},null,8,["onRegister","onSelected"]),r(M,{open:e.visibleEmoji,"onUpdate:open":l[7]||(l[7]=s=>e.visibleEmoji=s),footer:null,wrapClassName:"emoji-modal",closable:!1,width:490},{title:p(()=>[no]),default:p(()=>[r(v,{pickerStyles:e.pickerStyles,i18n:e.optionsName,data:e.emojiIndex,emoji:"grinning",showPreview:!1,infiniteScroll:!1,showSearch:!1,showSkinTones:!1,set:"apple",onSelect:e.showEmoji},null,8,["pickerStyles","i18n","data","onSelect"])]),_:1},8,["open"])],64)}const ao=W(Jt,[["render",lo]]);const so={name:"HistoryFileList",props:{dataList:{type:Array,default:()=>[]},isComment:{type:Boolean,default:!1}},components:{UploadOutlined:ge,FolderOutlined:he,DownloadOutlined:ye,PaperClipOutlined:ce,DeleteOutlined:Ce,Tooltip:Z},setup(){const{getBackground:t,getFileSize:l,downLoad:n,isImage:e,getImageAsBackground:k,viewImage:w}=de();return{getBackground:t,downLoad:n,getFileSize:l,isImage:e,getImageAsBackground:k,viewImage:w}}},te=t=>(ae("data-v-e83913e0"),t=t(),se(),t),io={class:"selected-file-list"},co={class:"item"},ro={class:"complex"},uo={class:"content"},mo={key:0,class:"content-top",style:{height:"100%"}},_o={class:"content-top"},fo=["title"],po=["onClick"],vo={class:"text"},go={class:"text"},ho={class:"buttons"},yo={class:"opt-icon"},Co=te(()=>o("div",{class:"item empty"},null,-1)),bo=te(()=>o("div",{class:"item empty"},null,-1)),ko=te(()=>o("div",{class:"item empty"},null,-1)),Io=te(()=>o("div",{class:"item empty"},null,-1)),wo=te(()=>o("div",{class:"item empty"},null,-1)),Fo=te(()=>o("div",{class:"item empty"},null,-1));function So(t,l,n,e,k,w){const y=i("download-outlined"),m=i("Tooltip");return u(),h("div",{class:X(["comment-file-his-list",n.isComment===!0?"in-comment":""])},[o("div",io,[(u(!0),h(R,null,Q(n.dataList,a=>(u(),h("div",co,[o("div",ro,[o("div",uo,[e.isImage(a)?(u(),h("div",mo,[o("div",{class:"content-image",style:P(e.getImageAsBackground(a))},null,4)])):(u(),h(R,{key:1},[o("div",_o,[o("div",{class:"content-icon",style:P({background:"url("+e.getBackground(a)+") no-repeat"})},null,4)]),o("div",{class:"content-bottom",title:a.name},[o("span",null,B(a.name),1)],8,fo)],64))]),o("div",{class:X(["layer",{"layer-image":e.isImage(a)}])},[o("div",{class:"next",onClick:c=>e.viewImage(a)},[o("div",vo,B(a.name),1),o("div",go,B(e.getFileSize(a)),1)],8,po),o("div",ho,[o("div",yo,[r(m,{title:"下载"},{default:p(()=>[r(y,{onClick:c=>e.downLoad(a)},null,8,["onClick"])]),_:2},1024)])])],2)])]))),256)),Co,bo,ko,A(),Io,wo,Fo])],2)}const He=W(so,[["render",So],["__scopeId","data-v-e83913e0"]]);const Lo=Fe({name:"CommentList",components:{MessageOutlined:Je,AComment:Qe,Tooltip:Z,MyComment:ao,Popconfirm:Xe,HistoryFileList:He},props:{tableName:H.string.def(""),dataId:H.string.def(""),datetime:H.number.def(1),otherHeight:H.number.def(0)},setup(t){const{createMessage:l}=Re(),n=I([]),{userInfo:e}=fe(),k=Le("$dayjs");function w(){return e.realname?e.realname.substr(0,2):""}function y(){return e.avatar}function m(C){return C.fromUserAvatar?Pe(C.fromUserAvatar):""}function a(C){return C.fromUserId_dictText?C.fromUserId_dictText.substr(0,2):"未知"}function c(C){return C.toUser?C.fromUserId_dictText+" 回复 "+C.fromUserId_dictText:C.fromUserId_dictText}function f(C){return C.createTime?k(C.createTime,"YYYY-MM-DD hh:mm:ss").fromNow():""}const d=I(300),L=I(300);Ye(()=>{let C=t.otherHeight||0;d.value=window.innerHeight-57-46-70-160-C,L.value=window.innerHeight-57-46-53-20-C});function v(){return D(this,null,function*(){const C={tableName:t.tableName,tableDataId:t.dataId,column:"createTime",order:"desc"},S=yield nt(C);if(!S||!S.records||S.records.length==0)n.value=[];else{let _=S.records;n.value=_}})}const{saveCommentAndFiles:M}=xe(t);function s(C,S,_){return D(this,null,function*(){let F={fromUserId:e.id,toUserId:C.fromUserId,commentId:C.id,commentContent:S};yield M(F,_),yield v()})}function T(C,S){return D(this,null,function*(){let _={fromUserId:e.id,commentContent:C};yield M(_,S),yield v(),N.value=!1,setTimeout(()=>{N.value=!0},100)})}function z(C){return D(this,null,function*(){const S={id:C.id};yield lt(S),yield v()})}const N=I(!1);function G(C){let S=n.value;for(let _ of S)_.commentStatus=!1;C.commentStatus=!0,N.value=!1,N.value=!0}ve(()=>{t.datetime&&t.tableName&&t.dataId&&v()});const x=Te(),{getHtml:$}=Me(x),q=I();function J(){q.value.changeActive()}function ne(C,S){return D(this,null,function*(){if(C==!0&&!S.commentId_dictText){const _=yield at(S.commentId);_.success==!0?S.commentId_dictText=_.result.commentContent:S.commentId_dictText="该评论已被删除"}})}return{dataList:n,getAvatar:m,getAvatarText:a,getAuthor:c,getDateDiff:f,commentHeight:d,allHeight:L,replyComment:s,sendComment:T,getMyname:w,getMyAvatar:y,focusStatus:N,showReply:G,deleteComment:z,getHtml:$,handleClickItem:J,bottomCommentRef:q,visibleChange:ne}}}),Be=t=>(ae("data-v-dfafab0a"),t=t(),se(),t),To={class:"comment-author"},Mo=Be(()=>o("span",null,"回复",-1)),xo=["innerHTML"],Uo=["onClick"],Ho=Be(()=>o("span",null,"删除",-1)),Bo=["innerHTML"],No={key:0},jo={key:0,class:"inner-comment"},Do={style:{position:"absolute",bottom:"0",left:"0",width:"100%",background:"#fff","border-top":"1px solid #eee"}};function Ao(t,l,n,e,k,w){const y=i("a-avatar"),m=i("message-outlined"),a=i("Tooltip"),c=i("Popconfirm"),f=i("history-file-list"),d=i("a-comment"),L=i("my-comment"),v=i("a-list-item"),M=i("a-list");return u(),h("div",{style:P({position:"relative",height:t.allHeight+"px"})},[r(M,{class:"jeecg-comment-list",header:"","item-layout":"horizontal","data-source":t.dataList,style:P({height:t.commentHeight+"px"})},{renderItem:p(({item:s})=>[r(v,{style:{"padding-left":"10px","flex-direction":"column"},onClick:t.handleClickItem},{default:p(()=>[r(d,null,{avatar:p(()=>[r(y,{class:"tx",src:t.getAvatar(s),alt:t.getAvatarText(s)},{default:p(()=>[A(B(t.getAvatarText(s)),1)]),_:2},1032,["src","alt"])]),author:p(()=>[o("div",To,[o("span",null,B(s.fromUserId_dictText),1),s.toUserId?(u(),h(R,{key:0},[Mo,o("span",null,B(s.toUserId_dictText),1),r(a,{class:"comment-last-content",onOpenChange:T=>t.visibleChange(T,s)},{title:p(()=>[o("div",{innerHTML:t.getHtml(s.commentId_dictText)},null,8,xo)]),default:p(()=>[r(m)]),_:2},1032,["onOpenChange"])],64)):V("",!0)])]),datetime:p(()=>[o("div",null,[r(a,{title:s.createTime},{default:p(()=>[o("span",null,B(t.getDateDiff(s)),1)]),_:2},1032,["title"])])]),actions:p(()=>[o("span",{onClick:T=>t.showReply(s)},"回复",8,Uo),r(c,{title:"确定删除吗",onConfirm:T=>t.deleteComment(s)},{default:p(()=>[Ho]),_:2},1032,["onConfirm"])]),content:p(()=>[o("div",{innerHTML:t.getHtml(s.commentContent),style:{"font-size":"15px"}},null,8,Bo),s.fileList&&s.fileList.length>0?(u(),h("div",No,[r(f,{dataList:s.fileList,isComment:""},null,8,["dataList"])])):V("",!0)]),_:2},1024),s.commentStatus?(u(),h("div",jo,[r(L,{inner:"",onCancel:T=>s.commentStatus=!1,onComment:(T,z)=>t.replyComment(s,T,z),inputFocus:t.focusStatus},null,8,["onCancel","onComment","inputFocus"])])):V("",!0)]),_:2},1032,["onClick"])]),_:1},8,["data-source","style"]),o("div",Do,[r(d,{style:{margin:"0 10px"}},{avatar:p(()=>[r(y,{class:"tx",src:t.getMyAvatar(),alt:t.getMyname()},{default:p(()=>[A(B(t.getMyname()),1)]),_:1},8,["src","alt"])]),content:p(()=>[r(L,{ref:"bottomCommentRef",onComment:t.sendComment,inputFocus:t.focusStatus},null,8,["onComment","inputFocus"])]),_:1})])],4)}const $o=W(Lo,[["render",Ao],["__scopeId","data-v-dfafab0a"]]);const Eo={name:"CommentFiles",components:{UploadOutlined:ge,FolderOutlined:he,JUpload:ft,DownloadOutlined:ye,PaperClipOutlined:ce,DeleteOutlined:Ce,Tooltip:Z,HistoryFileList:He,SelectFileModal:Ue},props:{tableName:H.string.def(""),dataId:H.string.def(""),datetime:H.number.def(1)},setup(t){const[l,{openModal:n}]=pe(),{userInfo:e}=fe(),k=I([]),w=I("");function y(){return D(this,null,function*(){const x={tableName:t.tableName,tableDataId:t.dataId},$=yield st(x);if(!$||!$.records||$.records.length==0)k.value=[];else{let q=$.records;k.value=q}w.value=""})}ve(()=>{t.datetime&&t.tableName&&t.dataId&&y()});const{saveCommentAndFiles:m,buttonLoading:a}=xe(t),{selectFileList:c,beforeUpload:f,handleRemove:d,getBackground:L,isImage:v,getImageAsBackground:M,viewImage:s}=de();function T(){c.value=[]}function z(){return D(this,null,function*(){let x={fromUserId:e.id,commentContent:"上传了附件"};yield m(x,c.value),c.value=[],yield y()})}function N(){n(!0,{})}function G(x){let $=c.value;$.push(me(ue({},x),{exist:!0})),c.value=$}return{selectFileList:c,beforeUpload:f,handleRemove:d,getBackground:L,isImage:v,dataList:k,uploadFileUrl:it,quxiao:T,queding:z,buttonLoading:a,getImageAsBackground:M,viewImage:s,registerModel:l,showFileModal:N,onSelectFileOk:G}}},oe=t=>(ae("data-v-adc1865a"),t=t(),se(),t),Oo={class:"j-icon"},Ro={class:"inner-button"},Po={class:"j-icon"},Vo={key:0,class:"selected-file-warp"},zo={class:"selected-file-list"},Ko={class:"item"},qo={class:"complex"},Yo={class:"content"},Wo={key:0,class:"content-top",style:{height:"100%"}},Go={class:"content-top"},Jo=["title"],Qo=["onClick"],Xo={class:"text"},Zo={class:"buttons"},en={class:"opt-icon"},tn=oe(()=>o("div",{class:"item empty"},null,-1)),on=oe(()=>o("div",{class:"item empty"},null,-1)),nn=oe(()=>o("div",{class:"item empty"},null,-1)),ln=oe(()=>o("div",{class:"item empty"},null,-1)),an=oe(()=>o("div",{class:"item empty"},null,-1)),sn=oe(()=>o("div",{class:"item empty"},null,-1)),cn={style:{"margin-bottom":"24px","margin-top":"18px","text-align":"right"}};function dn(t,l,n,e,k,w){const y=i("upload-outlined"),m=i("a-upload"),a=i("folder-outlined"),c=i("a-alert"),f=i("delete-outlined"),d=i("Tooltip"),L=i("a-button"),v=i("history-file-list"),M=i("SelectFileModal");return u(),h("div",null,[r(c,{type:"info",class:"jeecg-comment-files"},{message:p(()=>[o("span",Oo,[r(m,{multiple:"","file-list":e.selectFileList,"onUpdate:fileList":l[0]||(l[0]=s=>e.selectFileList=s),showUploadList:!1,"before-upload":e.beforeUpload},{default:p(()=>[o("span",Ro,[r(y),A("上传")])]),_:1},8,["file-list","before-upload"])]),o("span",Po,[o("span",{class:"inner-button",onClick:l[1]||(l[1]=(...s)=>e.showFileModal&&e.showFileModal(...s))},[r(a),A("从文件库选择")])])]),_:1}),e.selectFileList&&e.selectFileList.length>0?(u(),h("div",Vo,[o("div",zo,[(u(!0),h(R,null,Q(e.selectFileList,s=>(u(),h("div",Ko,[o("div",qo,[o("div",Yo,[e.isImage(s)?(u(),h("div",Wo,[o("div",{class:"content-image",style:P(e.getImageAsBackground(s))},null,4)])):(u(),h(R,{key:1},[o("div",Go,[o("div",{class:"content-icon",style:P({background:"url("+e.getBackground(s)+") no-repeat"})},null,4)]),o("div",{class:"content-bottom",title:s.name},[o("span",null,B(s.name),1)],8,Jo)],64))]),o("div",{class:X(["layer",{"layer-image":e.isImage(s)}])},[o("div",{class:"next",onClick:T=>e.viewImage(s)},[o("div",Xo,B(s.name),1)],8,Qo),o("div",Zo,[o("div",en,[r(d,{title:"删除"},{default:p(()=>[r(f,{onClick:T=>e.handleRemove(s)},null,8,["onClick"])]),_:2},1024)])])],2)])]))),256)),tn,on,nn,A(),ln,an,sn]),o("div",cn,[r(L,{onClick:e.quxiao},{default:p(()=>[A("取消")]),_:1},8,["onClick"]),r(L,{type:"primary",style:{"margin-left":"10px"},onClick:e.queding,loading:e.buttonLoading},{default:p(()=>[A("确定")]),_:1},8,["onClick","loading"])])])):V("",!0),r(v,{dataList:e.dataList},null,8,["dataList"]),r(M,{onRegister:e.registerModel,onSelected:e.onSelectFileOk},null,8,["onRegister","onSelected"])])}const rn=W(Eo,[["render",dn],["__scopeId","data-v-adc1865a"]]);const un={name:"DataLogList",components:{PlusOutlined:Ze,EditOutlined:et,Tooltip:Z},props:{tableName:H.string.def(""),dataId:H.string.def(""),datetime:H.number.def(1)},setup(t){const l=Le("$dayjs"),n=ct(),e=I(300);e.value=n-46-57-53-30;const k=I([]),w=I(0);function y(){return D(this,null,function*(){const c={dataTable:t.tableName,dataId:t.dataId,type:"comment"},f=yield dt(c);if(!f||!f.result||f.result.length==0)k.value=[],w.value=-1;else{let d=f.result;w.value=d.length-1,k.value=d}})}ve(()=>{t.datetime&&t.tableName&&t.dataId&&y()});function m(c){return c.createTime?l(c.createTime,"YYYY-MM-DD hh:mm:ss").fromNow():""}function a(){}return{height:e,lastIndex:w,dataList:k,getDateDiff:m,handleClickPerson:a}}};const mn={class:"data-log-content"},_n={class:"logbox"},fn={class:"log-item"},pn={class:"log-item-icon"},vn={class:"log-item-content"},gn={class:"log-item-date"};function hn(t,l,n,e,k,w){const y=i("plus-outlined"),m=i("edit-outlined"),a=i("Tooltip");return u(),h("div",{class:"data-log-scroll",style:P({height:e.height+"px"})},[o("div",mn,[o("div",_n,[(u(!0),h(R,null,Q(e.dataList,(c,f)=>(u(),h("div",fn,[o("span",pn,[e.lastIndex==f?(u(),O(y,{key:0,style:{"margin-top":"3px"}})):(u(),O(m,{key:1}))]),o("span",vn,[o("a",{onClick:l[0]||(l[0]=(...d)=>e.handleClickPerson&&e.handleClickPerson(...d))},"@"+B(c.createName||c.createBy),1),A(" "+B(c.dataContent),1)]),o("div",gn,[r(a,{title:c.createTime},{default:p(()=>[o("span",null,B(e.getDateDiff(c)),1)]),_:2},1032,["title"])])]))),256))])])],4)}const yn=W(un,[["render",hn],["__scopeId","data-v-2a7d5818"]]);const Cn={name:"CommentPanel",components:{CommentList:$o,CommentFiles:rn,DataLogList:yn},props:{tableName:H.string.def(""),dataId:H.string.def(""),showComment:H.bool.def(!0),showFiles:H.bool.def(!0),showDataLog:H.bool.def(!0),otherHeight:H.number.def(0)},setup(t){const l=_e(()=>!!(t.dataId&&t.tableName)),n=I(1),e=I(1),k=I(1);function w(m){let a=new Date().getTime();m=="comment"?n.value=a:m=="file"?e.value=a:k.value=a}function y(){let m=new Date().getTime();n.value=m,e.value=m,k.value=m}return{showStatus:l,handleChange:w,datetime1:n,datetime2:e,datetime3:k,reload:y}}};const bn={key:0,class:"comment-tabs-warp"};function kn(t,l,n,e,k,w){const y=i("comment-list"),m=i("a-tab-pane"),a=i("comment-files"),c=i("data-log-list"),f=i("a-tabs"),d=i("a-empty");return e.showStatus?(u(),h("div",bn,[r(f,{onChange:e.handleChange,animated:!1},{default:p(()=>[n.showComment?(u(),O(m,{tab:"评论",key:"comment",class:"comment-list-tab"},{default:p(()=>[r(y,{tableName:n.tableName,dataId:n.dataId,datetime:e.datetime1,otherHeight:n.otherHeight},null,8,["tableName","dataId","datetime","otherHeight"])]),_:1})):V("",!0),n.showFiles?(u(),O(m,{tab:"文件",key:"file"},{default:p(()=>[r(a,{tableName:n.tableName,dataId:n.dataId,datetime:e.datetime2},null,8,["tableName","dataId","datetime"])]),_:1})):V("",!0),n.showDataLog?(u(),O(m,{tab:"日志",key:"log"},{default:p(()=>[r(c,{tableName:n.tableName,dataId:n.dataId,datetime:e.datetime3},null,8,["tableName","dataId","datetime"])]),_:1})):V("",!0)]),_:1},8,["onChange"])])):(u(),O(d,{key:1,description:"新增页面不支持评论"}))}const Hn=W(Cn,[["render",kn],["__scopeId","data-v-4e1b1cce"]]);export{Hn as C};