@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
234 lines • 167 kB
JavaScript
(function(H,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("../dynamic-resolver/index.umd.js"),require("../common/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../button-edit/index.umd.js"),require("../locale/index.umd.js"),require("lodash-es"),require("../list-view/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../property-panel/index.umd.js"),require("../tree-view/index.umd.js"),require("../tags/index.umd.js"),require("../popover/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../dynamic-resolver/index.umd.js","../common/index.umd.js","../designer-canvas/index.umd.js","../button-edit/index.umd.js","../locale/index.umd.js","lodash-es","../list-view/index.umd.js","../../designer/button-edit/index.umd.js","../property-panel/index.umd.js","../tree-view/index.umd.js","../tags/index.umd.js","../popover/index.umd.js"],t):(H=typeof globalThis<"u"?globalThis:H||self,t(H["expression-editor"]={},H.Vue,H.dynamicResolver,H.common,H.designerCanvas,H.FButtonEdit$1,H.locale,H.LodashES,H.FListView,H.FButtonEditDesign,H.propertyPanel,H.FTreeView,H.FTags,H.FPopover))})(this,function(H,t,U,G,se,he,K,ne,it,lt,rt,st,ct,ut){"use strict";var ba=Object.defineProperty;var ka=(H,t,U)=>t in H?ba(H,t,{enumerable:!0,configurable:!0,writable:!0,value:U}):H[t]=U;var Q=(H,t,U)=>ka(H,typeof t!="symbol"?t+"":t,U);const Se={modelValue:{type:String,default:""},singleExpand:{type:Boolean,default:!0},entities:{type:Array,default:[]},variables:{type:Array,default:[]},disabledFunctions:{type:Object,default:null},esprimaPath:{type:String,default:"assets/esprima-config.json"},showMessage:{type:Boolean,default:!1},validateMessage:{type:String,default:""},messageType:{type:String,default:"info"},showMessageType:{type:Boolean,default:!1},showDataPanel:{type:Boolean,default:!0},isServerSide:{type:Boolean,default:!1}},Ne=new Map([["appearance",U.resolveAppearance]]);function Me(e,n,a){return n}const dt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/layout.schema.json",title:"layout",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for layout component",type:"string"},type:{description:"The type string of layout component",type:"string",default:"layout"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},collapsable:{description:"",type:"boolean",default:!1},resizable:{description:"",type:"boolean",default:!0},visible:{description:"",type:"boolean",default:!0}},required:["id","type","contents"]},ft={title:"layout",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"类型",title:"类型",type:"string",readonly:!0}}},behavior:{description:"Basic Infomation",title:"行为",properties:{collapsable:{description:"",title:"可收折",type:"boolean"},resizable:{description:"",title:"可调整尺寸",type:"boolean"}}}}},ge={customStyle:{type:String,defaut:""},customClass:{type:String,defaut:""}},Oe=U.createPropsResolver(ge,dt,Ne,Me,ft);function Ve(e){const n=t.ref(-1),a=t.ref(-1),o=t.ref(0),i=t.ref(0),l=t.ref(!1),s=t.ref(!1),c=t.computed(()=>({display:l.value?"block":"none",left:`${o.value}px`,cursor:"e-resize"})),d=t.computed(()=>({display:s.value?"block":"none",top:`${i.value}px`,cursor:"n-resize"})),m=t.computed(()=>{const r={display:s.value||l.value?"block":"none"};return i.value>0&&(r.cursor="n-resize"),r});function g(r,y,f,k){const S=e.value;if(S){const{left:u,right:p,width:b}=S.getBoundingClientRect();let C=r.clientX-u;k==="right"&&(C=p-r.clientX),C>y&&(C=y),C<f&&(C=f),k==="right"&&(C=b-C),o.value=C}}function h(r,y,f,k){const S=e.value;if(S){const{top:u,bottom:p,height:b}=S.getBoundingClientRect();let C=r.clientY-u;k==="bottom"&&(C=p-r.clientY),C>y&&(C=y),C<f&&(C=f),k==="bottom"&&(C=b-C),i.value=C}}function v(){const r=e.value;if(r){const{width:y,height:f}=r.getBoundingClientRect();return{width:y,height:f}}return null}function N(){const r=e.value;return r?Array.from(r.querySelectorAll("[data-position]")).reduce((y,f)=>{const k=f.getAttribute("data-position");return y=Object.assign(y,{[k]:f}),y},{}):null}function x(r,y){const f=v(),k=N();if(f&&k){const S=k==null?void 0:k.right,u=k==null?void 0:k.left;if(r==="left"&&u)return S?f.width-S.clientWidth-y:f.width-y;if(r==="right"&&S)return u?f.width-u.clientWidth-y:f.width-y}}function T(r,y){const f=v(),k=N();if(f&&k){const S=k==null?void 0:k.bottom,u=k==null?void 0:k.top;if(r==="top"&&u)return S?f.height-S.clientHeight-y:f.height-y;if(r==="bottom"&&S)return u?f.height-u.clientHeight-y:f.height-y}}return{horizontalResizeHandleStyle:c,verticalResizeHandleStyle:d,resizeOverlayStyle:m,showHorizontalResizeHandle:l,showVerticalResizeHandle:s,horizontalResizeBarPosition:n,verticalResizeBarPosition:a,verticalResizeHandleOffset:i,horizontalResizeHandleOffset:o,draggingHorizontalResizeHandle:g,draggingVerticalResizeHandle:h,getPanelMaxHeight:T,getPanelMaxWidth:x}}const J=t.defineComponent({name:"FLayout",props:ge,emits:[],setup(e,n){const a=t.ref(),o=Ve(a),{horizontalResizeHandleStyle:i,verticalResizeHandleStyle:l,resizeOverlayStyle:s}=o;t.provide("layout",{useResizeHandleComposition:o});const c=t.computed(()=>{const m={"f-layout":!0};return G.getCustomClass(m,e==null?void 0:e.customClass)}),d=t.computed(()=>{const m={};return G.getCustomStyle(m,e==null?void 0:e.customStyle)});return()=>t.createVNode("div",{class:c.value,style:d.value,ref:a},[n.slots.default&&n.slots.default(),t.createVNode("div",{class:"f-layout-resize-overlay",style:s.value},null),t.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:i.value},null),t.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:l.value},null)])}}),mt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/layout-pane.schema.json",title:"layout-pane",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a layout pane",type:"string"},type:{description:"The type string of layout paney",type:"string",default:"layout-pane"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},collapsable:{description:"",type:"boolean",default:!1},contents:{description:"",type:"array",default:[]},height:{description:"",type:"number"},position:{description:"",type:"string",default:"left",enum:["left","center","right","top","bottom"]},resizeable:{description:"",type:"boolean",default:!0},width:{description:"",type:"number"},visible:{description:"",type:"number",default:!0}},required:["id","type","contents"]},yt={title:"layout-pane",description:"A Farris Container Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"enum"},width:{description:"",type:"number",title:"宽度"},height:{description:"",type:"number",title:"高度"}}},appearance:{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:""},style:{title:"style",type:"string",description:""}}},behavior:{description:"",title:"行为",properties:{collapsable:{description:"",type:"boolean",title:"允许收折"},position:{description:"",type:"enum",title:"位置",editor:{type:"combo-list",data:[{id:"left",name:"左侧"},{id:"center",name:"居中"},{id:"right",name:"右侧"},{id:"top",name:"顶部"},{id:"bottom",name:"底部"}]}},resizeable:{description:"",type:"boolean",title:"允许调整尺寸"},visible:{description:"运行时组件是否可见",type:"boolean",title:"是否可见"}}}}},ve={customClass:{type:String,defaut:""},customStyle:{type:String,defaut:""},width:{type:Number,default:-1},height:{type:Number,default:-1},position:{type:String,default:"left"},visible:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},collapsable:{type:Boolean,default:!1},minWidth:{type:Number,default:100},minHeight:{type:Number,default:100},maxWidth:{type:Number,default:null}},Be=U.createPropsResolver(ve,mt,Ne,Me,yt);function Ee(e,n,a,o,i,l){const{horizontalResizeBarPosition:s,horizontalResizeHandleOffset:c,showHorizontalResizeHandle:d,showVerticalResizeHandle:m,verticalResizeBarPosition:g,verticalResizeHandleOffset:h,draggingHorizontalResizeHandle:v,draggingVerticalResizeHandle:N,getPanelMaxHeight:x,getPanelMaxWidth:T}=i;let r="",y,f,k;const S=()=>l.maxWidth?l.maxWidth:T(r,a.value)||0;function u(C){if((r==="left"||r==="right")&&f){const{left:D}=f.getBoundingClientRect(),{width:R}=y.getBoundingClientRect(),V=C.clientX-D;let O=r==="left"?(R||0)+(V-s.value):(R||0)-(V-s.value);O=a.value>0?Math.max(a.value,O):O;const w=S();w!=null&&(O=w>O?O:w),e.value=O}if((r==="top"||r==="bottom")&&f){const{top:D}=f.getBoundingClientRect(),{height:R}=y.getBoundingClientRect(),V=C.clientY-D;let O=r==="top"?(R||0)+(V-g.value):(R||0)-(V-g.value);O=o.value>0?Math.max(o.value,O):O;const w=x(r,o.value);w!=null&&(O=w>O?O:w),n.value=O}c.value=0,h.value=0,s.value=-1,g.value=-1,d.value=!1,m.value=!1,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",u),document.body.style.userSelect="",r="",y=null,f=null}function p(C,D,R){if(r=D,y=R,d.value=!0,f=C.composedPath().find(O=>(O.className||"").split(" ")[0]==="f-layout"),f){const{left:O}=f.getBoundingClientRect(),w=C.clientX-O;c.value=w,s.value=w;const B=S();k=E=>v(E,B,a.value,r),document.addEventListener("mousemove",k),document.addEventListener("mouseup",u),document.body.style.userSelect="none"}}function b(C,D,R){if(r=D,y=R,m.value=!0,f=C.composedPath().find(O=>(O.className||"").split(" ")[0]==="f-layout"),f){const{top:O}=f.getBoundingClientRect();h.value=C.clientY-O,g.value=C.clientY-O;const w=x(r,o.value)||0;k=B=>N(B,w,o.value,r),document.addEventListener("mousemove",k),document.addEventListener("mouseup",u),document.body.style.userSelect="none"}}return{onClickHorizontalResizeBar:p,onClickVerticalResizeBar:b}}const _=t.defineComponent({name:"FLayoutPane",props:ve,emits:[],setup(e,n){const a=t.ref(e.minHeight<=0?100:e.minHeight),o=t.ref(e.minWidth<=0?100:e.minWidth),i=t.ref(e.width<=0?100:e.width),l=t.ref(e.height<=0?100:e.height),s=t.ref(Math.max(a.value,l.value)),c=t.ref(Math.max(o.value,i.value)),d=t.ref(),m=t.ref(e.position),g=t.ref(e.resizable);t.watch(()=>e.resizable,u=>{g.value=u});const h=t.inject("layout"),{useResizeHandleComposition:v}=h,N=Ee(c,s,o,a,v,e),{onClickHorizontalResizeBar:x,onClickVerticalResizeBar:T}=N,r=t.computed(()=>({"f-layout-resize-bar":!0,"f-layout-resize-bar-e":m.value==="left","f-layout-resize-bar-n":m.value==="bottom","f-layout-resize-bar-s":m.value==="top","f-layout-resize-bar-w":m.value==="right"})),y=t.computed(()=>m.value!=="center"&&g.value);function f(u,p){(p==="left"||p==="right")&&x(u,p,d.value),(p==="top"||p==="bottom")&&T(u,p,d.value)}const k=t.computed(()=>{const u={"f-layout-pane":!0,"f-page-content-nav":m.value==="left"||m.value==="right","f-page-content-main":m.value==="center"};return e.customClass&&String(e.customClass).split(" ").reduce((p,b)=>(p[b]=!0,p),u),u}),S=t.computed(()=>{const u={};return(c.value&&m.value==="left"||m.value==="right")&&(u.width=`${c.value}px`),(s.value&&m.value==="bottom"||m.value==="top")&&(u.height=`${s.value}px`),e.visible||(u.display="none"),u});return()=>t.createVNode("div",{ref:d,class:k.value,style:S.value,"data-position":m.value},[n.slots.default&&n.slots.default(),y.value&&t.createVNode("span",{class:r.value,onMousedown:u=>f(u,m.value)},null)])}});function pt(e,n){function a(){return!1}return{canAccepts:a}}const ht=t.defineComponent({name:"FLayoutDesign",props:ge,emits:[],setup(e,n){var g;const a=t.ref(),o=t.inject("design-item-context"),i=pt(o.schema,(g=o.parent)==null?void 0:g.schema),l=se.useDesignerComponent(a,o,i);l.value.canNested=!1;const s=Ve(a),{horizontalResizeHandleStyle:c,verticalResizeHandleStyle:d,resizeOverlayStyle:m}=s;return t.provide("layout",{useResizeHandleComposition:s}),t.onMounted(()=>{a.value.componentInstance=l}),n.expose(l.value),()=>t.createVNode("div",{class:"f-layout f-page-content",ref:a},[n.slots.default&&n.slots.default(),t.createVNode("div",{class:"f-layout-resize-overlay",style:m.value},null),t.createVNode("div",{class:"f-layout-horizontal-resize-proxy",style:c.value},null),t.createVNode("div",{class:"f-layout-vertical-resize-proxy",style:d.value},null)])}});function gt(e,n){const a=e.schema;function o(l){return!!se.useDragulaCommonRule().basalDragulaRuleForContainer(l)}function i(){const l=["f-layout-pane"];return(a.position==="left"||a.position==="right")&&l.push("f-page-content-nav"),a.position==="center"&&l.push("f-page-content-main"),l.join(" ")}return{canAccepts:o,getDesignerClass:i}}const vt=t.defineComponent({name:"FLayoutPaneDesign",props:ve,emits:[],setup(e,n){const a=t.ref(),o=t.ref();t.inject("designer-host-service");const i=t.inject("design-item-context"),l=gt(i),s=se.useDesignerComponent(o,i,l);s.value.canNested=!1,s.value.canMove=!1,s.value.canDelete=!1,t.onMounted(()=>{o.value.componentInstance=s}),n.expose(s.value);const c=t.ref(Math.max(e.minHeight,e.height)),d=t.ref(Math.max(e.minWidth,e.width)),m=t.ref(e.minHeight),g=t.ref(e.minWidth),h=t.ref(e.position),v=t.inject("layout"),{useResizeHandleComposition:N}=v,x=Ee(d,c,g,m,N,e),{onClickHorizontalResizeBar:T,onClickVerticalResizeBar:r}=x,y=t.computed(()=>({"f-layout-resize-bar":!0,"f-layout-resize-bar-e":h.value==="left","f-layout-resize-bar-n":h.value==="bottom","f-layout-resize-bar-s":h.value==="top","f-layout-resize-bar-w":h.value==="right"}));function f(u,p){(p==="left"||p==="right")&&T(u,p,a.value),(p==="top"||p==="bottom")&&r(u,p,a.value)}const k=t.computed(()=>{const u={"f-layout-pane":!0,"f-page-content-nav":h.value==="left"||h.value==="right","f-page-content-main":h.value==="center"};return e.customClass&&String(e.customClass).split(" ").reduce((p,b)=>(p[b]=!0,p),u),u}),S=t.computed(()=>{const u={flex:"1"};return(d.value&&h.value==="left"||h.value==="right")&&(u.width=`${d.value}px`),(c.value&&h.value==="bottom"||h.value==="top")&&(u.height=`${c.value}px`),u});return()=>t.createVNode("div",{ref:a,class:k.value,style:S.value},[t.createVNode("div",{ref:o,class:"drag-container","data-dragref":`${i.schema.id}-container`},[n.slots.default&&n.slots.default()]),t.createVNode("span",{class:y.value,onMousedown:u=>f(u,h.value)},null)])}});J.install=e=>{e.component(J.name,J),e.component(_.name,_)},J.register=(e,n,a,o)=>{e.layout=J,n.layout=Oe,e["layout-pane"]=_,n["layout-pane"]=Be},J.registerDesigner=(e,n,a)=>{e.layout=ht,n.layout=Oe,e["layout-pane"]=vt,n["layout-pane"]=Be};const Pe=new Map([["appearance",U.resolveAppearance]]),De={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/combo-list.schema.json",title:"combo-list",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a combo list",type:"string"},type:{description:"The type string of number combo list component",type:"string",default:"combo-list"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disabled:{description:"",type:"boolean",default:!1},enableClear:{description:"",type:"boolean",default:!1},editable:{description:"",type:"boolean",default:!1},enableLinkLabel:{description:"",type:"boolean",default:!1},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},placeholder:{description:"",type:"string",default:"请选择"},idField:{description:"",type:"string",default:"id"},valueField:{description:"",type:"string",default:"id"},titleField:{description:"",type:"string",default:"name"},textField:{description:"",type:"string",default:"name"},dataSourceType:{description:"",type:"string",default:"static"},data:{description:"",type:"array"},dataSource:{description:"",type:"string"},remote:{description:"",type:"string"},readonly:{description:"",type:"boolean",default:!1},required:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},textAlign:{description:"",type:"string",enum:["left","middle","right"],default:"left"},multiSelect:{description:"",type:"boolean",default:!1},maxLength:{description:"",type:"number",default:null},visible:{description:"",type:"boolean",default:!0},onBlur:{description:"",type:"string",default:""},onClickLinkLabel:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:350},minPanelWidth:{description:"",type:"number",default:160},popupOnClick:{description:"",type:"boolean",default:!0},separator:{description:"",type:"string",default:","},viewType:{description:"",type:"string",default:"tag"},enableSearch:{description:"启用搜索",type:"boolean",default:!0},enableHighlightSearch:{description:"启用高亮搜索",type:"boolean",default:!1},beforeOpen:{description:"打卡面板前回调",type:"string"},onChange:{description:"值变化事件",type:"string",default:""},onInput:{description:"输入事件",type:"string",default:""},onClear:{description:"清空事件",type:"string",default:""},onDataChanged:{description:"清空事件",type:"string",default:""}},required:["type"],ignore:["id","appearance","binding","visible"],events:{onClear:"清空事件",onChange:"值变化事件",beforeOpen:"打开下拉面板前事件"}};function je(e,n,a){return n}function bt(){function e(n,a,o){const i={};return i.beforeOpen=l=>a.call("beforeOpen",n,[l,n],o),i}return{resolve:e}}const ce={id:{type:String},data:{type:Array,default:[]},disabled:{default:!1,type:Boolean},dropDownIcon:{type:String,default:'<span class="f-icon f-icon-arrow-chevron-down"></span>'},editable:{default:!1,type:Boolean},enableClear:{default:!0,type:Boolean},enableSearch:{type:Boolean,default:!1},enableTitle:{default:!0,type:Boolean},fitEditor:{default:!1,type:Boolean},forcePlaceholder:{default:!1,type:Boolean},hidePanelOnClear:{default:!0,type:Boolean},idField:{default:"id",type:String},mapFields:{type:Object},maxHeight:{default:350,type:Number},maxLength:{type:Number},multiSelect:{type:Boolean,default:!1},modelValue:{},placeholder:{type:String,default:"请选择"},placement:{type:String,default:"auto"},readonly:{default:!1,type:Boolean},remote:{default:null,type:Object},remoteSearch:{default:!1,type:Boolean},separator:{default:",",type:String},tabIndex:{type:Number,default:-1},textField:{default:"name",type:String},titleField:{default:"name",type:String},valueField:{default:"id",type:String},viewType:{default:"tag",type:String},change:{type:Function,default:()=>{}},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},autoHeight:{type:Boolean,default:!0},beforeOpen:{type:Function,default:null},load:{type:Function},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0},minPanelWidth:{type:Number,default:160},popupOnClick:{type:Boolean,default:!0}},kt=Object.assign({},ce,{readonly:{}});U.createPropsResolver(ce,De,Pe,je);const Ie=U.getPropsResolverGenerator(ce,De,Pe,je),Ct=bt(),xt={dataSource:{type:Array,default:[]},enableSearch:{type:Boolean,default:!1},idField:{type:String,default:"id"},multiSelect:{type:Boolean,default:!1},selectedValues:{type:String,default:""},separator:{type:String,default:","},textField:{type:String,default:"name"},titleField:{type:String,default:"name"},width:{type:Number},maxHeight:{type:Number},valueField:{type:String,default:"id"},onSelectionChange:{type:Function,default:()=>{}},searchOption:{type:[Boolean,Function],default:!1},enableHighlightSearch:{type:Boolean,default:!0}},wt=t.defineComponent({name:"FComboListContainer",props:xt,emits:["selectionChange"],setup(e,n){const a=t.ref(),o=t.ref(e.dataSource),i=t.ref([]),l=t.ref(e.separator),s=t.ref(e.width),c=t.ref(e.maxHeight),d=t.computed(()=>e.multiSelect),m=t.ref(e.multiSelect?String(e.selectedValues).split(l.value):[e.selectedValues]),g=t.computed(()=>({enableSelectRow:!0,multiSelect:e.multiSelect,multiSelectMode:"OnCheckAndClick",showCheckbox:d.value,showSelectAll:!1,showSelection:!0}));t.watch(e.dataSource,()=>{o.value=e.dataSource}),t.computed(()=>e.enableSearch?"SearchBar":"ContentHeader");const h=t.computed(()=>{const r={};return s.value!==void 0&&(r.width=`${s.value}px`),c.value!==void 0&&c.value>0&&(r.maxHeight=`${c.value}px`),r});function v(r){a.value.search(r)}function N(r){i.value=r.map(y=>Object.assign({},y)),m.value=r.map(y=>y[e.idField]),n.emit("selectionChange",i.value)}function x(r){if(e.enableHighlightSearch)return;let y=[];const{searchOption:f}=e;typeof f=="function"?y=o.value.filter(k=>f(r,k)):y=o.value.filter(k=>k[e.valueField].indexOf(r)>-1||k[e.textField].indexOf(r)>-1),a.value.updateDataSource(y)}t.watch([()=>e.selectedValues],([r])=>{e.multiSelect?m.value=r.split(l.value):m.value=[r]});function T(r){a.value.activeRowById(r)}return t.onMounted(()=>{var r,y;if(!e.multiSelect){const f=(r=m.value)==null?void 0:r[0];let k=f;const S=o.value.map(u=>u[e.valueField||e.idField]);if(!ne.isUndefined(f)&&S.includes(f)){const u=typeof f,p=typeof((y=o.value[0])==null?void 0:y[e.valueField||e.idField]);p==="number"&&u!==p&&(k=Number(f)),p==="boolean"&&u!==p&&(k=f==="true"?!0:f==="false"?!1:f),T(k)}}}),n.expose({search:v,activeRowById:T}),()=>t.createVNode("div",{class:"f-combo-list-container",style:h.value},[t.createVNode(it,{ref:a,size:"small",itemClass:"f-combo-list-item",itemContentClass:"text-truncate",header:"ContentHeader",headerClass:"f-combo-list-search-box",data:o.value,idField:e.idField,textField:e.textField,titleField:e.titleField,multiSelect:e.multiSelect,selection:g.value,enableHighlightSearch:e.enableHighlightSearch,selectionValues:m.value,onSelectionUpdate:N,onAfterSearch:x},null)])}});function Ft(e,n){const a=t.ref(""),o=t.ref(e.modelValue),i=t.ref(e.data||[]),l=t.ref(e.editable);function s(r){const y=e.multiSelect?String(r).split(e.separator):[String(r)],f=y.map(u=>[u,!0]),k=new Map(f);return i.value.filter(u=>k.has(String(u[e.valueField]))).sort((u,p)=>{const b=y.indexOf(u[e.valueField]),C=y.indexOf(p[e.valueField]);return b-C})}function c(r){const y=s(r).map(f=>f[e.textField]).join(e.separator);a.value=l.value?y||r:y}function d(r){if(e.multiSelect){const y=r.split(e.separator).map(k=>[k,!0]),f=new Map(y);return i.value.filter(k=>f.has(k[e.textField]))}return i.value.filter(y=>""+y[e.textField]===r)}function m(r){const y={};return y[e.idField]=r,y[e.textField]=r,[y]}function g(r){let y=d(r);const f=y&&y.length>0;return l.value&&!f&&(y=m(r)),y}function h(){const{url:r,method:y="GET",headers:f={"Content-Type":"application/json;charset=utf-8;"},body:k=null}=e.remote;if(!r)return;const S=y.toLowerCase()==="get"?{method:y,headers:f}:{method:y,headers:f,body:k};let u=!1;fetch(new Request(r,S)).then(p=>{var C,D;if(p.status===200)return u=!!((D=(C=p.headers)==null?void 0:C.get("content-type"))!=null&&D.includes("application/json")),u?p.text():p.json();throw p.status===405?new Error(K.LocaleService.getLocaleValue("comboList.remoteError")):new Error(p.statusText)}).then(p=>{p.length&&(i.value=u?JSON.parse(p):p,o.value&&c(o.value))}).catch(p=>{console.warn(p)})}e.remote&&(e.load?e.load().then(r=>{i.value=r}).catch(r=>{console.log(r)}):h()),t.watch(()=>e.data,()=>{i.value=e.data}),t.watch([i],([r],[y])=>{if(e.modelValue!=null&&!e.multiSelect){const f=r.find(k=>k[e.valueField]===o.value);f?f[e.valueField]!==o.value?(o.value=f[e.valueField],a.value=f[e.textField],n.emit("update:modelValue",f[e.valueField]),n.emit("change",[f],f[e.valueField])):a.value!==f[e.textField]&&(a.value=f[e.textField]):o.value!==""&&(o.value="",a.value="",n.emit("update:modelValue",""),n.emit("change",[],""))}}),t.watch(()=>e.modelValue,(r,y)=>{y!==r&&(o.value=r,c(r))});function v(r){i.value=r,n.emit("dataChanged",r)}function N(){return i.value}function x(){return a.value}function T(){const r=typeof e.beforeOpen=="function";return!e.beforeOpen||!r?Promise.resolve(!0):Promise.resolve().then(()=>e.beforeOpen({instance:{updateDataSource:v,getData:N,getDisplayText:x}})).then(y=>typeof(y==null?void 0:y.canOpen)=="boolean"?y==null?void 0:y.canOpen:!0)}return c(e.modelValue),{dataSource:i,displayText:a,editable:l,modelValue:o,beforeOpenList:T,getItemsByDisplayText:d,getItemsByValue:s,getSelectedItemsByDisplayText:g}}const ae=t.defineComponent({name:"FComboList",props:ce,emits:["clear","update:modelValue","change","input","dataChanged"],setup(e,n){const a=t.ref(),o=t.ref(),i=t.ref(e.disabled||e.readonly),l=t.ref(e.enableClear),s=t.ref(e.enableSearch),c=t.ref(e.readonly),{dataSource:d,displayText:m,editable:g,modelValue:h,getItemsByDisplayText:v,getItemsByValue:N,beforeOpenList:x}=Ft(e,n),T=t.ref(e.dropDownIcon);T.value==='<span class="f-icon f-icon-arrow-chevron-down"></span>'&&(T.value='<span id="'+e.id+'-icon-dropdown" class="f-icon f-icon-arrow-chevron-down"></span>');const r=t.computed(()=>e.multiSelect),y=t.computed(()=>o.value?o.value.elementRef.getBoundingClientRect().width:0);function f(){!r.value&&o.value&&o.value.hidePopup()}function k(E){m.value=E.map(L=>L[e.textField]).join(e.separator)||h.value;let j="";E.length===1?j=E[0][e.valueField]:j=E.map(L=>L[e.valueField]).join(e.separator),h.value!==j&&(h.value=j,n.emit("update:modelValue",h.value),n.emit("change",E,h.value))}function S(){const E=N(h.value);k(E)}function u(){c.value||m.value}function p(E){var j;h.value="",(j=a.value)==null||j.activeRowById(""),n.emit("clear")}function b(E){var j,L;e.enableSearch&&e.enableHighlightSearch&&((j=a.value)==null||j.search(E)),(L=a.value)==null||L.activeRowById(E),n.emit("change",[h.value],h.value)}function C(E){if(e.multiSelect){const j=v(E);e.viewType;const M=j.map(P=>P[e.idField||e.valueField]).join(e.separator);h.value!==M&&(h.value=M,n.emit("update:modelValue",h.value),n.emit("change",j,h.value))}else E!==h.value&&(h.value=E,n.emit("update:modelValue",h.value),n.emit("change",[],E))}function D(){return m.value}function R(E){const{value:j}=E.target;b(j),n.emit("input",j)}function V(){o.value.hidePopup()}function O(E){d.value=E}function w(){return d.value}const B={getDisplayText:D,hidePopup:V,updateDataSource:O,getData:w};return n.expose(B),t.watch([()=>e.disabled,()=>e.editable,()=>e.enableClear,()=>e.enableSearch,()=>e.readonly],([E,j,L,M,P])=>{i.value=E,g.value=j,l.value=L,s.value=M,c.value=P}),()=>t.createVNode(he,{ref:o,id:e.id,disable:i.value,readonly:c.value,forcePlaceholder:e.forcePlaceholder,editable:g.value,buttonContent:T.value,placeholder:e.placeholder==="请选择"?K.LocaleService.getLocaleValue("comboList.placeholder"):e.placeholder,enableClear:l.value,maxLength:e.maxLength,tabIndex:e.tabIndex,enableTitle:e.enableTitle,multiSelect:e.multiSelect,inputType:e.multiSelect?e.viewType:"text",modelValue:m.value,"onUpdate:modelValue":E=>m.value=E,focusOnCreated:e.focusOnCreated,selectOnCreated:e.selectOnCreated,onClear:p,onClick:u,onChange:C,onBlur:S,onInput:R,beforeOpen:x,placement:e.placement,popupMinWidth:e.minPanelWidth,popupClass:"f-combo-list-wrapper",popupOnClick:e.popupOnClick,limitContentBySpace:!0},{default:()=>[t.createVNode(wt,{ref:a,idField:e.idField,valueField:e.valueField,textField:e.textField,titleField:e.titleField,dataSource:d.value,selectedValues:h.value,separator:e.separator,multiSelect:e.multiSelect,enableSearch:s.value,maxHeight:e.maxHeight,enableHighlightSearch:e.enableHighlightSearch,width:e.fitEditor?y.value:void 0,onSelectionChange:E=>{k(E),f()}},null)]})}}),Re={convertFrom:(e,n)=>(e.editor.remote||{})[n],convertTo:(e,n,a)=>{e.editor.remote=e.editor.remote||{},e.editor.remote[n]=a}};class Tt extends rt.InputBaseProperty{constructor(n,a){super(n,a)}getCommonEditorProperties(n){var a,o,i;return{viewType:{visible:!!((a=n.editor)!=null&&a.multiSelect),description:"数据展示类型,有标签和文本两种方式",title:"数据展示类型",type:"enum",editor:{data:[{id:"tag",name:"标签"},{id:"text",name:"文本"}]},refreshPanelAfterChanged:!0},separator:{visible:!!((o=n.editor)!=null&&o.multiSelect)&&((i=n.editor)==null?void 0:i.viewType)==="text",description:"下拉列表启用多选且数据展示类型为文本时的分隔符",title:"分隔符",type:"enum",editor:{data:[{id:",",name:"逗号(,)"},{id:"#",name:"井号(#)"},{id:".",name:"句号(.)"},{id:"|",name:"竖线(|)"}]}},editable:{description:"",title:"允许编辑",type:"boolean",refreshPanelAfterChanged:!0,readonly:!0}}}getEditorProperties(n){var d,m,g,h,v,N,x,T,r,y,f,k,S;const a=this;let o="";if(((d=n==null?void 0:n.binding)==null?void 0:d.type)==="Form"){const u=this.schemaService.getFieldByIDAndVMID(n.binding.field,this.viewModelId);(m=u==null?void 0:u.schemaField)!=null&&m.type&&(o=u.schemaField.type.$type)}const i=this.getPropertyEditorParams(n,["Variable"]),l=!n.editor.dataSourceType||n.editor.dataSourceType==="static",s=(((h=(g=this.designViewModelField)==null?void 0:g.type)==null?void 0:h.$type)===G.FormSchemaEntityFieldType$Type.StringType||!!this.formRule&&((v=this.designerHostService.schemaService.getFieldByID(n.binding.field))==null?void 0:v.type.$type)===G.FormSchemaEntityFieldType$Type.StringType)&&((N=n.editor)==null?void 0:N.type)==="combo-list"&&((x=n.editor)==null?void 0:x.dataSourceType)==="dynamic"&&!((r=(T=n.editor)==null?void 0:T.remote)!=null&&r.url)&&!((y=n.editor)!=null&&y.multiSelect);return a.getComponentConfig(n,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},dataSourceType:{description:"",title:"数据源类型",type:"enum",editor:{default:"static",data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},dataSource:{description:"动态数据源绑定变量",visible:s,title:"数据",editor:{...i,controlName:"",enableClear:!0},refreshPanelAfterChanged:!0},data:{description:"",title:"数据",type:"array",visible:l,...a.getItemCollectionEditor(n,n.editor.valueField,n.editor.textField),refreshPanelAfterChanged:!0},url:{visible:n.editor.dataSourceType==="dynamic"&&!((f=n.editor)!=null&&f.dataSource),$converter:Re,description:"",title:"服务端API",type:"string",refreshPanelAfterChanged:!0},body:{visible:!1,$converter:Re,description:"",title:"服务端API参数",type:"string"},textField:{description:"",title:"数据源显示字段",type:"string",readonly:n.editor.dataSourceType!=="dynamic"},valueField:{description:"",title:"数据源值字段",type:"string",readonly:n.editor.dataSourceType!=="dynamic"},multiSelect:{description:"",title:"启用多选",visible:!o||o==="StringType",readonly:((k=n.editor)==null?void 0:k.dataSourceType)==="dynamic"&&!!((S=n.editor)!=null&&S.dataSource),type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,needValid:!0}},...this.getCommonEditorProperties(n)},(u,p)=>{if(!u||!p.editor)return;const b=this;switch(u.propertyID){case"dataSourceType":{u.propertyValue==="static"?(p.editor.valueField="value",p.editor.textField="name",p.editor.remote=null):u.propertyValue==="dynamic"&&(p.editor.remote={method:"GET"},p.editor.valueField="value",p.editor.textField="name");break}case"data":{!b.checkEnumDataReadonly(p)&&p.formatter&&(p.formatter.data=[...u.propertyValue]);break}case"viewType":{u.propertyValue==="tag"&&(p.editor.editable=!1);break}case"dataSource":b.afterMutilEditorChanged(p,u)}})}getGridFieldEdtiorProperties(n,a){var d,m,g,h,v,N,x,T,r,y,f,k,S;const o=this;let i="";if(((d=n==null?void 0:n.binding)==null?void 0:d.type)==="Form"){const u=this.schemaService.getFieldByIDAndVMID(n.binding.field,this.viewModelId);(m=u==null?void 0:u.schemaField)!=null&&m.type&&(i=u.schemaField.type.$type)}const l=((h=(g=this.designViewModelField)==null?void 0:g.type)==null?void 0:h.$type)===G.FormSchemaEntityFieldType$Type.StringType&&((v=n.editor)==null?void 0:v.type)==="combo-list"&&((N=n.editor)==null?void 0:N.dataSourceType)==="dynamic"&&!((x=n.editor)!=null&&x.multiSelect),s=this.getPropertyEditorParams(n,["Variable"]);return o.getComponentConfig(n,{type:"combo-list"},{enableClear:{description:"",title:"启用清空",type:"boolean"},dataSourceType:{description:"",title:"数据源类型",type:"enum",editor:{default:"static",data:[{id:"static",name:"静态"},{id:"dynamic",name:"动态"}]},refreshPanelAfterChanged:!0},dataSource:{description:"动态数据源绑定变量",visible:l,title:"数据",editor:{...s,controlName:"",enableClear:!0},refreshPanelAfterChanged:!0},data:{description:"",title:"数据",type:"array",visible:!((T=n.editor)!=null&&T.dataSourceType)||((r=n.editor)==null?void 0:r.dataSourceType)==="static",...o.getItemCollectionEditor(n,(y=n.editor)==null?void 0:y.valueField,(f=n.editor)==null?void 0:f.textField),refreshPanelAfterChanged:!0},textField:{description:"",title:"数据源显示字段",type:"string",readonly:!0},valueField:{description:"",title:"数据源值字段",type:"string",readonly:!0},multiSelect:{description:"",title:"启用多选",visible:i==="StringType",readonly:((k=n.editor)==null?void 0:k.dataSourceType)==="dynamic"&&!!((S=n.editor)!=null&&S.dataSource),type:"boolean",refreshPanelAfterChanged:!0},maxLength:{description:"",title:"最大输入长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,needValid:!0}},...this.getCommonEditorProperties(n)},(u,p)=>{if(!u||!p.editor)return;const b=this;switch(u.propertyID){case"dataSourceType":{u.propertyValue==="static"?(p.editor.valueField="value",p.editor.textField="name",p.editor.remote=null):u.propertyValue==="dynamic"&&(p.editor.remote={method:"GET"},p.editor.valueField="value",p.editor.textField="name");break}case"data":{!b.checkEnumDataReadonly(p)&&p.formatter&&(p.formatter.data=[...u.propertyValue]);break}case"dataSource":b.afterMutilEditorChanged(p,u)}})}setEditorPropertyRelates(n,a,o){if(!n||!a.editor)return;const i=this;switch(n.propertyID){case"dataSourceType":{n.propertyValue==="static"&&(a.editor.valueField="value",a.editor.textField="name",a.editor.remote={});break}case"data":{!i.checkEnumDataReadonly(a)&&a.formatter&&(a.formatter.data=[...n.propertyValue]);break}}}changeBindingField(n,a,o){var l;super.changeBindingField(n,a);const i=o;n.editor&&((l=i==null?void 0:i.type)==null?void 0:l.$type)===G.FormSchemaEntityFieldType$Type.EnumType&&(n.editor.data=i.type.enumValues||[])}getEventPropertyConfig(n,a="card",o,i){const l=this;let s=[{label:"onChange",name:"值变化事件"},{label:"beforeOpen",name:"下拉面板前事件"}];s=[...s,...this.getInputCommonEvents(n)],o&&(s=s.concat(o)),this.formRule&&(s=s.filter(g=>g.label!=="onChange")),this.appendFieldValueChangeEvents(n,s);const c=l.eventsEditorUtils.formProperties(n,l.viewModelId,s);return{title:"事件",hideTitle:!0,properties:l.createBaseEventProperty(c),tabId:"commands",tabName:"交互",setPropertyRelates(g,h){const v=g.propertyValue;delete n[l.viewModelId],v&&(v.setPropertyRelates=this.setPropertyRelates,l.eventsEditorUtils.saveRelatedParameters(n,l.viewModelId,v.events,v),l.updateLinkedLabel(v,h)),i&&i(g,h,v);const N=l.designViewModelUtils.getDgViewModel(l.viewModelId);N&&l.designViewModelField&&N.changeField(l.designViewModelField.id,{valueChanging:n.fieldValueChanging,valueChanged:n.fieldValueChanged}),n.editor.beforeOpen!==n.beforeOpen&&(n.editor.beforeOpen=n.beforeOpen),n.editor.onChange!==n.onChange&&(n.editor.onChange=n.onChange),n.editor.onClear!==n.onClear&&(n.editor.onClear=n.onClear)}}}}function St(e,n){const a=e.schema;function o(i,l){return new Tt(i,n).getPropertyConfig(a,l)}return{getPropsConfig:o}}const Nt=t.defineComponent({name:"FComboListDesign",props:kt,emits:["clear","update:modelValue","change"],setup(e,n){const a=t.ref(),o=t.inject("designer-host-service"),i=t.inject("design-item-context"),l=St(i,o),s=se.useDesignerComponent(a,i,l);return t.onMounted(()=>{a.value.componentInstance=s}),n.expose(s.value),()=>t.createVNode(lt,{ref:a,buttonContent:e.dropDownIcon,readonly:!0,editable:!1,forcePlaceholder:!0,placeholder:e.placeholder,enableClear:!0},null)}});ae.register=(e,n,a,o,i)=>{e["combo-list"]=ae,n["combo-list"]=Ie(i),o["combo-list"]={callbackResolver:Ct}},ae.registerDesigner=(e,n,a,o)=>{e["combo-list"]=Nt,n["combo-list"]=Ie(o)},G.withInstall(ae);const Mt={analytical:{name:"数据",items:[{key:"IsNull",name:"是空值",params:[{key:"obj",name:"检测对象",type:"object"}],description:`【功能】判断检测对象是否为空值(null)。检测对象为null返回true,否则返回false
【参数】
【obj】检测对象
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含编号code字段
【需求】判断提交单据的编号是否为null
【举例】是空值(Order.code)`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"IsNullOrWhiteSpace",name:"是空串",params:[{key:"obj",name:"检测对象",type:"object"}],description:`【功能】判断检测对象是否为null值或空串""。检测对象为null或""返回true,否则返回false
【参数】
【obj】检测对象
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含编号code字段
【需求】判断提交单据的编号是否为null或空串""
【举例】是空值(Order.code)`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"IsNaN",name:"非数字",params:[{key:"obj",name:"检测对象",type:"object"}],description:`【功能】判断检测对象是否可以转换成数字(Double)。检测对象不能转为数字返回true,否则返回false
【参数】
【obj】检测对象
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含单据总额sum字段
【需求】判断提交单据的单据总额是否为非数字
【举例】非数字(Order.sum)`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"IsNumber",name:"是数字",params:[{key:"obj",name:"检测对象",type:"object"}],description:`【功能】判断检测对象是否可以转换成数字(Double)。检测对象能转为数字返回true,否则返回false
【参数】
【obj】检测对象
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含单据总额sum字段
【需求】判断提交单据的单据总额是否是数字
【举例】是数字(Order.sum)`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"ExistData",name:"子表有无数据",params:[{key:"table",name:"主表.子表",type:"string"}],description:`【功能】判断子表中有没有数据。有数据返回true,无数据返回false(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips
【需求】判断差旅明细子表是否有数据
【举例】子表有无数据("Order.trips")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"CountOfChild",name:"子表数据数量",params:[{key:"table",name:"主表.子表",type:"string"}],description:`【功能】返回子表数据的数量(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【返回值】数量(数值类型)
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips
【需求】获取差旅明细子表的数量
【举例】子表数据数量("Order.trips")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"SortChildData",name:"子表数据排序",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表排序字段",type:"string"},{key:"order",name:"排序方式",type:"string"}],description:`【功能】对子表数据进行排序(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段(字段类型应为数字类型)
【order】排序方式("ESC"表示正序从小到大,"DESC"表示倒序从大到小)
【返回值】无
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差费用money字段
【需求】按照出差费用money字段对差旅明细从小到大排序
【举例】子表数据排序("Order.trips","money","ESC")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"IncludedInList",name:"是否在列表中",params:[{key:"property",name:"字段",type:"object"},{key:"list",name:"数据列表",type:"list"}],description:`【功能】:判断字段是否在数据列表中存在。字段在列表中存在返回true,不存在返回false。支持判断字符和数字类型
【参数】
【property】字段
【list】数据列表
【返回值】true或false
【示例】是否在列表中(Order.name,["Zs","Ls"])
【示例】是否在列表中(Order.quantity,[100,200])`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"CountByProp",name:"子表列非空数",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"}],description:`【功能】:统计子表某字段不为null的数据数量(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段
【返回值】子表字段不为null的数量(数值类型)
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差方式way字段
【需求】统计差旅明细子表trips中出差方式way不为空的数据数量
【举例】子表列非空数("Order.trips","way")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"SumByProp",name:"子表字段求和",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"}],description:`【功能】求和子表某字段(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段(数值类型)
【返回值】子表某字段的和(数值类型)
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差费用money字段
【需求】对差旅明细子表trips的出差费用money字段求和
【举例】子表字段求和("Order.trips","money")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"AvgByProp",name:"子表列平均值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"}],description:`【功能】求子表某字段的平均值(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段(数值类型)
【返回值】子表某字段的平均值(数值类型)
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差费用money字段
【需求】获取差旅明细子表trips的出差费用money的平均值
【举例】子表列平均值("Order.trips","money")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"MaxByProp",name:"子表列最大值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"}],description:`【功能】求子表某字段的最大值(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段(数值类型)
【返回值】子表某字段的最大值(数值类型)
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差费用money字段
【需求】获取差旅明细子表trips的出差费用money的最大值
【举例】子表列最大值("Order.trips","money")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"MinByProp",name:"子表列最小值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"}],description:`【功能】求子表某字段的最小值(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段(数值类型)
【返回值】子表某字段的最小值(数值类型)
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差费用money字段
【需求】获取差旅明细子表trips的出差费用money的最小值
【举例】子表列最小值("Order.trips","money")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"IsExistRecord",name:"子表有无等于匹配值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"},{key:"match",name:"匹配值",type:"string"}],description:`【功能】判断子表某字段是否存在等于匹配值的数据(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段
【match】匹配值
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差方式way
【需求】判断差旅明细子表trips是否存在出差方式way等于'火车'的数据
【举例】子表有无等于匹配值("Order.trips","way","火车")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"IsContainMatch",name:"子表有无包含匹配值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"},{key:"match",name:"匹配值",type:"string"}],description:`【功能】判断子表某字段是否存在包含匹配值的数据(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段
【match】匹配值
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差方式way
【需求】判断差旅明细子表trips是否存在出差方式way包含匹配值'飞机'的数据
【举例】子表有无包含匹配值("Order.trips","way","飞机")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"ListGreaterThan",name:"子表有无大于匹配值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"},{key:"match",name:"匹配值",type:"double"}],description:`【功能】判断子表某字段是否存在大于匹配值的数据(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段(数值类型)
【match】匹配值
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差距离distance
【需求】判断差旅明细子表trips是否存在出差距离distance大于1000的数据
【举例】子表有无大于匹配值("Order.trips","distance",1000)`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"ListLessThan",name:"子表有无小于匹配值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"},{key:"match",name:"匹配值",type:"double"}],description:`【功能】判断子表某字段是否存在小于匹配值的数据(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段(数值类型)
【match】匹配值
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差距离distance
【需求】判断差旅明细子表trips是否存在出差距离distance小于10的数据
【举例】子表有无小于匹配值("Order.trips","distance",10)`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"ListStartWith",name:"子表有无以匹配值开头",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"},{key:"match",name:"匹配值",type:"string"}],description:`【功能】判断子表某字段有无开头是匹配值的数据(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段
【match】匹配值
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含编号code字段
【需求】判断差旅明细子表trips是否存在编号code字段以'0001'开头的数据
【举例】子表有无以匹配值开头("Order.trips","code","0001")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"ListEndWith",name:"子表有无以匹配值结尾",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"},{key:"match",name:"匹配值",type:"string"}],description:`【功能】判断子表某字段有无结尾是匹配值的数据(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段
【match】匹配值
【返回值】true或false
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含编号code字段
【需求】判断差旅明细子表trips是否存在编号code字段以'0002'结尾的数据
【举例】子表有无以匹配值结尾("Order.trips","code","0002")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"GetComputeJsonData",name:"子表字段取JSON串",params:[{key:"table",name:"主表.子表",type:"string"},{key:"property",name:"子表字段",type:"string"}],description:`【功能】判断子表某字段有无结尾是匹配值的数据(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【property】子表字段
【返回值】子表某字段的JSON格式
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含编号code字段
【需求】将差旅明细子表trips编号code字段用一个列表统计数据,并返回序列化后的值
【举例】子表字段取JSON串("Order.trips","code")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"MultiplyChildNumber",name:"子表属性乘积求和",params:[{key:"table",name:"主表.子表",type:"string"},{key:"prop1",name:"属性一",type:"string"},{key:"prop2",name:"属性二",type:"string"}],description:`【功能】对子表的两个数字类型属性,先做乘积,然后求和(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【prop1】属性一(数值类型)
【prop2】属性二(数值类型)
【返回值】求和值(数值类型)
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差天数days、出差费用money
【需求】获取差旅明细的总费用,即子表出差天数*出差费用的总和
【举例】子表属性乘积求和("Order.trips","days","money")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"MinValueOfPeriod",name:"时间范围内取最小值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"timeProp",name:"比较时间字段",type:"string"},{key:"valueProp",name:"取值字段",type:"string"},{key:"startTime",name:"起始时间",type:"string"},{key:"endTime",name:"结束时间",type:"string"}],description:`【功能】在指定时间范围内,取子表某字段的最小值(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【timeProp】比较时间字段(字段类型应为时间类型)
【valueProp】取值字段(字段类型应为数字类型)
【startTime】起始时间(支持'yyyy-MM-dd' 或 'yyyy-MM-dd hh:mm:ss')
【endTime】结束时间(支持'yyyy-MM-dd' 或 'yyyy-MM-dd hh:mm:ss')
【返回值】时间范围内,子表某字段的最小值
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差费用money字段,出差日期date字段
【需求】获取2022-10-01到2022-10-07时间段内,哪一天的出差费用money最小
【举例】时间范围内取最小值("Order.trips","date","money","2022-10-01","2022-10-07")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"MaxValueOfPeriod",name:"时间范围内取最大值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"timeProp",name:"比较时间字段",type:"string"},{key:"valueProp",name:"取值字段",type:"string"},{key:"startTime",name:"起始时间",type:"string"},{key:"endTime",name:"结束时间",type:"string"}],description:`【功能】在指定时间范围内,取子表某字段的最大值(参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【timeProp】比较时间字段(字段类型应为时间类型)
【valueProp】取值字段(字段类型应为数字类型)
【startTime】起始时间(支持'yyyy-MM-dd' 或 'yyyy-MM-dd hh:mm:ss')
【endTime】结束时间(支持'yyyy-MM-dd' 或 'yyyy-MM-dd hh:mm:ss')
【返回值】时间范围内,子表某字段的最大值
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差费用money字段,出差日期date字段
【需求】获取2022-10-01到2022-10-07时间段内,哪一天的出差费用money最大
【举例】时间范围内取最大值("Order.trips","date","money","2022-10-01","2022-10-07")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"AvgValueOfPeriod",name:"时间范围内取平均值",params:[{key:"table",name:"主表.子表",type:"string"},{key:"timeProp",name:"比较时间字段",type:"string"},{key:"valueProp",name:"取值字段",type:"string"},{key:"startTime",name:"起始时间",type:"string"},{key:"endTime",name:"结束时间",type:"string"}],description:`【功能】在指定时间范围内,取子表某字段的平均值(所有参数用""包起来)
【参数】
【table】主表.子表(链式结构)
【timeProp】比较时间字段(字段类型应为时间类型)
【valueProp】取值字段(字段类型应为数字类型)
【startTime】起始时间(支持'yyyy-MM-dd' 或 'yyyy-MM-dd hh:mm:ss')
【endTime】结束时间(支持'yyyy-MM-dd' 或 'yyyy-MM-dd hh:mm:ss')
【返回值】时间范围内,子表某字段的平均值
【示例】
【场景】提交单据Order,单据包含差旅明细子表trips,子表包含出差费用money字段,出差日期date字段
【需求】获取2022-10-01到2022-10-07时间段内,平均的出差费用money是多少
【举例】时间范围内取平均值("Order.trips","date","money","2022-10-01","2022-10-07")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"GetSessionValue",name:"获取会话变量",params:[{key:"name",name:"名称",type:"string"}],description:`【功能】获取用户会话变量的值
【参数】
【name】会话变量名
【返回值】对象(object)
【示例】
【举例】获取会话变量("会话变量一")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"GetContextParameter",name:"获取上下文变量",params:[{key:"name",name:"名称",type:"string"}],description:`【功能】获取上下文变量的值
【参数】
【name】上下文变量名
【返回值】对象(object)
【示例】
【举例】获取上下文变量("上下文变量一")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"GetInjectedEntity",name:"根据注入名获取注入对象",params:[{key:"name",name:"注入名",type:"string"}],description:`【功能】获取运行时注入对象的实际对象(参数用""包起来),不支持获取属性
【参数】
【name】注入名
【返回值】对象(object)
【示例】
【举例】根据注入名获取注入对象("注入名")`,type:"Analytical",keyFront:"DefaultFunction",className:""},{key:"GetChainedPropertyValue",name:"根据属性名获取属性值",params:[{key:"property",name:"属性名",type:"string"}],description:`【功能】:获取运行时注入属性的实际值(参数用""包起来)
【参数】
【property】属性名
【返回值】对象(object)
【示例】
【举例】根据属性名获取属性值("属性名")`,type:"Analytical",keyFront:"DefaultFunction",className:""}]},datetime:{name:"时间",items:[{key:"DayDifference",name:"天数差",params:[{key:"date1",name:"时间一",type:"obj"},{key:"date2",name:"时间二",type:"obj"}],description:`【功能】计算两个时间的天数差,计算时以年月日为准,自动忽略时分秒。时间一若早于时间二,返回正数;若晚于时间二,返回负数
【参数】
【date1】时间一
【date2】时间二
【返回值】两个日期的天数差
【示例】
【示例一】天数差("2024-01-01","2024-01-11")
【返回值】10
【示例一】天数差("2024-01-11","2024-01-01")
【返回值】-10`,type:"DateTime",keyFront:"DefaultFunction",className:""},{key:"DateTimeAddDays",name:"增加天数",params:[{key:"date",name:"日期时间",type:"string"},{key:"value",name:"增加天数",type:"int"}],description:`【功能】:在指定日期时间上增加指定天数
【返回值类型】:日期时间(DateTime)
【示例】:增加天数("2019-01-30T10:00:00+08:00",2)【返回值】:2019-02-01T10:00+08:00`,type:"DateTime",keyFront:"DefaultFunction",className:""},{key:"DateTimeAddYears",name:"增加年数",params:[{key:"date",name:"日期时间",type:"string"},{key:"value",name:"增加年数",type:"int"}],description:`【功能】:在指定日期时间上增加指定年数
【返回值类型】:日期时间(DateTim