Files
tehran_taj/apps/admin-panel/dist/assets/model-DOsh9ZRP.js
T
s.esmaeiliandClaude Opus 5 53436ec855 chore(release): prepare release/delivery + fix docker env passthrough
DEPLOY-01: docker-compose.yml passed only DATABASE_URL and PORT to the api
service, so JWT_SECRET, JWT_CUSTOMER_SECRET, OTP_MASTER_CODE and every SMS_TREZ_*
variable were silently dropped in Docker. A deployed build would have used the
development JWT fallback and would not have had the delivery master code at all,
so the demo login would have failed with no obvious cause. All are now forwarded,
defaulting to empty (which the code treats as unset); verified with
`docker compose config`.

TEST-01: test-sales-expert-roundtrip.cjs had localhost:3077 hardcoded and could
only connect by accident. Now defaults to the repo's API_PORT. 33/33.

DELIVERY.md documents env vars (names only), run/deploy commands, how migrations
run inside the container, the verification results and the known issues.

release/delivery contains both parity branches with no conflicts (fast-forward).
build 5/5, jest 45/45, admin smoke 43/43, apps smoke 43/43, B2B scan 34/34,
B2B writes 25/25, auth-smoke 32/32, typecheck clean.

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

2 lines
10 KiB
JavaScript

import{c as n,I as Q,d as ve,v as _e,o as f,b as k,n as U,a as y,i as x,w as u,s as me,f as O,h as T,F as R,e as X,U as ye,V as E,p as b,l as F,y as be,x as ge,r as _,t as we}from"./index-JKzARUiG.js";import{S as ke}from"./SettingOutlined-7WAqpvd6.js";import{_ as xe}from"./_plugin-vue_export-helper-DlAUqK2U.js";var Se={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"};function Y(o){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(v){return Object.getOwnPropertyDescriptor(r,v).enumerable}))),s.forEach(function(v){Oe(o,v,r[v])})}return o}function Oe(o,t,r){return t in o?Object.defineProperty(o,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[t]=r,o}var z=function(t,r){var s=Y({},t,r.attrs);return n(Q,Y({},s,{icon:Se}),null)};z.displayName="FilterOutlined";z.inheritAttrs=!1;var Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M820 436h-40c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-40c0-4.4-3.6-8-8-8zm32-104H732V120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM360 180h304v152H360V180zm304 664H360V568h304v276zm200-140H732V500H292v204H160V412c0-6.6 5.4-12 12-12h680c6.6 0 12 5.4 12 12v292z"}}]},name:"printer",theme:"outlined"};function A(o){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},s=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(s=s.concat(Object.getOwnPropertySymbols(r).filter(function(v){return Object.getOwnPropertyDescriptor(r,v).enumerable}))),s.forEach(function(v){Ve(o,v,r[v])})}return o}function Ve(o,t,r){return t in o?Object.defineProperty(o,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[t]=r,o}var D=function(t,r){var s=A({},t,r.attrs);return n(Q,A({},s,{icon:Fe}),null)};D.displayName="PrinterOutlined";D.inheritAttrs=!1;const Ce={class:"x-table"},Pe={class:"x-table__toolbar"},Ue={class:"x-table__search-group"},Te={class:"x-table__actions"},$e={key:0,class:"x-table__add"},Ie={key:0,class:"x-table__filters"},ze={class:"x-table__filter-actions"},De=ve({__name:"XTable",props:{model:{},hasSelection:{type:Boolean,default:!1},modelValue:{default:()=>[]}},emits:["query","update:modelValue"],setup(o,{expose:t,emit:r}){const s=o,v=r,W=b(()=>s.hasSelection?{selectedRowKeys:s.modelValue.map(e=>e.id),onChange:(e,l)=>{v("update:modelValue",l)}}:void 0),H=F([]),V=F(!1),g=F(!1),C=F(void 0),M=F("asc"),a=be({search:void 0,filters:[],total:0,limit:10,page:1}),G={emptyText:"هیج رکوردی یافت نشد."},J=[{value:"=",label:"برابر"},{value:"!=",label:"نامساوی"},{value:"like",label:"شامل"},{value:">",label:"بزرگتر"},{value:">=",label:"بزرگتر مساوی"},{value:"<",label:"کوچکتر"},{value:"<=",label:"کوچکتر مساوی"},{value:"between",label:"بین"}],P=b(()=>{var e;return((e=s.model)==null?void 0:e.cols)??[]}),$=b(()=>P.value.filter(e=>e.show)),K=b(()=>P.value.filter(e=>e.filtered).map(e=>({value:e.__fkey??e.key,label:e.title}))),Z=b(()=>C.value?`${M.value==="asc"?"+":"-"}${C.value}`:void 0),ee=b(()=>$.value.map(e=>{var l;return{key:e.key,title:e.title,dataIndex:e.dataIndex.includes(".")?e.dataIndex.split("."):e.dataIndex,sorter:e.__sorter,width:e.width,__slot:(l=e.scopedSlots)==null?void 0:l.customRender}}));function j(e){return e.__slot}function q(e){if(e)return P.value.find(l=>(l.__fkey??l.key)===e)}function N(e){const l=q(e);if(!((l==null?void 0:l.filterType)!=="select"||!l.filterItems))return Object.entries(l.filterItems).map(([c,d])=>({value:c,label:d}))}function te(e){var l;return((l=q(e))==null?void 0:l.filterType)==="date"}const le=b(()=>{var e;return(e=s.model)!=null&&e._hidePagination?!1:{current:a.page,pageSize:a.limit,total:a.total,showSizeChanger:!0}});function ae(e){var p;const l={};$.value.forEach(m=>{l[m.key]=m.title});const c=$.value.map(m=>m.key),d={search:a.search,filters:a.filters.filter(m=>m.field&&m.op),total:a.total,limit:a.limit,page:a.page,order:Z.value,select:c,titles:l,report_title:(p=s.model)==null?void 0:p.title};return e?{...d,op:e}:d}async function w(e){var l,c,d;if(s.model)try{V.value=!0;const{data:p}=await ge.post(s.model.url,ae(e));H.value=p.rows,a.total=((l=p.query)==null?void 0:l.total)??0,a.page=((c=p.query)==null?void 0:c.page)??a.page,a.limit=((d=p.query)==null?void 0:d.limit)??a.limit,v("query",p.query)}catch(p){throw console.log(p),p}finally{V.value=!1}}function ie(e){a.search=e,a.page=1,w()}function re(){g.value=!g.value,g.value&&a.filters.length===0&&B()}function B(){a.filters.push({id:parseFloat(`${a.filters.length}.${Math.floor(Math.random()*1e3)}`)})}function oe(e){a.filters.splice(e,1)}function ne(){g.value=!1,a.page=1,w()}function se(e,l,c){a.page=e.current??1,a.limit=e.pageSize??a.limit,c!=null&&c.columnKey&&c.order?(C.value=String(c.columnKey),M.value=c.order==="ascend"?"asc":"desc"):C.value=void 0,w()}return _e(()=>{var e;for(const l of((e=s.model)==null?void 0:e.defaultFilters)??[])a.filters.push({id:Math.random(),...l});w()}),t({fetch:w}),(e,l)=>{const c=_("a-input-search"),d=_("a-button"),p=_("a-badge"),m=_("a-tooltip"),ue=_("a-checkbox"),ce=_("a-menu-item"),de=_("a-menu"),he=_("a-dropdown"),I=_("a-select"),pe=_("a-date-picker"),L=_("a-input"),fe=_("a-table");return f(),k("div",Ce,[U("div",Pe,[U("div",Ue,[o.model._hideSearch?x("",!0):(f(),y(c,{key:0,value:a.search,"onUpdate:value":l[0]||(l[0]=i=>a.search=i),placeholder:"جستجو","allow-clear":"",style:{"max-width":"260px"},onSearch:ie},null,8,["value"])),U("div",Te,[o.model._noFilters?x("",!0):(f(),y(p,{key:0,count:a.filters.length},{default:u(()=>[n(d,{type:"text",class:me({"x-table__action--active":g.value}),onClick:re},{icon:u(()=>[n(T(z))]),default:u(()=>[l[2]||(l[2]=O(" فیلتر ",-1))]),_:1},8,["class"])]),_:1},8,["count"])),n(m,{title:"چاپ"},{default:u(()=>[n(d,{type:"text",shape:"circle"},{icon:u(()=>[n(T(D))]),_:1})]),_:1}),n(he,{trigger:["click"]},{overlay:u(()=>[n(de,null,{default:u(()=>[(f(!0),k(R,null,X(P.value,i=>(f(),y(ce,{key:i.key},{default:u(()=>[n(ue,{checked:i.show,"onUpdate:checked":S=>i.show=S},{default:u(()=>[O(we(i.title),1)]),_:2},1032,["checked","onUpdate:checked"])]),_:2},1024))),128))]),_:1})]),default:u(()=>[n(m,{title:"ستون‌ها"},{default:u(()=>[n(d,{type:"text",shape:"circle"},{icon:u(()=>[n(T(ke))]),_:1})]),_:1})]),_:1}),n(m,{title:"بارگذاری مجدد"},{default:u(()=>[n(d,{class:"refresh-btn",type:"text",shape:"circle",loading:V.value,onClick:l[1]||(l[1]=i=>w())},{icon:u(()=>[n(T(ye))]),_:1},8,["loading"])]),_:1})])]),e.$slots.add?(f(),k("div",$e,[E(e.$slots,"add",{},void 0,!0)])):x("",!0)]),g.value?(f(),k("div",Ie,[(f(!0),k(R,null,X(a.filters,(i,S)=>(f(),k("div",{key:i.id,class:"x-table__filter-row"},[n(I,{value:i.field,"onUpdate:value":h=>i.field=h,placeholder:"ستون",style:{width:"180px"},options:K.value},null,8,["value","onUpdate:value","options"]),n(I,{value:i.op,"onUpdate:value":h=>i.op=h,placeholder:"شرط",style:{width:"130px"},options:J},null,8,["value","onUpdate:value"]),N(i.field)?(f(),y(I,{key:0,value:i.value,"onUpdate:value":h=>i.value=h,placeholder:"مقدار",style:{width:"200px"},options:N(i.field)},null,8,["value","onUpdate:value","options"])):te(i.field)?(f(),y(pe,{key:1,value:i.value,"onUpdate:value":h=>i.value=h,placeholder:"مقدار",style:{width:"200px"},"value-format":"YYYY-MM-DD"},null,8,["value","onUpdate:value"])):(f(),y(L,{key:2,value:i.value,"onUpdate:value":h=>i.value=h,placeholder:"مقدار",style:{width:"200px"}},null,8,["value","onUpdate:value"])),i.op==="between"?(f(),y(L,{key:3,value:i.value2,"onUpdate:value":h=>i.value2=h,placeholder:"تا",style:{width:"200px"}},null,8,["value","onUpdate:value"])):x("",!0),n(d,{danger:"",onClick:h=>oe(S)},{default:u(()=>[...l[3]||(l[3]=[O("حذف",-1)])]),_:1},8,["onClick"])]))),128)),U("div",ze,[n(d,{onClick:B},{default:u(()=>[...l[4]||(l[4]=[O("افزودن فیلتر",-1)])]),_:1}),n(d,{type:"primary",onClick:ne},{default:u(()=>[...l[5]||(l[5]=[O("اعمال",-1)])]),_:1})])])):x("",!0),n(fe,{columns:ee.value,"data-source":H.value,loading:V.value,pagination:le.value,locale:G,"row-selection":W.value,"row-key":"id",size:"middle",bordered:"",onChange:se},{bodyCell:u(({column:i,record:S,text:h})=>[j(i)?E(e.$slots,j(i),{text:h,record:S},void 0,!0,0):x("",!0)]),_:3},8,["columns","data-source","loading","pagination","row-selection"])])}}}),qe=xe(De,[["__scopeId","data-v-38ceb800"]]);class Ne{constructor(t,r){this.show=!0,this.__sorter=!0,this.filtered=!1,this.key=t,this.title=r,this.dataIndex=t}__filter(){this.filtered=!0,this.scopedSlots||(this.scopedSlots={}),this.scopedSlots.filterDropdown=`${this.key}_filterDropdown`,this.scopedSlots.filterIcon=`${this.key}_filterIcon`}filterKey(t){return this.__fkey=t,this}renderSlot(t){return this.scopedSlots||(this.scopedSlots={}),this.scopedSlots.customRender=t,this}filterText(){return this.__filter(),this.filterType="default",this}filterSwitch(){return this.__filter(),this.filterType="switch",this}filterQuery(t){return this.__filter(),this.filterType="query",this.filterAction=t,this}filterDate(){return this.__filter(),this.filterType="date",this}filterNumber(){return this.__filter(),this.filterType="number",this}filterSelect(t){return this.__filter(),this.filterType="select",this.filterItems=t,this}noSort(){return this.__sorter=!1,this}hidden(){return this.show=!1,this}setWidth(t){return this.width=t,this}}class Be{constructor(t,r){this.cols=[],this._hidePagination=!1,this._hideSearch=!1,this._noFilters=!1,this.url=t,this.title=r}add(t){return this.cols.push(t),this}addDefaultFilter(t){return this.defaultFilters||(this.defaultFilters=[]),this.defaultFilters.push(t),this}hidePagination(){return this._hidePagination=!0,this}hideSearch(){return this._hideSearch=!0,this}noFilters(){return this._noFilters=!0,this}getSortFields(){return this.cols.filter(t=>t.__sorter)}}export{qe as X,Be as a,Ne as b};