paas-component-library 1.0.96 → 1.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/paas-ui.js +8 -3
- package/dist/paas-ui.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/PaasMenu/index.vue +16 -10
package/dist/paas-ui.js
CHANGED
|
@@ -556,7 +556,12 @@ const i9e = /* @__PURE__ */ hr(r9e, [["render", n9e]]), a9e = {
|
|
|
556
556
|
let r = window.location.hash || "";
|
|
557
557
|
if (r = r.replace("#", "").split("?")[0], !this.data || this.data.length === 0) return;
|
|
558
558
|
let e = null, t = this.current;
|
|
559
|
-
r && r !== "/"
|
|
559
|
+
if (r && r !== "/") {
|
|
560
|
+
if (e = this.findItemByKey(this.data, r), e || (e = this.findItemByPathPrefix(this.data, r)), !e)
|
|
561
|
+
return;
|
|
562
|
+
} else
|
|
563
|
+
t && (e = this.findItemByKey(this.data, t)), e || (e = this.findFirstLeaf(this.data));
|
|
564
|
+
e && (this.selectAndOpenMenu(e), this.$router.push(e.key));
|
|
560
565
|
},
|
|
561
566
|
selectAndOpenMenu(r) {
|
|
562
567
|
this.selectedKeys = [r.key];
|
|
@@ -582,7 +587,7 @@ const i9e = /* @__PURE__ */ hr(r9e, [["render", n9e]]), a9e = {
|
|
|
582
587
|
findItemByPathPrefix(r, e) {
|
|
583
588
|
if (!r || !e) return null;
|
|
584
589
|
for (const t of r) {
|
|
585
|
-
if (e
|
|
590
|
+
if (e === t.key)
|
|
586
591
|
return t;
|
|
587
592
|
if (t.children) {
|
|
588
593
|
const n = this.findItemByPathPrefix(t.children, e);
|
|
@@ -692,7 +697,7 @@ function h9e(r, e, t, n, i, o) {
|
|
|
692
697
|
])
|
|
693
698
|
]);
|
|
694
699
|
}
|
|
695
|
-
const d9e = /* @__PURE__ */ hr(a9e, [["render", h9e], ["__scopeId", "data-v-
|
|
700
|
+
const d9e = /* @__PURE__ */ hr(a9e, [["render", h9e], ["__scopeId", "data-v-16bf3410"]]);
|
|
696
701
|
var p9e = typeof global == "object" && global && global.Object === Object && global, v9e = typeof self == "object" && self && self.Object === Object && self, tne = p9e || v9e || Function("return this")(), Q0 = tne.Symbol, rne = Object.prototype, m9e = rne.hasOwnProperty, g9e = rne.toString, P1 = Q0 ? Q0.toStringTag : void 0;
|
|
697
702
|
function O9e(r) {
|
|
698
703
|
var e = m9e.call(r, P1), t = r[P1];
|
package/dist/paas-ui.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Zt,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("vue"),require("ant-design-vue")):typeof define=="function"&&define.amd?define(["exports","vue","ant-design-vue"],A):(Zt=typeof globalThis<"u"?globalThis:Zt||self,A(Zt["pass-ui"]={},Zt.Vue,Zt.AntDesignVue))})(this,(function(Zt,A,Er){"use strict";var Fl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wo(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $d={exports:{}},Vce=$d.exports,_k;function Bce(){return _k||(_k=1,(function(r,e){(function(t,n){r.exports=n()})(Vce,(function(){var t=1e3,n=6e4,i=36e5,o="millisecond",s="second",d="minute",f="hour",p="day",v="week",m="month",O="quarter",b="year",S="date",w="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Q){var U=["th","st","nd","rd"],re=Q%100;return"["+Q+(U[(re-20)%10]||U[re]||U[0])+"]"}},_=function(Q,U,re){var K=String(Q);return!K||K.length>=U?Q:""+Array(U+1-K.length).join(re)+Q},k={s:_,z:function(Q){var U=-Q.utcOffset(),re=Math.abs(U),K=Math.floor(re/60),ne=re%60;return(U<=0?"+":"-")+_(K,2,"0")+":"+_(ne,2,"0")},m:function Q(U,re){if(U.date()<re.date())return-Q(re,U);var K=12*(re.year()-U.year())+(re.month()-U.month()),ne=U.clone().add(K,m),se=re-ne<0,ie=U.clone().add(K+(se?-1:1),m);return+(-(K+(re-ne)/(se?ne-ie:ie-ne))||0)},a:function(Q){return Q<0?Math.ceil(Q)||0:Math.floor(Q)},p:function(Q){return{M:m,y:b,w:v,d:p,D:S,h:f,m:d,s,ms:o,Q:O}[Q]||String(Q||"").toLowerCase().replace(/s$/,"")},u:function(Q){return Q===void 0}},j="en",L={};L[j]=M;var R="$isDayjsObject",D=function(Q){return Q instanceof N||!(!Q||!Q[R])},F=function Q(U,re,K){var ne;if(!U)return j;if(typeof U=="string"){var se=U.toLowerCase();L[se]&&(ne=se),re&&(L[se]=re,ne=se);var ie=U.split("-");if(!ne&&ie.length>1)return Q(ie[0])}else{var te=U.name;L[te]=U,ne=te}return!K&&ne&&(j=ne),ne||!K&&j},B=function(Q,U){if(D(Q))return Q.clone();var re=typeof U=="object"?U:{};return re.date=Q,re.args=arguments,new N(re)},$=k;$.l=F,$.i=D,$.w=function(Q,U){return B(Q,{locale:U.$L,utc:U.$u,x:U.$x,$offset:U.$offset})};var N=(function(){function Q(re){this.$L=F(re.locale,null,!0),this.parse(re),this.$x=this.$x||re.x||{},this[R]=!0}var U=Q.prototype;return U.parse=function(re){this.$d=(function(K){var ne=K.date,se=K.utc;if(ne===null)return new Date(NaN);if($.u(ne))return new Date;if(ne instanceof Date)return new Date(ne);if(typeof ne=="string"&&!/Z$/i.test(ne)){var ie=ne.match(x);if(ie){var te=ie[2]-1||0,oe=(ie[7]||"0").substring(0,3);return se?new Date(Date.UTC(ie[1],te,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,oe)):new Date(ie[1],te,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,oe)}}return new Date(ne)})(re),this.init()},U.init=function(){var re=this.$d;this.$y=re.getFullYear(),this.$M=re.getMonth(),this.$D=re.getDate(),this.$W=re.getDay(),this.$H=re.getHours(),this.$m=re.getMinutes(),this.$s=re.getSeconds(),this.$ms=re.getMilliseconds()},U.$utils=function(){return $},U.isValid=function(){return this.$d.toString()!==w},U.isSame=function(re,K){var ne=B(re);return this.startOf(K)<=ne&&ne<=this.endOf(K)},U.isAfter=function(re,K){return B(re)<this.startOf(K)},U.isBefore=function(re,K){return this.endOf(K)<B(re)},U.$g=function(re,K,ne){return $.u(re)?this[K]:this.set(ne,re)},U.unix=function(){return Math.floor(this.valueOf()/1e3)},U.valueOf=function(){return this.$d.getTime()},U.startOf=function(re,K){var ne=this,se=!!$.u(K)||K,ie=$.p(re),te=function(je,Ve){var Ue=$.w(ne.$u?Date.UTC(ne.$y,Ve,je):new Date(ne.$y,Ve,je),ne);return se?Ue:Ue.endOf(p)},oe=function(je,Ve){return $.w(ne.toDate()[je].apply(ne.toDate("s"),(se?[0,0,0,0]:[23,59,59,999]).slice(Ve)),ne)},pe=this.$W,Pe=this.$M,me=this.$D,ue="set"+(this.$u?"UTC":"");switch(ie){case b:return se?te(1,0):te(31,11);case m:return se?te(1,Pe):te(0,Pe+1);case v:var we=this.$locale().weekStart||0,Ee=(pe<we?pe+7:pe)-we;return te(se?me-Ee:me+(6-Ee),Pe);case p:case S:return oe(ue+"Hours",0);case f:return oe(ue+"Minutes",1);case d:return oe(ue+"Seconds",2);case s:return oe(ue+"Milliseconds",3);default:return this.clone()}},U.endOf=function(re){return this.startOf(re,!1)},U.$set=function(re,K){var ne,se=$.p(re),ie="set"+(this.$u?"UTC":""),te=(ne={},ne[p]=ie+"Date",ne[S]=ie+"Date",ne[m]=ie+"Month",ne[b]=ie+"FullYear",ne[f]=ie+"Hours",ne[d]=ie+"Minutes",ne[s]=ie+"Seconds",ne[o]=ie+"Milliseconds",ne)[se],oe=se===p?this.$D+(K-this.$W):K;if(se===m||se===b){var pe=this.clone().set(S,1);pe.$d[te](oe),pe.init(),this.$d=pe.set(S,Math.min(this.$D,pe.daysInMonth())).$d}else te&&this.$d[te](oe);return this.init(),this},U.set=function(re,K){return this.clone().$set(re,K)},U.get=function(re){return this[$.p(re)]()},U.add=function(re,K){var ne,se=this;re=Number(re);var ie=$.p(K),te=function(Pe){var me=B(se);return $.w(me.date(me.date()+Math.round(Pe*re)),se)};if(ie===m)return this.set(m,this.$M+re);if(ie===b)return this.set(b,this.$y+re);if(ie===p)return te(1);if(ie===v)return te(7);var oe=(ne={},ne[d]=n,ne[f]=i,ne[s]=t,ne)[ie]||1,pe=this.$d.getTime()+re*oe;return $.w(pe,this)},U.subtract=function(re,K){return this.add(-1*re,K)},U.format=function(re){var K=this,ne=this.$locale();if(!this.isValid())return ne.invalidDate||w;var se=re||"YYYY-MM-DDTHH:mm:ssZ",ie=$.z(this),te=this.$H,oe=this.$m,pe=this.$M,Pe=ne.weekdays,me=ne.months,ue=ne.meridiem,we=function(Ve,Ue,Le,De){return Ve&&(Ve[Ue]||Ve(K,se))||Le[Ue].slice(0,De)},Ee=function(Ve){return $.s(te%12||12,Ve,"0")},je=ue||function(Ve,Ue,Le){var De=Ve<12?"AM":"PM";return Le?De.toLowerCase():De};return se.replace(C,(function(Ve,Ue){return Ue||(function(Le){switch(Le){case"YY":return String(K.$y).slice(-2);case"YYYY":return $.s(K.$y,4,"0");case"M":return pe+1;case"MM":return $.s(pe+1,2,"0");case"MMM":return we(ne.monthsShort,pe,me,3);case"MMMM":return we(me,pe);case"D":return K.$D;case"DD":return $.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return we(ne.weekdaysMin,K.$W,Pe,2);case"ddd":return we(ne.weekdaysShort,K.$W,Pe,3);case"dddd":return Pe[K.$W];case"H":return String(te);case"HH":return $.s(te,2,"0");case"h":return Ee(1);case"hh":return Ee(2);case"a":return je(te,oe,!0);case"A":return je(te,oe,!1);case"m":return String(oe);case"mm":return $.s(oe,2,"0");case"s":return String(K.$s);case"ss":return $.s(K.$s,2,"0");case"SSS":return $.s(K.$ms,3,"0");case"Z":return ie}return null})(Ve)||ie.replace(":","")}))},U.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},U.diff=function(re,K,ne){var se,ie=this,te=$.p(K),oe=B(re),pe=(oe.utcOffset()-this.utcOffset())*n,Pe=this-oe,me=function(){return $.m(ie,oe)};switch(te){case b:se=me()/12;break;case m:se=me();break;case O:se=me()/3;break;case v:se=(Pe-pe)/6048e5;break;case p:se=(Pe-pe)/864e5;break;case f:se=Pe/i;break;case d:se=Pe/n;break;case s:se=Pe/t;break;default:se=Pe}return ne?se:$.a(se)},U.daysInMonth=function(){return this.endOf(m).$D},U.$locale=function(){return L[this.$L]},U.locale=function(re,K){if(!re)return this.$L;var ne=this.clone(),se=F(re,K,!0);return se&&(ne.$L=se),ne},U.clone=function(){return $.w(this.$d,this)},U.toDate=function(){return new Date(this.valueOf())},U.toJSON=function(){return this.isValid()?this.toISOString():null},U.toISOString=function(){return this.$d.toISOString()},U.toString=function(){return this.$d.toUTCString()},Q})(),I=N.prototype;return B.prototype=I,[["$ms",o],["$s",s],["$m",d],["$H",f],["$W",p],["$M",m],["$y",b],["$D",S]].forEach((function(Q){I[Q[1]]=function(U){return this.$g(U,Q[0],Q[1])}})),B.extend=function(Q,U){return Q.$i||(Q(U,N,B),Q.$i=!0),B},B.locale=F,B.isDayjs=D,B.unix=function(Q){return B(1e3*Q)},B.en=L[j],B.Ls=L,B.p={},B}))})($d)),$d.exports}var Ice=Bce();const an=wo(Ice);var Dd={exports:{}},Hce=Dd.exports,Mk;function Fce(){return Mk||(Mk=1,(function(r,e){(function(t,n){r.exports=n()})(Hce,(function(){return function(t,n){n.prototype.weekday=function(i){var o=this.$locale().weekStart||0,s=this.$W,d=(s<o?s+7:s)-o;return this.$utils().u(i)?d:this.subtract(d,"day").add(i,"day")}}}))})(Dd)),Dd.exports}var Qce=Fce();const Ld=wo(Qce);var Nd={exports:{}},Wce=Nd.exports,Ek;function Uce(){return Ek||(Ek=1,(function(r,e){(function(t,n){r.exports=n()})(Wce,(function(){return function(t,n,i){var o=n.prototype,s=function(m){return m&&(m.indexOf?m:m.s)},d=function(m,O,b,S,w){var x=m.name?m:m.$locale(),C=s(x[O]),M=s(x[b]),_=C||M.map((function(j){return j.slice(0,S)}));if(!w)return _;var k=x.weekStart;return _.map((function(j,L){return _[(L+(k||0))%7]}))},f=function(){return i.Ls[i.locale()]},p=function(m,O){return m.formats[O]||(function(b){return b.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,w,x){return w||x.slice(1)}))})(m.formats[O.toUpperCase()])},v=function(){var m=this;return{months:function(O){return O?O.format("MMMM"):d(m,"months")},monthsShort:function(O){return O?O.format("MMM"):d(m,"monthsShort","months",3)},firstDayOfWeek:function(){return m.$locale().weekStart||0},weekdays:function(O){return O?O.format("dddd"):d(m,"weekdays")},weekdaysMin:function(O){return O?O.format("dd"):d(m,"weekdaysMin","weekdays",2)},weekdaysShort:function(O){return O?O.format("ddd"):d(m,"weekdaysShort","weekdays",3)},longDateFormat:function(O){return p(m.$locale(),O)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return v.bind(this)()},i.localeData=function(){var m=f();return{firstDayOfWeek:function(){return m.weekStart||0},weekdays:function(){return i.weekdays()},weekdaysShort:function(){return i.weekdaysShort()},weekdaysMin:function(){return i.weekdaysMin()},months:function(){return i.months()},monthsShort:function(){return i.monthsShort()},longDateFormat:function(O){return p(m,O)},meridiem:m.meridiem,ordinal:m.ordinal}},i.months=function(){return d(f(),"months")},i.monthsShort=function(){return d(f(),"monthsShort","months",3)},i.weekdays=function(m){return d(f(),"weekdays",null,null,m)},i.weekdaysShort=function(m){return d(f(),"weekdaysShort","weekdays",3,m)},i.weekdaysMin=function(m){return d(f(),"weekdaysMin","weekdays",2,m)}}}))})(Nd)),Nd.exports}var Xce=Uce();const Vd=wo(Xce),or=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t};an.extend(Ld),an.extend(Vd),an.locale("zh-cn");const Zce={name:"PaasDate",inheritAttrs:!1,computed:{see(){return this.$store?.forms?.see||!1},formattedValue(){return this.modelValue?Array.isArray(this.modelValue)?this.modelValue.map(r=>r?an(r):null):an.isDayjs(this.modelValue)?this.modelValue:an(this.modelValue):null}},props:{placeholder:{type:String,default:""},type:{type:String,default:"date"},icon:String,readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},modelValue:{type:[String,Array,Date],default:null},showTime:{type:Boolean,default:!1},format:{type:String,default:"YYYY-MM-DD"},onChange:{type:Function,default:null},style:{type:[String,Object],default:"width: 100%;"}},data(){return{}},methods:{handleChange(r){this.onChange&&this.onChange(r),Array.isArray(r)?this.$emit("update:modelValue",r.map(e=>e?.format(this.format||"YYYY-MM-DD"))):this.$emit("update:modelValue",r?.format(this.format||"YYYY-MM-DD"))}}};function qce(r,e,t,n,i,o){const s=A.resolveComponent("a-date-picker");return A.openBlock(),A.createBlock(s,A.mergeProps({"show-time":t.showTime,readonly:t.readonly,disabled:o.see||t.disabled,value:o.formattedValue,format:t.format,picker:t.type,onChange:o.handleChange,placeholder:t.placeholder,style:t.style},r.$attrs),null,16,["show-time","readonly","disabled","value","format","picker","onChange","placeholder","style"])}const kk=or(Zce,[["render",qce]]),Yce={name:"PaasMenu",components:{AMenu:Er.Menu,ASubMenu:Er.Menu.SubMenu,AMenuItem:Er.Menu.Item},props:{url:String,logoSrc:String,logoAlt:{type:String,default:"System Logo"},disabled:{type:Boolean,default:!1},theme:{type:String,default:"light"},selected:{type:String,default:""},mode:{type:String,default:"inline"},inlineCollapsed:{type:Boolean,default:!1}},data(){return{selectedKeys:this.selected?[this.selected]:[],selectValue:"",selectMenuOpend:!1,hostname:window.location.protocol+"//"+window.location.host}},computed:{current(){return this.$store.menus.current},menuOptions(){return this.$store.menus.menuOptions||[]},openKeys(){return this.$store.menus.openKeys},data(){return this.$store.menus.data}},watch:{selected(r){this.selectedKeys=r?[r]:[]},url(r){r?this.$post(r).then(e=>{this.$store.setMenuData(e.data.data),this.autoSelectMenu()}):this.data.length>0&&this.autoSelectMenu()},data(r){r.length>0&&!this.selectedKeys.length&&this.autoSelectMenu()}},beforeUnmount(){this.$bus.off("selectAndOpenMenu")},mounted(){this.$store.loginFlag&&this.data.length===0?this.$post(this.url).then(r=>{this.$store.setMenuData(r.data.data),this.autoSelectMenu()}):this.data.length>0&&this.autoSelectMenu(),this.$bus.on("selectAndOpenMenu",r=>{this.selectAndOpenMenu(r)})},methods:{renderIcon(r){let e="";r.icon?e=r.icon:e=this.selectedKeys.includes(r.key)?"FolderOpenOutlined":"FolderOutlined";try{const t=A.resolveComponent(e);return()=>A.h(t)}catch{return null}},autoSelectMenu(){let r=window.location.hash||"";if(r=r.replace("#","").split("?")[0],!this.data||this.data.length===0)return;let e=null,t=this.current;r&&r!=="/"&&(e=this.findItemByKey(this.data,r),e||(e=this.findItemByPathPrefix(this.data,r))),!e&&t&&(e=this.findItemByKey(this.data,t)),e||(e=this.findFirstLeaf(this.data)),e&&this.selectAndOpenMenu(e)},selectAndOpenMenu(r){this.selectedKeys=[r.key];const e=this.getParentKeys(this.data,r.key);this.$store.setOpenKeys(e),this.$store.setCurrent(r.key),this.$store.setTitle(r.title),this.$store.setMenuId(r.id),this.$store.setButtons(r.buttons||[]),this.$store.setMenuCache({key:r.key,title:r.title,id:r.id,buttons:r.buttons||[]})},findItemByKey(r,e){if(!r||e===null)return null;for(const t of r){if(t.key===e)return t;if(t.children){const n=this.findItemByKey(t.children,e);if(n)return n}}return null},findItemByPathPrefix(r,e){if(!r||!e)return null;for(const t of r){if(e.startsWith(t.key+"/")||e===t.key)return t;if(t.children){const n=this.findItemByPathPrefix(t.children,e);if(n)return n}}return null},findFirstLeaf(r){for(const e of r)if(e.children&&e.children.length>0){const t=this.findFirstLeaf(e.children);if(t)return t}else return e;return null},getParentKeys(r,e,t=[]){for(const n of r){if(n.key===e)return t;if(n.children){const i=this.getParentKeys(n.children,e,[...t,n.key]);if(i.length)return i}}return[]},menuSelect(r){this.selectAndOpenMenu(r),this.$router.push(r.key)},onOpenChange(r){const e=r.find(t=>!this.openKeys.includes(t));e?this.$store.setOpenKeys([e]):this.$store.setOpenKeys([])},selectMenuClick(){if(!this.selectValue){this.selectMenuOpend=!1;return}this.selectMenuOpend=!0}}},Gce={class:"paas-menu-container"},Jce={class:"paas-menu-header"},Kce={key:0,class:"paas-menu-logo"},eue=["src","alt"],tue={class:"paas-menu-system-name"},rue={class:"paas-menu-scroll-wrapper"};function nue(r,e,t,n,i,o){const s=A.resolveComponent("a-menu-item"),d=A.resolveComponent("a-sub-menu"),f=A.resolveComponent("a-menu");return A.openBlock(),A.createElementBlock("div",Gce,[A.createElementVNode("div",Jce,[t.logoSrc?(A.openBlock(),A.createElementBlock("div",Kce,[A.createElementVNode("img",{src:t.logoSrc,alt:t.logoAlt},null,8,eue)])):A.createCommentVNode("",!0),A.createElementVNode("div",tue,[A.createElementVNode("label",null,A.toDisplayString(r.$store.header.system.deviceName),1)])]),A.createElementVNode("div",rue,[A.createVNode(f,A.mergeProps({ref:"menus"},r.$attrs,{theme:t.theme,selectedKeys:i.selectedKeys,"open-keys":o.openKeys,onOpenChange:o.onOpenChange,"inline-collapsed":t.inlineCollapsed,mode:t.mode}),{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(o.data,p=>(A.openBlock(),A.createElementBlock(A.Fragment,{key:p.id},[p.children&&p.children.length?(A.openBlock(),A.createBlock(d,{key:p.key,title:p.title,icon:o.renderIcon(p)},{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(p.children,v=>(A.openBlock(),A.createBlock(s,{key:v.key,onClick:m=>o.menuSelect(v),icon:o.renderIcon(v)},{default:A.withCtx(()=>[A.createElementVNode("span",null,A.toDisplayString(v.title),1)]),_:2},1032,["onClick","icon"]))),128))]),_:2},1032,["title","icon"])):(A.openBlock(),A.createBlock(s,{key:p.key||"",onClick:v=>o.menuSelect(p),icon:o.renderIcon(p)},{default:A.withCtx(()=>[A.createElementVNode("span",null,A.toDisplayString(p.title),1)]),_:2},1032,["onClick","icon"]))],64))),128))]),_:1},16,["theme","selectedKeys","open-keys","onOpenChange","inline-collapsed","mode"])])])}const jk=or(Yce,[["render",nue],["__scopeId","data-v-86e10743"]]);var iue=typeof global=="object"&&global&&global.Object===Object&&global,aue=typeof self=="object"&&self&&self.Object===Object&&self,zk=iue||aue||Function("return this")(),Bd=zk.Symbol,Rk=Object.prototype,oue=Rk.hasOwnProperty,lue=Rk.toString,jf=Bd?Bd.toStringTag:void 0;function sue(r){var e=oue.call(r,jf),t=r[jf];try{r[jf]=void 0;var n=!0}catch{}var i=lue.call(r);return n&&(e?r[jf]=t:delete r[jf]),i}var cue=Object.prototype,uue=cue.toString;function fue(r){return uue.call(r)}var due="[object Null]",hue="[object Undefined]",$k=Bd?Bd.toStringTag:void 0;function pue(r){return r==null?r===void 0?hue:due:$k&&$k in Object(r)?sue(r):fue(r)}function vue(r){return r!=null&&typeof r=="object"}var mue="[object Symbol]";function gue(r){return typeof r=="symbol"||vue(r)&&pue(r)==mue}var Oue=/\s/;function bue(r){for(var e=r.length;e--&&Oue.test(r.charAt(e)););return e}var yue=/^\s+/;function Sue(r){return r&&r.slice(0,bue(r)+1).replace(yue,"")}function b3(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Dk=NaN,wue=/^[-+]0x[0-9a-f]+$/i,xue=/^0b[01]+$/i,Pue=/^0o[0-7]+$/i,Tue=parseInt;function Lk(r){if(typeof r=="number")return r;if(gue(r))return Dk;if(b3(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=b3(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Sue(r);var t=xue.test(r);return t||Pue.test(r)?Tue(r.slice(2),t?2:8):wue.test(r)?Dk:+r}var y3=function(){return zk.Date.now()},Cue="Expected a function",Aue=Math.max,_ue=Math.min;function Mue(r,e,t){var n,i,o,s,d,f,p=0,v=!1,m=!1,O=!0;if(typeof r!="function")throw new TypeError(Cue);e=Lk(e)||0,b3(t)&&(v=!!t.leading,m="maxWait"in t,o=m?Aue(Lk(t.maxWait)||0,e):o,O="trailing"in t?!!t.trailing:O);function b(L){var R=n,D=i;return n=i=void 0,p=L,s=r.apply(D,R),s}function S(L){return p=L,d=setTimeout(C,e),v?b(L):s}function w(L){var R=L-f,D=L-p,F=e-R;return m?_ue(F,o-D):F}function x(L){var R=L-f,D=L-p;return f===void 0||R>=e||R<0||m&&D>=o}function C(){var L=y3();if(x(L))return M(L);d=setTimeout(C,w(L))}function M(L){return d=void 0,O&&n?b(L):(n=i=void 0,s)}function _(){d!==void 0&&clearTimeout(d),p=0,n=f=i=d=void 0}function k(){return d===void 0?s:M(y3())}function j(){var L=y3(),R=x(L);if(n=arguments,i=this,f=L,R){if(d===void 0)return S(f);if(m)return clearTimeout(d),d=setTimeout(C,e),b(f)}return d===void 0&&(d=setTimeout(C,e)),s}return j.cancel=_,j.flush=k,j}const Eue={name:"MentionInput",computed:{see(){return this.$store?.forms?.see||!1}},props:{modelValue:{type:String,default:""},options:{type:Array,required:!0},saveSymbol:{type:String,default:"$"},height:{type:[String,Number],default:void 0},width:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},mode:{type:String,default:"input"},multiple:{type:Boolean,default:!0},style:{type:[String,Object],default:"width: 100%;"}},emits:["update:modelValue","change"],data(){return{PREFIX:"/",SAVE_SYMBOL:this.saveSymbol||"$",showDropdown:!1,dropdownPos:null,triggerText:"",selectionRange:null,cascaderOptions:[],selectedValue:[],currentPathValues:[],currentPathLabels:[],optionMap:new Map,pathToNameMap:new Map,wrapperRef:null,inputRef:null,cascaderRef:null}},computed:{overlayStyle(){if(!this.dropdownPos)return{};let r=this.dropdownPos.top,e=this.dropdownPos.left;return{position:"fixed",top:r+"px",left:e+"px",zIndex:1050}}},mounted(){this.wrapperRef=this.$refs.wrapperRef,this.inputRef=this.$refs.inputRef,this.cascaderRef=this.$refs.cascaderRef,this.optionMap=this.buildOptionMap(this.options),this.pathToNameMap=this.buildPathToNameMap(this.options),this.inputRef&&this.inputRef.addEventListener("click",this.handleInputClick),document.addEventListener("click",this.handleClickOutside),this.initializeValue(),this.debouncedOnInput=Mue(this._onInput,100)},beforeDestroy(){this.debouncedOnInput&&this.debouncedOnInput.cancel(),this.inputRef&&this.inputRef.removeEventListener("click",this.handleInputClick),document.removeEventListener("click",this.handleClickOutside)},watch:{modelValue:{handler(r){document.activeElement!==this.inputRef&&this.setValue(r||"")},immediate:!0},options:{handler(r){r&&(this.optionMap=this.buildOptionMap(r),this.pathToNameMap=this.buildPathToNameMap(r),this.modelValue&&this.setValue(this.modelValue))},deep:!0}},methods:{buildOptionMap(r,e=new Map){if(r){for(const t of r){const n=t.id||t.value||"",i=t.name||t.label||"";n&&i&&e.set(n,i),t.children&&this.buildOptionMap(t.children,e)}return e}},buildPathToNameMap(r,e=[],t=[]){if(!r)return;const n=new Map;for(const i of r){const o=i.id||i.value||"",s=i.name||i.label||"";if(!o)continue;const d=[...e,o],f=[...t,s],p=d.join("."),v=f.join("/");if(n.set(p,v),i.children){const m=this.buildPathToNameMap(i.children,d,f);for(const[O,b]of m)n.set(O,b)}}return n},onCascaderChange(r,e){r&&e&&(this.currentPathValues=[...r],this.currentPathLabels=e.map(t=>String(t.label||"")),this.insertMentionTag())},handleCascaderKeydown(r){r.key==="Escape"&&(this.showDropdown=!1)},onDropdownVisibleChange(r){},onInput(r){if(this.mode==="select"){r.preventDefault();return}this.debouncedOnInput(r)},_onInput(r){if(this.mode==="select")return;const e=r.target,t=this.parseContent(e);if(this.$emit("change",t),this.$emit("update:modelValue",this.serialize(t)),(e.textContent||"").lastIndexOf(this.PREFIX)===-1){this.showDropdown=!1;return}const o=this.getCurrentTextBeforeCursor(),s=o.lastIndexOf(this.PREFIX);if(s===-1){this.showDropdown=!1;return}const d=o.slice(s+this.PREFIX.length);if(d.includes(" ")||d.includes(" ")){this.showDropdown=!1;return}this.triggerText=d;const f=document.getSelection()?.getRangeAt(0);if(f&&this.inputRef){const p=f.getBoundingClientRect();this.dropdownPos={top:p.bottom+window.scrollY,left:p.left+window.scrollX},this.selectionRange=f.cloneRange(),this.cascaderOptions=this.options,this.showDropdown=!0}else this.showDropdown=!1},getCurrentTextBeforeCursor(){const r=window.getSelection();if(!r||r.rangeCount===0)return"";const e=r.getRangeAt(0).cloneRange(),t=e.cloneRange();return t.selectNodeContents(this.inputRef),t.setEnd(e.endContainer,e.endOffset),t.toString().replace(/\r\n|\r/g,`
|
|
1
|
+
(function(Zt,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("vue"),require("ant-design-vue")):typeof define=="function"&&define.amd?define(["exports","vue","ant-design-vue"],A):(Zt=typeof globalThis<"u"?globalThis:Zt||self,A(Zt["pass-ui"]={},Zt.Vue,Zt.AntDesignVue))})(this,(function(Zt,A,Er){"use strict";var Fl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wo(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $d={exports:{}},Vce=$d.exports,_k;function Bce(){return _k||(_k=1,(function(r,e){(function(t,n){r.exports=n()})(Vce,(function(){var t=1e3,n=6e4,i=36e5,o="millisecond",s="second",d="minute",f="hour",p="day",v="week",m="month",O="quarter",b="year",S="date",w="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Q){var U=["th","st","nd","rd"],re=Q%100;return"["+Q+(U[(re-20)%10]||U[re]||U[0])+"]"}},_=function(Q,U,re){var K=String(Q);return!K||K.length>=U?Q:""+Array(U+1-K.length).join(re)+Q},k={s:_,z:function(Q){var U=-Q.utcOffset(),re=Math.abs(U),K=Math.floor(re/60),ne=re%60;return(U<=0?"+":"-")+_(K,2,"0")+":"+_(ne,2,"0")},m:function Q(U,re){if(U.date()<re.date())return-Q(re,U);var K=12*(re.year()-U.year())+(re.month()-U.month()),ne=U.clone().add(K,m),se=re-ne<0,ie=U.clone().add(K+(se?-1:1),m);return+(-(K+(re-ne)/(se?ne-ie:ie-ne))||0)},a:function(Q){return Q<0?Math.ceil(Q)||0:Math.floor(Q)},p:function(Q){return{M:m,y:b,w:v,d:p,D:S,h:f,m:d,s,ms:o,Q:O}[Q]||String(Q||"").toLowerCase().replace(/s$/,"")},u:function(Q){return Q===void 0}},j="en",L={};L[j]=M;var R="$isDayjsObject",D=function(Q){return Q instanceof N||!(!Q||!Q[R])},F=function Q(U,re,K){var ne;if(!U)return j;if(typeof U=="string"){var se=U.toLowerCase();L[se]&&(ne=se),re&&(L[se]=re,ne=se);var ie=U.split("-");if(!ne&&ie.length>1)return Q(ie[0])}else{var te=U.name;L[te]=U,ne=te}return!K&&ne&&(j=ne),ne||!K&&j},B=function(Q,U){if(D(Q))return Q.clone();var re=typeof U=="object"?U:{};return re.date=Q,re.args=arguments,new N(re)},$=k;$.l=F,$.i=D,$.w=function(Q,U){return B(Q,{locale:U.$L,utc:U.$u,x:U.$x,$offset:U.$offset})};var N=(function(){function Q(re){this.$L=F(re.locale,null,!0),this.parse(re),this.$x=this.$x||re.x||{},this[R]=!0}var U=Q.prototype;return U.parse=function(re){this.$d=(function(K){var ne=K.date,se=K.utc;if(ne===null)return new Date(NaN);if($.u(ne))return new Date;if(ne instanceof Date)return new Date(ne);if(typeof ne=="string"&&!/Z$/i.test(ne)){var ie=ne.match(x);if(ie){var te=ie[2]-1||0,oe=(ie[7]||"0").substring(0,3);return se?new Date(Date.UTC(ie[1],te,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,oe)):new Date(ie[1],te,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,oe)}}return new Date(ne)})(re),this.init()},U.init=function(){var re=this.$d;this.$y=re.getFullYear(),this.$M=re.getMonth(),this.$D=re.getDate(),this.$W=re.getDay(),this.$H=re.getHours(),this.$m=re.getMinutes(),this.$s=re.getSeconds(),this.$ms=re.getMilliseconds()},U.$utils=function(){return $},U.isValid=function(){return this.$d.toString()!==w},U.isSame=function(re,K){var ne=B(re);return this.startOf(K)<=ne&&ne<=this.endOf(K)},U.isAfter=function(re,K){return B(re)<this.startOf(K)},U.isBefore=function(re,K){return this.endOf(K)<B(re)},U.$g=function(re,K,ne){return $.u(re)?this[K]:this.set(ne,re)},U.unix=function(){return Math.floor(this.valueOf()/1e3)},U.valueOf=function(){return this.$d.getTime()},U.startOf=function(re,K){var ne=this,se=!!$.u(K)||K,ie=$.p(re),te=function(je,Ve){var Ue=$.w(ne.$u?Date.UTC(ne.$y,Ve,je):new Date(ne.$y,Ve,je),ne);return se?Ue:Ue.endOf(p)},oe=function(je,Ve){return $.w(ne.toDate()[je].apply(ne.toDate("s"),(se?[0,0,0,0]:[23,59,59,999]).slice(Ve)),ne)},pe=this.$W,Pe=this.$M,me=this.$D,ue="set"+(this.$u?"UTC":"");switch(ie){case b:return se?te(1,0):te(31,11);case m:return se?te(1,Pe):te(0,Pe+1);case v:var we=this.$locale().weekStart||0,Ee=(pe<we?pe+7:pe)-we;return te(se?me-Ee:me+(6-Ee),Pe);case p:case S:return oe(ue+"Hours",0);case f:return oe(ue+"Minutes",1);case d:return oe(ue+"Seconds",2);case s:return oe(ue+"Milliseconds",3);default:return this.clone()}},U.endOf=function(re){return this.startOf(re,!1)},U.$set=function(re,K){var ne,se=$.p(re),ie="set"+(this.$u?"UTC":""),te=(ne={},ne[p]=ie+"Date",ne[S]=ie+"Date",ne[m]=ie+"Month",ne[b]=ie+"FullYear",ne[f]=ie+"Hours",ne[d]=ie+"Minutes",ne[s]=ie+"Seconds",ne[o]=ie+"Milliseconds",ne)[se],oe=se===p?this.$D+(K-this.$W):K;if(se===m||se===b){var pe=this.clone().set(S,1);pe.$d[te](oe),pe.init(),this.$d=pe.set(S,Math.min(this.$D,pe.daysInMonth())).$d}else te&&this.$d[te](oe);return this.init(),this},U.set=function(re,K){return this.clone().$set(re,K)},U.get=function(re){return this[$.p(re)]()},U.add=function(re,K){var ne,se=this;re=Number(re);var ie=$.p(K),te=function(Pe){var me=B(se);return $.w(me.date(me.date()+Math.round(Pe*re)),se)};if(ie===m)return this.set(m,this.$M+re);if(ie===b)return this.set(b,this.$y+re);if(ie===p)return te(1);if(ie===v)return te(7);var oe=(ne={},ne[d]=n,ne[f]=i,ne[s]=t,ne)[ie]||1,pe=this.$d.getTime()+re*oe;return $.w(pe,this)},U.subtract=function(re,K){return this.add(-1*re,K)},U.format=function(re){var K=this,ne=this.$locale();if(!this.isValid())return ne.invalidDate||w;var se=re||"YYYY-MM-DDTHH:mm:ssZ",ie=$.z(this),te=this.$H,oe=this.$m,pe=this.$M,Pe=ne.weekdays,me=ne.months,ue=ne.meridiem,we=function(Ve,Ue,Le,De){return Ve&&(Ve[Ue]||Ve(K,se))||Le[Ue].slice(0,De)},Ee=function(Ve){return $.s(te%12||12,Ve,"0")},je=ue||function(Ve,Ue,Le){var De=Ve<12?"AM":"PM";return Le?De.toLowerCase():De};return se.replace(C,(function(Ve,Ue){return Ue||(function(Le){switch(Le){case"YY":return String(K.$y).slice(-2);case"YYYY":return $.s(K.$y,4,"0");case"M":return pe+1;case"MM":return $.s(pe+1,2,"0");case"MMM":return we(ne.monthsShort,pe,me,3);case"MMMM":return we(me,pe);case"D":return K.$D;case"DD":return $.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return we(ne.weekdaysMin,K.$W,Pe,2);case"ddd":return we(ne.weekdaysShort,K.$W,Pe,3);case"dddd":return Pe[K.$W];case"H":return String(te);case"HH":return $.s(te,2,"0");case"h":return Ee(1);case"hh":return Ee(2);case"a":return je(te,oe,!0);case"A":return je(te,oe,!1);case"m":return String(oe);case"mm":return $.s(oe,2,"0");case"s":return String(K.$s);case"ss":return $.s(K.$s,2,"0");case"SSS":return $.s(K.$ms,3,"0");case"Z":return ie}return null})(Ve)||ie.replace(":","")}))},U.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},U.diff=function(re,K,ne){var se,ie=this,te=$.p(K),oe=B(re),pe=(oe.utcOffset()-this.utcOffset())*n,Pe=this-oe,me=function(){return $.m(ie,oe)};switch(te){case b:se=me()/12;break;case m:se=me();break;case O:se=me()/3;break;case v:se=(Pe-pe)/6048e5;break;case p:se=(Pe-pe)/864e5;break;case f:se=Pe/i;break;case d:se=Pe/n;break;case s:se=Pe/t;break;default:se=Pe}return ne?se:$.a(se)},U.daysInMonth=function(){return this.endOf(m).$D},U.$locale=function(){return L[this.$L]},U.locale=function(re,K){if(!re)return this.$L;var ne=this.clone(),se=F(re,K,!0);return se&&(ne.$L=se),ne},U.clone=function(){return $.w(this.$d,this)},U.toDate=function(){return new Date(this.valueOf())},U.toJSON=function(){return this.isValid()?this.toISOString():null},U.toISOString=function(){return this.$d.toISOString()},U.toString=function(){return this.$d.toUTCString()},Q})(),I=N.prototype;return B.prototype=I,[["$ms",o],["$s",s],["$m",d],["$H",f],["$W",p],["$M",m],["$y",b],["$D",S]].forEach((function(Q){I[Q[1]]=function(U){return this.$g(U,Q[0],Q[1])}})),B.extend=function(Q,U){return Q.$i||(Q(U,N,B),Q.$i=!0),B},B.locale=F,B.isDayjs=D,B.unix=function(Q){return B(1e3*Q)},B.en=L[j],B.Ls=L,B.p={},B}))})($d)),$d.exports}var Ice=Bce();const an=wo(Ice);var Dd={exports:{}},Hce=Dd.exports,Mk;function Fce(){return Mk||(Mk=1,(function(r,e){(function(t,n){r.exports=n()})(Hce,(function(){return function(t,n){n.prototype.weekday=function(i){var o=this.$locale().weekStart||0,s=this.$W,d=(s<o?s+7:s)-o;return this.$utils().u(i)?d:this.subtract(d,"day").add(i,"day")}}}))})(Dd)),Dd.exports}var Qce=Fce();const Ld=wo(Qce);var Nd={exports:{}},Wce=Nd.exports,Ek;function Uce(){return Ek||(Ek=1,(function(r,e){(function(t,n){r.exports=n()})(Wce,(function(){return function(t,n,i){var o=n.prototype,s=function(m){return m&&(m.indexOf?m:m.s)},d=function(m,O,b,S,w){var x=m.name?m:m.$locale(),C=s(x[O]),M=s(x[b]),_=C||M.map((function(j){return j.slice(0,S)}));if(!w)return _;var k=x.weekStart;return _.map((function(j,L){return _[(L+(k||0))%7]}))},f=function(){return i.Ls[i.locale()]},p=function(m,O){return m.formats[O]||(function(b){return b.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,w,x){return w||x.slice(1)}))})(m.formats[O.toUpperCase()])},v=function(){var m=this;return{months:function(O){return O?O.format("MMMM"):d(m,"months")},monthsShort:function(O){return O?O.format("MMM"):d(m,"monthsShort","months",3)},firstDayOfWeek:function(){return m.$locale().weekStart||0},weekdays:function(O){return O?O.format("dddd"):d(m,"weekdays")},weekdaysMin:function(O){return O?O.format("dd"):d(m,"weekdaysMin","weekdays",2)},weekdaysShort:function(O){return O?O.format("ddd"):d(m,"weekdaysShort","weekdays",3)},longDateFormat:function(O){return p(m.$locale(),O)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return v.bind(this)()},i.localeData=function(){var m=f();return{firstDayOfWeek:function(){return m.weekStart||0},weekdays:function(){return i.weekdays()},weekdaysShort:function(){return i.weekdaysShort()},weekdaysMin:function(){return i.weekdaysMin()},months:function(){return i.months()},monthsShort:function(){return i.monthsShort()},longDateFormat:function(O){return p(m,O)},meridiem:m.meridiem,ordinal:m.ordinal}},i.months=function(){return d(f(),"months")},i.monthsShort=function(){return d(f(),"monthsShort","months",3)},i.weekdays=function(m){return d(f(),"weekdays",null,null,m)},i.weekdaysShort=function(m){return d(f(),"weekdaysShort","weekdays",3,m)},i.weekdaysMin=function(m){return d(f(),"weekdaysMin","weekdays",2,m)}}}))})(Nd)),Nd.exports}var Xce=Uce();const Vd=wo(Xce),or=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t};an.extend(Ld),an.extend(Vd),an.locale("zh-cn");const Zce={name:"PaasDate",inheritAttrs:!1,computed:{see(){return this.$store?.forms?.see||!1},formattedValue(){return this.modelValue?Array.isArray(this.modelValue)?this.modelValue.map(r=>r?an(r):null):an.isDayjs(this.modelValue)?this.modelValue:an(this.modelValue):null}},props:{placeholder:{type:String,default:""},type:{type:String,default:"date"},icon:String,readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},modelValue:{type:[String,Array,Date],default:null},showTime:{type:Boolean,default:!1},format:{type:String,default:"YYYY-MM-DD"},onChange:{type:Function,default:null},style:{type:[String,Object],default:"width: 100%;"}},data(){return{}},methods:{handleChange(r){this.onChange&&this.onChange(r),Array.isArray(r)?this.$emit("update:modelValue",r.map(e=>e?.format(this.format||"YYYY-MM-DD"))):this.$emit("update:modelValue",r?.format(this.format||"YYYY-MM-DD"))}}};function qce(r,e,t,n,i,o){const s=A.resolveComponent("a-date-picker");return A.openBlock(),A.createBlock(s,A.mergeProps({"show-time":t.showTime,readonly:t.readonly,disabled:o.see||t.disabled,value:o.formattedValue,format:t.format,picker:t.type,onChange:o.handleChange,placeholder:t.placeholder,style:t.style},r.$attrs),null,16,["show-time","readonly","disabled","value","format","picker","onChange","placeholder","style"])}const kk=or(Zce,[["render",qce]]),Yce={name:"PaasMenu",components:{AMenu:Er.Menu,ASubMenu:Er.Menu.SubMenu,AMenuItem:Er.Menu.Item},props:{url:String,logoSrc:String,logoAlt:{type:String,default:"System Logo"},disabled:{type:Boolean,default:!1},theme:{type:String,default:"light"},selected:{type:String,default:""},mode:{type:String,default:"inline"},inlineCollapsed:{type:Boolean,default:!1}},data(){return{selectedKeys:this.selected?[this.selected]:[],selectValue:"",selectMenuOpend:!1,hostname:window.location.protocol+"//"+window.location.host}},computed:{current(){return this.$store.menus.current},menuOptions(){return this.$store.menus.menuOptions||[]},openKeys(){return this.$store.menus.openKeys},data(){return this.$store.menus.data}},watch:{selected(r){this.selectedKeys=r?[r]:[]},url(r){r?this.$post(r).then(e=>{this.$store.setMenuData(e.data.data),this.autoSelectMenu()}):this.data.length>0&&this.autoSelectMenu()},data(r){r.length>0&&!this.selectedKeys.length&&this.autoSelectMenu()}},beforeUnmount(){this.$bus.off("selectAndOpenMenu")},mounted(){this.$store.loginFlag&&this.data.length===0?this.$post(this.url).then(r=>{this.$store.setMenuData(r.data.data),this.autoSelectMenu()}):this.data.length>0&&this.autoSelectMenu(),this.$bus.on("selectAndOpenMenu",r=>{this.selectAndOpenMenu(r)})},methods:{renderIcon(r){let e="";r.icon?e=r.icon:e=this.selectedKeys.includes(r.key)?"FolderOpenOutlined":"FolderOutlined";try{const t=A.resolveComponent(e);return()=>A.h(t)}catch{return null}},autoSelectMenu(){let r=window.location.hash||"";if(r=r.replace("#","").split("?")[0],!this.data||this.data.length===0)return;let e=null,t=this.current;if(r&&r!=="/"){if(e=this.findItemByKey(this.data,r),e||(e=this.findItemByPathPrefix(this.data,r)),!e)return}else t&&(e=this.findItemByKey(this.data,t)),e||(e=this.findFirstLeaf(this.data));e&&(this.selectAndOpenMenu(e),this.$router.push(e.key))},selectAndOpenMenu(r){this.selectedKeys=[r.key];const e=this.getParentKeys(this.data,r.key);this.$store.setOpenKeys(e),this.$store.setCurrent(r.key),this.$store.setTitle(r.title),this.$store.setMenuId(r.id),this.$store.setButtons(r.buttons||[]),this.$store.setMenuCache({key:r.key,title:r.title,id:r.id,buttons:r.buttons||[]})},findItemByKey(r,e){if(!r||e===null)return null;for(const t of r){if(t.key===e)return t;if(t.children){const n=this.findItemByKey(t.children,e);if(n)return n}}return null},findItemByPathPrefix(r,e){if(!r||!e)return null;for(const t of r){if(e===t.key)return t;if(t.children){const n=this.findItemByPathPrefix(t.children,e);if(n)return n}}return null},findFirstLeaf(r){for(const e of r)if(e.children&&e.children.length>0){const t=this.findFirstLeaf(e.children);if(t)return t}else return e;return null},getParentKeys(r,e,t=[]){for(const n of r){if(n.key===e)return t;if(n.children){const i=this.getParentKeys(n.children,e,[...t,n.key]);if(i.length)return i}}return[]},menuSelect(r){this.selectAndOpenMenu(r),this.$router.push(r.key)},onOpenChange(r){const e=r.find(t=>!this.openKeys.includes(t));e?this.$store.setOpenKeys([e]):this.$store.setOpenKeys([])},selectMenuClick(){if(!this.selectValue){this.selectMenuOpend=!1;return}this.selectMenuOpend=!0}}},Gce={class:"paas-menu-container"},Jce={class:"paas-menu-header"},Kce={key:0,class:"paas-menu-logo"},eue=["src","alt"],tue={class:"paas-menu-system-name"},rue={class:"paas-menu-scroll-wrapper"};function nue(r,e,t,n,i,o){const s=A.resolveComponent("a-menu-item"),d=A.resolveComponent("a-sub-menu"),f=A.resolveComponent("a-menu");return A.openBlock(),A.createElementBlock("div",Gce,[A.createElementVNode("div",Jce,[t.logoSrc?(A.openBlock(),A.createElementBlock("div",Kce,[A.createElementVNode("img",{src:t.logoSrc,alt:t.logoAlt},null,8,eue)])):A.createCommentVNode("",!0),A.createElementVNode("div",tue,[A.createElementVNode("label",null,A.toDisplayString(r.$store.header.system.deviceName),1)])]),A.createElementVNode("div",rue,[A.createVNode(f,A.mergeProps({ref:"menus"},r.$attrs,{theme:t.theme,selectedKeys:i.selectedKeys,"open-keys":o.openKeys,onOpenChange:o.onOpenChange,"inline-collapsed":t.inlineCollapsed,mode:t.mode}),{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(o.data,p=>(A.openBlock(),A.createElementBlock(A.Fragment,{key:p.id},[p.children&&p.children.length?(A.openBlock(),A.createBlock(d,{key:p.key,title:p.title,icon:o.renderIcon(p)},{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(p.children,v=>(A.openBlock(),A.createBlock(s,{key:v.key,onClick:m=>o.menuSelect(v),icon:o.renderIcon(v)},{default:A.withCtx(()=>[A.createElementVNode("span",null,A.toDisplayString(v.title),1)]),_:2},1032,["onClick","icon"]))),128))]),_:2},1032,["title","icon"])):(A.openBlock(),A.createBlock(s,{key:p.key||"",onClick:v=>o.menuSelect(p),icon:o.renderIcon(p)},{default:A.withCtx(()=>[A.createElementVNode("span",null,A.toDisplayString(p.title),1)]),_:2},1032,["onClick","icon"]))],64))),128))]),_:1},16,["theme","selectedKeys","open-keys","onOpenChange","inline-collapsed","mode"])])])}const jk=or(Yce,[["render",nue],["__scopeId","data-v-16bf3410"]]);var iue=typeof global=="object"&&global&&global.Object===Object&&global,aue=typeof self=="object"&&self&&self.Object===Object&&self,zk=iue||aue||Function("return this")(),Bd=zk.Symbol,Rk=Object.prototype,oue=Rk.hasOwnProperty,lue=Rk.toString,jf=Bd?Bd.toStringTag:void 0;function sue(r){var e=oue.call(r,jf),t=r[jf];try{r[jf]=void 0;var n=!0}catch{}var i=lue.call(r);return n&&(e?r[jf]=t:delete r[jf]),i}var cue=Object.prototype,uue=cue.toString;function fue(r){return uue.call(r)}var due="[object Null]",hue="[object Undefined]",$k=Bd?Bd.toStringTag:void 0;function pue(r){return r==null?r===void 0?hue:due:$k&&$k in Object(r)?sue(r):fue(r)}function vue(r){return r!=null&&typeof r=="object"}var mue="[object Symbol]";function gue(r){return typeof r=="symbol"||vue(r)&&pue(r)==mue}var Oue=/\s/;function bue(r){for(var e=r.length;e--&&Oue.test(r.charAt(e)););return e}var yue=/^\s+/;function Sue(r){return r&&r.slice(0,bue(r)+1).replace(yue,"")}function b3(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Dk=NaN,wue=/^[-+]0x[0-9a-f]+$/i,xue=/^0b[01]+$/i,Pue=/^0o[0-7]+$/i,Tue=parseInt;function Lk(r){if(typeof r=="number")return r;if(gue(r))return Dk;if(b3(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=b3(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Sue(r);var t=xue.test(r);return t||Pue.test(r)?Tue(r.slice(2),t?2:8):wue.test(r)?Dk:+r}var y3=function(){return zk.Date.now()},Cue="Expected a function",Aue=Math.max,_ue=Math.min;function Mue(r,e,t){var n,i,o,s,d,f,p=0,v=!1,m=!1,O=!0;if(typeof r!="function")throw new TypeError(Cue);e=Lk(e)||0,b3(t)&&(v=!!t.leading,m="maxWait"in t,o=m?Aue(Lk(t.maxWait)||0,e):o,O="trailing"in t?!!t.trailing:O);function b(L){var R=n,D=i;return n=i=void 0,p=L,s=r.apply(D,R),s}function S(L){return p=L,d=setTimeout(C,e),v?b(L):s}function w(L){var R=L-f,D=L-p,F=e-R;return m?_ue(F,o-D):F}function x(L){var R=L-f,D=L-p;return f===void 0||R>=e||R<0||m&&D>=o}function C(){var L=y3();if(x(L))return M(L);d=setTimeout(C,w(L))}function M(L){return d=void 0,O&&n?b(L):(n=i=void 0,s)}function _(){d!==void 0&&clearTimeout(d),p=0,n=f=i=d=void 0}function k(){return d===void 0?s:M(y3())}function j(){var L=y3(),R=x(L);if(n=arguments,i=this,f=L,R){if(d===void 0)return S(f);if(m)return clearTimeout(d),d=setTimeout(C,e),b(f)}return d===void 0&&(d=setTimeout(C,e)),s}return j.cancel=_,j.flush=k,j}const Eue={name:"MentionInput",computed:{see(){return this.$store?.forms?.see||!1}},props:{modelValue:{type:String,default:""},options:{type:Array,required:!0},saveSymbol:{type:String,default:"$"},height:{type:[String,Number],default:void 0},width:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},mode:{type:String,default:"input"},multiple:{type:Boolean,default:!0},style:{type:[String,Object],default:"width: 100%;"}},emits:["update:modelValue","change"],data(){return{PREFIX:"/",SAVE_SYMBOL:this.saveSymbol||"$",showDropdown:!1,dropdownPos:null,triggerText:"",selectionRange:null,cascaderOptions:[],selectedValue:[],currentPathValues:[],currentPathLabels:[],optionMap:new Map,pathToNameMap:new Map,wrapperRef:null,inputRef:null,cascaderRef:null}},computed:{overlayStyle(){if(!this.dropdownPos)return{};let r=this.dropdownPos.top,e=this.dropdownPos.left;return{position:"fixed",top:r+"px",left:e+"px",zIndex:1050}}},mounted(){this.wrapperRef=this.$refs.wrapperRef,this.inputRef=this.$refs.inputRef,this.cascaderRef=this.$refs.cascaderRef,this.optionMap=this.buildOptionMap(this.options),this.pathToNameMap=this.buildPathToNameMap(this.options),this.inputRef&&this.inputRef.addEventListener("click",this.handleInputClick),document.addEventListener("click",this.handleClickOutside),this.initializeValue(),this.debouncedOnInput=Mue(this._onInput,100)},beforeDestroy(){this.debouncedOnInput&&this.debouncedOnInput.cancel(),this.inputRef&&this.inputRef.removeEventListener("click",this.handleInputClick),document.removeEventListener("click",this.handleClickOutside)},watch:{modelValue:{handler(r){document.activeElement!==this.inputRef&&this.setValue(r||"")},immediate:!0},options:{handler(r){r&&(this.optionMap=this.buildOptionMap(r),this.pathToNameMap=this.buildPathToNameMap(r),this.modelValue&&this.setValue(this.modelValue))},deep:!0}},methods:{buildOptionMap(r,e=new Map){if(r){for(const t of r){const n=t.id||t.value||"",i=t.name||t.label||"";n&&i&&e.set(n,i),t.children&&this.buildOptionMap(t.children,e)}return e}},buildPathToNameMap(r,e=[],t=[]){if(!r)return;const n=new Map;for(const i of r){const o=i.id||i.value||"",s=i.name||i.label||"";if(!o)continue;const d=[...e,o],f=[...t,s],p=d.join("."),v=f.join("/");if(n.set(p,v),i.children){const m=this.buildPathToNameMap(i.children,d,f);for(const[O,b]of m)n.set(O,b)}}return n},onCascaderChange(r,e){r&&e&&(this.currentPathValues=[...r],this.currentPathLabels=e.map(t=>String(t.label||"")),this.insertMentionTag())},handleCascaderKeydown(r){r.key==="Escape"&&(this.showDropdown=!1)},onDropdownVisibleChange(r){},onInput(r){if(this.mode==="select"){r.preventDefault();return}this.debouncedOnInput(r)},_onInput(r){if(this.mode==="select")return;const e=r.target,t=this.parseContent(e);if(this.$emit("change",t),this.$emit("update:modelValue",this.serialize(t)),(e.textContent||"").lastIndexOf(this.PREFIX)===-1){this.showDropdown=!1;return}const o=this.getCurrentTextBeforeCursor(),s=o.lastIndexOf(this.PREFIX);if(s===-1){this.showDropdown=!1;return}const d=o.slice(s+this.PREFIX.length);if(d.includes(" ")||d.includes(" ")){this.showDropdown=!1;return}this.triggerText=d;const f=document.getSelection()?.getRangeAt(0);if(f&&this.inputRef){const p=f.getBoundingClientRect();this.dropdownPos={top:p.bottom+window.scrollY,left:p.left+window.scrollX},this.selectionRange=f.cloneRange(),this.cascaderOptions=this.options,this.showDropdown=!0}else this.showDropdown=!1},getCurrentTextBeforeCursor(){const r=window.getSelection();if(!r||r.rangeCount===0)return"";const e=r.getRangeAt(0).cloneRange(),t=e.cloneRange();return t.selectNodeContents(this.inputRef),t.setEnd(e.endContainer,e.endOffset),t.toString().replace(/\r\n|\r/g,`
|
|
2
2
|
`)},onKeydown(r){if(this.mode==="select"&&r.key!=="Tab"&&r.key!=="ArrowUp"&&r.key!=="ArrowDown"&&r.key!=="Enter"&&r.key!=="Escape"){r.preventDefault(),/[a-zA-Z0-9]/.test(r.key)&&!r.ctrlKey&&!r.metaKey&&!r.altKey&&this.showSelectDropdown();return}if(!this.showDropdown){if(r.key==="Backspace")this.handleBackspace(r);else if(r.key==="Enter"){r.preventDefault();const e=window.getSelection();if(e&&e.rangeCount>0){const t=e.getRangeAt(0);t.deleteContents();const n=document.createElement("br");t.insertNode(n);const i=document.createRange();i.setStartAfter(n),i.collapse(!0),e.removeAllRanges(),e.addRange(i)}this.$nextTick(()=>{const t=this.parseContent(this.inputRef);this.$emit("change",t),this.$emit("update:modelValue",this.serialize(t))})}return}r.key==="Escape"&&(this.showDropdown=!1)},insertMentionTag(){if(!this.inputRef)return;this.multiple||(this.inputRef.innerHTML="");let r;this.selectionRange?r=this.selectionRange.cloneRange():(r=document.createRange(),r.selectNodeContents(this.inputRef),r.collapse(!1));let e=null,t=0;if(r.startContainer.nodeType===Node.TEXT_NODE)e=r.startContainer,t=r.startOffset;else{const f=document.createTreeWalker(this.inputRef,NodeFilter.SHOW_TEXT,null);let p=null;for(;f.nextNode();)(f.currentNode===r.startContainer||f.currentNode.contains(r.startContainer))&&(p=f.currentNode);p&&(e=p,t=p.textContent?.length||0)}const n=this.SAVE_SYMBOL+this.currentPathValues.join("."),i=this.currentPathLabels.join("/"),o=document.createElement("span");o.className="mention-tag",o.contentEditable="false",o.dataset.value=n,o.innerHTML=`
|
|
3
3
|
<span class="tag-close">×</span>
|
|
4
4
|
<span class="tag-content">${i}</span>
|