Files
tehran_taj/apps/admin-panel/dist/assets/model-Ccgnj9lY.js
T
s.esmaeiliandClaude Opus 5 d15129168a admin-panel: drop the four redundant add entries from the sidebar
Each of these now has an add button at the top of its own list page, so the
nav entry duplicated it:
  - 'اضافه کردن شخص'  (/customer/add)
  - 'افزودن شعب'      (/branch/add)
  - 'افزودن کارگاه'    (/workshop/add)
  - 'افزودن مدیر'      (/user/create)

Only the adminMenu tree is touched; branchMenu keeps its own /customer/add
entry, since the branch build has no converted add-modal. All four routes
still exist and still work as a direct-link fallback, and the parent
submenus keep their remaining children (including 'دسترسی ها' under مدیران).

Verified in a real browser: menu items 30 -> 26, none of the four labels
render, all four parent submenus still present with their list children,
icons unchanged at 16, no console errors. Committed dist/ artifact rebuilt
to match (force-added, as it is gitignored but deliberately tracked for
Dokploy).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 17:45:30 +03:30

2 lines
7.7 KiB
JavaScript

import{d as ne,v as re,o as r,i as S,h as q,f as _,j as k,g as u,l as v,c as d,F as P,k as R,U as ue,p as m,r as F,y as de,x as ce,e as c,t as he}from"./index-Cv1Zmfn4.js";import{_ as pe}from"./_plugin-vue_export-helper-DlAUqK2U.js";const fe={class:"x-table"},_e={class:"x-table__toolbar"},ve={class:"x-table__actions"},me={key:0,class:"x-table__filters"},ye={class:"x-table__filter-actions"},ge=ne({__name:"XTable",props:{model:{},hasSelection:{type:Boolean,default:!1},modelValue:{default:()=>[]}},emits:["query","update:modelValue"],setup(b,{expose:i,emit:w}){const f=b,V=w,Y=m(()=>f.hasSelection?{selectedRowKeys:f.modelValue.map(e=>e.id),onChange:(e,t)=>{V("update:modelValue",t)}}:void 0),$=F([]),C=F(!1),y=F(!1),U=F(void 0),M=F("asc"),l=de({search:void 0,filters:[],total:0,limit:10,page:1}),O={emptyText:"هیج رکوردی یافت نشد."},j=[{value:"=",label:"برابر"},{value:"!=",label:"نامساوی"},{value:"like",label:"شامل"},{value:">",label:"بزرگتر"},{value:">=",label:"بزرگتر مساوی"},{value:"<",label:"کوچکتر"},{value:"<=",label:"کوچکتر مساوی"},{value:"between",label:"بین"}],T=m(()=>{var e;return((e=f.model)==null?void 0:e.cols)??[]}),I=m(()=>T.value.filter(e=>e.show)),E=m(()=>T.value.filter(e=>e.filtered).map(e=>({value:e.__fkey??e.key,label:e.title}))),A=m(()=>U.value?`${M.value==="asc"?"+":"-"}${U.value}`:void 0),L=m(()=>I.value.map(e=>{var t;return{key:e.key,title:e.title,dataIndex:e.dataIndex.includes(".")?e.dataIndex.split("."):e.dataIndex,sorter:e.__sorter,width:e.width,__slot:(t=e.scopedSlots)==null?void 0:t.customRender}}));function N(e){return e.__slot}function B(e){if(e)return T.value.find(t=>(t.__fkey??t.key)===e)}function X(e){const t=B(e);if(!((t==null?void 0:t.filterType)!=="select"||!t.filterItems))return Object.entries(t.filterItems).map(([s,h])=>({value:s,label:h}))}function Q(e){var t;return((t=B(e))==null?void 0:t.filterType)==="date"}const W=m(()=>{var e;return(e=f.model)!=null&&e._hidePagination?!1:{current:l.page,pageSize:l.limit,total:l.total,showSizeChanger:!0}});function G(e){var o;const t={};I.value.forEach(p=>{t[p.key]=p.title});const s=I.value.map(p=>p.key),h={search:l.search,filters:l.filters.filter(p=>p.field&&p.op),total:l.total,limit:l.limit,page:l.page,order:A.value,select:s,titles:t,report_title:(o=f.model)==null?void 0:o.title};return e?{...h,op:e}:h}async function g(e){var t,s,h;if(f.model)try{C.value=!0;const{data:o}=await ce.post(f.model.url,G(e));$.value=o.rows,l.total=((t=o.query)==null?void 0:t.total)??0,l.page=((s=o.query)==null?void 0:s.page)??l.page,l.limit=((h=o.query)==null?void 0:h.limit)??l.limit,V("query",o.query)}catch(o){throw console.log(o),o}finally{C.value=!1}}function H(e){l.search=e,l.page=1,g()}function J(){y.value=!y.value,y.value&&l.filters.length===0&&z()}function z(){l.filters.push({id:parseFloat(`${l.filters.length}.${Math.floor(Math.random()*1e3)}`)})}function Z(e){l.filters.splice(e,1)}function ee(){y.value=!1,l.page=1,g()}function te(e,t,s){l.page=e.current??1,l.limit=e.pageSize??l.limit,s!=null&&s.columnKey&&s.order?(U.value=String(s.columnKey),M.value=s.order==="ascend"?"asc":"desc"):U.value=void 0,g()}return re(()=>{var e;for(const t of((e=f.model)==null?void 0:e.defaultFilters)??[])l.filters.push({id:Math.random(),...t});g()}),i({fetch:g}),(e,t)=>{const s=c("a-input-search"),h=c("a-badge"),o=c("a-button"),p=c("a-checkbox"),le=c("a-menu-item"),ae=c("a-menu"),ie=c("a-dropdown"),D=c("a-select"),oe=c("a-date-picker"),K=c("a-input"),se=c("a-table");return r(),S("div",fe,[q("div",_e,[b.model._hideSearch?k("",!0):(r(),_(s,{key:0,value:l.search,"onUpdate:value":t[0]||(t[0]=a=>l.search=a),placeholder:"جستجو","allow-clear":"",style:{"max-width":"260px"},onSearch:H},null,8,["value"])),q("div",ve,[b.model._noFilters?k("",!0):(r(),_(o,{key:0,type:y.value?"primary":"default",onClick:J},{default:u(()=>[t[2]||(t[2]=v(" فیلتر ",-1)),l.filters.length?(r(),_(h,{key:0,count:l.filters.length},null,8,["count"])):k("",!0)]),_:1},8,["type"])),d(ie,{trigger:["click"]},{overlay:u(()=>[d(ae,null,{default:u(()=>[(r(!0),S(P,null,R(T.value,a=>(r(),_(le,{key:a.key},{default:u(()=>[d(p,{checked:a.show,"onUpdate:checked":x=>a.show=x},{default:u(()=>[v(he(a.title),1)]),_:2},1032,["checked","onUpdate:checked"])]),_:2},1024))),128))]),_:1})]),default:u(()=>[d(o,null,{default:u(()=>[...t[3]||(t[3]=[v("ستون‌ها",-1)])]),_:1})]),_:1}),d(o,{class:"refresh-btn",loading:C.value,onClick:t[1]||(t[1]=a=>g())},{default:u(()=>[...t[4]||(t[4]=[v("بارگذاری مجدد",-1)])]),_:1},8,["loading"])])]),y.value?(r(),S("div",me,[(r(!0),S(P,null,R(l.filters,(a,x)=>(r(),S("div",{key:a.id,class:"x-table__filter-row"},[d(D,{value:a.field,"onUpdate:value":n=>a.field=n,placeholder:"ستون",style:{width:"180px"},options:E.value},null,8,["value","onUpdate:value","options"]),d(D,{value:a.op,"onUpdate:value":n=>a.op=n,placeholder:"شرط",style:{width:"130px"},options:j},null,8,["value","onUpdate:value"]),X(a.field)?(r(),_(D,{key:0,value:a.value,"onUpdate:value":n=>a.value=n,placeholder:"مقدار",style:{width:"200px"},options:X(a.field)},null,8,["value","onUpdate:value","options"])):Q(a.field)?(r(),_(oe,{key:1,value:a.value,"onUpdate:value":n=>a.value=n,placeholder:"مقدار",style:{width:"200px"},"value-format":"YYYY-MM-DD"},null,8,["value","onUpdate:value"])):(r(),_(K,{key:2,value:a.value,"onUpdate:value":n=>a.value=n,placeholder:"مقدار",style:{width:"200px"}},null,8,["value","onUpdate:value"])),a.op==="between"?(r(),_(K,{key:3,value:a.value2,"onUpdate:value":n=>a.value2=n,placeholder:"تا",style:{width:"200px"}},null,8,["value","onUpdate:value"])):k("",!0),d(o,{danger:"",onClick:n=>Z(x)},{default:u(()=>[...t[5]||(t[5]=[v("حذف",-1)])]),_:1},8,["onClick"])]))),128)),q("div",ye,[d(o,{onClick:z},{default:u(()=>[...t[6]||(t[6]=[v("افزودن فیلتر",-1)])]),_:1}),d(o,{type:"primary",onClick:ee},{default:u(()=>[...t[7]||(t[7]=[v("اعمال",-1)])]),_:1})])])):k("",!0),d(se,{columns:L.value,"data-source":$.value,loading:C.value,pagination:W.value,locale:O,"row-selection":Y.value,"row-key":"id",size:"middle",bordered:"",onChange:te},{bodyCell:u(({column:a,record:x,text:n})=>[N(a)?ue(e.$slots,N(a),{text:n,record:x},void 0,!0,0):k("",!0)]),_:3},8,["columns","data-source","loading","pagination","row-selection"])])}}}),we=pe(ge,[["__scopeId","data-v-c07387ba"]]);class xe{constructor(i,w){this.show=!0,this.__sorter=!0,this.filtered=!1,this.key=i,this.title=w,this.dataIndex=i}__filter(){this.filtered=!0,this.scopedSlots||(this.scopedSlots={}),this.scopedSlots.filterDropdown=`${this.key}_filterDropdown`,this.scopedSlots.filterIcon=`${this.key}_filterIcon`}filterKey(i){return this.__fkey=i,this}renderSlot(i){return this.scopedSlots||(this.scopedSlots={}),this.scopedSlots.customRender=i,this}filterText(){return this.__filter(),this.filterType="default",this}filterSwitch(){return this.__filter(),this.filterType="switch",this}filterQuery(i){return this.__filter(),this.filterType="query",this.filterAction=i,this}filterDate(){return this.__filter(),this.filterType="date",this}filterNumber(){return this.__filter(),this.filterType="number",this}filterSelect(i){return this.__filter(),this.filterType="select",this.filterItems=i,this}noSort(){return this.__sorter=!1,this}hidden(){return this.show=!1,this}setWidth(i){return this.width=i,this}}class Se{constructor(i,w){this.cols=[],this._hidePagination=!1,this._hideSearch=!1,this._noFilters=!1,this.url=i,this.title=w}add(i){return this.cols.push(i),this}addDefaultFilter(i){return this.defaultFilters||(this.defaultFilters=[]),this.defaultFilters.push(i),this}hidePagination(){return this._hidePagination=!0,this}hideSearch(){return this._hideSearch=!0,this}noFilters(){return this._noFilters=!0,this}getSortFields(){return this.cols.filter(i=>i.__sorter)}}export{we as X,Se as a,xe as b};