como-admin-web.4290f457.js 12 KB

1
  1. import{d as e}from"../como-ts-utils/como-ts-utils.52443996.js";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var s={},i={};Object.defineProperty(i,"__esModule",{value:!0}),i.BaseElementComponent=void 0;i.BaseElementComponent=class{LableName(e){return this.lableName=e,this}Style(e){return this.style=e,this}Size(e="default"){return this.size=e,this}toObject(){const e={},t=Object.keys(this);for(let n=0;n<t.length;n++){const r=t[n];e[r]=this[r]}return e}Span(e){return this.span=e,this}static get Ins(){return new this}};var o={};Object.defineProperty(o,"__esModule",{value:!0}),o.ButtonElementComponent=void 0;const u=i;class l extends u.BaseElementComponent{Type(e){return this.type=e,this}Text(e){return this.text=null==e||e,this}Round(e){return this.round=null==e||e,this}Circle(e){return this.circle=null==e||e,this}Disabled(e){return this.disabled=null==e||e,this}AutoInsertSpace(e){return this.autoInsertSpace=null==e||e,this}Color(e){return this.color=e,this}ClickEventName(e){return this.clickEventName=e,this}PowerName(e){return this.powerName=e,this}OtherParams(e){return this.params=e,this}static get Ins(){return new this}}o.ButtonElementComponent=l;var h={};Object.defineProperty(h,"__esModule",{value:!0}),h.ComoDialogComponent=void 0;const a=i;class m extends a.BaseElementComponent{ShowClose(e){return this.showClose=null==e||e,this}DestroyOnClose(e){return this.destroyOnClose=null==e||e,this}Center(e){return this.center=null==e||e,this}CloseOnPressEscape(e){return this.closeOnPressEscape=null==e||e,this}CloseOnClickModal(e){return this.closeOnClickModal=null==e||e,!1}AppendToBBody(e){return this.appendToBBody=null==e||e,this}Modal(e){return this.modal=null==e||e,this}Top(e){return this.top=e,this}Draggable(e){return this.draggable=null==e||e,this}Width(e){return this.width=e,this}Fullscreen(e){return this.fullscreen=null==e||e,this}MaxBtn(e){return this.maxBtn=null==e||e,this}Title(e){return this.title=e,this}TitleBgColor(e){return this.titleBgColor=e,this}TitleColor(e){return this.titleColor=e,this}Btns(e){return this.btns=e,this}static get Ins(){return new this}}h.ComoDialogComponent=m;var c={};Object.defineProperty(c,"__esModule",{value:!0}),c.EchartsGenderOptions=void 0;c.EchartsGenderOptions=class{Title(e){return this.title=e,this}BgColor(e){return this.backgroundColor=e,this}TextStyle(e){return this.textStyle=e,this}Animation(e){return this.animation=null==e||e,this}AnimationThreshold(e){return this.animationThreshold=null==e||e,this}AnimationDuration(e){return this.animationDuration=null!=e?e:1e3,this}Media(e){return this.media=null!=e?e:[],this}ToolTip(e){return this.tooltip=e,this}XAxis(e){return this.xAxis=e,this}YAxis(e){return this.yAxis=e,this}Series(e){return this.series=e,this}InitSeries(){this.series||(this.series=[])}SeriesLine(e){return this.InitSeries(),this.series.push(e),this}SeriesBar(e){return this.InitSeries(),this.series.push(e),this}SeriesPie(e){return this.InitSeries(),this.series.push(e),this}SeriesTree(e){return this.InitSeries(),this.series.push(e),this}SeriesSunburst(e){return this.InitSeries(),this.series.push(e),this}SeriesCandlestick(e){return this.InitSeries(),this.series.push(e),this}SeriesGraph(e){return this.InitSeries(),this.series.push(e),this}SeriesGauge(e){return this.InitSeries(),this.series.push(e),this}Legend(e){return this.legend=e,this}Grid(e){return this.grid=e,this}Toolbox(e){return this.toolbox=e,this}ToOptions(){const e={options:this._options},t=Object.keys(this);for(let n=0;n<t.length;n++){const r=t[n];e[r]=this[r]}return e}static get Ins(){return new this}};var p={};Object.defineProperty(p,"__esModule",{value:!0}),p.ElementFormColumnGender=void 0;p.ElementFormColumnGender=class{static get Ins(){return new this}Name(e){return this.label=e,this}Field(e){return this.prop=e,this}Required(e){return this.required=null==e||e,this}Value(e){return this.value=null!=e?e:"",this}Type(e){return this.type=e,this}Options(e){return this.options=e,this}Width(e){return this.width=e,this}Other(e,t){return this[e]=t,this}List(e){return this.list=e,this}Convert(){const e={},t=Object.keys(this);for(let n=0;n<t.length;n++){const r=t[n];e[r]=this[r]}return e.customName||(e.customName="buttons"),e.type||(e.type="input"),e}};var d={};Object.defineProperty(d,"__esModule",{value:!0}),d.ComoFormComponent=void 0;const C=i;class b extends C.BaseElementComponent{FormConfig(e){return this.config=e,this}ItemBottomMargin(e){return this.formItemMarginBottom=e,this}SubmitButtonName(e){return this.submitBtnName=e,this}SubmitBtnOptions(e){return this.submitBtnOptions=e,this}SubmitBtnStyle(e){return this.submitBtnStyle=e,this}Options(e){return this.options=e,this}Border(){return this.border=!0,this}toObject(){const e={},t=Object.keys(this);for(let n=0;n<t.length;n++){const r=t[n];e[r]=this[r]}return e.submitBtnName||(e.submitBtnName="提交"),e}static get Ins(){return new this}}d.ComoFormComponent=b;var g={};Object.defineProperty(g,"__esModule",{value:!0}),g.StringSize=g.SleepTime=g.UrlToObject=void 0;g.UrlToObject=function(e){let t={};const n=e.match(/[?&][^?&]+=[^?&%]+/g);return n&&n instanceof Array&&n.forEach((e=>{const n=e.substring(1).split("="),r=decodeURIComponent(n[0]),s=decodeURIComponent(n[1]);t[r]=s})),t};g.SleepTime=function(e){return e=null!=e?e:1e3,new Promise(((t,n)=>{setTimeout((()=>{t(!0)}),e)}))};g.StringSize=e=>{if(!e)return 0;const t=e.split("").reduce(((e,t)=>/[a-z]|[0-9]|[,;.!@#-+/\\$%^*()<>?:"'{}~]/i.test(t)?e+1:e+2),0);return Math.ceil(t/2)};var f={};Object.defineProperty(f,"__esModule",{value:!0}),f.ElementTableColumnGender=void 0;f.ElementTableColumnGender=class{get CurrentPage(){return 1}get PageSize(){return 20}static get Ins(){return new this}Options(e){return this.options=e,this}Name(e){return this.label=e,this}ColumnKey(e){return this.columnKey=e,this}MinWidth(e){return this.minWidth=e,this}Type(e){return this.type=e,this}CusTomName(e){return this.customName=e,this}Width(e){return this.width=e,this}Align(e){return this.align=e,this}Field(e){return this.prop=e,this}Fixed(e){return this.fixed=e,this}Format(e){return this.formatter=e,this}Other(e,t){return this[e]=t,this}Convert(){const e={},t=Object.keys(this);for(let n=0;n<t.length;n++){const r=t[n];e[r]=this[r]}return e.customName||(e.customName="buttons"),e}};var y={};Object.defineProperty(y,"__esModule",{value:!0}),y.ComoTableComponent=void 0;const O=i;class T extends O.BaseElementComponent{constructor(){super(...arguments),this._options={data:[]}}Columns(e){return this.columns=e,this}RowHeight(e,t){return this.rowHeight=`${e}${null!=t?t:"px"}`,this}Pagination(e){return this.pagination=e,this}Data(e){return this._options.data=e,this}Border(e){return this._options.border=null==e||e,this}TotalHeight(e){return this._options.height=null!=e?e:"75vh",this}MaxHeight(e){return this._options.maxHeight=null!=e?e:"75vh",this}Stripe(e){return this._options.stripe=null==e||e,this}ShowHeader(e){return this._options.showHeader=null==e||e,this}HighlightCurrentRow(e){return this._options.highlightCurrentRow=null==e||e,this}Size(e){return this._options.size=e,this}EmptyText(e){return this._options.emptyText=e,this}ShowSummary(e){return this._options.showSummary=null==e||e,this}FooterShow(e){return this.footerShow=null==e||e,this}ColumnFilterShow(e){return this.columnFilterShow=null==e||e,this}CardOptions(e){return this._cardOptions=e,this}toObject(){const e={options:this._options},t=Object.keys(this);for(let n=0;n<t.length;n++){const r=t[n];"_options"!==r&&(e[r]=this[r])}return e}static get Ins(){return new this}}y.ComoTableComponent=T;var S={};Object.defineProperty(S,"__esModule",{value:!0}),S.ElementTagComponent=void 0;const v=i;class E extends v.BaseElementComponent{Type(e){return this.type=e,this}Hit(){return this.hit=!0,this}Color(e){return this.color=e,this}Effect(e){return this.effect=e,this}Round(){return this.round=!0,this}ClickEventName(e){return this.clickEventName=e,this}PowerName(e){return this.powerName=e,this}OtherParams(e){return this.params=e,this}Style(e){return this.style=e,this}static get Ins(){return new this}}S.ElementTagComponent=E;var j={};Object.defineProperty(j,"__esModule",{value:!0}),j.UploadElementComponent=void 0;const w=i;class _ extends w.BaseElementComponent{ClickEventName(e){return this.clickEventName=e,this}PowerName(e){return this.powerName=e,this}BtnOptions(e){return this.btnOptions=e.toObject(),this}UploadOptions(e){return this.uploadOptions=e,this}static get Ins(){return new this}}j.UploadElementComponent=_;var P={};Object.defineProperty(P,"__esModule",{value:!0}),P.WebCacheManager=void 0;const I=e;P.WebCacheManager=class{constructor(e=window.sessionStorage){this.cacheIns=e}getItem(e){const t=this,n=t.cacheIns.getItem(e);if(!n)return null;const r=I.ComoTsUtils.Ins.JsonDecode(n);if(!r.expireTime)return r.value;const s=I.ComoTsUtils.Ins.Time();return r.expireTime-s<=0?(t.delItem(e),null):r.value}setItem(e,t,n=0){let r=0;n>0&&(r=I.ComoTsUtils.Ins.Time()+n);const s={value:t,expireTime:r};return this.cacheIns.setItem(e,I.ComoTsUtils.Ins.JsonEncode(s)),this}delItem(e){return this.cacheIns.removeItem(e),this}clear(){return this.cacheIns.clear(),this}static Ins(e=window.sessionStorage){return new this(e)}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UploadElementComponent=t.StringSize=t.SleepTime=t.UrlToObject=t.WebCacheManager=t.EchartsGenderOptions=t.ComoTsRuleUtil=t.ElementTagComponent=t.ComoTableComponent=t.ComoFormComponent=t.ComoDialogComponent=t.ButtonElementComponent=t.BaseElementComponent=t.ElementTableColumnGender=t.ElementFormColumnGender=void 0;const n=e;Object.defineProperty(t,"ComoTsRuleUtil",{enumerable:!0,get:function(){return n.ComoTsRuleUtil}});const r=i;Object.defineProperty(t,"BaseElementComponent",{enumerable:!0,get:function(){return r.BaseElementComponent}});const s=o;Object.defineProperty(t,"ButtonElementComponent",{enumerable:!0,get:function(){return s.ButtonElementComponent}});const u=h;Object.defineProperty(t,"ComoDialogComponent",{enumerable:!0,get:function(){return u.ComoDialogComponent}});const l=c;Object.defineProperty(t,"EchartsGenderOptions",{enumerable:!0,get:function(){return l.EchartsGenderOptions}});const a=p;Object.defineProperty(t,"ElementFormColumnGender",{enumerable:!0,get:function(){return a.ElementFormColumnGender}});const m=d;Object.defineProperty(t,"ComoFormComponent",{enumerable:!0,get:function(){return m.ComoFormComponent}});const C=g;Object.defineProperty(t,"SleepTime",{enumerable:!0,get:function(){return C.SleepTime}}),Object.defineProperty(t,"StringSize",{enumerable:!0,get:function(){return C.StringSize}}),Object.defineProperty(t,"UrlToObject",{enumerable:!0,get:function(){return C.UrlToObject}});const b=f;Object.defineProperty(t,"ElementTableColumnGender",{enumerable:!0,get:function(){return b.ElementTableColumnGender}});const O=y;Object.defineProperty(t,"ComoTableComponent",{enumerable:!0,get:function(){return O.ComoTableComponent}});const T=S;Object.defineProperty(t,"ElementTagComponent",{enumerable:!0,get:function(){return T.ElementTagComponent}});const v=j;Object.defineProperty(t,"UploadElementComponent",{enumerable:!0,get:function(){return v.UploadElementComponent}});const E=P;Object.defineProperty(t,"WebCacheManager",{enumerable:!0,get:function(){return E.WebCacheManager}})}(s);export{n as a,t as c,r as g,s as m};