2 lines
30 KiB
Java
2 lines
30 KiB
Java
var Xe=Object.defineProperty,Ge=Object.defineProperties;var Je=Object.getOwnPropertyDescriptors;var Se=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable;var ke=(n,t,o)=>t in n?Xe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,Te=(n,t)=>{for(var o in t||(t={}))Ke.call(t,o)&&ke(n,o,t[o]);if(Se)for(var o of Se(t))Qe.call(t,o)&&ke(n,o,t[o]);return n},xe=(n,t)=>Ge(n,Je(t));var z=(n,t,o)=>new Promise((e,r)=>{var g=i=>{try{m(o.next(i))}catch(l){r(l)}},h=i=>{try{m(o.throw(i))}catch(l){r(l)}},m=i=>i.done?e(i.value):Promise.resolve(i.value).then(g,h);m((o=o.apply(n,t)).next())});import{l as Ze,m as et,a5 as tt,P as se,f as nt,cd as ot,h as Le,cq as Ue,a$ as ue,eY as ie,eZ as fe,T as Q,iu as ve,au as J,bV as Be,as as L,fE as je,hm as He,M as at,aF as lt,s as st,u as De,iv as Ne,v as Ae,iw as it,ix as ct,iy as dt,iz as rt,iA as mt,aD as ut,iB as ft,iC as vt,aX as _t,aU as gt,bL as pt}from"./index-X7Y8jykP.js";import{U as ht}from"./UserSelectModal-BFDUCW9t.js";import"./index-BDvqZ5j4.js";import{F as _e}from"./DirectoryTree-nk_YTTIy.js";import{U as ge}from"./UploadOutlined-D3m-zwOG.js";import{u as pe}from"./useModal-DaJ3Bflg.js";import{e as Pe,f as s,h as re,t as yt,K as b,C,H as B,z as _,A as p,Q as a,E as R,U as he,F as E,D as ce,T as V,G as O,J as K,r as I,c as me,O as Me,ah as bt,_ as Ct,y as q,P as It,o as wt,w as ye,S as $e,n as ze}from"./vue-vendor-DNhG1Cve.js";import{b as Re}from"./index-CeNCCWzL.js";/* empty css */import{M as St}from"./MessageOutlined-BnylU_gE.js";import{A as kt}from"./index-B4gPlWQt.js";import{_ as Tt,L as xt}from"./index-Wl3jtD-0.js";import{_ as Lt}from"./JUpload.vue_vue_type_style_index_0_lang-B_SS088g.js";import{E as At}from"./EditOutlined-drlR34lz.js";const Mt=n=>{const{componentCls:t,commentBg:o,commentPaddingBase:e,commentNestIndent:r,commentFontSizeBase:g,commentFontSizeSm:h,commentAuthorNameColor:m,commentAuthorTimeColor:i,commentActionColor:l,commentActionHoverColor:u,commentActionsMarginBottom:d,commentActionsMarginTop:w,commentContentDetailPMarginBottom:v}=n;return{[t]:{position:"relative",backgroundColor:o,[`${t}-inner`]:{display:"flex",padding:e},[`${t}-avatar`]:{position:"relative",flexShrink:0,marginRight:n.marginSM,cursor:"pointer",img:{width:"32px",height:"32px",borderRadius:"50%"}},[`${t}-content`]:{position:"relative",flex:"1 1 auto",minWidth:"1px",fontSize:g,wordWrap:"break-word","&-author":{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",marginBottom:n.marginXXS,fontSize:g,"& > a,& > span":{paddingRight:n.paddingXS,fontSize:h,lineHeight:"18px"},"&-name":{color:m,fontSize:g,transition:`color ${n.motionDurationSlow}`,"> *":{color:m,"&:hover":{color:m}}},"&-time":{color:i,whiteSpace:"nowrap",cursor:"auto"}},"&-detail p":{marginBottom:v,whiteSpace:"pre-wrap"}},[`${t}-actions`]:{marginTop:w,marginBottom:d,paddingLeft:0,"> li":{display:"inline-block",color:l,"> span":{marginRight:"10px",color:l,fontSize:h,cursor:"pointer",transition:`color ${n.motionDurationSlow}`,userSelect:"none","&:hover":{color:u}}}},[`${t}-nested`]:{marginLeft:r},"&-rtl":{direction:"rtl"}}}},Ft=Ze("Comment",n=>{const t=et(n,{commentBg:"inherit",commentPaddingBase:`${n.paddingMD}px 0`,commentNestIndent:"44px",commentFontSizeBase:n.fontSize,commentFontSizeSm:n.fontSizeSM,commentAuthorNameColor:n.colorTextTertiary,commentAuthorTimeColor:n.colorTextPlaceholder,commentActionColor:n.colorTextTertiary,commentActionHoverColor:n.colorTextSecondary,commentActionsMarginBottom:"inherit",commentActionsMarginTop:n.marginSM,commentContentDetailPMarginBottom:"inherit"});return[Mt(t)]}),Ot=()=>({actions:Array,author:se.any,avatar:se.any,content:se.any,prefixCls:String,datetime:se.any}),Ut=Pe({compatConfig:{MODE:3},name:"AComment",inheritAttrs:!1,props:Ot(),slots:Object,setup(n,t){let{slots:o,attrs:e}=t;const{prefixCls:r,direction:g}=nt("comment",n),[h,m]=Ft(r),i=(u,d)=>s("div",{class:`${u}-nested`},[d]),l=u=>!u||!u.length?null:u.map((w,v)=>s("li",{key:`action-${v}`},[w]));return()=>{var u,d,w,v,x,c,S,U,P,A,M;const k=r.value,j=(u=n.actions)!==null&&u!==void 0?u:(d=o.actions)===null||d===void 0?void 0:d.call(o),X=(w=n.author)!==null&&w!==void 0?w:(v=o.author)===null||v===void 0?void 0:v.call(o),Y=(x=n.avatar)!==null&&x!==void 0?x:(c=o.avatar)===null||c===void 0?void 0:c.call(o),Z=(S=n.content)!==null&&S!==void 0?S:(U=o.content)===null||U===void 0?void 0:U.call(o),ee=(P=n.datetime)!==null&&P!==void 0?P:(A=o.datetime)===null||A===void 0?void 0:A.call(o),f=s("div",{class:`${k}-avatar`},[typeof Y=="string"?s("img",{src:Y,alt:"comment-avatar"},null):Y]),T=j?s("ul",{class:`${k}-actions`},[l(Array.isArray(j)?j:[j])]):null,F=s("div",{class:`${k}-content-author`},[X&&s("span",{class:`${k}-content-author-name`},[X]),ee&&s("span",{class:`${k}-content-author-time`},[ee])]),$=s("div",{class:`${k}-content`},[F,s("div",{class:`${k}-content-detail`},[Z]),T]),de=s("div",{class:`${k}-inner`},[f,$]),te=ot((M=o.default)===null||M===void 0?void 0:M.call(o));return h(s("div",Le(Le({},e),{},{class:[k,{[`${k}-rtl`]:g.value==="rtl"},e.class,m.value]}),[de,te&&te.length?i(k,te):null]))}}}),Ee=tt(Ut);var Bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z"}}]},name:"smile",theme:"outlined"};function Fe(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?Object(arguments[t]):{},e=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(e=e.concat(Object.getOwnPropertySymbols(o).filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable}))),e.forEach(function(r){jt(n,r,o[r])})}return n}function jt(n,t,o){return t in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}var be=function(t,o){var e=Fe({},t,o.attrs);return s(Ue,Fe({},e,{icon:Bt}),null)};be.displayName="SmileOutlined";be.inheritAttrs=!1;var Ht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M678.3 642.4c24.2-13 51.9-20.4 81.4-20.4h.1c3 0 4.4-3.6 2.2-5.6a371.67 371.67 0 00-103.7-65.8c-.4-.2-.8-.3-1.2-.5C719.2 505 759.6 431.7 759.6 349c0-137-110.8-248-247.5-248S264.7 212 264.7 349c0 82.7 40.4 156 102.6 201.1-.4.2-.8.3-1.2.5-44.7 18.9-84.8 46-119.3 80.6a373.42 373.42 0 00-80.4 119.5A373.6 373.6 0 00137 888.8a8 8 0 008 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 628.2 432.2 597 512.2 597c56.7 0 111.1 15.7 158 45.1a8.1 8.1 0 008.1.3zM512.2 521c-45.8 0-88.9-17.9-121.4-50.4A171.2 171.2 0 01340.5 349c0-45.9 17.9-89.1 50.3-121.6S466.3 177 512.2 177s88.9 17.9 121.4 50.4A171.2 171.2 0 01683.9 349c0 45.9-17.9 89.1-50.3 121.6C601.1 503.1 558 521 512.2 521zM880 759h-84v-84c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v84h-84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h84v84c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-84h84c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"user-add",theme:"outlined"};function Oe(n){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?Object(arguments[t]):{},e=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(e=e.concat(Object.getOwnPropertySymbols(o).filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable}))),e.forEach(function(r){Dt(n,r,o[r])})}return n}function Dt(n,t,o){return t in n?Object.defineProperty(n,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[t]=o,n}var Ce=function(t,o){var e=Oe({},t,o.attrs);return s(Ue,Oe({},e,{icon:Ht}),null)};Ce.displayName="UserAddOutlined";Ce.inheritAttrs=!1;const Nt={name:"UploadChunk",components:{Tooltip:Q,UploadOutlined:ge,FolderOutlined:_e,DownloadOutlined:fe,PaperClipOutlined:ie,DeleteOutlined:ue},props:{visible:{type:Boolean,default:!1}},emits:["select"],setup(n,{emit:t}){const{selectFileList:o,beforeUpload:e,handleRemove:r,getBackground:g,isImage:h,getImageSrc:m,viewImage:i}=ve(),[l,{openModal:u}]=pe();function d(){return yt(o.value)}function w(){o.value=[]}re(()=>o.value,c=>{if(c&&c.length>0){let S=c[0].name;S&&t("select",S)}});function v(){u(!0,{})}function x(c){let S=o.value;c.forEach(U=>{S.push(xe(Te({},U),{exist:!0}))}),o.value=S}return{selectFileList:o,beforeUpload:e,handleRemove:r,getBackground:g,getUploadFileList:d,clear:w,isImage:h,getImageSrc:m,viewImage:i,registerModel:l,showFileModal:v,onSelectFileOk:x}}},Pt={key:0},$t={class:"j-icon"},zt={class:"inner-button"},Rt={key:0,class:"selected-file-warp"},Et={class:"selected-file-list"},Vt={class:"item"},Yt={class:"complex"},Wt={class:"content"},qt={key:0,class:"content-top",style:{height:"100%"}},Xt={class:"content-top"},Gt=["title"],Jt=["onClick"],Kt={class:"text"},Qt={class:"buttons"},Zt={class:"opt-icon"};function en(n,t,o,e,r,g){const h=b("upload-outlined"),m=Be,i=Re,l=b("delete-outlined"),u=b("Tooltip");return o.visible?(_(),C("div",Pt,[s(i,{type:"info",class:"jeecg-comment-files",style:{margin:"0"}},{message:p(()=>[a("span",$t,[s(m,{multiple:"","file-list":e.selectFileList,"onUpdate:fileList":t[0]||(t[0]=d=>e.selectFileList=d),showUploadList:!1,"before-upload":e.beforeUpload},{default:p(()=>[a("span",zt,[s(h),t[1]||(t[1]=R("上传",-1))])]),_:1},8,["file-list","before-upload"])])]),_:1}),e.selectFileList&&e.selectFileList.length>0?(_(),C("div",Rt,[a("div",Et,[(_(!0),C(E,null,ce(e.selectFileList,d=>(_(),C("div",Vt,[a("div",Yt,[a("div",Wt,[e.isImage(d)?(_(),C("div",qt,[a("div",{class:"content-image",style:V({height:"100%",backgroundImage:"url("+e.getImageSrc(d)+")"})},null,4)])):(_(),C(E,{key:1},[a("div",Xt,[a("div",{class:"content-icon",style:V({background:"url("+e.getBackground(d)+") no-repeat"})},null,4)]),a("div",{class:"content-bottom",title:d.name},[a("span",null,O(d.name),1)],8,Gt)],64))]),a("div",{class:K(["layer",{"layer-image":e.isImage(d)}])},[a("div",{class:"next",onClick:w=>e.viewImage(d)},[a("div",Kt,O(d.name),1)],8,Jt),a("div",Qt,[a("div",Zt,[s(u,{title:"删除"},{default:p(()=>[s(l,{onClick:w=>e.handleRemove(d)},null,8,["onClick"])]),_:2},1024)])])],2)])]))),256)),t[2]||(t[2]=he('<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))])])):B("",!0)])):B("",!0)}const tn=J(Nt,[["render",en],["__scopeId","data-v-fb074890"]]),nn={categories:{recent:"最常用的",smileys:"表情选择",people:"人物&身体",nature:"动物&自然",foods:"食物&饮料",activity:"活动",places:"旅行&地点",objects:"物品",symbols:"符号",flags:"旗帜"}},on={name:"MyComment",components:{UserAddOutlined:Ce,Tooltip:Q,UserSelectModal:ht,PaperClipOutlined:ie,UploadChunk:tn,SmileOutlined:be},props:{inner:L.bool.def(!1),inputFocus:{type:Boolean,default:!1}},emits:["cancel","comment"],setup(n,{emit:t}){const o=I(!1),e=I(),r=I(null),[g,{openModal:h,closeModal:m}]=pe(),i=I(!1),l=I("");function u(y){if((y.keyCode||y.which)==13&&y.shiftKey)return;let H=l.value;if(!H&&H!=="0")d.value=!0;else{i.value=!0;let W=[];o.value==!0&&(W=e.value.getUploadFileList()),t("comment",H,W),setTimeout(()=>{i.value=!1},350)}}const d=I(!1);re(l,()=>{let y=l.value;!y&&y!=="0"?d.value=!0:d.value=!1});function w(){t("cancel")}const v=I();re(()=>n.inputFocus,y=>{y==!0&&(l.value="",o.value==!0&&(e.value.clear(),o.value=!1))},{deep:!0,immediate:!0});function x(){h(!0,{isUpdate:!1})}function c(y){var D,H;if(y&&y.length>0){const{realname:W,username:ae}=y[0];if(W&&ae){let ne=`${W}[${ae}]`,G=l.value;if(!G)l.value="@"+ne+" ";else{const oe=(H=(D=v.value)==null?void 0:D.selectionStart)!=null?H:G.length;let N=G.substring(0,oe);const Ie=G.substring(oe);if(N.endsWith("@")){if(N.length>=2){const le=N.length-1,we=N.substring(0,le),We=N.substring(le),qe=we.endsWith(" ")?"":" ";N=we+qe+We}l.value=N+ne+" "+Ie}else{const le=N&&N.endsWith(" ")?"@":" @";l.value=N+le+ne+" "+Ie}}f.value=!1,v.value.focus(),$.value=!0}}m()}function S(y){y.data==="@"&&(y.target.blur(),x())}const U=I();function P(y){let D=l.value||"";D+=y,l.value=D,U.value.click()}const A=I(!1);function M(y){var G,oe;let D=l.value||"",H=y.colons;H.indexOf("::")>0&&(H=H.substring(0,H.indexOf(":")+1));const W=(oe=(G=v.value)==null?void 0:G.selectionStart)!=null?oe:D.length,ae=D.substring(0,W),ne=D.substring(W);l.value=ae+H+ne,A.value=!1,F()}const k={width:"460px"};function j(y){y.preventDefault(),y.stopPropagation(),A.value=!1,$.value=!0}function X(y){y.preventDefault(),y.stopPropagation(),A.value=!A.value}const Y=je(),{getHtml:Z}=He(Y),ee=me(()=>{let y=l.value;return y?Z(y):"请输入你的评论,可以@成员"}),f=I(!1);function T(y){y.preventDefault(),y.stopPropagation(),f.value=!1,v.value.focus(),$.value=!0}function F(){f.value=!0,setTimeout(()=>{r.value.scrollTop=v.value.scrollTop},0)}const $=I(!1),de=me(()=>!(l.value.length>0));function te(){l.value.length==0&&($.value=!1,o.value=!1)}function Ye(y){l.value.length==0&&(l.value=y)}return{myComment:l,sendComment:u,noComment:w,disabledButton:d,buttonLoading:i,commentRef:v,registerModal:g,openSelectUser:x,setValue:c,handleCommentChange:S,uploadRef:e,uploadVisible:o,onSelectEmoji:P,optionsName:nn,emojiButton:U,emojiIndex:Y,showEmoji:M,pickerStyles:k,visibleEmoji:A,handleClickBlank:j,handleShowEmoji:X,commentHtml:ee,showHtml:f,handleClickHtmlShower:T,handleBlur:F,commentActive:$,noConent:de,changeActive:te,selectFirstFile:Ye,commentContentRef:r}}},an=["innerHTML"],ln={key:0,class:"comment-buttons"},sn={style:{cursor:"pointer"}},cn={title:"表情",style:{display:"inline-block"}},dn={style:{position:"relative"}},rn={key:0};function mn(n,t,o,e,r,g){const h=b("user-add-outlined"),m=b("Tooltip"),i=b("PaperClipOutlined"),l=b("SmileOutlined"),u=b("a-button"),d=b("upload-chunk"),w=b("UserSelectModal"),v=b("Picker"),x=at;return _(),C(E,null,[a("div",{class:K([{"comment-active":e.commentActive},"comment-main"]),onClick:t[6]||(t[6]=(...c)=>e.handleClickBlank&&e.handleClickBlank(...c))},[Me(a("textarea",{ref:"commentRef","onUpdate:modelValue":t[0]||(t[0]=c=>e.myComment=c),onKeyup:t[1]||(t[1]=Ct((...c)=>e.sendComment&&e.sendComment(...c),["enter"])),onInput:t[2]||(t[2]=(...c)=>e.handleCommentChange&&e.handleCommentChange(...c)),onBlur:t[3]||(t[3]=(...c)=>e.handleBlur&&e.handleBlur(...c)),class:"comment-content",rows:3,placeholder:"请输入你的评论,可以@成员"},null,544),[[bt,e.myComment]]),a("div",{ref:"commentContentRef",class:K(["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]=(...c)=>e.handleClickHtmlShower&&e.handleClickHtmlShower(...c))},null,10,an),e.commentActive?(_(),C("div",ln,[a("div",sn,[s(m,{title:"选择@用户"},{default:p(()=>[s(h,{onClick:e.openSelectUser},null,8,["onClick"])]),_:1}),s(m,{title:"上传附件"},{default:p(()=>[s(i,{onClick:t[5]||(t[5]=c=>e.uploadVisible=!e.uploadVisible)})]),_:1}),a("span",cn,[s(l,{ref:"emojiButton",onClick:e.handleShowEmoji},null,8,["onClick"]),Me(a("div",dn,null,512),[[It]])])]),e.commentActive?(_(),C("div",rn,[o.inner?(_(),q(u,{key:0,onClick:e.noComment,style:{"margin-right":"10px"}},{default:p(()=>[...t[8]||(t[8]=[R("取消",-1)])]),_:1},8,["onClick"])):B("",!0),s(u,{type:"primary",onClick:e.sendComment,loading:e.buttonLoading,disabled:e.disabledButton},{default:p(()=>[...t[9]||(t[9]=[R("发 送",-1)])]),_:1},8,["onClick","loading","disabled"])])):B("",!0)])):B("",!0),s(d,{ref:"uploadRef",visible:e.uploadVisible,onSelect:e.selectFirstFile},null,8,["visible","onSelect"])],2),s(w,{rowKey:"username",onRegister:e.registerModal,onSelected:e.setValue,multi:!1},null,8,["onRegister","onSelected"]),s(x,{open:e.visibleEmoji,"onUpdate:open":t[7]||(t[7]=c=>e.visibleEmoji=c),footer:null,wrapClassName:"emoji-modal",closable:!1,width:460},{title:p(()=>[...t[10]||(t[10]=[a("span",null,null,-1)])]),default:p(()=>[s(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 un=J(on,[["render",mn]]),fn={name:"HistoryFileList",props:{dataList:{type:Array,default:()=>[]},isComment:{type:Boolean,default:!1}},components:{UploadOutlined:ge,FolderOutlined:_e,DownloadOutlined:fe,PaperClipOutlined:ie,DeleteOutlined:ue,Tooltip:Q},setup(){const{getBackground:n,getFileSize:t,downLoad:o,isImage:e,getImageAsBackground:r,viewImage:g}=ve();return{getBackground:n,downLoad:o,getFileSize:t,isImage:e,getImageAsBackground:r,viewImage:g}}},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"],In={class:"text"},wn={class:"text"},Sn={class:"buttons"},kn={class:"opt-icon"};function Tn(n,t,o,e,r,g){const h=b("download-outlined"),m=b("Tooltip");return _(),C("div",{class:K(["comment-file-his-list",o.isComment===!0?"in-comment":""])},[a("div",vn,[(_(!0),C(E,null,ce(o.dataList,i=>(_(),C("div",_n,[a("div",gn,[a("div",pn,[e.isImage(i)?(_(),C("div",hn,[a("div",{class:"content-image",style:V(e.getImageAsBackground(i))},null,4)])):(_(),C(E,{key:1},[a("div",yn,[a("div",{class:"content-icon",style:V({background:"url("+e.getBackground(i)+") no-repeat"})},null,4)]),a("div",{class:"content-bottom",title:i.name},[a("span",null,O(i.name),1)],8,bn)],64))]),a("div",{class:K(["layer",{"layer-image":e.isImage(i)}])},[a("div",{class:"next",onClick:l=>e.viewImage(i)},[a("div",In,O(i.name),1),a("div",wn,O(e.getFileSize(i)),1)],8,Cn),a("div",Sn,[a("div",kn,[s(m,{title:"下载"},{default:p(()=>[s(h,{onClick:l=>e.downLoad(i)},null,8,["onClick"])]),_:2},1024)])])],2)])]))),256)),t[0]||(t[0]=he('<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 Ve=J(fn,[["render",Tn],["__scopeId","data-v-e83913e0"]]),xn=Pe({name:"CommentList",components:{MessageOutlined:St,AComment:Ee,Tooltip:Q,MyComment:un,Popconfirm:lt,HistoryFileList:Ve},props:{tableId:L.string.def(""),tableName:L.string.def(""),dataId:L.string.def(""),datetime:L.number.def(1),otherHeight:L.number.def(0)},setup(n){const{createMessage:t}=st(),o=I([]),{userInfo:e}=De(),r=$e("$dayjs"),g=I(null);function h(){return e.realname?e.realname.substr(0,2):""}function m(){return Ae(e.avatar)}function i(f){return f.fromUserAvatar?Ae(f.fromUserAvatar):""}function l(f){return f.fromUserId_dictText?f.fromUserId_dictText.substr(0,2):"未知"}function u(f){return f.toUser?f.fromUserId_dictText+" 回复 "+f.fromUserId_dictText:f.fromUserId_dictText}function d(f){return f.createTime?r(f.createTime,"YYYY-MM-DD hh:mm:ss").fromNow():""}const w=I(300),v=I(300);wt(()=>{let f=n.otherHeight||0;w.value=window.innerHeight-57-46-70-160-f,v.value=window.innerHeight-57-46-53-20-f});function x(){return z(this,null,function*(){const f={tableName:n.tableName,tableDataId:n.dataId,column:"createTime",order:"desc"},T=yield dt(f);if(!T||!T.records||T.records.length==0)o.value=[];else{let F=T.records;o.value=F,ze(()=>{g.value&&g.value.$el&&(g.value.$el.scrollTop=1e6)})}})}const{saveCommentAndFiles:c}=Ne(n);function S(f,T,F){return z(this,null,function*(){let $={fromUserId:e.id,toUserId:f.fromUserId,commentId:f.id,commentContent:T};yield c($,F),yield x()})}function U(f,T){return z(this,null,function*(){let F={fromUserId:e.id,commentContent:f};yield c(F,T),yield x(),A.value=!1,setTimeout(()=>{A.value=!0},100)})}function P(f){return z(this,null,function*(){const T={id:f.id};yield it(T),yield x()})}const A=I(!1);function M(f){let T=o.value;for(let F of T)F.commentStatus=!1;f.commentStatus=!0,A.value=!1,A.value=!0}ye(()=>{n.datetime&&n.tableName&&n.dataId&&x()});const k=je(),{getHtml:j}=He(k),X=I();function Y(){X.value.changeActive()}function Z(f,T){return z(this,null,function*(){if(f==!0&&!T.commentId_dictText){const F=yield ct(T.commentId);F.success==!0?T.commentId_dictText=F.result.commentContent:T.commentId_dictText="该评论已被删除"}})}return{dataList:o,getAvatar:i,getAvatarText:l,getAuthor:u,getDateDiff:d,commentHeight:w,allHeight:v,replyComment:S,sendComment:U,getMyname:h,getMyAvatar:m,focusStatus:A,showReply:M,deleteComment:P,getHtml:j,handleClickItem:Y,bottomCommentRef:X,visibleChange:Z,listRef:g,lineFeed:f=>f.replace(/\n/g,"<br>")}}}),Ln={class:"comment-author"},An=["innerHTML"],Mn=["onClick"],Fn=["innerHTML"],On={key:0},Un={key:0,class:"inner-comment"},Bn={class:"comment-area"};function jn(n,t,o,e,r,g){const h=kt,m=b("message-outlined"),i=b("Tooltip"),l=b("Popconfirm"),u=b("history-file-list"),d=Ee,w=b("my-comment"),v=Tt,x=xt;return _(),C("div",{style:V({position:"relative",height:n.allHeight+"px"})},[s(x,{ref:"listRef",class:"jeecg-comment-list",header:"","item-layout":"horizontal","data-source":n.dataList,style:V({height:n.commentHeight+"px"})},{renderItem:p(({item:c})=>[s(v,{style:{"padding-left":"10px","flex-direction":"column"},onClick:n.handleClickItem},{default:p(()=>[s(d,null,{avatar:p(()=>[s(h,{class:"tx",src:n.getAvatar(c),alt:n.getAvatarText(c)},{default:p(()=>[R(O(n.getAvatarText(c)),1)]),_:2},1032,["src","alt"])]),author:p(()=>[a("div",Ln,[a("span",null,O(c.fromUserId_dictText),1),c.toUserId?(_(),C(E,{key:0},[t[0]||(t[0]=a("span",null,"回复",-1)),a("span",null,O(c.toUserId_dictText),1),s(i,{class:"comment-last-content",onOpenChange:S=>n.visibleChange(S,c)},{title:p(()=>[a("div",{innerHTML:n.getHtml(n.lineFeed(c.commentId_dictText))},null,8,An)]),default:p(()=>[s(m)]),_:2},1032,["onOpenChange"])],64)):B("",!0)])]),datetime:p(()=>[a("div",null,[s(i,{title:c.createTime},{default:p(()=>[a("span",null,O(n.getDateDiff(c)),1)]),_:2},1032,["title"])])]),actions:p(()=>[a("span",{onClick:S=>n.showReply(c)},"回复",8,Mn),s(l,{title:"确定删除吗?",onConfirm:S=>n.deleteComment(c)},{default:p(()=>[...t[1]||(t[1]=[a("span",null,"删除",-1)])]),_:1},8,["onConfirm"])]),content:p(()=>[a("div",{class:"content",innerHTML:n.getHtml(n.lineFeed(c.commentContent)),style:{"font-size":"15px"}},null,8,Fn),c.fileList&&c.fileList.length>0?(_(),C("div",On,[s(u,{dataList:c.fileList,isComment:""},null,8,["dataList"])])):B("",!0)]),_:2},1024),c.commentStatus?(_(),C("div",Un,[s(w,{inner:"",onCancel:S=>c.commentStatus=!1,onComment:(S,U)=>n.replyComment(c,S,U),inputFocus:n.focusStatus},null,8,["onCancel","onComment","inputFocus"])])):B("",!0)]),_:2},1032,["onClick"])]),_:1},8,["data-source","style"]),a("div",Bn,[s(d,{style:{margin:"0 10px"}},{avatar:p(()=>[s(h,{class:"tx",src:n.getMyAvatar(),alt:n.getMyname()},{default:p(()=>[R(O(n.getMyname()),1)]),_:1},8,["src","alt"])]),content:p(()=>[s(w,{ref:"bottomCommentRef",onComment:n.sendComment,inputFocus:n.focusStatus},null,8,["onComment","inputFocus"])]),_:1})])],4)}const Hn=J(xn,[["render",jn],["__scopeId","data-v-22cc0891"]]),Dn={name:"CommentFiles",components:{UploadOutlined:ge,FolderOutlined:_e,JUpload:Lt,DownloadOutlined:fe,PaperClipOutlined:ie,DeleteOutlined:ue,Tooltip:Q,HistoryFileList:Ve},props:{tableId:L.string.def(""),tableName:L.string.def(""),dataId:L.string.def(""),datetime:L.number.def(1)},setup(n){const[t,{openModal:o}]=pe(),{userInfo:e}=De(),r=I([]),g=I("");function h(){return z(this,null,function*(){const M={tableName:n.tableName,tableDataId:n.dataId},k=yield mt(M);if(!k||!k.records||k.records.length==0)r.value=[];else{let j=k.records;r.value=j}g.value=""})}ye(()=>{n.datetime&&n.tableName&&n.dataId&&h()});const{saveCommentAndFiles:m,buttonLoading:i}=Ne(n),{selectFileList:l,beforeUpload:u,handleRemove:d,getBackground:w,isImage:v,getImageAsBackground:x,viewImage:c}=ve();function S(){l.value=[]}function U(){return z(this,null,function*(){let M={fromUserId:e.id,commentContent:"上传了附件"};yield m(M,l.value),l.value=[],yield h()})}function P(){o(!0,{})}function A(M){if(M.length===0)return;let k=l.value;M.forEach(j=>{j.exist=!0}),l.value=[...k,...M]}return{selectFileList:l,beforeUpload:u,handleRemove:d,getBackground:w,isImage:v,dataList:r,uploadFileUrl:rt,quxiao:S,queding:U,buttonLoading:i,getImageAsBackground:x,viewImage:c,registerModel:t,showFileModal:P,onSelectFileOk:A}}},Nn={class:"j-icon"},Pn={class:"inner-button"},$n={key:0,class:"selected-file-warp"},zn={class:"selected-file-list"},Rn={class:"item"},En={class:"complex"},Vn={class:"content"},Yn={key:0,class:"content-top",style:{height:"100%"}},Wn={class:"content-top"},qn=["title"],Xn=["onClick"],Gn={class:"text"},Jn={class:"buttons"},Kn={class:"opt-icon"},Qn={style:{"margin-bottom":"24px","margin-top":"18px","text-align":"right"}};function Zn(n,t,o,e,r,g){const h=b("upload-outlined"),m=Be,i=Re,l=b("delete-outlined"),u=b("Tooltip"),d=b("a-button"),w=b("history-file-list");return _(),C("div",null,[s(i,{type:"info",class:"jeecg-comment-files"},{message:p(()=>[a("span",Nn,[s(m,{multiple:"","file-list":e.selectFileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.selectFileList=v),showUploadList:!1,"before-upload":e.beforeUpload},{default:p(()=>[a("span",Pn,[s(h),t[1]||(t[1]=R("上传",-1))])]),_:1},8,["file-list","before-upload"])])]),_:1}),e.selectFileList&&e.selectFileList.length>0?(_(),C("div",$n,[a("div",zn,[(_(!0),C(E,null,ce(e.selectFileList,v=>(_(),C("div",Rn,[a("div",En,[a("div",Vn,[e.isImage(v)?(_(),C("div",Yn,[a("div",{class:"content-image",style:V(e.getImageAsBackground(v))},null,4)])):(_(),C(E,{key:1},[a("div",Wn,[a("div",{class:"content-icon",style:V({background:"url("+e.getBackground(v)+") no-repeat"})},null,4)]),a("div",{class:"content-bottom",title:v.name},[a("span",null,O(v.name),1)],8,qn)],64))]),a("div",{class:K(["layer",{"layer-image":e.isImage(v)}])},[a("div",{class:"next",onClick:x=>e.viewImage(v)},[a("div",Gn,O(v.name),1)],8,Xn),a("div",Jn,[a("div",Kn,[s(u,{title:"删除"},{default:p(()=>[s(l,{onClick:x=>e.handleRemove(v)},null,8,["onClick"])]),_:2},1024)])])],2)])]))),256)),t[2]||(t[2]=he('<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))]),a("div",Qn,[s(d,{onClick:e.quxiao},{default:p(()=>[...t[3]||(t[3]=[R("取消",-1)])]),_:1},8,["onClick"]),s(d,{type:"primary",style:{"margin-left":"10px"},onClick:e.queding,loading:e.buttonLoading},{default:p(()=>[...t[4]||(t[4]=[R("确定",-1)])]),_:1},8,["onClick","loading"])])])):B("",!0),s(w,{dataList:e.dataList},null,8,["dataList"])])}const eo=J(Dn,[["render",Zn],["__scopeId","data-v-c86f55ed"]]),to={name:"DataLogList",components:{PlusOutlined:ut,EditOutlined:At,Tooltip:Q},props:{tableName:L.string.def(""),dataId:L.string.def(""),datetime:L.number.def(1)},setup(n){const t=$e("$dayjs"),o=ft(),e=I(300);e.value=o-46-57-53-30;const r=I([]),g=I(0);function h(){return z(this,null,function*(){const l={dataTable:n.tableName,dataId:n.dataId,type:"comment"},u=yield vt(l);if(!u||!u.result||u.result.length==0)r.value=[],g.value=-1;else{let d=u.result;g.value=d.length-1,r.value=d}})}ye(()=>{n.datetime&&n.tableName&&n.dataId&&h()});function m(l){return l.createTime?t(l.createTime,"YYYY-MM-DD hh:mm:ss").fromNow():""}function i(){}return{height:e,lastIndex:g,dataList:r,getDateDiff:m,handleClickPerson:i}}},no={class:"data-log-content"},oo={class:"logbox"},ao={class:"log-item"},lo={class:"log-item-icon"},so={class:"log-item-content"},io={class:"log-item-date"};function co(n,t,o,e,r,g){const h=b("plus-outlined"),m=b("edit-outlined"),i=b("Tooltip");return _(),C("div",{class:"data-log-scroll",style:V({height:e.height+"px"})},[a("div",no,[a("div",oo,[(_(!0),C(E,null,ce(e.dataList,(l,u)=>(_(),C("div",ao,[a("span",lo,[e.lastIndex==u?(_(),q(h,{key:0,style:{"margin-top":"3px"}})):(_(),q(m,{key:1}))]),a("span",so,[a("a",{onClick:t[0]||(t[0]=(...d)=>e.handleClickPerson&&e.handleClickPerson(...d))},"@"+O(l.createName||l.createBy),1),R(" "+O(l.dataContent),1)]),a("div",io,[s(i,{title:l.createTime},{default:p(()=>[a("span",null,O(e.getDateDiff(l)),1)]),_:2},1032,["title"])])]))),256))])])],4)}const ro=J(to,[["render",co],["__scopeId","data-v-23165764"]]),mo={name:"CommentPanel",components:{CommentList:Hn,CommentFiles:eo,DataLogList:ro},props:{tableId:L.string.def(""),tableName:L.string.def(""),dataId:L.string.def(""),showComment:L.bool.def(!0),showFiles:L.bool.def(!0),showDataLog:L.bool.def(!0),otherHeight:L.number.def(0)},setup(n){const t=me(()=>!!(n.dataId&&n.tableName)),o=I(1),e=I(1),r=I(1),g=I(!0);function h(i){let l=new Date().getTime();i=="comment"?o.value=l:i=="file"?e.value=l:r.value=l}function m(){let i=new Date().getTime();o.value=i,e.value=i,r.value=i,g.value=!1,ze(()=>{g.value=!0})}return{showStatus:t,handleChange:h,datetime1:o,datetime2:e,datetime3:r,reload:m,show:g}}},uo={key:0,class:"comment-tabs-warp"};function fo(n,t,o,e,r,g){const h=b("comment-list"),m=_t,i=b("comment-files"),l=b("data-log-list"),u=gt,d=pt;return e.showStatus?(_(),C("div",uo,[e.show?(_(),q(u,{key:0,onChange:e.handleChange,animated:!1},{default:p(()=>[o.showComment?(_(),q(m,{tab:"评论",key:"comment",class:"comment-list-tab"},{default:p(()=>[s(h,{tableId:o.tableId,tableName:o.tableName,dataId:o.dataId,datetime:e.datetime1,otherHeight:o.otherHeight},null,8,["tableId","tableName","dataId","datetime","otherHeight"])]),_:1})):B("",!0),o.showFiles?(_(),q(m,{tab:"文件",key:"file"},{default:p(()=>[s(i,{tableId:o.tableId,tableName:o.tableName,dataId:o.dataId,datetime:e.datetime2},null,8,["tableId","tableName","dataId","datetime"])]),_:1})):B("",!0),o.showDataLog?(_(),q(m,{tab:"日志",key:"log"},{default:p(()=>[s(l,{tableName:o.tableName,dataId:o.dataId,datetime:e.datetime3},null,8,["tableName","dataId","datetime"])]),_:1})):B("",!0)]),_:1},8,["onChange"])):B("",!0)])):(_(),q(d,{key:1,description:"新增页面不支持评论"}))}const Ao=J(mo,[["render",fo],["__scopeId","data-v-1c9ab375"]]);export{Ao as C};
|