2 lines
16 KiB
Java
2 lines
16 KiB
Java
|
|
var Fe=Object.defineProperty,Ce=Object.defineProperties;var _e=Object.getOwnPropertyDescriptors;var ne=Object.getOwnPropertySymbols;var Oe=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;var ae=(t,l,i)=>l in t?Fe(t,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[l]=i,H=(t,l)=>{for(var i in l||(l={}))Oe.call(l,i)&&ae(t,i,l[i]);if(ne)for(var i of ne(l))ve.call(l,i)&&ae(t,i,l[i]);return t},Q=(t,l)=>Ce(t,_e(l));var M=(t,l,i)=>new Promise((s,f)=>{var a=o=>{try{d(i.next(o))}catch(n){f(n)}},e=o=>{try{d(i.throw(o))}catch(n){f(n)}},d=o=>o.done?s(o.value):Promise.resolve(o.value).then(a,e);d((i=i.apply(t,l)).next())});import{u as Ee,F as X,b as De}from"./useExtendComponent-DsD-dPUC.js";import{d as ke}from"./user.api-M95RuX7p.js";import{aK as $,d2 as Le,u as Re,ba as Ne,d as Ie,at as Je,b8 as je}from"./index-X7Y8jykP.js";import{C as ue}from"./customExpression-DKKqya45.js";import{w as Ae,q as Ye}from"./quarterOfYear-BU2sPnff.js";import{L as oe}from"./constant-DfcHKztj.js";import{useAppInject as Pe}from"./useAppInject-DPZGPcR3.js";import{r as D,c as pe,b as ee,h as fe,n as Me,t as $e}from"./vue-vendor-DNhG1Cve.js";$.extend(Ae);$.extend(Ye);const ce=Object.keys(ue),qe=ce.join(","),He=ce.map(t=>ue[t]),me=/#{([^}]+)?}/g,be=/{{([^}]+)?}}/g,W=/\${([^}]+)?}/g,he={ADD:"add"};function z(t,l,i){if(te(l.defVal)){const s={field:t,type:l.type,value:l.defVal,view:l.view,fieldExtendJson:l.fieldExtendJson},f=i.findIndex(a=>a.field===t);f===-1?i.push(s):i[f]=s}}function Ke(t,l){te(t.fieldDefaultValue)&&l.push({field:t.key,type:t.type,value:t.fieldDefaultValue})}function pt(t,l,i){return M(this,null,function*(){if(Array.isArray(t)&&t.length>0){let s={};for(let f of t){let{value:a,type:e,field:d}=f;a=yield ge(a,he.ADD,i||{}),e==="number"&&a&&(a=Number.parseFloat(a)),a=Be(f,a),s[d]=a}l(s)}})}function Be(t,l){const{type:i,field:s,view:f,fieldExtendJson:a}=t;if(f=="date"&&a){const e=JSON.parse(a),{picker:d}=e;if(d&&d!="default"&&l){let o;try{if(d==="year"){const h=l.split("-")[0];o=$().year(h).format("YYYY-MM-DD")}if(d==="month"){const n=l.split("-"),h=n[0],y=+n[1]+1;o=$().year(h).month(y).format("YYYY-MM-DD")}if(d==="week"){const n=l.split("-"),h=n[0],y=n[1].match(/^(\d+)周$/)[1];o=$().year(h).week(y).format("YYYY-MM-DD")}if(d==="quarter"){const n=l.split("-"),h=n[0],y=n[1].match(/^[Qq](\d)$/)[1];o=$().year(h).quarter(y).format("YYYY-MM-DD")}}catch(n){o=l}return o}return l}return l}function ct(t,l,i){return M(this,null,function*(){let{defVal:s,type:f}=l;if(te(s)){let a=yield ge(s,he.ADD,{});if(f==="number"&&a)if(l.mode=="group"&&typeof a=="string"&&a.indexOf(",")!=-1){const e=a.split(",");a=[],e[0]&&a.push(Number.parseFloat(e[0])),e[1]&&a.push(Number.parseFloat(e[1]))}else a=Number.parseFloat(a);i[t]=a}})}function te(t){return!!(t||t===0)}function ge(t,l,i){return M(this,null,function*(){if(t!=null&&xe(t)){let s=yield Ue(t,l,i);if(s!=null)return s}return t})}function xe(t){let l=0,i=0,s=0;if(t.replace(W,()=>s++),s>1)return!1;t.replace(me,()=>l++),t.replace(be,()=>i++);let f=l+i;return!(s>0&&f>0)}function ye(t,l){let i=new Map;return t.replace(l,function(s,f){return i.set(s,f.trim()),s}),i}function Ue(t,l,i){return M(this,null,function*(){return W.test(t)?yield Z(t,W,Qe,[i]):(t=yield Z(t,me,Ve),t=yield Z(t,be,Ge),t)})}function Z(f,a,e){return M(this,arguments,function*(t,l,i,s=[]){let d=ye(t,l);for(let o of d.keys()){let n=d.get(o),h=yield i.apply(null,[n,o,...s]);if(o===t)return h;t=Le(t,o,h)}return t})}function Ve(t,l){return M(this,null,function*(){switch(t){case"date":return $().format("YYYY-MM-DD");case"time":return $().format("HH:mm:ss");case"datetime":return $().format("YYYY-MM-DD HH:mm:ss");default:let i=We(t);return i!=null?i:l}})}function We(t){let i=Re().getUserInfo;if(i)switch(t){case"sysUserId":return i.id;case"sysUserCode":case"sys_user_code":return i.username;case"sysUserName":return i.realname;case"sysOrgCode":case"sys_org_code":return i.orgCode}return null}function Ge(t,l){return M(this,null,function*(){let i=Ne(`(function (${qe}){ return ${t} })`);try{return i.apply(null,He)}catch(s){return l}})}funct
|