2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{_ as P}from"./index.76a66f15.js";/* empty css *//* empty css */import{C as p,D as b,aJ as t,b2 as s,aV as r,ci as Y,bj as V,a$ as _,E as C,b1 as S,b3 as h,aG as L,bE as q,bF as G,b_ as J,bI as M,bJ as R,cq as j,bZ as H,bo as Z,bs as K,bS as Q,bU as W,bD as X,bn as $,bV as ee,bL as te}from"./arco.f3c60d68.js";import"./chart.a626c034.js";import"./vue.7d1f2b31.js";const se={components:{},data(){return{visible:this.isShow,content:""}},props:{isShow:{type:Boolean,default:!1},formId:{type:[String,Number],default:0},type:{type:[String],default:"reply"}},methods:{handleCancel(){this.$emit("cancel",!1)},handleOk(){if(this.type=="edit")var l="admin/user/comment/edit",e={row:{content:this.content},ids:this.formId};else var l="admin/user/comment/reply",e={comment_id:this.formId,content:this.content};this.$request.post(l,e).then(u=>{this.$message.success(u.msg),this.$emit("ok",!1)}).catch(u=>{this.$message.error(u.msg)})}},watch:{isShow:function(){this.visible=this.isShow,this.visible&&this.type=="edit"?this.$request.post("admin/user/comment/detail",{id:this.formId}).then(l=>{this.content=l.data.content}).catch(l=>{this.$message.error(l.msg)}):this.content=""}}};function ae(l,e,u,i,n,o){const f=Y,m=V;return p(),b("div",null,[t(m,{visible:n.visible,onOk:o.handleOk,onCancel:o.handleCancel,"title-align":"start",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",unmountOnClose:""},{title:s(()=>[...e[1]||(e[1]=[r(" \u8BC4\u8BBA ",-1)])]),default:s(()=>[t(f,{placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8",modelValue:n.content,"onUpdate:modelValue":e[0]||(e[0]=d=>n.content=d),"allow-clear":"","max-length":1e3,"show-word-limit":"","auto-size":{minRows:3,maxRows:6}},null,8,["modelValue"])]),_:1},8,["visible","onOk","onCancel"])])}const le=P(se,[["render",ae]]),ne={components:{replyModal:le},data(){return{modal:{reply:!1},form:{type:"reply",id:0},tableLoading:!1,collapsed:!1,rowSelection:{type:"checkbox",showCheckedAll:!0},scroll:{x:1400},columns:[{title:"\u7528\u6237",dataIndex:"user",slotName:"user",width:200},{title:"\u8BFE\u7A0B",dataIndex:"course",slotName:"course",width:320},{title:"\u5185\u5BB9",dataIndex:"content",slotName:"content"},{title:"\u56DE\u590D",dataIndex:"reply",slotName:"reply"},{title:"\u70B9\u8D5E\u6570",dataIndex:"like_count",sortable:{sortDirections:["ascend","descend"]},width:100},{title:"\u72B6\u6001",dataIndex:"status",slotName:"status",width:150},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createtime",slotName:"createtime",sortable:{sortDirections:["ascend","descend"]},width:200},{title:"\u64CD\u4F5C",dataIndex:"operations",slotName:"operations",align:"right",fixed:"right",width:140}],searchParams:{sort:"",order:"desc",offset:0,limit:10},searchFieldType:{content:"=","user.username":"like","course.name":"like",createtime:"RANGE",status:"="},searchFilter:{content:"",status:"","user.username":"","course.name":"",createtime:""}}},methods:{edit(l,e){this.form.type=e,this.form.id=l,this.modal.reply=!0},getSearchParams(){this.searchParams.op="",this.searchParams.filter="";var l=this.searchParams,e={},u={};if(this.searchFilter){for(var i in this.searchFilter)this.searchFilter[i]!==""&&(i=="createtime"&&this.searchFilter[i]?e[i]=this.searchFilter[i].join(" - "):e[i]=this.searchFilter[i],u[i]=this.searchFieldType[i]);JSON.stringify(e)!=="{}"&&(l.op=JSON.stringify(u),l.filter=JSON.stringify(e))}return l},statusChange(l){this.$request.post("admin/user/comment/changeStatus",{id:l}).then(e=>{this.$message.success(e.msg),this.getData()}).catch(e=>{this.$message.error(e.msg)})},getData(){this.tableLoading=!0,this.$request.post("admin/user/comment/index",this.getSearchParams()).then(l=>{this.data=l.data.rows,this.dataTotal=l.data.total,this.tableLoading=!1})},pageChange(l){this.searchParams.offset=l,this.getData()},pageSizeChange(l){this.searchParams.limit=l,this.refresh()},refresh(){this.searchParams.offset=0,this.getData()},delAlone(l){this.del([l])},delBatch(){this.del(this.tableCheckedList)},del(l){if(!l)return this.$message.warning("\u8BF7\u5148\u9009\u62E9\u8981\u5220\u9664\u7684\u8BB0\u5F55"),!1;V.warning({title:"\u63D0\u793A",titleAlign:"start",content:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6D88\u606F\u5417",hideCancel:!1,onOk:()=>{this.$request.post("admin/user/comment/del",{ids:l}).then(e=>{this.$message.success(e.msg),this.refresh()}).catch(e=>{this.$message.error(e.msg)})}})},tablecheckedChange(l){this.tableCheckedList=l},handleChange(l,e,u){e.type=="sorter"&&e.sorter&&(this.searchParams.order=e.sorter.direction=="ascend"?"asc":"desc",this.searchParams.sort=e.sorter.field,this.refresh())}},mounted(){this.refresh()}},oe={class:"container"},re={class:"form-sub-box mt-8"},ie={key:1},ue={style:{width:"100%"}};function de(l,e,u,i,n,o){const f=q,m=G,d=J,w=M,x=R,D=j,v=H,E=_("icon-search"),c=Z,y=K,I=_("icon-refresh"),k=Q,B=W,N=_("user-item"),T=_("course-item"),F=X,z=$,A=ee,O=te,U=_("reply-modal");return p(),b("div",oe,[t(O,{class:"content-card"},{default:s(()=>[C("div",re,[t(v,{cols:3,colGap:12,class:"grid-demo-grid"},{default:s(()=>[t(d,{span:1},{default:s(()=>[t(m,{field:"user",label:"\u7528\u6237\u540D"},{default:s(()=>[t(f,{modelValue:n.searchFilter["user.username"],"onUpdate:modelValue":e[0]||(e[0]=a=>n.searchFilter["user.username"]=a),onPressEnter:o.refresh},null,8,["modelValue","onPressEnter"])]),_:1})]),_:1}),t(d,{span:1},{default:s(()=>[t(m,{field:"course",label:"\u8BFE\u7A0B\u540D"},{default:s(()=>[t(f,{modelValue:n.searchFilter["course.name"],"onUpdate:modelValue":e[1]||(e[1]=a=>n.searchFilter["course.name"]=a),onPressEnter:o.refresh},null,8,["modelValue","onPressEnter"])]),_:1})]),_:1}),t(d,{span:1},{default:s(()=>[t(m,{field:"number",label:"\u8BC4\u8BBA\u5185\u5BB9"},{default:s(()=>[t(f,{modelValue:n.searchFilter.content,"onUpdate:modelValue":e[2]||(e[2]=a=>n.searchFilter.content=a),onPressEnter:o.refresh},null,8,["modelValue","onPressEnter"])]),_:1})]),_:1}),t(d,{span:1},{default:s(()=>[t(m,{field:"number",label:"\u72B6\u6001"},{default:s(()=>[t(x,{modelValue:n.searchFilter.status,"onUpdate:modelValue":e[3]||(e[3]=a=>n.searchFilter.status=a),placeholder:"\u72B6\u6001",onChange:o.refresh},{default:s(()=>[t(w,{value:""},{default:s(()=>[...e[7]||(e[7]=[r("\u5168\u90E8",-1)])]),_:1}),t(w,{value:1},{default:s(()=>[...e[8]||(e[8]=[r("\u6B63\u5E38",-1)])]),_:1}),t(w,{value:0},{default:s(()=>[...e[9]||(e[9]=[r("\u9690\u85CF",-1)])]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})]),_:1}),t(d,{span:1},{default:s(()=>[t(m,{field:"number",label:"\u8BC4\u8BBA\u65F6\u95F4"},{default:s(()=>[t(D,{"shortcuts-position":"left",modelValue:n.searchFilter.createtime,"onUpdate:modelValue":e[4]||(e[4]=a=>n.searchFilter.createtime=a),"value-format":"YYYY-MM-DD HH:mm:ss",format:a=>`custom format: ${l.dayjs(a).format("YYYY-MM-DD HH:mm:ss")}`,onChange:o.refresh},null,8,["modelValue","format","onChange"])]),_:1})]),_:1})]),_:1}),t(v,{cols:4,colGap:12,class:"grid-demo-grid",collapsed:n.collapsed},{default:s(()=>[t(d,{span:4,suffix:""},{default:s(({overflow:a})=>[t(y,{size:20},{default:s(()=>[t(c,{type:"primary",onClick:o.refresh},{icon:s(()=>[t(E)]),default:s(()=>[e[10]||(e[10]=r(" \u641C\u7D22 ",-1))]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["collapsed"])]),t(B,{style:{"margin-bottom":"16px"}},{default:s(()=>[t(k,{span:12},{default:s(()=>[t(y,null,{default:s(()=>[t(c,{type:"primary",onClick:o.refresh},{icon:s(()=>[t(I)]),_:1},8,["onClick"])]),_:1})]),_:1}),t(k,{span:12,style:{display:"flex","align-items":"center","justify-content":"end"}})]),_:1}),t(A,{"row-key":"id",pagination:{total:l.dataTotal,defaultPageSize:n.searchParams.limit,showTotal:!0,showPageSize:!0,showJumper:!0},"row-selection":n.rowSelection,bordered:!1,scroll:n.scroll,columns:n.columns,data:l.data,loading:n.tableLoading,onPageChange:o.pageChange,onPageSizeChange:o.pageSizeChange,onChange:o.handleChange,onSelectionChange:o.tablecheckedChange},{user:s(({record:a})=>[a.user.id?(p(),S(N,{key:0,userinfo:a.user},null,8,["userinfo"])):(p(),b("span",ie,"-"))]),course:s(({record:a})=>[t(T,{name:a.course.name,type:a.course.type,cover:a.course.cover,pay_type:a.course.pay_type,price:a.course.price},null,8,["name","type","cover","pay_type","price"])]),content:s(({record:a})=>[t(F,{ellipsis:{rows:2,expandable:!0,showTooltip:!0}},{default:s(()=>[r(h(a.content),1)]),_:2},1024)]),reply:s(({record:a})=>[a.reply?(p(),S(F,{key:0,ellipsis:{rows:2,expandable:!0,showTooltip:!0}},{default:s(()=>[C("b",null,"@"+h(a.user.nickname)+"["+h(a.user.username)+"]",1),r("\uFF1A"+h(a.reply.content),1)]),_:2},1024)):(p(),b(L,{key:1},[r(" - ")],64))]),createtime:s(({record:a})=>[C("span",null,h(l.$format.formatDate(a.createtime)),1)]),title:s(({record:a})=>[t(F,{ellipsis:{rows:1,showTooltip:!0}},{default:s(()=>[r(h(a.title),1)]),_:2},1024)]),status:s(({record:a})=>[t(z,{size:"small","checked-value":1,"unchecked-value":0,modelValue:a.status,"onUpdate:modelValue":g=>a.status=g,onChange:g=>o.statusChange(a.id),disabled:a.default_page==1},null,8,["modelValue","onUpdate:modelValue","onChange","disabled"])]),operations:s(({record:a})=>[t(y,{size:10},{default:s(()=>[t(c,{style:{padding:"0"},type:"text",long:"",size:"small",onClick:g=>o.edit(a.id,"edit")},{default:s(()=>[...e[11]||(e[11]=[r(" \u7F16\u8F91 ",-1)])]),_:1},8,["onClick"]),t(c,{style:{padding:"0"},type:"text",long:"",size:"small",onClick:g=>o.edit(a.id,"reply")},{default:s(()=>[...e[12]||(e[12]=[r(" \u56DE\u590D ",-1)])]),_:1},8,["onClick"]),t(c,{style:{padding:"0"},type:"text",long:"",size:"small",onClick:g=>o.delAlone(a.id)},{default:s(()=>[...e[13]||(e[13]=[r(" \u5220\u9664 ",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),"pagination-left":s(()=>[C("div",ue,[t(B,{gutter:24},{default:s(()=>[t(k,{span:20},{default:s(()=>[t(y,null,{default:s(()=>[t(c,{onClick:o.delBatch},{default:s(()=>[...e[14]||(e[14]=[r(" \u5220\u9664 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})])]),_:1},8,["pagination","row-selection","scroll","columns","data","loading","onPageChange","onPageSizeChange","onChange","onSelectionChange"])]),_:1}),t(U,{isShow:n.modal.reply,type:n.form.type,formId:n.form.id,onOk:e[5]||(e[5]=a=>{n.modal.reply=!1,o.refresh()}),onCancel:e[6]||(e[6]=a=>n.modal.reply=!1)},null,8,["isShow","type","formId"])])}const _e=P(ne,[["render",de]]);export{_e as default};
|