Files
tehran_taj/apps/admin-panel/dist/assets/Comments-DPjbyXx2.js
T
s.esmaeiliandClaude Sonnet 5 a2ab9ba192 admin-panel: drop six more redundant add entries from the sidebar
Each now has an add button at the top of its own list page, so the nav
entry duplicated it:
  - 'افزودن دسته بندی'          (/category/add)
  - 'وارد کردن سند مالی مشتری'  (/add/findoc)
  - 'تعریف تخفیف  تک'           (/major/promotion/tak/add)
  - 'تعریف تخفیف  عمده'         (/major/promotion/add)
  - 'افزودن فاکتور'             (/invoice/add)
  - 'افزودن شهر'                (/city/create)

Only adminMenu is touched; all six routes still exist and still work as a
direct-link fallback. Parent submenus keep their remaining children
('تخفیف اتوماتیک' and 'لیست تخفیفات ' both still sit under 'تخفیفات', for
instance).

Verified in a real browser: menu items 26 -> 20, none of the six labels
render, all five parent submenus (دسته بندی ها، اسناد مالی، تخفیفات، فاکتور
انتقال، شهر ها) still present with their list children, icons unchanged at
16, no console errors. Committed dist/ artifact rebuilt to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-14 19:43:40 +03:30

2 lines
6.6 KiB
JavaScript

import{_ as G}from"./henza-icon-DJ1pqeD1.js";import{a as J,b as p,X as K}from"./model-d1Prdbon.js";import{_ as z}from"./TooltipBtn.vue_vue_type_script_setup_true_lang-LSOTzQP2.js";import{b as X,d as Q,i as N,c as m,g as o,e as u,o as i,n as C,h as a,f as d,j as y,l as c,t as w,H as W,z as _,r as h,p as V,x as B}from"./index-BhesYFRn.js";import{U as Y}from"./icons-MICjc-88.js";import{_ as Z}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./UnorderedListOutlined-wfihx1Ro.js";import"./TeamOutlined-D8v3LQ4l.js";import"./CreditCardOutlined-B5AuqjiO.js";function ee(){const x=X(),r=new J("admin/comments/list","لیست دیدگاه ها");return r.add(new p("product_id","شناسه محصول").filterNumber().hidden()),r.add(new p("product.title","نام محصول").filterNumber().renderSlot("productName")),r.add(new p("customer.id","شناسه نویسنده دیدگاه").filterNumber().hidden()),r.add(new p("customer","نام نویسنده ").filterText().renderSlot("customer")),r.add(new p("reply","پاسخ").renderSlot("reply").noSort()),r.add(new p("sts","وضعیت").renderSlot("sts").noSort()),x.roles&&x.roles.includes("comment.state")&&r.add(new p("changeState","تغییر وضعیت").renderSlot("changeState").noSort()),r.add(new p("opt","عملیات").noSort().renderSlot("opt")),r}const te={id:"page-user-list"},oe=["href"],ne=["onClick"],se=["onClick"],le={class:"flex"},ae={key:0,class:"comments-list"},me={class:"comment-item"},ie={class:"img"},re={class:"comment-body"},ue={class:"time"},de={class:"comment-item"},ce={class:"comment-body"},pe={key:0,class:"time"},_e=Q({__name:"Comments",setup(x){const r=X(),v=n=>!!r.hasPermission(n),D=ee(),S=h(null),l=h(void 0),k=h(!1),$=h(""),g=h(""),I=V(()=>{var n;return $.value!==(((n=l.value)==null?void 0:n.comment)??"")}),E=V(()=>{var n,e,s;return g.value!==(((s=(e=(n=l.value)==null?void 0:n.reply)==null?void 0:e[0])==null?void 0:s.comment)??"")});function L(n){var s,f;return`https://henzagold.com/product/${String(((s=n.product)==null?void 0:s.title)??"").split(" ").join("-")}/${(f=n.product)==null?void 0:f.id}`}async function T(n,e){var s;try{await B.post("comment/sts",{id:n,sts:e}),_.info("تغییرات ثبت شد "),(s=S.value)==null||s.fetch()}catch{_.error("خطا در تغییر وضعیت")}}function O(n){var e,s;l.value=n,$.value=n.comment??"",g.value=((s=(e=n.reply)==null?void 0:e[0])==null?void 0:s.comment)??"",k.value=!0}async function P(n){var e;try{await B.delete(`comment/${n}`),_.info("دیدگاه حذف شد"),(e=S.value)==null||e.fetch()}catch{_.error("خطا در حذف")}}async function H(n){var e;try{await B.post("comment",{product_id:n.product_id,customer_id:n.customer_id,comment:g.value,reply_to:n.id}),_.info("تغییرات ثبت شد "),k.value=!1,(e=S.value)==null||e.fetch()}catch{_.error("خطا در ثبت تغییرات")}}return(n,e)=>{const s=u("a-tag"),f=u("a-menu-item"),M=u("a-menu"),q=u("a-dropdown"),j=u("a-textarea"),R=u("a-form-item"),U=u("a-button"),A=u("a-modal"),F=u("a-card");return i(),N("div",te,[m(F,{title:"لیست دیدگاه ها"},{default:o(()=>[m(K,{ref_key:"tbl",ref:S,model:C(D)},{customer:o(({text:t})=>[c(w(t&&t.fname&&t.lname?`${t.fname} ${t.lname}`:"بدون نام"),1)]),productName:o(({record:t})=>[a("a",{href:L(t),target:"_blank"},w(t.product.title),9,oe)]),sts:o(({text:t})=>[t==1?(i(),d(s,{key:0},{default:o(()=>[...e[6]||(e[6]=[c("در انتظار تایید",-1)])]),_:1})):t==2?(i(),d(s,{key:1,color:"green"},{default:o(()=>[...e[7]||(e[7]=[c("تایید شده",-1)])]),_:1})):(i(),d(s,{key:2,color:"red"},{default:o(()=>[...e[8]||(e[8]=[c("عدم تایید",-1)])]),_:1}))]),reply:o(({text:t})=>[t&&t.length>0&&t[0].comment!==null?(i(),d(s,{key:0,color:"green"},{default:o(()=>[...e[9]||(e[9]=[c(" پاسخ داده شده ",-1)])]),_:1})):(i(),d(s,{key:1},{default:o(()=>[...e[10]||(e[10]=[c("بدون پاسخ",-1)])]),_:1}))]),changeState:o(({record:t})=>[v("comment.state")?(i(),d(q,{key:0},{overlay:o(()=>[m(M,null,{default:o(()=>[m(f,null,{default:o(()=>[a("div",{onClick:b=>t.sts!==2?T(t.id,2):C(_).error("حالت فعلی تایید می باشد")}," تایید ",8,ne)]),_:2},1024),m(f,{class:"red"},{default:o(()=>[a("div",{onClick:b=>t.sts!==3?T(t.id,3):C(_).error("حالت فعلی عدم تایید می باشد")}," عدم تایید ",8,se)]),_:2},1024)]),_:2},1024)]),default:o(()=>[m(s,{style:{cursor:"pointer"},color:t.sts===1?"":t.sts===2?"green":t.sts===3?"red":"",onClick:e[0]||(e[0]=b=>b.preventDefault())},{default:o(()=>[c(w(t.sts===1?"در انتظار تایید":t.sts===2?"تایید":"عدم تایید")+" ",1),m(C(W))]),_:2},1032,["color"])]),_:2},1024)):y("",!0)]),opt:o(({record:t})=>[a("div",le,[v("comment.view")?(i(),d(z,{key:0,"icon-class":"w-5 h-5 text-primary",class:"mr-3",icon:"EyeIcon",title:"مشاهده دیدگاه",onClick:b=>O(t)},null,8,["onClick"])):y("",!0),v("comment.remove")?(i(),d(z,{key:1,"icon-class":"w-5 h-5 text-danger",class:"mr-3",icon:"TrashIcon","pop-title":"دیدگاه حذف شود؟",onClick:b=>P(t.id)},null,8,["onClick"])):y("",!0)])]),_:1},8,["model"]),m(A,{open:k.value,"onUpdate:open":e[5]||(e[5]=t=>k.value=t),title:"مشاهده دیدگاه",width:"80%"},{footer:o(()=>[m(U,{onClick:e[4]||(e[4]=t=>k.value=!1)},{default:o(()=>[...e[14]||(e[14]=[c("بستن",-1)])]),_:1})]),default:o(()=>[l.value?(i(),N("div",ae,[a("ul",null,[a("li",me,[a("span",ie,[m(C(Y),{style:{"font-size":"48px",color:"#1c2d56"}})]),a("div",re,[a("h5",null,w(l.value.customer&&l.value.customer.fname&&l.value.customer.lname?`${l.value.customer.fname} ${l.value.customer.lname}`:"بدون نام"),1),a("span",ue," ارسال شده در تاریخ : "+w(l.value.caj?String(l.value.caj).split("-")[0]:null),1),m(R,{style:{width:"100%"}},{default:o(()=>[m(j,{value:$.value,"onUpdate:value":e[1]||(e[1]=t=>$.value=t),disabled:!v("comment.view.edit"),"auto-size":{minRows:3,maxRows:5}},null,8,["value","disabled"])]),_:1})]),a("ul",null,[a("li",de,[e[13]||(e[13]=a("img",{src:G,alt:"comment author",class:"img border"},null,-1)),a("div",ce,[e[12]||(e[12]=a("h5",null,"ادمین",-1)),l.value.reply&&l.value.reply[0]?(i(),N("span",pe," ارسال شده در تاریخ : "+w(l.value.reply[0].caj?String(l.value.reply[0].caj).split("-")[0]:""),1)):y("",!0),m(R,{style:{width:"100%"}},{default:o(()=>[m(j,{value:g.value,"onUpdate:value":e[2]||(e[2]=t=>g.value=t),disabled:!v("comment.view.edit"),"auto-size":{minRows:3,maxRows:5}},null,8,["value","disabled"])]),_:1}),(E.value||I.value)&&v("comment.view.edit")?(i(),d(U,{key:1,class:"mr-4",onClick:e[3]||(e[3]=t=>H(l.value))},{default:o(()=>[...e[11]||(e[11]=[c(" ثبت تغییرات ",-1)])]),_:1})):y("",!0)])])])])])])):y("",!0)]),_:1},8,["open"])]),_:1})])}}}),Se=Z(_e,[["__scopeId","data-v-17bd422b"]]);export{Se as default};