Files
qhmes/deploy-qhmes/frontend/js/CommentPanel-BqQr23e3.js
2026-05-15 11:34:12 +08:00

2 lines
23 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 Ae=Object.defineProperty,Oe=Object.defineProperties;var Re=Object.getOwnPropertyDescriptors;var ye=Object.getOwnPropertySymbols;var Pe=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable;var be=(o,t,a)=>t in o?Ae(o,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[t]=a,Ce=(o,t)=>{for(var a in t||(t={}))Pe.call(t,a)&&be(o,a,t[a]);if(ye)for(var a of ye(t))Ee.call(t,a)&&be(o,a,t[a]);return o},ke=(o,t)=>Oe(o,Re(t));var O=(o,t,a)=>new Promise((e,g)=>{var p=s=>{try{_(a.next(s))}catch(l){g(l)}},h=s=>{try{_(a.throw(s))}catch(l){g(l)}},_=s=>s.done?e(s.value):Promise.resolve(s.value).then(p,h);_((a=a.apply(o,t)).next())});import{al as de,d as W,p as w,u as Ve,ap as Le,b as Ie}from"./index-BI6CMai0.js";import{J as Ye,w as se,ah as c,ar as b,ag as M,as as u,k as d,aF as f,au as n,G as R,aT as ce,F as P,aD as oe,aB as E,av as F,at as $,f as k,e as ie,q as we,aO as qe,aR as ze,B as Ke,aC as Y,d as We,c as Te,o as $e,n as Se,h as re}from"./vue-vendor-C7Zq48Yl.js";import{bk as me,bo as ae,bp as ue,bR as fe,aQ as ve,T as G,bS as Ge,bT as Je,P as Qe,bU as Xe,bV as Ze,b5 as et,aM as tt}from"./antd-vue-vendor-BPnV8VqP.js";import{a as nt}from"./index-MREkPhsT.js";import"./index-Du0A3ksf.js";import{a as _e,g as Fe,u as xe,l as ot,b as Ue,d as at,q as lt,f as st,c as it,e as dt,h as ct}from"./useComment-Cm7xlwhe.js";import{_ as rt}from"./JUpload-Cz9HN61B.js";const mt={name:"UploadChunk",components:{Tooltip:G,UploadOutlined:ve,FolderOutlined:fe,DownloadOutlined:ue,PaperClipOutlined:ae,DeleteOutlined:me},props:{visible:{type:Boolean,default:!1}},emits:["select"],setup(o,{emit:t}){const{selectFileList:a,beforeUpload:e,handleRemove:g,getBackground:p,isImage:h,getImageSrc:_,viewImage:s}=_e(),[l,{openModal:C}]=de();function r(){return Ye(a.value)}function T(){a.value=[]}se(()=>a.value,i=>{if(i&&i.length>0){let L=i[0].name;L&&t("select",L)}});function y(){C(!0,{})}function S(i){let L=a.value;i.forEach(B=>{L.push(ke(Ce({},B),{exist:!0}))}),a.value=L}return{selectFileList:a,beforeUpload:e,handleRemove:g,getBackground:p,getUploadFileList:r,clear:T,isImage:h,getImageSrc:_,viewImage:s,registerModel:l,showFileModal:y,onSelectFileOk:S}}},ut={key:0},ft={class:"j-icon"},vt={class:"inner-button"},_t={key:0,class:"selected-file-warp"},gt={class:"selected-file-list"},pt={class:"item"},ht={class:"complex"},yt={class:"content"},bt={key:0,class:"content-top",style:{height:"100%"}},Ct={class:"content-top"},kt=["title"],It=["onClick"],wt={class:"text"},Lt={class:"buttons"},Tt={class:"opt-icon"};function St(o,t,a,e,g,p){const h=c("upload-outlined"),_=c("a-upload"),s=c("a-alert"),l=c("delete-outlined"),C=c("Tooltip");return a.visible?(u(),b("div",ut,[d(s,{type:"info",class:"jeecg-comment-files",style:{margin:"0"}},{message:f(()=>[n("span",ft,[d(_,{multiple:"","file-list":e.selectFileList,"onUpdate:fileList":t[0]||(t[0]=r=>e.selectFileList=r),showUploadList:!1,"before-upload":e.beforeUpload},{default:f(()=>[n("span",vt,[d(h),t[1]||(t[1]=R("上传",-1))])]),_:1},8,["file-list","before-upload"])])]),_:1}),e.selectFileList&&e.selectFileList.length>0?(u(),b("div",_t,[n("div",gt,[(u(!0),b(P,null,oe(e.selectFileList,r=>(u(),b("div",pt,[n("div",ht,[n("div",yt,[e.isImage(r)?(u(),b("div",bt,[n("div",{class:"content-image",style:E({height:"100%",backgroundImage:"url("+e.getImageSrc(r)+")"})},null,4)])):(u(),b(P,{key:1},[n("div",Ct,[n("div",{class:"content-icon",style:E({background:"url("+e.getBackground(r)+") no-repeat"})},null,4)]),n("div",{class:"content-bottom",title:r.name},[n("span",null,F(r.name),1)],8,kt)],64))]),n("div",{class:$(["layer",{"layer-image":e.isImage(r)}])},[n("div",{class:"next",onClick:T=>e.viewImage(r)},[n("div",wt,F(r.name),1)],8,It),n("div",Lt,[n("div",Tt,[d(C,{title:"删除"},{default:f(()=>[d(l,{onClick:T=>e.handleRemove(r)},null,8,["onClick"])]),_:2},1024)])])],2)])]))),256)),t[2]||(t[2]=ce('<div class="item empty" data-v-fb074890></div><div class="item empty" data-v-fb074890></div><div class="item empty" data-v-fb074890></div> <div class="item empty" data-v-fb074890></div><div class="item empty" data-v-fb074890></div><div class="item empty" data-v-fb074890></div>',7))])])):M("",!0)])):M("",!0)}const Ft=W(mt,[["render",St],["__scopeId","data-v-fb074890"]]),xt={categories:{recent:"最常用的",smileys:"表情选择",people:"人物&身体",nature:"动物&自然",foods:"食物&饮料",activity:"活动",places:"旅行&地点",objects:"物品",symbols:"符号",flags:"旗帜"}},Ut={name:"MyComment",components:{UserAddOutlined:Je,Tooltip:G,UserSelectModal:nt,PaperClipOutlined:ae,UploadChunk:Ft,SmileOutlined:Ge},props:{inner:w.bool.def(!1),inputFocus:{type:Boolean,default:!1}},emits:["cancel","comment"],setup(o,{emit:t}){const a=k(!1),e=k(),g=k(null),[p,{openModal:h,closeModal:_}]=de(),s=k(!1),l=k("");function C(v){if((v.keyCode||v.which)==13&&v.shiftKey)return;let H=l.value;if(!H&&H!=="0")r.value=!0;else{s.value=!0;let V=[];a.value==!0&&(V=e.value.getUploadFileList()),t("comment",H,V),setTimeout(()=>{s.value=!1},350)}}const r=k(!1);se(l,()=>{let v=l.value;!v&&v!=="0"?r.value=!0:r.value=!1});function T(){t("cancel")}const y=k();se(()=>o.inputFocus,v=>{v==!0&&(l.value="",a.value==!0&&(e.value.clear(),a.value=!1))},{deep:!0,immediate:!0});function S(){h(!0,{isUpdate:!1})}function i(v){var D,H;if(v&&v.length>0){const{realname:V,username:te}=v[0];if(V&&te){let Q=`${V}[${te}]`,K=l.value;if(!K)l.value="@"+Q+" ";else{const X=(H=(D=y.value)==null?void 0:D.selectionStart)!=null?H:K.length;let A=K.substring(0,X);const pe=K.substring(X);if(A.endsWith("@")){if(A.length>=2){const ne=A.length-1,he=A.substring(0,ne),je=A.substring(ne),De=he.endsWith(" ")?"":" ";A=he+De+je}l.value=A+Q+" "+pe}else{const ne=A&&A.endsWith(" ")?"@":" @";l.value=A+ne+Q+" "+pe}}m.value=!1,y.value.focus(),z.value=!0}}_()}function L(v){v.data==="@"&&(v.target.blur(),S())}const B=k();function J(v){let D=l.value||"";D+=v,l.value=D,B.value.click()}const x=k(!1);function N(v){var K,X;let D=l.value||"",H=v.colons;H.indexOf("::")>0&&(H=H.substring(0,H.indexOf(":")+1));const V=(X=(K=y.value)==null?void 0:K.selectionStart)!=null?X:D.length,te=D.substring(0,V),Q=D.substring(V);l.value=te+H+Q,x.value=!1,U()}const j={width:"460px"};function q(v){v.preventDefault(),v.stopPropagation(),x.value=!1,z.value=!0}function Z(v){v.preventDefault(),v.stopPropagation(),x.value=!x.value}const ee=Fe(),{getHtml:le}=xe(ee),ge=ie(()=>{let v=l.value;return v?le(v):"请输入你的评论可以@成员"}),m=k(!1);function I(v){v.preventDefault(),v.stopPropagation(),m.value=!1,y.value.focus(),z.value=!0}function U(){m.value=!0,setTimeout(()=>{g.value.scrollTop=y.value.scrollTop},0)}const z=k(!1),He=ie(()=>!(l.value.length>0));function Ne(){l.value.length==0&&(z.value=!1,a.value=!1)}function Be(v){l.value.length==0&&(l.value=v)}return{myComment:l,sendComment:C,noComment:T,disabledButton:r,buttonLoading:s,commentRef:y,registerModal:p,openSelectUser:S,setValue:i,handleCommentChange:L,uploadRef:e,uploadVisible:a,onSelectEmoji:J,optionsName:xt,emojiButton:B,emojiIndex:ee,showEmoji:N,pickerStyles:j,visibleEmoji:x,handleClickBlank:q,handleShowEmoji:Z,commentHtml:ge,showHtml:m,handleClickHtmlShower:I,handleBlur:U,commentActive:z,noConent:He,changeActive:Ne,selectFirstFile:Be,commentContentRef:g}}},Mt=["innerHTML"],Ht={key:0,class:"comment-buttons"},Nt={style:{cursor:"pointer"}},Bt={title:"表情",style:{display:"inline-block"}},jt={style:{position:"relative"}},Dt={key:0};function At(o,t,a,e,g,p){const h=c("user-add-outlined"),_=c("Tooltip"),s=c("PaperClipOutlined"),l=c("SmileOutlined"),C=c("a-button"),r=c("upload-chunk"),T=c("UserSelectModal"),y=c("Picker"),S=c("a-modal");return u(),b(P,null,[n("div",{class:$([{"comment-active":e.commentActive},"comment-main"]),onClick:t[6]||(t[6]=(...i)=>e.handleClickBlank&&e.handleClickBlank(...i))},[we(n("textarea",{ref:"commentRef","onUpdate:modelValue":t[0]||(t[0]=i=>e.myComment=i),onKeyup:t[1]||(t[1]=qe((...i)=>e.sendComment&&e.sendComment(...i),["enter"])),onInput:t[2]||(t[2]=(...i)=>e.handleCommentChange&&e.handleCommentChange(...i)),onBlur:t[3]||(t[3]=(...i)=>e.handleBlur&&e.handleBlur(...i)),class:"comment-content",rows:3,placeholder:"请输入你的评论可以@成员"},null,544),[[ze,e.myComment]]),n("div",{ref:"commentContentRef",class:$(["comment-content comment-html-shower",{"no-content":e.noConent,"top-div":e.showHtml,"bottom-div":e.showHtml==!1}]),innerHTML:e.commentHtml,onClick:t[4]||(t[4]=(...i)=>e.handleClickHtmlShower&&e.handleClickHtmlShower(...i))},null,10,Mt),e.commentActive?(u(),b("div",Ht,[n("div",Nt,[d(_,{title:"选择@用户"},{default:f(()=>[d(h,{onClick:e.openSelectUser},null,8,["onClick"])]),_:1}),d(_,{title:"上传附件"},{default:f(()=>[d(s,{onClick:t[5]||(t[5]=i=>e.uploadVisible=!e.uploadVisible)})]),_:1}),n("span",Bt,[d(l,{ref:"emojiButton",onClick:e.handleShowEmoji},null,8,["onClick"]),we(n("div",jt,null,512),[[Ke]])])]),e.commentActive?(u(),b("div",Dt,[a.inner?(u(),Y(C,{key:0,onClick:e.noComment,style:{"margin-right":"10px"}},{default:f(()=>[...t[8]||(t[8]=[R("取消",-1)])]),_:1},8,["onClick"])):M("",!0),d(C,{type:"primary",onClick:e.sendComment,loading:e.buttonLoading,disabled:e.disabledButton},{default:f(()=>[...t[9]||(t[9]=[R(" ",-1)])]),_:1},8,["onClick","loading","disabled"])])):M("",!0)])):M("",!0),d(r,{ref:"uploadRef",visible:e.uploadVisible,onSelect:e.selectFirstFile},null,8,["visible","onSelect"])],2),d(T,{rowKey:"username",onRegister:e.registerModal,onSelected:e.setValue,multi:!1},null,8,["onRegister","onSelected"]),d(S,{open:e.visibleEmoji,"onUpdate:open":t[7]||(t[7]=i=>e.visibleEmoji=i),footer:null,wrapClassName:"emoji-modal",closable:!1,width:460},{title:f(()=>[...t[10]||(t[10]=[n("span",null,null,-1)])]),default:f(()=>[d(y,{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 Ot=W(Ut,[["render",At]]),Rt={name:"HistoryFileList",props:{dataList:{type:Array,default:()=>[]},isComment:{type:Boolean,default:!1}},components:{UploadOutlined:ve,FolderOutlined:fe,DownloadOutlined:ue,PaperClipOutlined:ae,DeleteOutlined:me,Tooltip:G},setup(){const{getBackground:o,getFileSize:t,downLoad:a,isImage:e,getImageAsBackground:g,viewImage:p}=_e();return{getBackground:o,downLoad:a,getFileSize:t,isImage:e,getImageAsBackground:g,viewImage:p}}},Pt={class:"selected-file-list"},Et={class:"item"},Vt={class:"complex"},Yt={class:"content"},qt={key:0,class:"content-top",style:{height:"100%"}},zt={class:"content-top"},Kt=["title"],Wt=["onClick"],$t={class:"text"},Gt={class:"text"},Jt={class:"buttons"},Qt={class:"opt-icon"};function Xt(o,t,a,e,g,p){const h=c("download-outlined"),_=c("Tooltip");return u(),b("div",{class:$(["comment-file-his-list",a.isComment===!0?"in-comment":""])},[n("div",Pt,[(u(!0),b(P,null,oe(a.dataList,s=>(u(),b("div",Et,[n("div",Vt,[n("div",Yt,[e.isImage(s)?(u(),b("div",qt,[n("div",{class:"content-image",style:E(e.getImageAsBackground(s))},null,4)])):(u(),b(P,{key:1},[n("div",zt,[n("div",{class:"content-icon",style:E({background:"url("+e.getBackground(s)+") no-repeat"})},null,4)]),n("div",{class:"content-bottom",title:s.name},[n("span",null,F(s.name),1)],8,Kt)],64))]),n("div",{class:$(["layer",{"layer-image":e.isImage(s)}])},[n("div",{class:"next",onClick:l=>e.viewImage(s)},[n("div",$t,F(s.name),1),n("div",Gt,F(e.getFileSize(s)),1)],8,Wt),n("div",Jt,[n("div",Qt,[d(_,{title:"下载"},{default:f(()=>[d(h,{onClick:l=>e.downLoad(s)},null,8,["onClick"])]),_:2},1024)])])],2)])]))),256)),t[0]||(t[0]=ce('<div class="item empty" data-v-e83913e0></div><div class="item empty" data-v-e83913e0></div><div class="item empty" data-v-e83913e0></div> <div class="item empty" data-v-e83913e0></div><div class="item empty" data-v-e83913e0></div><div class="item empty" data-v-e83913e0></div>',7))])],2)}const Me=W(Rt,[["render",Xt],["__scopeId","data-v-e83913e0"]]),Zt=We({name:"CommentList",components:{MessageOutlined:Ze,AComment:Xe,Tooltip:G,MyComment:Ot,Popconfirm:Qe,HistoryFileList:Me},props:{tableId:w.string.def(""),tableName:w.string.def(""),dataId:w.string.def(""),datetime:w.number.def(1),otherHeight:w.number.def(0)},setup(o){const{createMessage:t}=Ve(),a=k([]),{userInfo:e}=Le(),g=Te("$dayjs"),p=k(null);function h(){return e.realname?e.realname.substr(0,2):""}function _(){return Ie(e.avatar)}function s(m){return m.fromUserAvatar?Ie(m.fromUserAvatar):""}function l(m){return m.fromUserId_dictText?m.fromUserId_dictText.substr(0,2):"未知"}function C(m){return m.toUser?m.fromUserId_dictText+" 回复 "+m.fromUserId_dictText:m.fromUserId_dictText}function r(m){return m.createTime?g(m.createTime,"YYYY-MM-DD hh:mm:ss").fromNow():""}const T=k(300),y=k(300);$e(()=>{let m=o.otherHeight||0;T.value=window.innerHeight-57-46-70-160-m,y.value=window.innerHeight-57-46-53-20-m});function S(){return O(this,null,function*(){const m={tableName:o.tableName,tableDataId:o.dataId,column:"createTime",order:"desc"},I=yield ot(m);if(!I||!I.records||I.records.length==0)a.value=[];else{let U=I.records;a.value=U,Se(()=>{p.value&&p.value.$el&&(p.value.$el.scrollTop=1e6)})}})}const{saveCommentAndFiles:i}=Ue(o);function L(m,I,U){return O(this,null,function*(){let z={fromUserId:e.id,toUserId:m.fromUserId,commentId:m.id,commentContent:I};yield i(z,U),yield S()})}function B(m,I){return O(this,null,function*(){let U={fromUserId:e.id,commentContent:m};yield i(U,I),yield S(),x.value=!1,setTimeout(()=>{x.value=!0},100)})}function J(m){return O(this,null,function*(){const I={id:m.id};yield at(I),yield S()})}const x=k(!1);function N(m){let I=a.value;for(let U of I)U.commentStatus=!1;m.commentStatus=!0,x.value=!1,x.value=!0}re(()=>{o.datetime&&o.tableName&&o.dataId&&S()});const j=Fe(),{getHtml:q}=xe(j),Z=k();function ee(){Z.value.changeActive()}function le(m,I){return O(this,null,function*(){if(m==!0&&!I.commentId_dictText){const U=yield lt(I.commentId);U.success==!0?I.commentId_dictText=U.result.commentContent:I.commentId_dictText="该评论已被删除"}})}return{dataList:a,getAvatar:s,getAvatarText:l,getAuthor:C,getDateDiff:r,commentHeight:T,allHeight:y,replyComment:L,sendComment:B,getMyname:h,getMyAvatar:_,focusStatus:x,showReply:N,deleteComment:J,getHtml:q,handleClickItem:ee,bottomCommentRef:Z,visibleChange:le,listRef:p,lineFeed:m=>m.replace(/\n/g,"<br>")}}}),en={class:"comment-author"},tn=["innerHTML"],nn=["onClick"],on=["innerHTML"],an={key:0},ln={key:0,class:"inner-comment"},sn={class:"comment-area"};function dn(o,t,a,e,g,p){const h=c("a-avatar"),_=c("message-outlined"),s=c("Tooltip"),l=c("Popconfirm"),C=c("history-file-list"),r=c("a-comment"),T=c("my-comment"),y=c("a-list-item"),S=c("a-list");return u(),b("div",{style:E({position:"relative",height:o.allHeight+"px"})},[d(S,{ref:"listRef",class:"jeecg-comment-list",header:"","item-layout":"horizontal","data-source":o.dataList,style:E({height:o.commentHeight+"px"})},{renderItem:f(({item:i})=>[d(y,{style:{"padding-left":"10px","flex-direction":"column"},onClick:o.handleClickItem},{default:f(()=>[d(r,null,{avatar:f(()=>[d(h,{class:"tx",src:o.getAvatar(i),alt:o.getAvatarText(i)},{default:f(()=>[R(F(o.getAvatarText(i)),1)]),_:2},1032,["src","alt"])]),author:f(()=>[n("div",en,[n("span",null,F(i.fromUserId_dictText),1),i.toUserId?(u(),b(P,{key:0},[t[0]||(t[0]=n("span",null,"回复",-1)),n("span",null,F(i.toUserId_dictText),1),d(s,{class:"comment-last-content",onOpenChange:L=>o.visibleChange(L,i)},{title:f(()=>[n("div",{innerHTML:o.getHtml(o.lineFeed(i.commentId_dictText))},null,8,tn)]),default:f(()=>[d(_)]),_:2},1032,["onOpenChange"])],64)):M("",!0)])]),datetime:f(()=>[n("div",null,[d(s,{title:i.createTime},{default:f(()=>[n("span",null,F(o.getDateDiff(i)),1)]),_:2},1032,["title"])])]),actions:f(()=>[n("span",{onClick:L=>o.showReply(i)},"回复",8,nn),d(l,{title:"确定删除吗",onConfirm:L=>o.deleteComment(i)},{default:f(()=>[...t[1]||(t[1]=[n("span",null,"删除",-1)])]),_:1},8,["onConfirm"])]),content:f(()=>[n("div",{class:"content",innerHTML:o.getHtml(o.lineFeed(i.commentContent)),style:{"font-size":"15px"}},null,8,on),i.fileList&&i.fileList.length>0?(u(),b("div",an,[d(C,{dataList:i.fileList,isComment:""},null,8,["dataList"])])):M("",!0)]),_:2},1024),i.commentStatus?(u(),b("div",ln,[d(T,{inner:"",onCancel:L=>i.commentStatus=!1,onComment:(L,B)=>o.replyComment(i,L,B),inputFocus:o.focusStatus},null,8,["onCancel","onComment","inputFocus"])])):M("",!0)]),_:2},1032,["onClick"])]),_:1},8,["data-source","style"]),n("div",sn,[d(r,{style:{margin:"0 10px"}},{avatar:f(()=>[d(h,{class:"tx",src:o.getMyAvatar(),alt:o.getMyname()},{default:f(()=>[R(F(o.getMyname()),1)]),_:1},8,["src","alt"])]),content:f(()=>[d(T,{ref:"bottomCommentRef",onComment:o.sendComment,inputFocus:o.focusStatus},null,8,["onComment","inputFocus"])]),_:1})])],4)}const cn=W(Zt,[["render",dn],["__scopeId","data-v-22cc0891"]]),rn={name:"CommentFiles",components:{UploadOutlined:ve,FolderOutlined:fe,JUpload:rt,DownloadOutlined:ue,PaperClipOutlined:ae,DeleteOutlined:me,Tooltip:G,HistoryFileList:Me},props:{tableId:w.string.def(""),tableName:w.string.def(""),dataId:w.string.def(""),datetime:w.number.def(1)},setup(o){const[t,{openModal:a}]=de(),{userInfo:e}=Le(),g=k([]),p=k("");function h(){return O(this,null,function*(){const N={tableName:o.tableName,tableDataId:o.dataId},j=yield st(N);if(!j||!j.records||j.records.length==0)g.value=[];else{let q=j.records;g.value=q}p.value=""})}re(()=>{o.datetime&&o.tableName&&o.dataId&&h()});const{saveCommentAndFiles:_,buttonLoading:s}=Ue(o),{selectFileList:l,beforeUpload:C,handleRemove:r,getBackground:T,isImage:y,getImageAsBackground:S,viewImage:i}=_e();function L(){l.value=[]}function B(){return O(this,null,function*(){let N={fromUserId:e.id,commentContent:"上传了附件"};yield _(N,l.value),l.value=[],yield h()})}function J(){a(!0,{})}function x(N){if(N.length===0)return;let j=l.value;N.forEach(q=>{q.exist=!0}),l.value=[...j,...N]}return{selectFileList:l,beforeUpload:C,handleRemove:r,getBackground:T,isImage:y,dataList:g,uploadFileUrl:it,quxiao:L,queding:B,buttonLoading:s,getImageAsBackground:S,viewImage:i,registerModel:t,showFileModal:J,onSelectFileOk:x}}},mn={class:"j-icon"},un={class:"inner-button"},fn={key:0,class:"selected-file-warp"},vn={class:"selected-file-list"},_n={class:"item"},gn={class:"complex"},pn={class:"content"},hn={key:0,class:"content-top",style:{height:"100%"}},yn={class:"content-top"},bn=["title"],Cn=["onClick"],kn={class:"text"},In={class:"buttons"},wn={class:"opt-icon"},Ln={style:{"margin-bottom":"24px","margin-top":"18px","text-align":"right"}};function Tn(o,t,a,e,g,p){const h=c("upload-outlined"),_=c("a-upload"),s=c("a-alert"),l=c("delete-outlined"),C=c("Tooltip"),r=c("a-button"),T=c("history-file-list");return u(),b("div",null,[d(s,{type:"info",class:"jeecg-comment-files"},{message:f(()=>[n("span",mn,[d(_,{multiple:"","file-list":e.selectFileList,"onUpdate:fileList":t[0]||(t[0]=y=>e.selectFileList=y),showUploadList:!1,"before-upload":e.beforeUpload},{default:f(()=>[n("span",un,[d(h),t[1]||(t[1]=R("上传",-1))])]),_:1},8,["file-list","before-upload"])])]),_:1}),e.selectFileList&&e.selectFileList.length>0?(u(),b("div",fn,[n("div",vn,[(u(!0),b(P,null,oe(e.selectFileList,y=>(u(),b("div",_n,[n("div",gn,[n("div",pn,[e.isImage(y)?(u(),b("div",hn,[n("div",{class:"content-image",style:E(e.getImageAsBackground(y))},null,4)])):(u(),b(P,{key:1},[n("div",yn,[n("div",{class:"content-icon",style:E({background:"url("+e.getBackground(y)+") no-repeat"})},null,4)]),n("div",{class:"content-bottom",title:y.name},[n("span",null,F(y.name),1)],8,bn)],64))]),n("div",{class:$(["layer",{"layer-image":e.isImage(y)}])},[n("div",{class:"next",onClick:S=>e.viewImage(y)},[n("div",kn,F(y.name),1)],8,Cn),n("div",In,[n("div",wn,[d(C,{title:"删除"},{default:f(()=>[d(l,{onClick:S=>e.handleRemove(y)},null,8,["onClick"])]),_:2},1024)])])],2)])]))),256)),t[2]||(t[2]=ce('<div class="item empty" data-v-c86f55ed></div><div class="item empty" data-v-c86f55ed></div><div class="item empty" data-v-c86f55ed></div> <div class="item empty" data-v-c86f55ed></div><div class="item empty" data-v-c86f55ed></div><div class="item empty" data-v-c86f55ed></div>',7))]),n("div",Ln,[d(r,{onClick:e.quxiao},{default:f(()=>[...t[3]||(t[3]=[R("取消",-1)])]),_:1},8,["onClick"]),d(r,{type:"primary",style:{"margin-left":"10px"},onClick:e.queding,loading:e.buttonLoading},{default:f(()=>[...t[4]||(t[4]=[R("确定",-1)])]),_:1},8,["onClick","loading"])])])):M("",!0),d(T,{dataList:e.dataList},null,8,["dataList"])])}const Sn=W(rn,[["render",Tn],["__scopeId","data-v-c86f55ed"]]),Fn={name:"DataLogList",components:{PlusOutlined:tt,EditOutlined:et,Tooltip:G},props:{tableName:w.string.def(""),dataId:w.string.def(""),datetime:w.number.def(1)},setup(o){const t=Te("$dayjs"),a=dt(),e=k(300);e.value=a-46-57-53-30;const g=k([]),p=k(0);function h(){return O(this,null,function*(){const l={dataTable:o.tableName,dataId:o.dataId,type:"comment"},C=yield ct(l);if(!C||!C.result||C.result.length==0)g.value=[],p.value=-1;else{let r=C.result;p.value=r.length-1,g.value=r}})}re(()=>{o.datetime&&o.tableName&&o.dataId&&h()});function _(l){return l.createTime?t(l.createTime,"YYYY-MM-DD hh:mm:ss").fromNow():""}function s(){}return{height:e,lastIndex:p,dataList:g,getDateDiff:_,handleClickPerson:s}}},xn={class:"data-log-content"},Un={class:"logbox"},Mn={class:"log-item"},Hn={class:"log-item-icon"},Nn={class:"log-item-content"},Bn={class:"log-item-date"};function jn(o,t,a,e,g,p){const h=c("plus-outlined"),_=c("edit-outlined"),s=c("Tooltip");return u(),b("div",{class:"data-log-scroll",style:E({height:e.height+"px"})},[n("div",xn,[n("div",Un,[(u(!0),b(P,null,oe(e.dataList,(l,C)=>(u(),b("div",Mn,[n("span",Hn,[e.lastIndex==C?(u(),Y(h,{key:0,style:{"margin-top":"3px"}})):(u(),Y(_,{key:1}))]),n("span",Nn,[n("a",{onClick:t[0]||(t[0]=(...r)=>e.handleClickPerson&&e.handleClickPerson(...r))},"@"+F(l.createName||l.createBy),1),R(" "+F(l.dataContent),1)]),n("div",Bn,[d(s,{title:l.createTime},{default:f(()=>[n("span",null,F(e.getDateDiff(l)),1)]),_:2},1032,["title"])])]))),256))])])],4)}const Dn=W(Fn,[["render",jn],["__scopeId","data-v-23165764"]]),An={name:"CommentPanel",components:{CommentList:cn,CommentFiles:Sn,DataLogList:Dn},props:{tableId:w.string.def(""),tableName:w.string.def(""),dataId:w.string.def(""),showComment:w.bool.def(!0),showFiles:w.bool.def(!0),showDataLog:w.bool.def(!0),otherHeight:w.number.def(0)},setup(o){const t=ie(()=>!!(o.dataId&&o.tableName)),a=k(1),e=k(1),g=k(1),p=k(!0);function h(s){let l=new Date().getTime();s=="comment"?a.value=l:s=="file"?e.value=l:g.value=l}function _(){let s=new Date().getTime();a.value=s,e.value=s,g.value=s,p.value=!1,Se(()=>{p.value=!0})}return{showStatus:t,handleChange:h,datetime1:a,datetime2:e,datetime3:g,reload:_,show:p}}},On={key:0,class:"comment-tabs-warp"};function Rn(o,t,a,e,g,p){const h=c("comment-list"),_=c("a-tab-pane"),s=c("comment-files"),l=c("data-log-list"),C=c("a-tabs"),r=c("a-empty");return e.showStatus?(u(),b("div",On,[e.show?(u(),Y(C,{key:0,onChange:e.handleChange,animated:!1},{default:f(()=>[a.showComment?(u(),Y(_,{tab:"评论",key:"comment",class:"comment-list-tab"},{default:f(()=>[d(h,{tableId:a.tableId,tableName:a.tableName,dataId:a.dataId,datetime:e.datetime1,otherHeight:a.otherHeight},null,8,["tableId","tableName","dataId","datetime","otherHeight"])]),_:1})):M("",!0),a.showFiles?(u(),Y(_,{tab:"文件",key:"file"},{default:f(()=>[d(s,{tableId:a.tableId,tableName:a.tableName,dataId:a.dataId,datetime:e.datetime2},null,8,["tableId","tableName","dataId","datetime"])]),_:1})):M("",!0),a.showDataLog?(u(),Y(_,{tab:"日志",key:"log"},{default:f(()=>[d(l,{tableName:a.tableName,dataId:a.dataId,datetime:e.datetime3},null,8,["tableName","dataId","datetime"])]),_:1})):M("",!0)]),_:1},8,["onChange"])):M("",!0)])):(u(),Y(r,{key:1,description:"新增页面不支持评论"}))}const $n=W(An,[["render",Rn],["__scopeId","data-v-1c9ab375"]]);export{$n as t};