@longhongguo/form-create-ant-design-vue 3.2.83 → 3.2.84
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/form-create.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @longhongguo/form-create-ant-design-vue v3.2.
|
|
2
|
+
* @longhongguo/form-create-ant-design-vue v3.2.84
|
|
3
3
|
* (c) 2018-2025 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
import e from"@longhongguo/component-antdv-upload/src/index";import t from"@form-create/component-antdv-frame/src/index";import r from"@form-create/component-antdv-group/src/index";import l from"@form-create/component-subform/src/index";import{openBlock as a,createElementBlock as o,createElementVNode as i,defineComponent as s,Fragment as n,createCommentVNode as p,normalizeClass as c,normalizeStyle as d,toDisplayString as u,renderList as h,resolveComponent as f,createVNode as m,reactive as y,markRaw as g,createBlock as v,resolveDynamicComponent as b,withCtx as w,createTextVNode as C,renderSlot as S,toRef as x,watch as k,nextTick as $}from"vue";import A,{hasProperty as F}from"@form-create/utils/lib/type";import{parseFn as V}from"@form-create/utils/lib/json";import I from"@form-create/utils/lib/deepset";import j,{creatorFactory as P}from"@longhongguo/form-create-core/src/index";import T from"@form-create/utils/lib/mergeprops";import O from"@form-create/utils/lib/extend";import"@longhongguo/component-antdv-upload/dist/index.css";import{invoke as E}from"@longhongguo/form-create-core/src/frame/util";import B from"@form-create/utils/lib/toarray";import D from"moment";var R={name:"QuestionCircleOutlined"};const z={class:"anticon"};R.render=function(e,t,r,l,s,n){return a(),o("span",z,[...t[0]||(t[0]=[i("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[i("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372z",fill:"currentColor"}),i("path",{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7c-21.2 8.1-39.2 22.3-52.1 40.9c-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0 1 30.9-44.8c59-22.7 97.1-74.7 97.1-132.5c.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1 0 80 0a40 40 0 1 0-80 0z",fill:"currentColor"})],-1)])])};var K=s({name:"CusSelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},sourceItems:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},bordered:{type:Boolean,default:!0}},emits:["update:modelValue","update:sourceItems","change"],computed:{currentValue:{get(){return Array.isArray(this.modelValue)?this.modelValue.map(e=>"object"!=typeof e||null===e||void 0===e.value&&void 0===e[this.valueKey]?{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}:e):null===this.modelValue||void 0===this.modelValue||""===this.modelValue?[]:"object"==typeof this.modelValue?[this.modelValue]:[{value:this.modelValue,label:this.getLabel(this.modelValue)}]},set(e){let t=[];null!=e&&(t=Array.isArray(e)?e.map(e=>"object"!=typeof e||null===e||void 0===e.value&&void 0===e[this.valueKey]?{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}:e):"object"==typeof e&&null!==e?[e]:[{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}]),this.$emit("update:modelValue",t),this.$emit("change",t)}},hasValue(){const e=this.currentValue;return Array.isArray(e)&&e.length>0},displayValue(){return this.hasValue?this.currentValue[0]:null},displayLabel(){if(!this.displayValue)return"";const e=this.displayValue;return"object"==typeof e&&null!==e?e[this.labelKey]||e.label||String(e[this.valueKey]||e.value||""):this.getLabel(e)},allSelectedItems(){const e=this.currentValue;return Array.isArray(e)&&0!==e.length?e.map(e=>"object"==typeof e&&null!==e?{value:e[this.valueKey]||e.value,label:e[this.labelKey]||e.label||String(e[this.valueKey]||e.value||"")}:{value:e,label:this.getLabel(e)}):[]},displayItems(){const e=this.allSelectedItems;return void 0===this.maxTagCount||null===this.maxTagCount?e:e.slice(0,this.maxTagCount)},remainingCount(){if(void 0===this.maxTagCount||null===this.maxTagCount)return 0;const e=this.allSelectedItems.length;return Math.max(0,e-this.maxTagCount)},showClear(){return this.allowClear&&this.hasValue&&!this.disabled}},methods:{findOptionByValue(e){return this.options&&0!==this.options.length?this.options.find(t=>{const r="object"==typeof t?t[this.valueKey]:t;return r===e||String(r)===String(e)}):null},getLabel(e){const t=this.findOptionByValue(e);return t?"object"==typeof t?t[this.labelKey]:t:String(e)},removeItem(e,t){if(this.disabled)return;t.stopPropagation();const r=this.currentValue;if(Array.isArray(r)){const t=r.filter(t=>{if("object"==typeof t&&null!==t){return(t[this.valueKey]||t.value)!==e}return t!==e}),l=this.sourceItems.filter(e=>!t.some(t=>t[this.valueKey]===e[this.valueKey]));this.$emit("update:sourceItems",l),this.currentValue=t}},clearValue(e){if(this.disabled)return;e.stopPropagation(),this.currentValue=[];const t=this.sourceItems.filter(e=>!this.currentValue.some(t=>t[this.valueKey]===e[this.valueKey]));this.$emit("update:sourceItems",t)}}});const M=["tabindex"],N=["title"],_={key:1,class:"fc-cus-select-selection-placeholder"},L={key:3,class:"fc-cus-select-arrow"},U=["tabindex"],q={class:"fc-cus-select-selection-overflow"},Y=["title"],Q={class:"fc-cus-select-selection-item-content"},Z=["onClick"],J={key:0,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},W={class:"fc-cus-select-selection-item"},H={class:"fc-cus-select-selection-item-content"},X={key:1,class:"fc-cus-select-selection-placeholder"},G={key:1,class:"fc-cus-select-arrow"};K.render=function(e,t,r,l,s,f){return a(),o(n,null,[p(" 单个展示模式 "),e.multiple?(a(),o(n,{key:1},[p(" 多个展示模式 "),i("div",{class:c(["fc-cus-select fc-cus-select-multiple",{"fc-cus-select-disabled":e.disabled}]),style:d(e.style),tabindex:e.disabled?-1:0},[i("div",{class:c(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[i("div",q,[p(" 显示的 tags "),(a(!0),o(n,null,h(e.displayItems,(r,l)=>(a(),o("div",{key:l,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},[i("span",{class:"fc-cus-select-selection-item",title:r.label},[i("span",Q,u(r.label),1),i("span",{class:"fc-cus-select-selection-item-remove",onClick:t=>e.removeItem(r.value,t)},[...t[4]||(t[4]=[i("span",{role:"img","aria-label":"close",class:"anticon anticon-close"},[i("svg",{focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"})])],-1)])],8,Z)],8,Y)]))),128)),p(" 折叠提示 "),e.remainingCount>0?(a(),o("div",J,[i("span",W,[i("span",H," +"+u(e.remainingCount),1)])])):p("v-if",!0),p(" 空值占位符 "),e.hasValue?p("v-if",!0):(a(),o("span",X,u(e.placeholder||"请选择"),1))]),e.showClear?(a(),o("span",{key:0,class:"fc-cus-select-clear",onClick:t[1]||(t[1]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[5]||(t[5]=[i("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[i("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})])],-1)])])):(a(),o("span",G,[...t[6]||(t[6]=[i("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[i("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[i("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})])],-1)])]))],2)],14,U)],2112)):(a(),o("div",{key:0,class:c(["fc-cus-select fc-cus-select-single",{"fc-cus-select-disabled":e.disabled}]),style:d(e.style),tabindex:e.disabled?-1:0},[i("div",{class:c(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[e.displayValue?(a(),o("span",{key:0,class:"fc-cus-select-selection-item",title:e.displayLabel},u(e.displayLabel),9,N)):(a(),o("span",_,u(e.placeholder||"请选择"),1)),e.showClear?(a(),o("span",{key:2,class:"fc-cus-select-clear",onClick:t[0]||(t[0]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[2]||(t[2]=[i("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[i("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})])],-1)])])):(a(),o("span",L,[...t[3]||(t[3]=[i("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[i("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[i("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})])],-1)])]))],2)],14,M))],2112)};var ee=s({name:"CusStoreSelect",components:{CusSelect:K},props:{formCreateInject:{type:Object,default:null},modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},field:{type:String,default:""},bordered:{type:Boolean,default:!0},extraQuery:{type:Object,default:()=>({})},extraQueryFn:{type:Function,default:()=>{}}},emits:["update:modelValue","change"],data:()=>({messageId:0,pendingCallbacks:{},internalOptions:[],sourceItems:[]}),computed:{mergedOptions(){if(this.internalOptions.length>0){const e=new Map;return this.options.forEach(t=>{const r="object"==typeof t?t[this.valueKey]:t;e.set(r,t)}),this.internalOptions.forEach(t=>{const r="object"==typeof t?t[this.valueKey]:t;e.set(r,t)}),Array.from(e.values())}return this.options}},watch:{options:{immediate:!0,handler(e){0===this.internalOptions.length&&Array.isArray(e)&&e.length>0&&(this.internalOptions=[...e])}}},mounted(){window.addEventListener("message",this.handleMessage)},beforeUnmount(){window.removeEventListener("message",this.handleMessage)},methods:{serializeForPostMessage(e){if(null==e)return e;try{return JSON.parse(JSON.stringify(e))}catch(t){if(console.warn("CusStoreSelect: 数据序列化失败,尝试递归处理",t),Array.isArray(e))return 0===e.length?[]:e.map(e=>this.serializeForPostMessage(e));if("object"==typeof e){const t={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r))try{t[r]=this.serializeForPostMessage(e[r])}catch(e){console.warn("CusStoreSelect: 跳过无法序列化的属性: "+r,e)}return t}return e}},handleClick(){if(this.disabled)return;const e=`store-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let r=null;t.length>0&&(r=t);const l=null==r?null:this.serializeForPostMessage(r),a={...this.extraQuery};this.extraQueryFn&&Object.assign(a,this.extraQueryFn());const o={type:"OPEN_STORE_SELECT",field:this.field||"",multiple:this.multiple,currentValue:l,valueKey:this.valueKey,labelKey:this.labelKey,extraQuery:a,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(o,"*")}catch(e){console.error("CusStoreSelect: 发送消息失败",e)}else console.warn("CusStoreSelect: 当前不在 iframe 环境中,无法向父窗口发送消息");this.pendingCallbacks[e]=(e,t)=>{t&&Array.isArray(t)&&t.length>0&&this.mergeOptions(t),this.sourceItems=t,this.handleUpdate(e),this.handleChange(e)}},handleMessage(e){const t=e.data;if(t&&"STORE_SELECT_RESULT"===t.type){const{field:e,value:r,sourceItems:l,messageId:a}=t;if(e!==this.field)return;const o=this.pendingCallbacks[a];o&&(o(r,l),delete this.pendingCallbacks[a])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const r="object"==typeof e?e[this.valueKey]:e;t.set(r,e)}),e.forEach(e=>{const r="object"==typeof e?e[this.valueKey]:e;t.set(r,e)}),this.internalOptions=Array.from(t.values())},handleUpdate(e){this.$emit("update:modelValue",e),this.triggerValidate()},handleChange(e){this.$emit("change",e,this.sourceItems&&this.sourceItems.length>0?this.multiple?this.sourceItems:this.sourceItems[0]:this.multiple?[]:null)},triggerValidate(){this.$nextTick(()=>{this.$nextTick(()=>{try{if(this.formCreateInject&&this.formCreateInject.api&&this.field)return void this.formCreateInject.api.validateField(this.field).catch(()=>{});let e=this.$parent;for(;e;){if(e.$options&&"FormCreate"===e.$options.name&&e.fapi){this.field&&e.fapi.validateField&&e.fapi.validateField(this.field).catch(()=>{});break}e=e.$parent}}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})}}});ee.render=function(e,t,r,l,i,s){const n=f("CusSelect");return a(),o("div",{onClick:t[1]||(t[1]=(...t)=>e.handleClick&&e.handleClick(...t))},[m(n,{"model-value":e.modelValue,options:e.mergedOptions,"source-items":e.sourceItems,"onUpdate:sourceItems":t[0]||(t[0]=t=>e.sourceItems=t),multiple:e.multiple,"max-tag-count":e.maxTagCount,placeholder:e.placeholder,disabled:e.disabled,style:d(e.style),valueKey:e.valueKey,labelKey:e.labelKey,allowClear:e.allowClear,bordered:e.bordered,"onUpdate:modelValue":e.handleUpdate,onChange:e.handleChange},null,8,["model-value","options","source-items","multiple","max-tag-count","placeholder","disabled","style","valueKey","labelKey","allowClear","bordered","onUpdate:modelValue","onChange"])])};var te=s({name:"CusUserSelect",components:{CusSelect:K},props:{formCreateInject:{type:Object,default:null},modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},field:{type:String,default:""},bordered:{type:Boolean,default:!0},selectType:{type:[String,Number],default:null},extraQuery:{type:Object,default:()=>({})},extraQueryFn:{type:Function,default:()=>{}}},emits:["update:modelValue","change"],data:()=>({messageId:0,pendingCallbacks:{},internalOptions:[],sourceItems:[]}),computed:{mergedOptions(){if(this.internalOptions.length>0){const e=new Map;return this.options.forEach(t=>{const r="object"==typeof t?t[this.valueKey]:t;e.set(r,t)}),this.internalOptions.forEach(t=>{const r="object"==typeof t?t[this.valueKey]:t;e.set(r,t)}),Array.from(e.values())}return this.options}},watch:{options:{immediate:!0,handler(e){0===this.internalOptions.length&&Array.isArray(e)&&e.length>0&&(this.internalOptions=[...e])}}},mounted(){window.addEventListener("message",this.handleMessage)},beforeUnmount(){window.removeEventListener("message",this.handleMessage)},methods:{serializeForPostMessage(e){if(null==e)return e;try{return JSON.parse(JSON.stringify(e))}catch(t){if(console.warn("CusUserSelect: 数据序列化失败,尝试递归处理",t),Array.isArray(e))return 0===e.length?[]:e.map(e=>this.serializeForPostMessage(e));if("object"==typeof e){const t={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r))try{t[r]=this.serializeForPostMessage(e[r])}catch(e){console.warn("CusUserSelect: 跳过无法序列化的属性: "+r,e)}return t}return e}},handleClick(){if(this.disabled)return;const e=`user-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let r=null;t.length>0&&(r=t);const l=null==r?null:this.serializeForPostMessage(r),a={...this.extraQuery};this.extraQueryFn&&Object.assign(a,this.extraQueryFn());const o={type:"OPEN_USER_SELECT",field:this.field||"",multiple:this.multiple,currentValue:l,valueKey:this.valueKey,labelKey:this.labelKey,selectType:this.selectType,extraQuery:a,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(o,"*")}catch(e){console.error("CusUserSelect: 发送消息失败",e)}else console.warn("CusUserSelect: 当前不在 iframe 环境中,无法向父窗口发送消息");this.pendingCallbacks[e]=(e,t)=>{t&&Array.isArray(t)&&t.length>0&&this.mergeOptions(t),this.sourceItems=t,this.handleUpdate(e),this.handleChange(e)}},handleMessage(e){const t=e.data;if(t&&"USER_SELECT_RESULT"===t.type){const{field:e,value:r,sourceItems:l,messageId:a}=t;if(e!==this.field)return;const o=this.pendingCallbacks[a];o&&(o(r,l),delete this.pendingCallbacks[a])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const r="object"==typeof e?e[this.valueKey]:e;t.set(r,e)}),e.forEach(e=>{const r="object"==typeof e?e[this.valueKey]:e;t.set(r,e)}),this.internalOptions=Array.from(t.values())},handleUpdate(e){this.$emit("update:modelValue",e),this.triggerValidate()},handleChange(e){this.$emit("change",e,this.sourceItems&&this.sourceItems.length>0?this.multiple?this.sourceItems:this.sourceItems[0]:this.multiple?[]:null)},triggerValidate(){this.$nextTick(()=>{this.$nextTick(()=>{try{if(this.formCreateInject&&this.formCreateInject.api&&this.field)return void this.formCreateInject.api.validateField(this.field).catch(()=>{});let e=this.$parent;for(;e;){if(e.$options&&"FormCreate"===e.$options.name&&e.fapi){this.field&&e.fapi.validateField&&e.fapi.validateField(this.field).catch(()=>{});break}e=e.$parent}}catch(e){console.warn("CusUserSelect: 触发校验失败",e)}})})}}});te.render=function(e,t,r,l,i,s){const n=f("CusSelect");return a(),o("div",{onClick:t[1]||(t[1]=(...t)=>e.handleClick&&e.handleClick(...t))},[m(n,{"model-value":e.modelValue,options:e.mergedOptions,"source-items":e.sourceItems,"onUpdate:sourceItems":t[0]||(t[0]=t=>e.sourceItems=t),multiple:e.multiple,"max-tag-count":e.maxTagCount,placeholder:e.placeholder,disabled:e.disabled,style:d(e.style),valueKey:e.valueKey,labelKey:e.labelKey,allowClear:e.allowClear,bordered:e.bordered,"onUpdate:modelValue":e.handleUpdate,onChange:e.handleChange},null,8,["model-value","options","source-items","multiple","max-tag-count","placeholder","disabled","style","valueKey","labelKey","allowClear","bordered","onUpdate:modelValue","onChange"])])};var re={name:"TableForm",emits:["change","add","delete","update:modelValue"],props:{formCreateInject:Object,modelValue:{type:Array,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},filterEmptyColumn:{type:Boolean,default:!0},deletable:{type:Boolean,default:!0},addable:{type:Boolean,default:!0},options:{type:Object,default:()=>y({submitBtn:!1,resetBtn:!1})},min:Number,max:Number,disabled:Boolean},watch:{modelValue:{handler(){this.updateTable()},deep:!0},"formCreateInject.preview":function(e){this.emptyRule.children[0].props.colspan=this.columns.length+(e?1:2)}},data(){return{rule:[],trs:[],fapi:{},Form:g(this.formCreateInject.form.$form()),copyTrs:"",oldValue:"",emptyRule:{type:"tr",_isEmpty:!0,native:!0,subRule:!0,children:[{type:"td",style:{textAlign:"center"},native:!0,subRule:!0,props:{colspan:this.columns.length+(this.formCreateInject.preview?1:2)},children:[this.formCreateInject.t("dataEmpty")||"暂无数据"]}]}}},methods:{formChange(){this.updateValue()},updateValue(){const e=this.trs.map((e,t)=>({...this.modelValue[t]||{},...this.fapi.getChildrenFormData(e)})).filter(e=>{if(!this.filterEmptyColumn)return!0;if(null==e)return!1;let t=!1;return Object.keys(e).forEach(r=>{t=t||void 0!==e[r]&&""!==e[r]&&null!==e[r]}),t}),t=JSON.stringify(e);t!==this.oldValue&&(this.oldValue=t,this.$emit("update:modelValue",e),this.$emit("change",e))},setRawData(e,t){const r=this.trs[e];this.fapi.setChildrenFormData(r,t,!0)},updateTable(){const e=JSON.stringify(this.modelValue);this.oldValue!==e&&(this.oldValue=e,this.trs=this.trs.splice(0,this.modelValue.length),this.modelValue.length?this.clearEmpty():this.addEmpty(),this.modelValue.forEach((e,t)=>{this.trs[t]||this.addRaw(),this.setRawData(t,e||{})}),this.rule[0].children[1].children=this.trs)},addEmpty(){this.trs.length&&this.trs.splice(0,this.trs.length),this.trs.push(this.emptyRule)},clearEmpty(){this.trs[0]&&this.trs[0]._isEmpty&&this.trs.splice(0,1)},delRaw(e){this.disabled||!this.deletable||this.min>0&&this.trs.length<=this.min||(this.trs.splice(e,1),this.updateValue(),this.trs.length?this.trs.forEach(e=>this.updateRaw(e)):this.addEmpty(),this.$emit("delete",e))},addRaw(e){if(e&&this.disabled)return;const t=this.formCreateInject.form.parseJson(this.copyTrs)[0];1===this.trs.length&&this.trs[0]._isEmpty&&this.trs.splice(0,1),this.trs.push(t),this.updateRaw(t),e&&(this.$emit("add",this.trs.length),this.updateValue())},updateRaw(e){const t=this.trs.indexOf(e);e.children[0].props.innerText=t+1,e.children[e.children.length-1].children[0].props.onClick=()=>{this.delRaw(t)}},loadRule(){const e=[{type:"th",native:!0,class:"_fc-tf-head-idx",props:{innerText:"#"}}];let t=[{type:"td",class:"_fc-tf-idx",native:!0,props:{innerText:"0"}}];this.columns.forEach(r=>{e.push({type:"th",native:!0,style:{...r.style||{},textAlign:r.align||"center"},class:r.required?"_fc-tf-head-required":"",props:{innerText:r.label||""}}),t.push({type:"td",native:!0,children:[...r.rule||[]]})}),e.push({type:"th",native:!0,class:"_fc-tf-edit fc-clock",props:{innerText:this.formCreateInject.t("operation")||"操作"}}),t.push({type:"td",native:!0,class:"_fc-tf-btn fc-clock",children:[{type:"i",native:!0,class:"fc-icon icon-delete",props:{}}]}),this.copyTrs=this.formCreateInject.form.toJson([{type:"tr",native:!0,subRule:!0,children:t}]),this.rule=[{type:"table",native:!0,class:"_fc-tf-table",props:{border:"1",cellspacing:"0",cellpadding:"0"},children:[{type:"thead",native:!0,children:[{type:"tr",native:!0,children:e}]},{type:"tbody",native:!0,children:this.trs}]}]}},created(){this.loadRule()},mounted(){this.updateTable()}};re.render=function(e,t,r,l,s,n){const d=f("a-button");return a(),o("div",{class:c(["_fc-table-form",{"_fc-disabled":r.disabled}])},[(a(),v(b(s.Form),{option:r.options,rule:s.rule,extendOption:!0,disabled:r.disabled,onChange:n.formChange,api:s.fapi,"onUpdate:api":t[0]||(t[0]=e=>s.fapi=e),onEmitEvent:e.$emit},null,40,["option","rule","disabled","onChange","api","onEmitEvent"])),r.addable&&(!r.max||r.max>this.trs.length)?(a(),v(d,{key:0,type:"link",class:"fc-clock",onClick:t[1]||(t[1]=e=>n.addRaw(!0)),disabled:r.disabled},{default:w(()=>[t[2]||(t[2]=i("i",{class:"fc-icon icon-add-circle",style:{"font-weight":"700"}},null,-1)),C(" "+u(r.formCreateInject.t("add")||"添加"),1)]),_:1},8,["disabled"])):p("v-if",!0)],2)};var le=s({name:"TableFormView",data:()=>({})});const ae={class:"_fd-table-form"},oe={key:0,class:"_fd-tf-wrap"},ie={key:1,class:"_fc-child-empty"};le.render=function(e,t,r,l,i,s){return a(),o("div",ae,[e.$slots.default?(a(),o("div",oe,[S(e.$slots,"default")])):(a(),o("div",ie))])};var se=s({name:"TableFormColumnView",props:{label:String,align:String,width:[Number,String],color:String,required:Boolean},computed:{colStyle(){const e=this.width,t={width:A.Number(e)?e+"px":e&&"auto"!==e?e:"180px"};return this.color&&(t.color=this.color),t}},data:()=>({})});const ne={key:0,class:"_fd-tf-required"},pe={class:"_fd-tf-con"};se.render=function(e,t,r,l,s,n){return a(),o("div",{class:"_fd-tf-col",style:d(e.colStyle)},[i("div",{class:"_fd-tf-title",style:d({textAlign:e.align||"center"})},[e.required?(a(),o("span",ne,"*")):p("v-if",!0),C(u(e.label||""),1)],4),i("div",pe,[S(e.$slots,"default")])],4)};var ce=[e,t,r,l,R,K,ee,te,re,le,se],de={name:"checkbox",modelField:"value",mergeProp(e){const t=e.prop.props;F(t,"options")||(t.options=e.prop.options||[])}},ue={...de,name:"radio"},he={...de,name:"select",mergeProp(e){const t=e.prop.props;F(t,"options")||(t.options=e.prop.options||[]);const r=e.effectData("fetch");r&&!0===r.loading&&(t.disabled=!0,t.loading=!0)},render(e,t){const r=t.effectData("fetch");if(r&&!0===r.loading&&e.loading){const r={...e};return r.notFoundContent=e.loading,t.$render.defaultRender(t,r)}return t.$render.defaultRender(t,e)}},fe={name:"cascader",mergeProp(e){const t=e.prop.props;F(t,"options")||(t.options=e.prop.options||[]);const r=e.effectData("fetch");if(r&&!0===r.loading&&(t.disabled=!0,t.loading=!0),t.loadData){var l;const r=null===(l=e.$handle)||void 0===l?void 0:l.api,a=e.rule,o=e;let i=A.String(t.loadData)?V(t.loadData):t.loadData;if(!A.Function(i)&&A.String(t.loadData))try{const e=t.loadData.trim();e.startsWith("function")||e.startsWith("[[FORM-CREATE-PREFIX-function")||e.startsWith("$FNX:")||(i=new Function("selectedOptions","options","updateOptions","api","rule",e))}catch(e){console.error("Failed to parse loadData:",e)}A.Function(i)&&(t.loadData=function(e){if(!e||0===e.length)return;const l=e[e.length-1];if(!0===(null==l?void 0:l.isLeaf))return;const s=t.options||[],n=()=>{var e,i;const s=t.options||[];let n=-1;l&&(n=s.findIndex(e=>e.value===l.value||e.id===l.id||e===l));const p=s.map((e,t)=>{if(t===n&&l){return{...l}}return{...e}}),c=o.effectData("fetch");c&&I(c,"props.options",p),t.options=p,null!==(e=o.prop)&&void 0!==e&&e.props&&(o.prop.props.options=p),null!==(i=o.rule)&&void 0!==i&&i.props&&(o.rule.props.options=p),r&&a&&r.sync(a),o.$handle&&o.$handle.refresh()};l&&(l.loading=!0,n());const p=i.call(this,e,s,n,r,a);return p&&"function"==typeof p.then?p.finally(()=>{n()}):p})}},render(e,t){const r=t.effectData("fetch");if(r&&!0===r.loading&&e.loading){const r={...e};return r.notFoundContent=e.loading,t.$render.defaultRender(t,r)}return t.$render.defaultRender(t,e)}};const me={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",quarter:"YYYY-qQ",year:"YYYY"},ye="datePicker";var ge={name:ye,maker:["date","month","week"].reduce((e,t)=>(e[t]=P(ye,{type:t}),e),{dateRange:P(ye,{type:"range"}),datetimeRange:P(ye,e=>e.props({type:"range",showTime:!0}))}),modelField:"value",mergeProp(e){const t=e.prop.props,r=t.type||t.picker;t.valueFormat||(t.valueFormat=(me[r]||me.date)+(!t.showTime||r&&"date"!==r?"":" HH:mm:ss"))},render:(e,t)=>t.$render.vNode[(!0===t.prop.props.range?"range":"date")+"Picker"](t.prop,e)};var ve={name:"hidden",maker:{hidden:(e,t)=>P("hidden")("",e,t)},render:()=>[]},be={name:"text",loadChildren:!1,mounted(e){var t,r;const l=e.rule.props||{},a=e.rule.bindField||l.bindField||(null===(t=e.prop.props)||void 0===t?void 0:t.bindField),o=e.rule.template||l.template||(null===(r=e.prop.props)||void 0===r?void 0:r.template);(o||a)&&setTimeout(()=>{if(e.$handle&&e.$handle.api)try{let t="";if(o){const r=e.$handle.api.formData();t=e.$handle.loadStrVar(o,t=>{const l=e.$handle.api.getValue(t);return void 0===l&&r&&void 0!==r[t]?r[t]:l},null)}else a&&(t=e.$handle.api.getValue(a)||"");null!=t&&(e.rule.children||(e.rule.children=[]),e.rule.children[0]=String(t),e.$handle.api.sync(e.rule),e.$handle.refresh())}catch(e){}},500)},renderChildren:(e,t)=>({default:()=>{var r;let l=null===(r=t.rule)||void 0===r?void 0:r.children;l||(l=e);return(Array.isArray(l)?l:[l]).filter(e=>null!=e).map(e=>A.String(e)?e:String(e)).join("")||""}}),mergeProp(e){var t,r,l;const a=e.rule.props||{},o=e.rule.bindField||a.bindField||(null===(t=e.prop.props)||void 0===t?void 0:t.bindField),i=e.rule.template||a.template||(null===(r=e.prop.props)||void 0===r?void 0:r.template);let s=e.rule.bindMode||a.bindMode||(null===(l=e.prop.props)||void 0===l?void 0:l.bindMode);if(s||(s=i?"template":o?"field":"static"),"field"===s&&o){const t={attr:o,to:"child",modify:!0,wait:300,watch:!0};e.rule.effect||(e.rule.effect={}),e.rule.effect.loadData||(e.rule.effect.loadData=[]);e.rule.effect.loadData.some(e=>e.attr===o&&"child"===e.to)||(e.rule.effect.loadData.push(t),e.$handle&&e.$handle.effect&&e.$handle.effect(e,"loaded"))}else if("template"===s&&i){const t={template:i,to:"child",modify:!0,wait:300,watch:!0};e.rule.effect||(e.rule.effect={}),e.rule.effect.loadData||(e.rule.effect.loadData=[]);if(!e.rule.effect.loadData.some(e=>e.template===i&&"child"===e.to)&&(e.rule.effect.loadData.push(t),e.$handle&&e.$handle.effect&&(e.$handle.effect(e,"loaded"),!e._textLoadDataWatched))){e._textLoadDataWatched=!0;const t=x(e.rule.effect,"loadData");e.watch.push(k(t,(t,r)=>{e.$handle.effect(e,"watch",{loadData:t})},{deep:!0}))}}null==e.rule.formCreateChild||e.rule.children||(e.rule.children=[e.rule.formCreateChild]),e.rule.children||(e.rule.children=[]),("field"===s&&o||"template"===s&&i)&&(!e.rule.children||Array.isArray(e.rule.children)&&0===e.rule.children.length)&&(e.rule.children="template"===s?[""]:[" "])},render(e,t){let r="";if(e&&"function"==typeof e.default)try{r=e.default()||""}catch(e){r=""}r=null==r||void 0===r?"":String(r);const l={...t.prop};l.props||(l.props={}),"text"===l.type&&(l.type="div"),delete l.props.innerHTML;return t.vNode.make("div",l,[r])}};var we={name:"input",maker:["password","url","email","text","textarea","search"].reduce((e,t)=>(e[t]=P("input",{type:t}),e),{idate:P("input",{type:"date"})}),modelField:"value",render(e,t){let r=t.prop.props.type;return-1===["textarea","search","password"].indexOf(r)&&(r="input"),r={textarea:"aTextarea",search:"aInputSearch",password:"aInputPassword"}[r]||"aInput",t.$render.vNode.make(r,t.prop,e)}},Ce={name:"timePicker",modelField:"value",mergeProp(e){const t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss")},render:(e,t)=>t.$render.vNode["time"+(!0===t.prop.props.range?"Range":"")+"Picker"](t.prop,e)},Se={name:"tree",modelField:"checkedKeys",mergeProp(e){const t=e.prop.props;t.fieldNames?t.fieldNames.key||(t.fieldNames.key="id"):t.fieldNames={key:"id"},t.checkedKeys=e.rule.value,t.checkable=!0}},xe={name:"FcRow",render:(e,t)=>t.vNode.col({props:{span:24}},{default:()=>[t.vNode.row(t.prop,e)]})};var ke=[de,ge,{...ge,name:"rangePicker",maker:{},render:(e,t)=>t.$render.vNode.rangePicker(t.prop,e)},ve,be,we,Ce,{...Ce,name:"timeRangePicker",render:(e,t)=>t.$render.vNode.timeRangePicker(t.prop,e)},Se,ue,he,fe,xe,{name:"cusStoreSelect",modelField:"modelValue",toFormValue:(e,t)=>null==e||""===e?[]:Array.isArray(e)?e.map(e=>("object"!=typeof e||null===e||void 0===e.value&&e.label,e)):[e],toValue:(e,t)=>e,mergeProp(e){const t=e.prop.props;if(F(t,"options")||(t.options=e.prop.options||[]),F(t,"field")||(t.field=e.rule.field||""),void 0!==e.rule.value){const t=e.rule.value;null==t||""===t?e.rule.value=[]:Array.isArray(t)||(e.rule.value=[t])}},render(e,t){const r=t.$render.defaultRender(t,e);if(r&&r.props&&r.props.on){const e=r.props.on["update:modelValue"],l=()=>{$(()=>{$(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const r=t.$handle.getFieldCtx(t.rule.field);r&&r.id&&t.$handle.$manager.validateField(r.id).catch(()=>{})}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})};r.props.on["update:modelValue"]=(...t)=>{e&&e(...t),l()};const a=r.props.on.change;r.props.on.change=a?(...e)=>{a(...e),l()}:l}return r}},{name:"cusUserSelect",modelField:"modelValue",toFormValue:(e,t)=>null==e||""===e?[]:Array.isArray(e)?e.map(e=>("object"!=typeof e||null===e||void 0===e.value&&e.label,e)):[e],toValue:(e,t)=>e,mergeProp(e){const t=e.prop.props;if(F(t,"options")||(t.options=e.prop.options||[]),F(t,"field")||(t.field=e.rule.field||""),F(t,"formCreateInject")||(t.formCreateInject=e.inject),void 0!==e.rule.value){const t=e.rule.value;null==t||""===t?e.rule.value=[]:Array.isArray(t)||(e.rule.value=[t])}},render(e,t){const r=t.$render.defaultRender(t,e);if(r&&r.props&&r.props.on){const e=r.props.on["update:modelValue"],l=()=>{$(()=>{$(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const r=t.$handle.getFieldCtx(t.rule.field);r&&r.id&&t.$handle.$manager.validateField(r.id).catch(()=>{})}catch(e){console.warn("CusUserSelect: 触发校验失败",e)}})})};r.props.on["update:modelValue"]=(...t)=>{e&&e(...t),l()};const a=r.props.on.change;r.props.on.change=a?(...e)=>{a(...e),l()}:l}return r}},{name:"flex",mergeProp(e){var t,r,l;const a=e.rule.props||{},o=a.flexDirection||e.rule.flexDirection||"row",i=a.flexWrap||e.rule.flexWrap||"nowrap",s=a.justifyContent||e.rule.justifyContent||"flex-start",n=a.alignItems||e.rule.alignItems||"flex-start",p=a.alignContent||e.rule.alignContent||"flex-start",c="column"===o||"column-reverse"===o,d={"flex-start":"start","flex-end":"end",center:"center","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"}[s]||"start",u={"flex-start":"start","flex-end":"end",center:"center",baseline:"baseline",stretch:"stretch"}[n]||"start";e.prop.props||(e.prop.props={}),e.prop.props.vertical=c,e.prop.props.justify=d,e.prop.props.align=u,void 0!==a.gap&&(e.prop.props.gap=a.gap);const h=e.rule.style||{},{display:f,flexDirection:m,flexWrap:y,justifyContent:g,alignItems:v,alignContent:b,...w}=h,C={display:f||"flex",flexWrap:i,...w};p&&"flex-start"!==p&&(C.alignContent=p);const S=e.prop.style||{},x=(null===(t=e.prop.props)||void 0===t?void 0:t.style)||{};e.prop.style={...S,...C},e.prop.props||(e.prop.props={}),e.prop.props.style={...x,...C},e.rule.children||(e.rule.children=[]),e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.forEach(e=>{e&&"object"==typeof e&&"DragTool"===!e.type&&"DragBox"===!e.type&&(void 0===e.col||null===e.col?e.col=!1:e.col&&"object"==typeof e.col&&!1!==e.col.show&&(e.col.show=!1))});if(null!==(r=null!==(l=a.resetMarginBottom)&&void 0!==l?l:e.rule.resetMarginBottom)&&void 0!==r&&r){e.rule.wrap||(e.rule.wrap={}),"object"!=typeof e.rule.wrap||e.rule.wrap.class||(e.rule.wrap.class="");const t="object"==typeof e.rule.wrap?(e.rule.wrap.class||"").split(" ").filter(Boolean):[];t.includes("_fc-reset-margin-bottom")||(t.push("_fc-reset-margin-bottom"),"object"==typeof e.rule.wrap&&(e.rule.wrap.class=t.join(" ")))}},render(e,t){var r,l;const a={...t.prop};"flex"===a.type&&(a.type="a-flex");const o=(t.rule.props||{}).flexDirection||t.rule.flexDirection||"row",i="column"===o||"column-reverse"===o;a.props||(a.props={});const s=()=>{a.class||(a.class=[]),Array.isArray(a.class)||(a.class=[a.class])},n=null!==(r=null===(l=t.rule.props)||void 0===l?void 0:l.childFlex)&&void 0!==r?r:t.rule.childFlex;if(null!=n&&""!==n){s(),a.class.includes("_fc-flex-container")||a.class.push("_fc-flex-container");const e=String(n).trim();a.props.style||(a.props.style={}),a.props.style["--fc-child-flex"]=e,a.style||(a.style={}),a.style["--fc-child-flex"]=e}if(i){var p,c,d;const e=null!==(p=null!==(c=null===(d=t.rule.props)||void 0===d?void 0:d.childWidth)&&void 0!==c?c:t.rule.childWidth)&&void 0!==p?p:"100%";s(),a.class.includes("_fc-flex-container")||a.class.push("_fc-flex-container"),a.class.includes("_fc-flex-vertical")||a.class.push("_fc-flex-vertical");const r=String(e).trim();a.props.style||(a.props.style={}),a.props.style["--fc-child-width"]=r,a.style||(a.style={}),a.style["--fc-child-width"]=r}const u=e||[];return t.vNode.col({props:{span:24}},{default:()=>[t.vNode.make("a-flex",a,u)]})}},{name:"space",mergeProp(e){var t,r;const l=e.rule.props||{},a=l.direction||e.rule.direction||"horizontal",o=l.size||e.rule.size||"small",i=l.align||e.rule.align,s=l.wrap||e.rule.wrap||!1;e.prop.props||(e.prop.props={}),e.prop.props.direction=a,e.prop.props.size=o,null!=i&&""!==i&&(e.prop.props.align=i),e.prop.props.wrap=s;const n={width:"100%",...e.rule.style||{}};e.prop.style||(e.prop.style={}),e.prop.style={...e.prop.style,...n},e.prop.props.style||(e.prop.props.style={}),e.prop.props.style={...e.prop.props.style,...n},e.rule.children||(e.rule.children=[]),e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.forEach(e=>{e&&"object"==typeof e&&"DragTool"!==e.type&&"DragBox"!==e.type&&(void 0===e.col||null===e.col?e.col=!1:e.col&&"object"==typeof e.col&&!1!==e.col.show&&(e.col.show=!1))});if(null!==(t=null!==(r=l.resetMarginBottom)&&void 0!==r?r:e.rule.resetMarginBottom)&&void 0!==t&&t){e.rule.wrap||(e.rule.wrap={}),"object"!=typeof e.rule.wrap||e.rule.wrap.class||(e.rule.wrap.class="");const t="object"==typeof e.rule.wrap?(e.rule.wrap.class||"").split(" ").filter(Boolean):[];t.includes("_fc-reset-margin-bottom")||(t.push("_fc-reset-margin-bottom"),"object"==typeof e.rule.wrap&&(e.rule.wrap.class=t.join(" ")))}},render(e,t){const r={...t.prop};(t.rule.props||{}).compact||t.rule.compact||!1?r.type="a-space-compact":"space"===r.type&&(r.type="a-space");const l=e||[];return t.vNode.col({props:{span:24}},{default:()=>[t.vNode.make(r.type,r,l)]})}},{name:"spin",mergeProp(e){var t,r,l,a,o,i,s,n,p;e.rule.wrap||(e.rule.wrap={}),e.rule.wrap.title=!1;const c=e.prop.props||{},d=null===(t=null!==(r=null!==(l=e.rule.containerMode)&&void 0!==l?l:null===(a=e.rule.props)||void 0===a?void 0:a.containerMode)&&void 0!==r?r:null===(o=e.prop.props)||void 0===o?void 0:o.containerMode)||void 0===t||t;var u,h,f,m;(d||(e.rule.children=[]),F(c,"spinning"))||(c.spinning=null!==(u=null!==(h=null===(f=e.prop.props)||void 0===f?void 0:f.spinning)&&void 0!==h?h:null===(m=e.rule.props)||void 0===m?void 0:m.spinning)&&void 0!==u&&u);const y=e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.length>0;!d&&!y&&c.spinning;const g=e.rule.bindField||(null===(i=e.rule.props)||void 0===i?void 0:i.bindField)||(null===(s=e.prop.props)||void 0===s?void 0:s.bindField);let v=e.rule.bindMode||(null===(n=e.rule.props)||void 0===n?void 0:n.bindMode)||(null===(p=e.prop.props)||void 0===p?void 0:p.bindMode);if(v||(v=g?"field":"static"),"field"===v&&g){const t={attr:g,to:"props.spinning",modify:!0,wait:300,watch:!0};e.rule.effect||(e.rule.effect={}),e.rule.effect.loadData||(e.rule.effect.loadData=[]);e.rule.effect.loadData.some(e=>e.attr===g&&"props.spinning"===e.to)||(e.rule.effect.loadData.push(t),e.$handle&&e.$handle.effect&&e.$handle.effect(e,"loaded"))}d&&(e.rule.children||(e.rule.children=[]),e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.forEach(e=>{e&&"object"==typeof e&&"DragTool"!==e.type&&"DragBox"!==e.type&&(void 0===e.col||null===e.col?e.col=!1:e.col&&"object"==typeof e.col&&!1!==e.col.show&&(e.col.show=!1))}))},render(e,t){var r,l,a,o,i,s,n,p,c,d,u;const h=(t.prop.props||{}).spinning||!1;t.prop.props||(t.prop.props={}),t.prop.props.spinning=h;const f=t.rule.tip||(null===(r=t.rule.props)||void 0===r?void 0:r.tip)||(null===(l=t.prop.props)||void 0===l?void 0:l.tip);f&&(t.prop.props.tip=f);const m=t.rule.delay||(null===(a=t.rule.props)||void 0===a?void 0:a.delay)||(null===(o=t.prop.props)||void 0===o?void 0:o.delay);null!=m&&(t.prop.props.delay=m);const y=t.rule.size||(null===(i=t.rule.props)||void 0===i?void 0:i.size)||(null===(s=t.prop.props)||void 0===s?void 0:s.size);y&&(t.prop.props.size=y),"spin"===t.prop.type&&(t.prop.type="a-spin");if(!(null===(n=null!==(p=null!==(c=t.rule.containerMode)&&void 0!==c?c:null===(d=t.rule.props)||void 0===d?void 0:d.containerMode)&&void 0!==p?p:null===(u=t.prop.props)||void 0===u?void 0:u.containerMode)||void 0===n||n))return t.$render.defaultRender(t,void 0);const g=e&&Array.isArray(e)?e:e||[];return t.vNode.col({props:{span:24}},{default:()=>[t.vNode.make("a-spin",t.prop,g)]})}},{name:"div",mergeProp(e){e.rule.children||(e.rule.children=[]),e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.forEach(e=>{e&&"object"==typeof e&&"DragTool"!==e.type&&"DragBox"!==e.type&&(void 0===e.col||null===e.col?e.col=!1:e.col&&"object"==typeof e.col&&!1!==e.col.show&&(e.col.show=!1))})},render(e,t){const r={...t.prop};"div"===r.type&&(r.type="div");const l=e||[];return r.props||(r.props={}),r.props.style||(r.props.style={}),t.vNode.make("div",r,l)}},{name:"accTable",mergeProp(e){const t=e.prop.props||{},r=e.rule;if(!F(t,"columns")){var l;let e=(null===(l=r.props)||void 0===l?void 0:l.columns)||[];if("string"==typeof e)try{const t=JSON.parse(e);Array.isArray(t)&&(e=t)}catch(t){console.warn("accTable columns parse error:",t),e=[]}Array.isArray(e)||(e=[]),e=e.filter(e=>!e.hidden),t.columns=e}if(!F(t,"dataSource")){var a,o;let e=r.value||(null===(a=r.props)||void 0===a?void 0:a.dataSource)||[];if("string"==typeof e&&(null===(o=r.effect)||void 0===o||!o.fetch))try{const t=JSON.parse(e);Array.isArray(t)&&(e=t)}catch(t){console.warn("accTable dataSource parse error:",t),e=[]}Array.isArray(e)||(e=[]),t.dataSource=e}const i=e.effectData("fetch"),s=i&&!0===i.loading;var n;F(t,"loading")?t.loading=void 0!==(null===(n=r.props)||void 0===n?void 0:n.loading)?r.props.loading:s:t.loading=s;if(!F(t,"pagination")){var p;const e=null===(p=r.props)||void 0===p?void 0:p.pagination;t.pagination=!1!==e&&(!(!e||"object"!=typeof e)&&{current:e.current||1,pageSize:e.pageSize||10,total:e.total||0,showSizeChanger:!1!==e.showSizeChanger,showQuickJumper:e.showQuickJumper||!1,showTotal:e.showTotal,...e})}F(r.props,"bordered")&&(t.bordered=r.props.bordered),F(r.props,"size")&&(t.size=r.props.size),F(r.props,"scroll")&&(t.scroll=r.props.scroll),F(r.props,"rowKey")&&(t.rowKey=r.props.rowKey||"id"),F(r.props,"rowSelection")&&(t.rowSelection=r.props.rowSelection),F(r.props,"sticky")&&(t.sticky=r.props.sticky),F(r.props,"virtual")&&(t.virtual=r.props.virtual)},render:(e,t)=>t.$render.defaultRender(t,e)}];var $e={tooltip:"aTooltip",popover:"aPopover",button:"aButton",icon:"aIcon",slider:"aSlider",rate:"aRate",upload:"fcUpload",cascader:"aCascader",timePicker:"aTimePicker",timeRangePicker:"aTimeRangePicker",datePicker:"aDatePicker",rangePicker:"aRangePicker",switch:"aSwitch",select:"aSelect",checkbox:"aCheckboxGroup",radio:"aRadioGroup",input:"aInput",inputNumber:"aInputNumber",treeSelect:"aTreeSelect",search:"aInputSearch",inputPassword:"aInputPassword",textarea:"aTextarea",formItem:"aFormItem",form:"aForm",frame:"fcFrame",col:"aCol",row:"aRow",flex:"aFlex",space:"aSpace","space-compact":"aSpaceCompact",spin:"aSpin",tree:"aTree",autoComplete:"aAutoComplete",transfer:"aTransfer",group:"fcGroup",array:"fcGroup",subForm:"fcSubForm",object:"fcSubForm",image:"aImage",aImage:"aImage",accTable:"aTable",accTableTable:"aTable"};function Ae(e,t){F(e,t)&&A.String(e[t])&&(e[t]={[t]:e[t],show:!0})}function Fe(e){return!1===e}function Ve(e){const t={...e};return delete t.children,t}var Ie={validate(){const e=this.form();return e?e.validate():new Promise(e=>e())},validateField(e){const t=this.form();return t?t.validateFields(e):new Promise(e=>e())},clearValidateState(e){const t=this.vm.refs[e.wrapRef];t&&t.clearValidate()},tidyOptions:e=>(["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(t=>{!function(e,t){F(e,t)&&!A.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)}),e),tidyRule:({prop:e})=>(Ae(e,"title"),Ae(e,"info"),e),mergeProp(e){const t={info:{type:"popover",placement:"topLeft",icon:"QuestionCircleOutlined"},title:{},col:{span:24},wrap:{}};if(["info","wrap","col","title"].forEach(r=>{e.prop[r]=T([this.options[r]||{},e.prop[r]||{}],t[r])}),e.parent&&e.parent.rule){const t=e.parent.rule.type,r=e.parent.rule._menu;"flex"!==t&&"a-flex"!==t&&"flex"!==(null==r?void 0:r.name)&&"space"!==t&&"a-space"!==t&&"space"!==(null==r?void 0:r.name)||(e.prop.col=!1,e.rule&&(e.rule.col=!1))}if("upload"!==e.rule.type||e.prop.props.onPreview){if("upload"===e.rule.type&&e.prop.props.onPreview){const t=e.prop.props.onPreview,r=function(e){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:e.url,name:e.name,uid:e.uid,size:e.size,type:e.type},timestamp:Date.now()},"*")};e.prop.props.onPreview=function(e){r(e),t&&"function"==typeof t&&t.apply(this,arguments)}}}else{const t=function(e){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:e.url,name:e.name,uid:e.uid,size:e.size,type:e.type},timestamp:Date.now()},"*")};e.prop.props.onPreview=function(e){t(e)}}if("image"!==e.rule.type&&"aImage"!==e.rule.type||e.prop.props.preview){if(("image"===e.rule.type||"aImage"===e.rule.type)&&e.prop.props.preview){const t=e.prop.props.preview,r=function(t){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:t||e.prop.props.src||""},timestamp:Date.now()},"*")},l=e.prop.props.src||"",a=null==t?void 0:t.onVisibleChange;e.prop.props.preview={...t,visible:t.visible||!1,src:t.src||l,onVisibleChange:(e,o)=>(e&&!o&&r(t.src||l),!(!a||"function"!=typeof a)&&a.apply(this,arguments))}}}else{const t=function(t){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:t||e.prop.props.src||""},timestamp:Date.now()},"*")},r=e.prop.props.src||"";e.prop.props.preview={visible:!1,src:r,onVisibleChange:(e,l)=>{if(e&&!l)return t(r),!1}}}},getDefaultOptions:()=>({form:{hideRequiredMark:!1,layout:"horizontal",labelAlign:"right",labelCol:{span:3},wrapperCol:{span:21},validateOnRuleChange:!0},row:{gutter:0},submitBtn:{disabled:!1,loading:!1,type:"primary",innerText:"",show:!1,col:void 0,click:void 0},resetBtn:{disabled:!1,loading:!1,type:"default",innerText:"",show:!1,col:void 0,click:void 0}}),adapterValidate:(e,t)=>(e.validator=(e,r)=>new Promise((e,l)=>t(r,t=>{t?l(t):e()})),e),update(){const e=this.options.form;this.rule={props:{...e},on:{submit:e=>{e.preventDefault()}},style:e.style,type:"form"}},beforeRender(){const{key:e,ref:t,$handle:r}=this,l=this.options.form;O(this.rule,{key:e,ref:t,class:[l.className,l.class,"form-create",this.$handle.preview?"is-preview":""]}),O(this.rule.props,{model:r.formData})},render(e){return e.slotLen()&&!this.$handle.preview&&e.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,Fe(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap(e,t){const r=e.prop,l=`${this.key}${e.key}`,a=r.col,o=this.isTitle(r)&&!1!==r.wrap.title,{layout:i,col:s}=this.rule.props,n=r.wrap.class;delete r.wrap.class,delete r.wrap.title;let p=!1;if(e.parent&&e.parent.rule){const t=e.parent.rule.type,r=e.parent.rule._menu;"flex"!==t&&"a-flex"!==t&&"flex"!==(null==r?void 0:r.name)&&"space"!==t&&"a-space"!==t&&"space"!==(null==r?void 0:r.name)||(p=!0)}const c=Fe(r.wrap.show)?t:this.$r(T([r.wrap,{props:{...Ve(r.wrap||{}),hasFeedback:r.hasFeedback||!1,name:e.id,rules:e.injectValidate(),..."horizontal"!==i?{labelCol:{},wrapperCol:{}}:{}},class:this.$render.mergeClass(n||r.className,"fc-form-item"),key:l+"fi",ref:e.wrapRef,type:"formItem"}]),{default:()=>t,...o?{label:()=>this.makeInfo(r,l,e)}:{}});return"inline"===i||Fe(s)||Fe(a.show)||p?c:this.makeCol(r,l,[c])},isTitle(e){if(!1===this.options.form.title)return!1;const t=e.title;return!(!t.title&&!t.native||Fe(t.show))},makeInfo(e,t,r){var l,a;const o={...e.title},i={...e.info};if(!1===this.options.form.title)return!1;if(!o.title&&!o.native||Fe(o.show))return;const s="tooltip"===i.type;const n=this.getSlot("title"),p=[n?n({title:null===(l=r.refRule)||void 0===l||null===(l=l.__$title)||void 0===l?void 0:l.value,rule:r.rule,options:this.options}):null===(a=r.refRule)||void 0===a||null===(a=a.__$title)||void 0===a?void 0:a.value];if(!Fe(i.show)&&(i.info||i.native)&&!Fe(i.icon)){const e={type:i.type||"popover",props:Ve(i),key:t+"pop"};delete e.props.icon,delete e.props.show,delete e.props.info,delete e.props.align,delete e.props.native;const l=s?"title":"content";var c;if(i.info&&!F(e.props,l))e.props[l]=null===(c=r.refRule)||void 0===c||null===(c=c.__$info)||void 0===c?void 0:c.value;p["left"!==i.align?"unshift":"push"](this.$r(T([i,e]),{[o.slot||"default"]:()=>this.$r({type:!0===i.icon?"QuestionCircleOutlined":i.icon||"",props:{type:!0===i.icon?"QuestionCircleOutlined":i.icon},key:t+"i"})}))}const d=T([o,{props:Ve(o),key:t+"tit",class:"fc-form-title",type:o.type||"span"}]);return delete d.props.show,delete d.props.title,delete d.props.native,this.$r(d,p)},makeCol(e,t,r){const l=e.col;return this.$r({class:this.$render.mergeClass(l.class,"fc-form-col"),type:"col",props:l||{span:24},key:t+"col"},r)},makeRow(e){const t=this.options.row||{};return this.$r({type:"row",props:t,class:this.$render.mergeClass(t.class,"fc-form-row"),key:this.key+"row"},e)},makeFormBtn(){let e=[];if(Fe(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),Fe(this.options.resetBtn.show)||e.push(this.makeResetBtn()),!e.length)return;let{labelCol:t,wrapperCol:r,layout:l}=this.rule.props;"horizontal"!==l&&(t=r={});const a=this.$r({type:"formItem",class:"fc-form-item fc-form-footer",key:this.key+"fb",props:{labelCol:t,wrapperCol:r,label:" ",colon:!1}},e);return"inline"===l?a:this.$r({type:"col",class:"fc-form-col",props:{span:24},key:this.key+"fc"},[a])},makeResetBtn(){const e={...this.options.resetBtn},t=e.innerText||this.$handle.api.t("reset")||"重置";return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"fc-reset-btn",style:{width:e.width,marginLeft:"10px"},on:{click:()=>{const e=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(e):e.resetFields()}},key:this.key+"b2"},[t])},makeSubmitBtn(){const e={...this.options.submitBtn},t=e.innerText||this.$handle.api.t("submit")||"提交";return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"fc-submit-btn",style:{width:e.width},on:{click:()=>{const e=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(e):e.submit().catch(()=>{})}},key:this.key+"b1"},[t])}};const je={};var Pe;!function(e){["treeSelect","upload","frame","autoComplete","cascader","datePicker","frame","inputNumber","inputPassword","radio","rate","switch","rate","slider","timePicker"].reduce((e,t)=>(e[t]=P(t),e),e),e.auto=e.autoComplete,e.number=e.inputNumber,e.time=e.timePicker,e.password=e.inputPassword}(je),function(e){e.sliderRange=P("slider",{range:!0})}(je),function(e){const t={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(t).reduce((e,r)=>(e[r]=P("frame",e=>e.props({type:t[r][0],maxLength:t[r][1]})),e),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(je),function(e){const t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((e,r)=>(e[r]=P("upload",e=>e.props({uploadType:t[r][0],maxLength:t[r][1]})),e),e),e.uploadImage=e.image,e.uploadFile=e.file}(je),(Pe=je).selectMultiple=P("select",{mode:"multiple"}),Pe.selectTags=P("select",{mode:"tags"}),Pe.selectCombobox=P("select",{mode:"combobox"}),function(e){e.cusStoreSelect=P("cusStoreSelect"),e.storeSelect=e.cusStoreSelect}(je),function(e){e.cusUserSelect=P("cusUserSelect"),e.userSelect=e.cusUserSelect}(je),function(e){e.text=P("text")}(je),function(e){e.flex=P("flex")}(je),function(e){e.space=P("space")}(je),function(e){e.spin=P("spin")}(je);const Te=new class{mobile(e,t=!1){if(!e)return!1;const r=String(e).trim();return t?/^1[3-9]\d{9}$/.test(r):/^1\d{10,11}$/.test(r)}email(e){if(!e)return!1;const t=String(e).trim();return/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t)}idCard(e,t=!0){if(!e)return!1;const r=String(e).trim().toUpperCase();if(!/^\d{17}[\dX]$/.test(r))return!1;if(!t)return!0;const l=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let a=0;for(let e=0;e<17;e++)a+=parseInt(r[e])*l[e];const o=a%11;return r[17]===["1","0","X","9","8","7","6","5","4","3","2"][o]}url(e,t={}){if(!e)return!1;const r=String(e).trim(),{requireProtocol:l=!1}=t;return l?/^https?:\/\/.+\..+/.test(r):/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/.test(r)}ip(e){if(!e)return!1;const t=String(e).trim().split(".");return 4===t.length&&t.every(e=>{const t=parseInt(e,10);return t>=0&&t<=255&&String(t)===e})}number(e,t={}){if(null==e||""===e)return!1;const r=Number(e);if(isNaN(r))return!1;const{integer:l=!1,positive:a=!1,negative:o=!1,min:i,max:s}=t;return!(l&&!Number.isInteger(r))&&(!(a&&r<=0)&&(!(o&&r>=0)&&(!(void 0!==i&&r<i)&&!(void 0!==s&&r>s))))}length(e,t={}){if(null==e)return!1;const r=String(e),{min:l,max:a,len:o}=t;return void 0!==o?r.length===o:!(void 0!==l&&r.length<l)&&!(void 0!==a&&r.length>a)}pattern(e,t){if(!e||!t)return!1;const r=String(e);let l;if(t instanceof RegExp)l=t;else try{l=new RegExp(t)}catch(e){return!1}return l.test(r)}date(e,t={}){if(!e)return!1;let r;if(e instanceof Date)r=e;else if(r=new Date(e),isNaN(r.getTime()))return!1;const{min:l,max:a}=t;if(l){if(r<(l instanceof Date?l:new Date(l)))return!1}if(a){if(r>(a instanceof Date?a:new Date(a)))return!1}return!0}empty(e,t=!0){return null==e||("string"==typeof e?t?""===e.trim():""===e:Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)}notEmpty(e,t=!0){return!this.empty(e,t)}chinese(e){return!!e&&/^[\u4e00-\u9fa5]+$/.test(String(e))}alpha(e,t=!1){if(!e)return!1;const r=String(e);return t?/^[a-zA-Z]+$/.test(r):/^[a-z]+$/i.test(r)}alphanumeric(e){return!!e&&/^[a-zA-Z0-9]+$/.test(String(e))}integer(e){return this.number(e,{integer:!0})}positive(e){return this.number(e,{positive:!0})}negative(e){return this.number(e,{negative:!0})}bankCard(e){if(!e)return!1;const t=String(e).replace(/\s/g,"");return/^\d{16,19}$/.test(t)}postcode(e){return!!e&&/^\d{6}$/.test(String(e).trim())}licensePlate(e){if(!e)return!1;const t=String(e).trim().toUpperCase();return/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-Z0-9]{4,5}[A-Z0-9挂学警港澳]$/.test(t)||/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z]((\d{5}[DF])|([DF][A-Z0-9]\d{4}))$/.test(t)}creditCode(e){if(!e)return!1;const t=String(e).trim().toUpperCase();return/^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/.test(t)}enum(e,t){return!(!Array.isArray(t)||0===t.length)&&t.includes(e)}equal(e,t,r=!1){return r?e===t:e==t}notEqual(e,t,r=!0){return!this.equal(e,t,r)}uppercase(e){if(!e)return!1;const t=String(e);return t===t.toUpperCase()&&/[A-Z]/.test(t)}lowercase(e){if(!e)return!1;const t=String(e);return t===t.toLowerCase()&&/[a-z]/.test(t)}username(e,t={}){if(!e)return!1;const r=String(e).trim(),{min:l=3,max:a=20}=t;return!(r.length<l||r.length>a)&&/^[a-zA-Z0-9_]+$/.test(r)}password(e,t={}){if(!e)return!1;const r=String(e),{min:l=6,max:a=20,requireNumber:o=!1,requireLetter:i=!1,requireSpecial:s=!1}=t;return!(r.length<l||r.length>a)&&(!(o&&!/\d/.test(r))&&(!(i&&!/[a-zA-Z]/.test(r))&&!(s&&!/[!@#$%^&*(),.?":{}|<>]/.test(r))))}hexColor(e){return!!e&&/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(String(e).trim())}qq(e){return!!e&&/^[1-9]\d{4,10}$/.test(String(e).trim())}wechat(e){return!!e&&/^[a-zA-Z0-9_-]{6,20}$/.test(String(e).trim())}tel(e){if(!e)return!1;const t=String(e).trim();return/^(0\d{2,3}-?)?\d{7,8}$/.test(t)}mac(e){if(!e)return!1;const t=String(e).trim().toUpperCase();return/^([0-9A-F]{2}:){5}[0-9A-F]{2}$/.test(t)}base64(e){if(!e)return!1;const t=String(e).trim();if(t.length%4!=0)return!1;try{return btoa(atob(t))===t}catch(e){return!1}}json(e){if(!e)return!1;try{return JSON.parse(String(e)),!0}catch(e){return!1}}numeric(e){return null!=e&&/^\d+$/.test(String(e))}path(e){return!!e&&/^\/[^\s]*$/.test(String(e).trim())}port(e){return this.number(e,{integer:!0,min:1,max:65535})}};let Oe=null;try{var Ee,Be,De;if(null!==(Ee=parent)&&void 0!==Ee&&null!==(Ee=Ee.window)&&void 0!==Ee&&Ee.location)Oe="https://zxgj.zhixianai.com"==(null===(Be=parent)||void 0===Be||null===(Be=Be.window)||void 0===Be?void 0:Be.location.origin)||"http://zxgj.zhixianai.com"==(null===(De=parent)||void 0===De||null===(De=De.window)||void 0===De?void 0:De.location.origin)}catch(e){Oe=null}const Re=null!==Oe&&Oe?"https://merchant-api.zhixianai.com/api":!1===Oe?"https://sandbox-merchant-api.zhixianai.com/api":"";function ze(e,t){return A.Boolean(e)?e={show:e}:A.Undef(e)||A.Object(e)||(e={show:t}),e}function Ke(e,t){return{formEl:()=>t.$manager.form(),wrapEl(e){const r=t.getFieldCtx(e);if(r)return t.vm.refs[r.wrapRef]},validate:r=>new Promise((l,a)=>{const o=e.children,i=[t.$manager.validate()];o.filter(e=>!e.isScope).forEach(e=>{i.push(e.validate())}),Promise.all(i).then(()=>{l(!0),r&&r(!0)}).catch(l=>{a(l),r&&r(l),t.vm.emit("validate-fail",l,{api:e}),t.emitEvent("validate-fail",l,{api:e})})}),validateField:(r,l)=>new Promise((a,o)=>{const i=t.getFieldCtx(r);if(!i)return;const s=t.subForm[i.id],n=[t.$manager.validateField(i.id)];B(s).filter(e=>!e.isScope).forEach(e=>{n.push(e.validate())}),Promise.all(n).then(()=>{a(null),l&&l(null)}).catch(a=>{o(a),l&&l(a),t.vm.emit("validate-field-fail",a,{field:r,api:e})})}),clearValidateState(r,l=!0){e.helper.tidyFields(r).forEach(e=>{l&&this.clearSubValidateState(e),t.getCtxs(e).forEach(e=>{t.$manager.clearValidateState(e)})})},clearSubValidateState(r){e.helper.tidyFields(r).forEach(e=>{t.getCtxs(e).forEach(e=>{const r=t.subForm[e.id];r&&(Array.isArray(r)?r.forEach(e=>{e.clearValidateState()}):r&&r.clearValidateState())})})},btn:{loading:(t=!0)=>{e.submitBtnProps({loading:!!t})},disabled:(t=!0)=>{e.submitBtnProps({disabled:!!t})},show:(t=!0)=>{e.submitBtnProps({show:!!t})}},resetBtn:{loading:(t=!0)=>{e.resetBtnProps({loading:!!t})},disabled:(t=!0)=>{e.resetBtnProps({disabled:!!t})},show:(t=!0)=>{e.resetBtnProps({show:!!t})}},submitBtnProps:(r={})=>{let l=ze(t.options.submitBtn,!0);O(l,r),t.options.submitBtn=l,e.refreshOptions()},resetBtnProps:(r={})=>{let l=ze(t.options.resetBtn,!1);O(l,r),t.options.resetBtn=l,e.refreshOptions()},submit:(r,l)=>new Promise((a,o)=>{(!1===t.options.validateOnSubmit?Promise.resolve():e.validate()).then(()=>{let l=e.formData();t.beforeSubmit(l).then(()=>{A.Function(r)&&E(()=>r(l,e)),A.Function(t.options.onSubmit)&&E(()=>t.options.onSubmit(l,e)),t.vm.emit("submit",l,e),a(l)}).catch(e=>{})}).catch((...t)=>{A.Function(l)&&E(()=>l(e,...t)),o(...t)})}),request:t=>("string"==typeof t&&(t={action:t}),e.fetch(t)),getStoreInfo(t){if(!t)return Promise.resolve(null);let r={action:Re+"/storeInfo/page",method:"post",dataType:"json",data:{current:1,size:1,params:{storeId:t||""}}};return new Promise((t,l)=>{e.fetch(r).then(e=>{var r;0===(null==e?void 0:e.code)?t((null==e||null===(r=e.data)||void 0===r||null===(r=r.records)||void 0===r?void 0:r[0])||null):t(null)}).catch(e=>{l(e)})})},throttle(e,t){let r=0;return function(...l){const a=this,o=Date.now();o-r>=(t||0)&&(r=o,e.call(a,...l))}},debounce(e,t){let r=null;return function(...l){const a=this;null!==r&&clearTimeout(r),r=setTimeout(()=>{e.call(a,...l)},t||0)}},$validator:Te,$moment:D}}var Me={autoComplete:"value",cascader:"value",inputNumber:"value",inputPassword:"value",textarea:"value",rate:"value",slider:"value",treeSelect:"value",switch:"checked",cusStoreSelect:"modelValue",cusUserSelect:"modelValue"};const Ne={name:"required",load(e,t,r){const l=function(e){return A.Boolean(e)?{required:e}:A.String(e)?{message:e}:A.Undef(e)?{required:!1}:A.Function(e)?{validator:e}:A.Object(e)?e:{}}(e.getValue());if(!1===l.required)e.clearProp(),r.clearValidateState([t.field]);else{var a;const o={required:!0,validator:(e,t)=>new Promise((e,r)=>{A.empty(t)?r(o.message):e()}),...l},i=null===(a=t.__fc__.refRule)||void 0===a||null===(a=a.__$title)||void 0===a?void 0:a.value;if(o.message){const e=o.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);e&&(o.message=r.t(e[1],{title:i}))}else o.message=r.t("required",{title:i})||i+("en"===r.getLocale()?" is required":"不能为空");e.getProp().validate=[o]}r.sync(t)},watch(...e){Ne.load(...e)}};function _e(e){e.componentAlias($e),Object.keys(Me).forEach(t=>{e.setModelField(t,Me[t])}),ce.forEach(t=>{e.component(t.name,t)}),e.register(Ne),ke.forEach(t=>{e.parser(t)}),Object.keys(je).forEach(t=>{e.maker[t]=je[t]}),"undefined"!=typeof window&&window.antd&&e.useApp((e,t)=>{t.use(window.antd)})}const Le=j({ui:'"ant-design-vue"',version:'"3.2.83"',manager:Ie,install:_e,extendApi:Ke,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});"undefined"!=typeof window&&(window.formCreate=Le);const Ue=Le.maker;export{Le as default,Ue as maker};
|
|
7
|
+
import e from"@longhongguo/component-antdv-upload/src/index";import t from"@form-create/component-antdv-frame/src/index";import r from"@form-create/component-antdv-group/src/index";import l from"@form-create/component-subform/src/index";import{openBlock as a,createElementBlock as o,createElementVNode as i,defineComponent as n,Fragment as s,createCommentVNode as p,normalizeClass as c,normalizeStyle as d,toDisplayString as u,renderList as h,resolveComponent as f,createVNode as m,reactive as y,markRaw as g,createBlock as v,resolveDynamicComponent as b,withCtx as w,createTextVNode as C,renderSlot as S,toRef as x,watch as k,nextTick as $}from"vue";import A,{hasProperty as F}from"@form-create/utils/lib/type";import{parseFn as V}from"@form-create/utils/lib/json";import I from"@form-create/utils/lib/deepset";import j,{creatorFactory as P}from"@longhongguo/form-create-core/src/index";import T from"@form-create/utils/lib/mergeprops";import O from"@form-create/utils/lib/extend";import"@longhongguo/component-antdv-upload/dist/index.css";import{invoke as E}from"@longhongguo/form-create-core/src/frame/util";import D from"@form-create/utils/lib/toarray";import B from"moment";var R={name:"QuestionCircleOutlined"};const z={class:"anticon"};R.render=function(e,t,r,l,n,s){return a(),o("span",z,[...t[0]||(t[0]=[i("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[i("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372z",fill:"currentColor"}),i("path",{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7c-21.2 8.1-39.2 22.3-52.1 40.9c-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0 1 30.9-44.8c59-22.7 97.1-74.7 97.1-132.5c.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1 0 80 0a40 40 0 1 0-80 0z",fill:"currentColor"})],-1)])])};var K=n({name:"CusSelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},sourceItems:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},bordered:{type:Boolean,default:!0}},emits:["update:modelValue","update:sourceItems","change"],computed:{currentValue:{get(){return Array.isArray(this.modelValue)?this.modelValue.map(e=>"object"!=typeof e||null===e||void 0===e.value&&void 0===e[this.valueKey]?{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}:e):null===this.modelValue||void 0===this.modelValue||""===this.modelValue?[]:"object"==typeof this.modelValue?[this.modelValue]:[{value:this.modelValue,label:this.getLabel(this.modelValue)}]},set(e){let t=[];null!=e&&(t=Array.isArray(e)?e.map(e=>"object"!=typeof e||null===e||void 0===e.value&&void 0===e[this.valueKey]?{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}:e):"object"==typeof e&&null!==e?[e]:[{[this.valueKey]:e,[this.labelKey]:this.getLabel(e)}]),this.$emit("update:modelValue",t),this.$emit("change",t)}},hasValue(){const e=this.currentValue;return Array.isArray(e)&&e.length>0},displayValue(){return this.hasValue?this.currentValue[0]:null},displayLabel(){if(!this.displayValue)return"";const e=this.displayValue;return"object"==typeof e&&null!==e?e[this.labelKey]||e.label||String(e[this.valueKey]||e.value||""):this.getLabel(e)},allSelectedItems(){const e=this.currentValue;return Array.isArray(e)&&0!==e.length?e.map(e=>"object"==typeof e&&null!==e?{value:e[this.valueKey]||e.value,label:e[this.labelKey]||e.label||String(e[this.valueKey]||e.value||"")}:{value:e,label:this.getLabel(e)}):[]},displayItems(){const e=this.allSelectedItems;return void 0===this.maxTagCount||null===this.maxTagCount?e:e.slice(0,this.maxTagCount)},remainingCount(){if(void 0===this.maxTagCount||null===this.maxTagCount)return 0;const e=this.allSelectedItems.length;return Math.max(0,e-this.maxTagCount)},showClear(){return this.allowClear&&this.hasValue&&!this.disabled}},methods:{findOptionByValue(e){return this.options&&0!==this.options.length?this.options.find(t=>{const r="object"==typeof t?t[this.valueKey]:t;return r===e||String(r)===String(e)}):null},getLabel(e){const t=this.findOptionByValue(e);return t?"object"==typeof t?t[this.labelKey]:t:String(e)},removeItem(e,t){if(this.disabled)return;t.stopPropagation();const r=this.currentValue;if(Array.isArray(r)){const t=r.filter(t=>{if("object"==typeof t&&null!==t){return(t[this.valueKey]||t.value)!==e}return t!==e}),l=this.sourceItems.filter(e=>!t.some(t=>t[this.valueKey]===e[this.valueKey]));this.$emit("update:sourceItems",l),this.currentValue=t}},clearValue(e){if(this.disabled)return;e.stopPropagation(),this.currentValue=[];const t=this.sourceItems.filter(e=>!this.currentValue.some(t=>t[this.valueKey]===e[this.valueKey]));this.$emit("update:sourceItems",t)}}});const M=["tabindex"],N=["title"],_={key:1,class:"fc-cus-select-selection-placeholder"},L={key:3,class:"fc-cus-select-arrow"},U=["tabindex"],q={class:"fc-cus-select-selection-overflow"},Y=["title"],Q={class:"fc-cus-select-selection-item-content"},Z=["onClick"],J={key:0,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},W={class:"fc-cus-select-selection-item"},H={class:"fc-cus-select-selection-item-content"},X={key:1,class:"fc-cus-select-selection-placeholder"},G={key:1,class:"fc-cus-select-arrow"};K.render=function(e,t,r,l,n,f){return a(),o(s,null,[p(" 单个展示模式 "),e.multiple?(a(),o(s,{key:1},[p(" 多个展示模式 "),i("div",{class:c(["fc-cus-select fc-cus-select-multiple",{"fc-cus-select-disabled":e.disabled}]),style:d(e.style),tabindex:e.disabled?-1:0},[i("div",{class:c(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[i("div",q,[p(" 显示的 tags "),(a(!0),o(s,null,h(e.displayItems,(r,l)=>(a(),o("div",{key:l,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},[i("span",{class:"fc-cus-select-selection-item",title:r.label},[i("span",Q,u(r.label),1),i("span",{class:"fc-cus-select-selection-item-remove",onClick:t=>e.removeItem(r.value,t)},[...t[4]||(t[4]=[i("span",{role:"img","aria-label":"close",class:"anticon anticon-close"},[i("svg",{focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"})])],-1)])],8,Z)],8,Y)]))),128)),p(" 折叠提示 "),e.remainingCount>0?(a(),o("div",J,[i("span",W,[i("span",H," +"+u(e.remainingCount),1)])])):p("v-if",!0),p(" 空值占位符 "),e.hasValue?p("v-if",!0):(a(),o("span",X,u(e.placeholder||"请选择"),1))]),e.showClear?(a(),o("span",{key:0,class:"fc-cus-select-clear",onClick:t[1]||(t[1]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[5]||(t[5]=[i("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[i("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})])],-1)])])):(a(),o("span",G,[...t[6]||(t[6]=[i("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[i("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[i("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})])],-1)])]))],2)],14,U)],2112)):(a(),o("div",{key:0,class:c(["fc-cus-select fc-cus-select-single",{"fc-cus-select-disabled":e.disabled}]),style:d(e.style),tabindex:e.disabled?-1:0},[i("div",{class:c(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[e.displayValue?(a(),o("span",{key:0,class:"fc-cus-select-selection-item",title:e.displayLabel},u(e.displayLabel),9,N)):(a(),o("span",_,u(e.placeholder||"请选择"),1)),e.showClear?(a(),o("span",{key:2,class:"fc-cus-select-clear",onClick:t[0]||(t[0]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[2]||(t[2]=[i("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[i("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[i("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})])],-1)])])):(a(),o("span",L,[...t[3]||(t[3]=[i("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[i("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[i("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})])],-1)])]))],2)],14,M))],2112)};var ee=n({name:"CusStoreSelect",components:{CusSelect:K},props:{formCreateInject:{type:Object,default:null},modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},field:{type:String,default:""},bordered:{type:Boolean,default:!0},extraQuery:{type:Object,default:()=>({})},extraQueryFn:{type:Function,default:()=>{}}},emits:["update:modelValue","change"],data:()=>({messageId:0,pendingCallbacks:{},internalOptions:[],sourceItems:[]}),computed:{mergedOptions(){if(this.internalOptions.length>0){const e=new Map;return this.options.forEach(t=>{const r="object"==typeof t?t[this.valueKey]:t;e.set(r,t)}),this.internalOptions.forEach(t=>{const r="object"==typeof t?t[this.valueKey]:t;e.set(r,t)}),Array.from(e.values())}return this.options}},watch:{options:{immediate:!0,handler(e){0===this.internalOptions.length&&Array.isArray(e)&&e.length>0&&(this.internalOptions=[...e])}}},mounted(){window.addEventListener("message",this.handleMessage)},beforeUnmount(){window.removeEventListener("message",this.handleMessage)},methods:{serializeForPostMessage(e){if(null==e)return e;try{return JSON.parse(JSON.stringify(e))}catch(t){if(console.warn("CusStoreSelect: 数据序列化失败,尝试递归处理",t),Array.isArray(e))return 0===e.length?[]:e.map(e=>this.serializeForPostMessage(e));if("object"==typeof e){const t={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r))try{t[r]=this.serializeForPostMessage(e[r])}catch(e){console.warn("CusStoreSelect: 跳过无法序列化的属性: "+r,e)}return t}return e}},handleClick(){if(this.disabled)return;const e=`store-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let r=null;t.length>0&&(r=t);const l=null==r?null:this.serializeForPostMessage(r),a={...this.extraQuery};this.extraQueryFn&&Object.assign(a,this.extraQueryFn());const o={type:"OPEN_STORE_SELECT",field:this.field||"",multiple:this.multiple,currentValue:l,valueKey:this.valueKey,labelKey:this.labelKey,extraQuery:a,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(o,"*")}catch(e){console.error("CusStoreSelect: 发送消息失败",e)}else console.warn("CusStoreSelect: 当前不在 iframe 环境中,无法向父窗口发送消息");this.pendingCallbacks[e]=(e,t)=>{t&&Array.isArray(t)&&t.length>0&&this.mergeOptions(t),this.sourceItems=t,this.handleUpdate(e),this.handleChange(e)}},handleMessage(e){const t=e.data;if(t&&"STORE_SELECT_RESULT"===t.type){const{field:e,value:r,sourceItems:l,messageId:a}=t;if(e!==this.field)return;const o=this.pendingCallbacks[a];o&&(o(r,l),delete this.pendingCallbacks[a])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const r="object"==typeof e?e[this.valueKey]:e;t.set(r,e)}),e.forEach(e=>{const r="object"==typeof e?e[this.valueKey]:e;t.set(r,e)}),this.internalOptions=Array.from(t.values())},handleUpdate(e){this.$emit("update:modelValue",e),this.triggerValidate()},handleChange(e){this.$emit("change",e,this.sourceItems&&this.sourceItems.length>0?this.multiple?this.sourceItems:this.sourceItems[0]:this.multiple?[]:null)},triggerValidate(){this.$nextTick(()=>{this.$nextTick(()=>{try{if(this.formCreateInject&&this.formCreateInject.api&&this.field)return void this.formCreateInject.api.validateField(this.field).catch(()=>{});let e=this.$parent;for(;e;){if(e.$options&&"FormCreate"===e.$options.name&&e.fapi){this.field&&e.fapi.validateField&&e.fapi.validateField(this.field).catch(()=>{});break}e=e.$parent}}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})}}});ee.render=function(e,t,r,l,i,n){const s=f("CusSelect");return a(),o("div",{onClick:t[1]||(t[1]=(...t)=>e.handleClick&&e.handleClick(...t))},[m(s,{"model-value":e.modelValue,options:e.mergedOptions,"source-items":e.sourceItems,"onUpdate:sourceItems":t[0]||(t[0]=t=>e.sourceItems=t),multiple:e.multiple,"max-tag-count":e.maxTagCount,placeholder:e.placeholder,disabled:e.disabled,style:d(e.style),valueKey:e.valueKey,labelKey:e.labelKey,allowClear:e.allowClear,bordered:e.bordered,"onUpdate:modelValue":e.handleUpdate,onChange:e.handleChange},null,8,["model-value","options","source-items","multiple","max-tag-count","placeholder","disabled","style","valueKey","labelKey","allowClear","bordered","onUpdate:modelValue","onChange"])])};var te=n({name:"CusUserSelect",components:{CusSelect:K},props:{formCreateInject:{type:Object,default:null},modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},maxTagCount:{type:Number,default:void 0},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},style:{type:[String,Object],default:()=>({width:"100%"})},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},allowClear:{type:Boolean,default:!1},field:{type:String,default:""},bordered:{type:Boolean,default:!0},selectType:{type:[String,Number],default:null},extraQuery:{type:Object,default:()=>({})},extraQueryFn:{type:Function,default:()=>{}}},emits:["update:modelValue","change"],data:()=>({messageId:0,pendingCallbacks:{},internalOptions:[],sourceItems:[]}),computed:{mergedOptions(){if(this.internalOptions.length>0){const e=new Map;return this.options.forEach(t=>{const r="object"==typeof t?t[this.valueKey]:t;e.set(r,t)}),this.internalOptions.forEach(t=>{const r="object"==typeof t?t[this.valueKey]:t;e.set(r,t)}),Array.from(e.values())}return this.options}},watch:{options:{immediate:!0,handler(e){0===this.internalOptions.length&&Array.isArray(e)&&e.length>0&&(this.internalOptions=[...e])}}},mounted(){window.addEventListener("message",this.handleMessage)},beforeUnmount(){window.removeEventListener("message",this.handleMessage)},methods:{serializeForPostMessage(e){if(null==e)return e;try{return JSON.parse(JSON.stringify(e))}catch(t){if(console.warn("CusUserSelect: 数据序列化失败,尝试递归处理",t),Array.isArray(e))return 0===e.length?[]:e.map(e=>this.serializeForPostMessage(e));if("object"==typeof e){const t={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r))try{t[r]=this.serializeForPostMessage(e[r])}catch(e){console.warn("CusUserSelect: 跳过无法序列化的属性: "+r,e)}return t}return e}},handleClick(){if(this.disabled)return;const e=`user-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let r=null;t.length>0&&(r=t);const l=null==r?null:this.serializeForPostMessage(r),a={...this.extraQuery};this.extraQueryFn&&Object.assign(a,this.extraQueryFn());const o={type:"OPEN_USER_SELECT",field:this.field||"",multiple:this.multiple,currentValue:l,valueKey:this.valueKey,labelKey:this.labelKey,selectType:this.selectType,extraQuery:a,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(o,"*")}catch(e){console.error("CusUserSelect: 发送消息失败",e)}else console.warn("CusUserSelect: 当前不在 iframe 环境中,无法向父窗口发送消息");this.pendingCallbacks[e]=(e,t)=>{t&&Array.isArray(t)&&t.length>0&&this.mergeOptions(t),this.sourceItems=t,this.handleUpdate(e),this.handleChange(e)}},handleMessage(e){const t=e.data;if(t&&"USER_SELECT_RESULT"===t.type){const{field:e,value:r,sourceItems:l,messageId:a}=t;if(e!==this.field)return;const o=this.pendingCallbacks[a];o&&(o(r,l),delete this.pendingCallbacks[a])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const r="object"==typeof e?e[this.valueKey]:e;t.set(r,e)}),e.forEach(e=>{const r="object"==typeof e?e[this.valueKey]:e;t.set(r,e)}),this.internalOptions=Array.from(t.values())},handleUpdate(e){this.$emit("update:modelValue",e),this.triggerValidate()},handleChange(e){this.$emit("change",e,this.sourceItems&&this.sourceItems.length>0?this.multiple?this.sourceItems:this.sourceItems[0]:this.multiple?[]:null)},triggerValidate(){this.$nextTick(()=>{this.$nextTick(()=>{try{if(this.formCreateInject&&this.formCreateInject.api&&this.field)return void this.formCreateInject.api.validateField(this.field).catch(()=>{});let e=this.$parent;for(;e;){if(e.$options&&"FormCreate"===e.$options.name&&e.fapi){this.field&&e.fapi.validateField&&e.fapi.validateField(this.field).catch(()=>{});break}e=e.$parent}}catch(e){console.warn("CusUserSelect: 触发校验失败",e)}})})}}});te.render=function(e,t,r,l,i,n){const s=f("CusSelect");return a(),o("div",{onClick:t[1]||(t[1]=(...t)=>e.handleClick&&e.handleClick(...t))},[m(s,{"model-value":e.modelValue,options:e.mergedOptions,"source-items":e.sourceItems,"onUpdate:sourceItems":t[0]||(t[0]=t=>e.sourceItems=t),multiple:e.multiple,"max-tag-count":e.maxTagCount,placeholder:e.placeholder,disabled:e.disabled,style:d(e.style),valueKey:e.valueKey,labelKey:e.labelKey,allowClear:e.allowClear,bordered:e.bordered,"onUpdate:modelValue":e.handleUpdate,onChange:e.handleChange},null,8,["model-value","options","source-items","multiple","max-tag-count","placeholder","disabled","style","valueKey","labelKey","allowClear","bordered","onUpdate:modelValue","onChange"])])};var re={name:"TableForm",emits:["change","add","delete","update:modelValue"],props:{formCreateInject:Object,modelValue:{type:Array,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},filterEmptyColumn:{type:Boolean,default:!0},deletable:{type:Boolean,default:!0},addable:{type:Boolean,default:!0},options:{type:Object,default:()=>y({submitBtn:!1,resetBtn:!1})},min:Number,max:Number,disabled:Boolean},watch:{modelValue:{handler(){this.updateTable()},deep:!0},"formCreateInject.preview":function(e){this.emptyRule.children[0].props.colspan=this.columns.length+(e?1:2)}},data(){return{rule:[],trs:[],fapi:{},Form:g(this.formCreateInject.form.$form()),copyTrs:"",oldValue:"",emptyRule:{type:"tr",_isEmpty:!0,native:!0,subRule:!0,children:[{type:"td",style:{textAlign:"center"},native:!0,subRule:!0,props:{colspan:this.columns.length+(this.formCreateInject.preview?1:2)},children:[this.formCreateInject.t("dataEmpty")||"暂无数据"]}]}}},methods:{formChange(){this.updateValue()},updateValue(){const e=this.trs.map((e,t)=>({...this.modelValue[t]||{},...this.fapi.getChildrenFormData(e)})).filter(e=>{if(!this.filterEmptyColumn)return!0;if(null==e)return!1;let t=!1;return Object.keys(e).forEach(r=>{t=t||void 0!==e[r]&&""!==e[r]&&null!==e[r]}),t}),t=JSON.stringify(e);t!==this.oldValue&&(this.oldValue=t,this.$emit("update:modelValue",e),this.$emit("change",e))},setRawData(e,t){const r=this.trs[e];this.fapi.setChildrenFormData(r,t,!0)},updateTable(){const e=JSON.stringify(this.modelValue);this.oldValue!==e&&(this.oldValue=e,this.trs=this.trs.splice(0,this.modelValue.length),this.modelValue.length?this.clearEmpty():this.addEmpty(),this.modelValue.forEach((e,t)=>{this.trs[t]||this.addRaw(),this.setRawData(t,e||{})}),this.rule[0].children[1].children=this.trs)},addEmpty(){this.trs.length&&this.trs.splice(0,this.trs.length),this.trs.push(this.emptyRule)},clearEmpty(){this.trs[0]&&this.trs[0]._isEmpty&&this.trs.splice(0,1)},delRaw(e){this.disabled||!this.deletable||this.min>0&&this.trs.length<=this.min||(this.trs.splice(e,1),this.updateValue(),this.trs.length?this.trs.forEach(e=>this.updateRaw(e)):this.addEmpty(),this.$emit("delete",e))},addRaw(e){if(e&&this.disabled)return;const t=this.formCreateInject.form.parseJson(this.copyTrs)[0];1===this.trs.length&&this.trs[0]._isEmpty&&this.trs.splice(0,1),this.trs.push(t),this.updateRaw(t),e&&(this.$emit("add",this.trs.length),this.updateValue())},updateRaw(e){const t=this.trs.indexOf(e);e.children[0].props.innerText=t+1,e.children[e.children.length-1].children[0].props.onClick=()=>{this.delRaw(t)}},loadRule(){const e=[{type:"th",native:!0,class:"_fc-tf-head-idx",props:{innerText:"#"}}];let t=[{type:"td",class:"_fc-tf-idx",native:!0,props:{innerText:"0"}}];this.columns.forEach(r=>{e.push({type:"th",native:!0,style:{...r.style||{},textAlign:r.align||"center"},class:r.required?"_fc-tf-head-required":"",props:{innerText:r.label||""}}),t.push({type:"td",native:!0,children:[...r.rule||[]]})}),e.push({type:"th",native:!0,class:"_fc-tf-edit fc-clock",props:{innerText:this.formCreateInject.t("operation")||"操作"}}),t.push({type:"td",native:!0,class:"_fc-tf-btn fc-clock",children:[{type:"i",native:!0,class:"fc-icon icon-delete",props:{}}]}),this.copyTrs=this.formCreateInject.form.toJson([{type:"tr",native:!0,subRule:!0,children:t}]),this.rule=[{type:"table",native:!0,class:"_fc-tf-table",props:{border:"1",cellspacing:"0",cellpadding:"0"},children:[{type:"thead",native:!0,children:[{type:"tr",native:!0,children:e}]},{type:"tbody",native:!0,children:this.trs}]}]}},created(){this.loadRule()},mounted(){this.updateTable()}};re.render=function(e,t,r,l,n,s){const d=f("a-button");return a(),o("div",{class:c(["_fc-table-form",{"_fc-disabled":r.disabled}])},[(a(),v(b(n.Form),{option:r.options,rule:n.rule,extendOption:!0,disabled:r.disabled,onChange:s.formChange,api:n.fapi,"onUpdate:api":t[0]||(t[0]=e=>n.fapi=e),onEmitEvent:e.$emit},null,40,["option","rule","disabled","onChange","api","onEmitEvent"])),r.addable&&(!r.max||r.max>this.trs.length)?(a(),v(d,{key:0,type:"link",class:"fc-clock",onClick:t[1]||(t[1]=e=>s.addRaw(!0)),disabled:r.disabled},{default:w(()=>[t[2]||(t[2]=i("i",{class:"fc-icon icon-add-circle",style:{"font-weight":"700"}},null,-1)),C(" "+u(r.formCreateInject.t("add")||"添加"),1)]),_:1},8,["disabled"])):p("v-if",!0)],2)};var le=n({name:"TableFormView",data:()=>({})});const ae={class:"_fd-table-form"},oe={key:0,class:"_fd-tf-wrap"},ie={key:1,class:"_fc-child-empty"};le.render=function(e,t,r,l,i,n){return a(),o("div",ae,[e.$slots.default?(a(),o("div",oe,[S(e.$slots,"default")])):(a(),o("div",ie))])};var ne=n({name:"TableFormColumnView",props:{label:String,align:String,width:[Number,String],color:String,required:Boolean},computed:{colStyle(){const e=this.width,t={width:A.Number(e)?e+"px":e&&"auto"!==e?e:"180px"};return this.color&&(t.color=this.color),t}},data:()=>({})});const se={key:0,class:"_fd-tf-required"},pe={class:"_fd-tf-con"};ne.render=function(e,t,r,l,n,s){return a(),o("div",{class:"_fd-tf-col",style:d(e.colStyle)},[i("div",{class:"_fd-tf-title",style:d({textAlign:e.align||"center"})},[e.required?(a(),o("span",se,"*")):p("v-if",!0),C(u(e.label||""),1)],4),i("div",pe,[S(e.$slots,"default")])],4)};var ce=[e,t,r,l,R,K,ee,te,re,le,ne],de={name:"checkbox",modelField:"value",mergeProp(e){const t=e.prop.props;F(t,"options")||(t.options=e.prop.options||[])}},ue={...de,name:"radio"},he={...de,name:"select",mergeProp(e){const t=e.prop.props;F(t,"options")||(t.options=e.prop.options||[]);const r=e.effectData("fetch");r&&!0===r.loading&&(t.disabled=!0,t.loading=!0)},render(e,t){const r=t.effectData("fetch");if(r&&!0===r.loading&&e.loading){const r={...e};return r.notFoundContent=e.loading,t.$render.defaultRender(t,r)}return t.$render.defaultRender(t,e)}},fe={name:"cascader",mergeProp(e){const t=e.prop.props;F(t,"options")||(t.options=e.prop.options||[]);const r=e.effectData("fetch");if(r&&!0===r.loading&&(t.disabled=!0,t.loading=!0),t.loadData){var l;const r=null===(l=e.$handle)||void 0===l?void 0:l.api,a=e.rule,o=e;let i=A.String(t.loadData)?V(t.loadData):t.loadData;if(!A.Function(i)&&A.String(t.loadData))try{const e=t.loadData.trim();e.startsWith("function")||e.startsWith("[[FORM-CREATE-PREFIX-function")||e.startsWith("$FNX:")||(i=new Function("selectedOptions","options","updateOptions","api","rule",e))}catch(e){console.error("Failed to parse loadData:",e)}A.Function(i)&&(t.loadData=function(e){if(!e||0===e.length)return;const l=e[e.length-1];if(!0===(null==l?void 0:l.isLeaf))return;const n=t.options||[],s=()=>{var e,i;const n=t.options||[];let s=-1;l&&(s=n.findIndex(e=>e.value===l.value||e.id===l.id||e===l));const p=n.map((e,t)=>{if(t===s&&l){return{...l}}return{...e}}),c=o.effectData("fetch");c&&I(c,"props.options",p),t.options=p,null!==(e=o.prop)&&void 0!==e&&e.props&&(o.prop.props.options=p),null!==(i=o.rule)&&void 0!==i&&i.props&&(o.rule.props.options=p),r&&a&&r.sync(a),o.$handle&&o.$handle.refresh()};l&&(l.loading=!0,s());const p=i.call(this,e,n,s,r,a);return p&&"function"==typeof p.then?p.finally(()=>{s()}):p})}},render(e,t){const r=t.effectData("fetch");if(r&&!0===r.loading&&e.loading){const r={...e};return r.notFoundContent=e.loading,t.$render.defaultRender(t,r)}return t.$render.defaultRender(t,e)}};const me={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",quarter:"YYYY-qQ",year:"YYYY"},ye="datePicker";var ge={name:ye,maker:["date","month","week"].reduce((e,t)=>(e[t]=P(ye,{type:t}),e),{dateRange:P(ye,{type:"range"}),datetimeRange:P(ye,e=>e.props({type:"range",showTime:!0}))}),modelField:"value",mergeProp(e){const t=e.prop.props,r=t.type||t.picker;t.valueFormat||(t.valueFormat=(me[r]||me.date)+(!t.showTime||r&&"date"!==r?"":" HH:mm:ss"))},render:(e,t)=>t.$render.vNode[(!0===t.prop.props.range?"range":"date")+"Picker"](t.prop,e)};var ve={name:"hidden",maker:{hidden:(e,t)=>P("hidden")("",e,t)},render:()=>[]},be={name:"text",loadChildren:!1,mounted(e){var t,r;const l=e.rule.props||{},a=e.rule.bindField||l.bindField||(null===(t=e.prop.props)||void 0===t?void 0:t.bindField),o=e.rule.template||l.template||(null===(r=e.prop.props)||void 0===r?void 0:r.template);(o||a)&&setTimeout(()=>{if(e.$handle&&e.$handle.api)try{let t="";if(o){const r=e.$handle.api.formData();t=e.$handle.loadStrVar(o,t=>{const l=e.$handle.api.getValue(t);return void 0===l&&r&&void 0!==r[t]?r[t]:l},null)}else a&&(t=e.$handle.api.getValue(a)||"");null!=t&&(e.rule.children||(e.rule.children=[]),e.rule.children[0]=String(t),e.$handle.api.sync(e.rule),e.$handle.refresh())}catch(e){}},500)},renderChildren:(e,t)=>({default:()=>{var r;let l=null===(r=t.rule)||void 0===r?void 0:r.children;l||(l=e);return(Array.isArray(l)?l:[l]).filter(e=>null!=e).map(e=>A.String(e)?e:String(e)).join("")||""}}),mergeProp(e){var t,r,l;const a=e.rule.props||{},o=e.rule.bindField||a.bindField||(null===(t=e.prop.props)||void 0===t?void 0:t.bindField),i=e.rule.template||a.template||(null===(r=e.prop.props)||void 0===r?void 0:r.template);let n=e.rule.bindMode||a.bindMode||(null===(l=e.prop.props)||void 0===l?void 0:l.bindMode);if(n||(n=i?"template":o?"field":"static"),"field"===n&&o){const t={attr:o,to:"child",modify:!0,wait:300,watch:!0};e.rule.effect||(e.rule.effect={}),e.rule.effect.loadData||(e.rule.effect.loadData=[]);e.rule.effect.loadData.some(e=>e.attr===o&&"child"===e.to)||(e.rule.effect.loadData.push(t),e.$handle&&e.$handle.effect&&e.$handle.effect(e,"loaded"))}else if("template"===n&&i){const t={template:i,to:"child",modify:!0,wait:300,watch:!0};e.rule.effect||(e.rule.effect={}),e.rule.effect.loadData||(e.rule.effect.loadData=[]);if(!e.rule.effect.loadData.some(e=>e.template===i&&"child"===e.to)&&(e.rule.effect.loadData.push(t),e.$handle&&e.$handle.effect&&(e.$handle.effect(e,"loaded"),!e._textLoadDataWatched))){e._textLoadDataWatched=!0;const t=x(e.rule.effect,"loadData");e.watch.push(k(t,(t,r)=>{e.$handle.effect(e,"watch",{loadData:t})},{deep:!0}))}}null==e.rule.formCreateChild||e.rule.children||(e.rule.children=[e.rule.formCreateChild]),e.rule.children||(e.rule.children=[]),("field"===n&&o||"template"===n&&i)&&(!e.rule.children||Array.isArray(e.rule.children)&&0===e.rule.children.length)&&(e.rule.children="template"===n?[""]:[" "])},render(e,t){let r="";if(e&&"function"==typeof e.default)try{r=e.default()||""}catch(e){r=""}r=null==r||void 0===r?"":String(r);const l={...t.prop};l.props||(l.props={}),"text"===l.type&&(l.type="div"),delete l.props.innerHTML;return t.vNode.make("div",l,[r])}};var we={name:"input",maker:["password","url","email","text","textarea","search"].reduce((e,t)=>(e[t]=P("input",{type:t}),e),{idate:P("input",{type:"date"})}),modelField:"value",render(e,t){let r=t.prop.props.type;return-1===["textarea","search","password"].indexOf(r)&&(r="input"),r={textarea:"aTextarea",search:"aInputSearch",password:"aInputPassword"}[r]||"aInput",t.$render.vNode.make(r,t.prop,e)}},Ce={name:"timePicker",modelField:"value",mergeProp(e){const t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss")},render:(e,t)=>t.$render.vNode["time"+(!0===t.prop.props.range?"Range":"")+"Picker"](t.prop,e)},Se={name:"tree",modelField:"checkedKeys",mergeProp(e){const t=e.prop.props;t.fieldNames?t.fieldNames.key||(t.fieldNames.key="id"):t.fieldNames={key:"id"},t.checkedKeys=e.rule.value,t.checkable=!0}},xe={name:"FcRow",render:(e,t)=>t.vNode.col({props:{span:24}},{default:()=>[t.vNode.row(t.prop,e)]})};function ke(e,t){if(!e||!t)return;const r=t.split(".");let l=e;for(const e of r){if(null==l)return;l=l[e]}return l}var $e=[de,ge,{...ge,name:"rangePicker",maker:{},render:(e,t)=>t.$render.vNode.rangePicker(t.prop,e)},ve,be,we,Ce,{...Ce,name:"timeRangePicker",render:(e,t)=>t.$render.vNode.timeRangePicker(t.prop,e)},Se,ue,he,fe,xe,{name:"cusStoreSelect",modelField:"modelValue",toFormValue:(e,t)=>null==e||""===e?[]:Array.isArray(e)?e.map(e=>("object"!=typeof e||null===e||void 0===e.value&&e.label,e)):[e],toValue:(e,t)=>e,mergeProp(e){const t=e.prop.props;if(F(t,"options")||(t.options=e.prop.options||[]),F(t,"field")||(t.field=e.rule.field||""),void 0!==e.rule.value){const t=e.rule.value;null==t||""===t?e.rule.value=[]:Array.isArray(t)||(e.rule.value=[t])}},render(e,t){const r=t.$render.defaultRender(t,e);if(r&&r.props&&r.props.on){const e=r.props.on["update:modelValue"],l=()=>{$(()=>{$(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const r=t.$handle.getFieldCtx(t.rule.field);r&&r.id&&t.$handle.$manager.validateField(r.id).catch(()=>{})}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})};r.props.on["update:modelValue"]=(...t)=>{e&&e(...t),l()};const a=r.props.on.change;r.props.on.change=a?(...e)=>{a(...e),l()}:l}return r}},{name:"cusUserSelect",modelField:"modelValue",toFormValue:(e,t)=>null==e||""===e?[]:Array.isArray(e)?e.map(e=>("object"!=typeof e||null===e||void 0===e.value&&e.label,e)):[e],toValue:(e,t)=>e,mergeProp(e){const t=e.prop.props;if(F(t,"options")||(t.options=e.prop.options||[]),F(t,"field")||(t.field=e.rule.field||""),F(t,"formCreateInject")||(t.formCreateInject=e.inject),void 0!==e.rule.value){const t=e.rule.value;null==t||""===t?e.rule.value=[]:Array.isArray(t)||(e.rule.value=[t])}},render(e,t){const r=t.$render.defaultRender(t,e);if(r&&r.props&&r.props.on){const e=r.props.on["update:modelValue"],l=()=>{$(()=>{$(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const r=t.$handle.getFieldCtx(t.rule.field);r&&r.id&&t.$handle.$manager.validateField(r.id).catch(()=>{})}catch(e){console.warn("CusUserSelect: 触发校验失败",e)}})})};r.props.on["update:modelValue"]=(...t)=>{e&&e(...t),l()};const a=r.props.on.change;r.props.on.change=a?(...e)=>{a(...e),l()}:l}return r}},{name:"flex",mergeProp(e){var t,r,l;const a=e.rule.props||{},o=a.flexDirection||e.rule.flexDirection||"row",i=a.flexWrap||e.rule.flexWrap||"nowrap",n=a.justifyContent||e.rule.justifyContent||"flex-start",s=a.alignItems||e.rule.alignItems||"flex-start",p=a.alignContent||e.rule.alignContent||"flex-start",c="column"===o||"column-reverse"===o,d={"flex-start":"start","flex-end":"end",center:"center","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"}[n]||"start",u={"flex-start":"start","flex-end":"end",center:"center",baseline:"baseline",stretch:"stretch"}[s]||"start";e.prop.props||(e.prop.props={}),e.prop.props.vertical=c,e.prop.props.justify=d,e.prop.props.align=u,void 0!==a.gap&&(e.prop.props.gap=a.gap);const h=e.rule.style||{},{display:f,flexDirection:m,flexWrap:y,justifyContent:g,alignItems:v,alignContent:b,...w}=h,C={display:f||"flex",flexWrap:i,...w};p&&"flex-start"!==p&&(C.alignContent=p);const S=e.prop.style||{},x=(null===(t=e.prop.props)||void 0===t?void 0:t.style)||{};e.prop.style={...S,...C},e.prop.props||(e.prop.props={}),e.prop.props.style={...x,...C},e.rule.children||(e.rule.children=[]),e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.forEach(e=>{e&&"object"==typeof e&&"DragTool"===!e.type&&"DragBox"===!e.type&&(void 0===e.col||null===e.col?e.col=!1:e.col&&"object"==typeof e.col&&!1!==e.col.show&&(e.col.show=!1))});if(null!==(r=null!==(l=a.resetMarginBottom)&&void 0!==l?l:e.rule.resetMarginBottom)&&void 0!==r&&r){e.rule.wrap||(e.rule.wrap={}),"object"!=typeof e.rule.wrap||e.rule.wrap.class||(e.rule.wrap.class="");const t="object"==typeof e.rule.wrap?(e.rule.wrap.class||"").split(" ").filter(Boolean):[];t.includes("_fc-reset-margin-bottom")||(t.push("_fc-reset-margin-bottom"),"object"==typeof e.rule.wrap&&(e.rule.wrap.class=t.join(" ")))}},render(e,t){var r,l;const a={...t.prop};"flex"===a.type&&(a.type="a-flex");const o=(t.rule.props||{}).flexDirection||t.rule.flexDirection||"row",i="column"===o||"column-reverse"===o;a.props||(a.props={});const n=()=>{a.class||(a.class=[]),Array.isArray(a.class)||(a.class=[a.class])},s=null!==(r=null===(l=t.rule.props)||void 0===l?void 0:l.childFlex)&&void 0!==r?r:t.rule.childFlex;if(null!=s&&""!==s){n(),a.class.includes("_fc-flex-container")||a.class.push("_fc-flex-container");const e=String(s).trim();a.props.style||(a.props.style={}),a.props.style["--fc-child-flex"]=e,a.style||(a.style={}),a.style["--fc-child-flex"]=e}if(i){var p,c,d;const e=null!==(p=null!==(c=null===(d=t.rule.props)||void 0===d?void 0:d.childWidth)&&void 0!==c?c:t.rule.childWidth)&&void 0!==p?p:"100%";n(),a.class.includes("_fc-flex-container")||a.class.push("_fc-flex-container"),a.class.includes("_fc-flex-vertical")||a.class.push("_fc-flex-vertical");const r=String(e).trim();a.props.style||(a.props.style={}),a.props.style["--fc-child-width"]=r,a.style||(a.style={}),a.style["--fc-child-width"]=r}const u=e||[];return t.vNode.col({props:{span:24}},{default:()=>[t.vNode.make("a-flex",a,u)]})}},{name:"space",mergeProp(e){var t,r;const l=e.rule.props||{},a=l.direction||e.rule.direction||"horizontal",o=l.size||e.rule.size||"small",i=l.align||e.rule.align,n=l.wrap||e.rule.wrap||!1;e.prop.props||(e.prop.props={}),e.prop.props.direction=a,e.prop.props.size=o,null!=i&&""!==i&&(e.prop.props.align=i),e.prop.props.wrap=n;const s={width:"100%",...e.rule.style||{}};e.prop.style||(e.prop.style={}),e.prop.style={...e.prop.style,...s},e.prop.props.style||(e.prop.props.style={}),e.prop.props.style={...e.prop.props.style,...s},e.rule.children||(e.rule.children=[]),e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.forEach(e=>{e&&"object"==typeof e&&"DragTool"!==e.type&&"DragBox"!==e.type&&(void 0===e.col||null===e.col?e.col=!1:e.col&&"object"==typeof e.col&&!1!==e.col.show&&(e.col.show=!1))});if(null!==(t=null!==(r=l.resetMarginBottom)&&void 0!==r?r:e.rule.resetMarginBottom)&&void 0!==t&&t){e.rule.wrap||(e.rule.wrap={}),"object"!=typeof e.rule.wrap||e.rule.wrap.class||(e.rule.wrap.class="");const t="object"==typeof e.rule.wrap?(e.rule.wrap.class||"").split(" ").filter(Boolean):[];t.includes("_fc-reset-margin-bottom")||(t.push("_fc-reset-margin-bottom"),"object"==typeof e.rule.wrap&&(e.rule.wrap.class=t.join(" ")))}},render(e,t){const r={...t.prop};(t.rule.props||{}).compact||t.rule.compact||!1?r.type="a-space-compact":"space"===r.type&&(r.type="a-space");const l=e||[];return t.vNode.col({props:{span:24}},{default:()=>[t.vNode.make(r.type,r,l)]})}},{name:"spin",mergeProp(e){var t,r,l,a,o,i,n,s,p;e.rule.wrap||(e.rule.wrap={}),e.rule.wrap.title=!1;const c=e.prop.props||{},d=null===(t=null!==(r=null!==(l=e.rule.containerMode)&&void 0!==l?l:null===(a=e.rule.props)||void 0===a?void 0:a.containerMode)&&void 0!==r?r:null===(o=e.prop.props)||void 0===o?void 0:o.containerMode)||void 0===t||t;var u,h,f,m;(d||(e.rule.children=[]),F(c,"spinning"))||(c.spinning=null!==(u=null!==(h=null===(f=e.prop.props)||void 0===f?void 0:f.spinning)&&void 0!==h?h:null===(m=e.rule.props)||void 0===m?void 0:m.spinning)&&void 0!==u&&u);const y=e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.length>0;!d&&!y&&c.spinning;const g=e.rule.bindField||(null===(i=e.rule.props)||void 0===i?void 0:i.bindField)||(null===(n=e.prop.props)||void 0===n?void 0:n.bindField);let v=e.rule.bindMode||(null===(s=e.rule.props)||void 0===s?void 0:s.bindMode)||(null===(p=e.prop.props)||void 0===p?void 0:p.bindMode);if(v||(v=g?"field":"static"),"field"===v&&g){const t={attr:g,to:"props.spinning",modify:!0,wait:300,watch:!0};e.rule.effect||(e.rule.effect={}),e.rule.effect.loadData||(e.rule.effect.loadData=[]);e.rule.effect.loadData.some(e=>e.attr===g&&"props.spinning"===e.to)||(e.rule.effect.loadData.push(t),e.$handle&&e.$handle.effect&&e.$handle.effect(e,"loaded"))}d&&(e.rule.children||(e.rule.children=[]),e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.forEach(e=>{e&&"object"==typeof e&&"DragTool"!==e.type&&"DragBox"!==e.type&&(void 0===e.col||null===e.col?e.col=!1:e.col&&"object"==typeof e.col&&!1!==e.col.show&&(e.col.show=!1))}))},render(e,t){var r,l,a,o,i,n,s,p,c,d,u;const h=(t.prop.props||{}).spinning||!1;t.prop.props||(t.prop.props={}),t.prop.props.spinning=h;const f=t.rule.tip||(null===(r=t.rule.props)||void 0===r?void 0:r.tip)||(null===(l=t.prop.props)||void 0===l?void 0:l.tip);f&&(t.prop.props.tip=f);const m=t.rule.delay||(null===(a=t.rule.props)||void 0===a?void 0:a.delay)||(null===(o=t.prop.props)||void 0===o?void 0:o.delay);null!=m&&(t.prop.props.delay=m);const y=t.rule.size||(null===(i=t.rule.props)||void 0===i?void 0:i.size)||(null===(n=t.prop.props)||void 0===n?void 0:n.size);y&&(t.prop.props.size=y),"spin"===t.prop.type&&(t.prop.type="a-spin");if(!(null===(s=null!==(p=null!==(c=t.rule.containerMode)&&void 0!==c?c:null===(d=t.rule.props)||void 0===d?void 0:d.containerMode)&&void 0!==p?p:null===(u=t.prop.props)||void 0===u?void 0:u.containerMode)||void 0===s||s))return t.$render.defaultRender(t,void 0);const g=e&&Array.isArray(e)?e:e||[];return t.vNode.col({props:{span:24}},{default:()=>[t.vNode.make("a-spin",t.prop,g)]})}},{name:"div",mergeProp(e){e.rule.children||(e.rule.children=[]),e.rule.children&&Array.isArray(e.rule.children)&&e.rule.children.forEach(e=>{e&&"object"==typeof e&&"DragTool"!==e.type&&"DragBox"!==e.type&&(void 0===e.col||null===e.col?e.col=!1:e.col&&"object"==typeof e.col&&!1!==e.col.show&&(e.col.show=!1))})},render(e,t){const r={...t.prop};"div"===r.type&&(r.type="div");const l=e||[];return r.props||(r.props={}),r.props.style||(r.props.style={}),t.vNode.make("div",r,l)}},{name:"accTable",mergeProp(e){var t,r;const l=e.prop.props||{},a=e.rule;if(e.api,!F(l,"columns")){var o;let e=(null===(o=a.props)||void 0===o?void 0:o.columns)||[];if("string"==typeof e)try{const t=JSON.parse(e);Array.isArray(t)&&(e=t)}catch(t){console.warn("accTable columns parse error:",t),e=[]}Array.isArray(e)||(e=[]),e=e.filter(e=>!e.hidden),l.columns=e}if(!F(l,"dataSource")){var i,n;let e=a.value||(null===(i=a.props)||void 0===i?void 0:i.dataSource)||[];if("string"==typeof e&&(null===(n=a.effect)||void 0===n||!n.fetch))try{const t=JSON.parse(e);Array.isArray(t)&&(e=t)}catch(t){console.warn("accTable dataSource parse error:",t),e=[]}Array.isArray(e)||(e=[]),l.dataSource=e}const s=e.effectData("fetch"),p=s&&!0===s.loading;var c;F(l,"loading")?l.loading=void 0!==(null===(c=a.props)||void 0===c?void 0:c.loading)?a.props.loading:p:l.loading=p;if(!F(l,"pagination")){var d;const t=null===(d=a.props)||void 0===d?void 0:d.pagination;if(!1===t)l.pagination=!1;else if(t&&"object"==typeof t){var u;const r={current:t.current||1,pageSize:t.pageSize||10,total:t.total||0,showSizeChanger:!1!==t.showSizeChanger,showQuickJumper:t.showQuickJumper||!1,showTotal:t.showTotal,...t};if(null!==(u=a.effect)&&void 0!==u&&u.fetch&&void 0!==t.current){var h,f,m,y,g;const t=(null===(h=a.props)||void 0===h?void 0:h.paginationPageParam)||"page",l=(null===(f=a.props)||void 0===f?void 0:f.paginationPageSizeParam)||"pageSize",o=(null===(m=a.props)||void 0===m?void 0:m.paginationParamType)||"query";null===(y=a.props)||void 0===y||y.paginationResponseDataPath,null===(g=a.props)||void 0===g||g.paginationResponseTotalPath,r.onChange=(r,i)=>{var n,s;if(null!==(n=a.props)&&void 0!==n&&n.pagination&&(a.props.pagination.current=r,a.props.pagination.pageSize=i),null!==(s=a.effect)&&void 0!==s&&s.fetch){const n=a.effect.fetch;"object"==typeof n&&("query"===o?(n.query||(n.query={}),n.query[t]=r,n.query[l]=i):(n.data||(n.data={}),n.data[t]=r,n.data[l]=i),e.api.sync(a),setTimeout(()=>{e.api.refresh()},0))}},r.onShowSizeChange=(r,i)=>{var n,s;if(null!==(n=a.props)&&void 0!==n&&n.pagination&&(a.props.pagination.current=1,a.props.pagination.pageSize=i),null!==(s=a.effect)&&void 0!==s&&s.fetch){const r=a.effect.fetch;"object"==typeof r&&("query"===o?(r.query||(r.query={}),r.query[t]=1,r.query[l]=i):(r.data||(r.data={}),r.data[t]=1,r.data[l]=i),e.api.sync(a),setTimeout(()=>{e.api.refresh()},0))}}}l.pagination=r}else l.pagination=!1}if(null!==(t=a.effect)&&void 0!==t&&t.fetch&&null!==(r=a.props)&&void 0!==r&&r.pagination){const t=e.effectData("fetch");if(t&&t.value){var v,b;const e=(null===(v=a.props)||void 0===v?void 0:v.paginationResponseDataPath)||"data",r=(null===(b=a.props)||void 0===b?void 0:b.paginationResponseTotalPath)||"total";try{const o=ke(t.value,e);Array.isArray(o)&&(l.dataSource=o,a.value=o,a.props.dataSource=o);const i=ke(t.value,r);"number"==typeof i&&a.props.pagination&&"object"==typeof a.props.pagination&&(a.props.pagination.total=i,l.pagination&&"object"==typeof l.pagination&&(l.pagination.total=i))}catch(e){console.warn("accTable parse response error:",e)}}}F(a.props,"bordered")&&(l.bordered=a.props.bordered),F(a.props,"size")&&(l.size=a.props.size),F(a.props,"scroll")&&(l.scroll=a.props.scroll),F(a.props,"rowKey")&&(l.rowKey=a.props.rowKey||"id"),F(a.props,"rowSelection")&&(l.rowSelection=a.props.rowSelection),F(a.props,"sticky")&&(l.sticky=a.props.sticky),F(a.props,"virtual")&&(l.virtual=a.props.virtual)},render:(e,t)=>t.$render.defaultRender(t,e)}];var Ae={tooltip:"aTooltip",popover:"aPopover",button:"aButton",icon:"aIcon",slider:"aSlider",rate:"aRate",upload:"fcUpload",cascader:"aCascader",timePicker:"aTimePicker",timeRangePicker:"aTimeRangePicker",datePicker:"aDatePicker",rangePicker:"aRangePicker",switch:"aSwitch",select:"aSelect",checkbox:"aCheckboxGroup",radio:"aRadioGroup",input:"aInput",inputNumber:"aInputNumber",treeSelect:"aTreeSelect",search:"aInputSearch",inputPassword:"aInputPassword",textarea:"aTextarea",formItem:"aFormItem",form:"aForm",frame:"fcFrame",col:"aCol",row:"aRow",flex:"aFlex",space:"aSpace","space-compact":"aSpaceCompact",spin:"aSpin",tree:"aTree",autoComplete:"aAutoComplete",transfer:"aTransfer",group:"fcGroup",array:"fcGroup",subForm:"fcSubForm",object:"fcSubForm",image:"aImage",aImage:"aImage",accTable:"aTable",accTableTable:"aTable"};function Fe(e,t){F(e,t)&&A.String(e[t])&&(e[t]={[t]:e[t],show:!0})}function Ve(e){return!1===e}function Ie(e){const t={...e};return delete t.children,t}var je={validate(){const e=this.form();return e?e.validate():new Promise(e=>e())},validateField(e){const t=this.form();return t?t.validateFields(e):new Promise(e=>e())},clearValidateState(e){const t=this.vm.refs[e.wrapRef];t&&t.clearValidate()},tidyOptions:e=>(["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(t=>{!function(e,t){F(e,t)&&!A.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)}),e),tidyRule:({prop:e})=>(Fe(e,"title"),Fe(e,"info"),e),mergeProp(e){const t={info:{type:"popover",placement:"topLeft",icon:"QuestionCircleOutlined"},title:{},col:{span:24},wrap:{}};if(["info","wrap","col","title"].forEach(r=>{e.prop[r]=T([this.options[r]||{},e.prop[r]||{}],t[r])}),e.parent&&e.parent.rule){const t=e.parent.rule.type,r=e.parent.rule._menu;"flex"!==t&&"a-flex"!==t&&"flex"!==(null==r?void 0:r.name)&&"space"!==t&&"a-space"!==t&&"space"!==(null==r?void 0:r.name)||(e.prop.col=!1,e.rule&&(e.rule.col=!1))}if("upload"!==e.rule.type||e.prop.props.onPreview){if("upload"===e.rule.type&&e.prop.props.onPreview){const t=e.prop.props.onPreview,r=function(e){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:e.url,name:e.name,uid:e.uid,size:e.size,type:e.type},timestamp:Date.now()},"*")};e.prop.props.onPreview=function(e){r(e),t&&"function"==typeof t&&t.apply(this,arguments)}}}else{const t=function(e){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:e.url,name:e.name,uid:e.uid,size:e.size,type:e.type},timestamp:Date.now()},"*")};e.prop.props.onPreview=function(e){t(e)}}if("image"!==e.rule.type&&"aImage"!==e.rule.type||e.prop.props.preview){if(("image"===e.rule.type||"aImage"===e.rule.type)&&e.prop.props.preview){const t=e.prop.props.preview,r=function(t){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:t||e.prop.props.src||""},timestamp:Date.now()},"*")},l=e.prop.props.src||"",a=null==t?void 0:t.onVisibleChange;e.prop.props.preview={...t,visible:t.visible||!1,src:t.src||l,onVisibleChange:(e,o)=>(e&&!o&&r(t.src||l),!(!a||"function"!=typeof a)&&a.apply(this,arguments))}}}else{const t=function(t){window.parent&&window.parent!==window&&window.parent.postMessage({type:"upload-preview",file:{url:t||e.prop.props.src||""},timestamp:Date.now()},"*")},r=e.prop.props.src||"";e.prop.props.preview={visible:!1,src:r,onVisibleChange:(e,l)=>{if(e&&!l)return t(r),!1}}}},getDefaultOptions:()=>({form:{hideRequiredMark:!1,layout:"horizontal",labelAlign:"right",labelCol:{span:3},wrapperCol:{span:21},validateOnRuleChange:!0},row:{gutter:0},submitBtn:{disabled:!1,loading:!1,type:"primary",innerText:"",show:!1,col:void 0,click:void 0},resetBtn:{disabled:!1,loading:!1,type:"default",innerText:"",show:!1,col:void 0,click:void 0}}),adapterValidate:(e,t)=>(e.validator=(e,r)=>new Promise((e,l)=>t(r,t=>{t?l(t):e()})),e),update(){const e=this.options.form;this.rule={props:{...e},on:{submit:e=>{e.preventDefault()}},style:e.style,type:"form"}},beforeRender(){const{key:e,ref:t,$handle:r}=this,l=this.options.form;O(this.rule,{key:e,ref:t,class:[l.className,l.class,"form-create",this.$handle.preview?"is-preview":""]}),O(this.rule.props,{model:r.formData})},render(e){return e.slotLen()&&!this.$handle.preview&&e.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,Ve(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap(e,t){const r=e.prop,l=`${this.key}${e.key}`,a=r.col,o=this.isTitle(r)&&!1!==r.wrap.title,{layout:i,col:n}=this.rule.props,s=r.wrap.class;delete r.wrap.class,delete r.wrap.title;let p=!1;if(e.parent&&e.parent.rule){const t=e.parent.rule.type,r=e.parent.rule._menu;"flex"!==t&&"a-flex"!==t&&"flex"!==(null==r?void 0:r.name)&&"space"!==t&&"a-space"!==t&&"space"!==(null==r?void 0:r.name)||(p=!0)}const c=Ve(r.wrap.show)?t:this.$r(T([r.wrap,{props:{...Ie(r.wrap||{}),hasFeedback:r.hasFeedback||!1,name:e.id,rules:e.injectValidate(),..."horizontal"!==i?{labelCol:{},wrapperCol:{}}:{}},class:this.$render.mergeClass(s||r.className,"fc-form-item"),key:l+"fi",ref:e.wrapRef,type:"formItem"}]),{default:()=>t,...o?{label:()=>this.makeInfo(r,l,e)}:{}});return"inline"===i||Ve(n)||Ve(a.show)||p?c:this.makeCol(r,l,[c])},isTitle(e){if(!1===this.options.form.title)return!1;const t=e.title;return!(!t.title&&!t.native||Ve(t.show))},makeInfo(e,t,r){var l,a;const o={...e.title},i={...e.info};if(!1===this.options.form.title)return!1;if(!o.title&&!o.native||Ve(o.show))return;const n="tooltip"===i.type;const s=this.getSlot("title"),p=[s?s({title:null===(l=r.refRule)||void 0===l||null===(l=l.__$title)||void 0===l?void 0:l.value,rule:r.rule,options:this.options}):null===(a=r.refRule)||void 0===a||null===(a=a.__$title)||void 0===a?void 0:a.value];if(!Ve(i.show)&&(i.info||i.native)&&!Ve(i.icon)){const e={type:i.type||"popover",props:Ie(i),key:t+"pop"};delete e.props.icon,delete e.props.show,delete e.props.info,delete e.props.align,delete e.props.native;const l=n?"title":"content";var c;if(i.info&&!F(e.props,l))e.props[l]=null===(c=r.refRule)||void 0===c||null===(c=c.__$info)||void 0===c?void 0:c.value;p["left"!==i.align?"unshift":"push"](this.$r(T([i,e]),{[o.slot||"default"]:()=>this.$r({type:!0===i.icon?"QuestionCircleOutlined":i.icon||"",props:{type:!0===i.icon?"QuestionCircleOutlined":i.icon},key:t+"i"})}))}const d=T([o,{props:Ie(o),key:t+"tit",class:"fc-form-title",type:o.type||"span"}]);return delete d.props.show,delete d.props.title,delete d.props.native,this.$r(d,p)},makeCol(e,t,r){const l=e.col;return this.$r({class:this.$render.mergeClass(l.class,"fc-form-col"),type:"col",props:l||{span:24},key:t+"col"},r)},makeRow(e){const t=this.options.row||{};return this.$r({type:"row",props:t,class:this.$render.mergeClass(t.class,"fc-form-row"),key:this.key+"row"},e)},makeFormBtn(){let e=[];if(Ve(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),Ve(this.options.resetBtn.show)||e.push(this.makeResetBtn()),!e.length)return;let{labelCol:t,wrapperCol:r,layout:l}=this.rule.props;"horizontal"!==l&&(t=r={});const a=this.$r({type:"formItem",class:"fc-form-item fc-form-footer",key:this.key+"fb",props:{labelCol:t,wrapperCol:r,label:" ",colon:!1}},e);return"inline"===l?a:this.$r({type:"col",class:"fc-form-col",props:{span:24},key:this.key+"fc"},[a])},makeResetBtn(){const e={...this.options.resetBtn},t=e.innerText||this.$handle.api.t("reset")||"重置";return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"fc-reset-btn",style:{width:e.width,marginLeft:"10px"},on:{click:()=>{const e=this.$handle.api;this.options.resetBtn.click?this.options.resetBtn.click(e):e.resetFields()}},key:this.key+"b2"},[t])},makeSubmitBtn(){const e={...this.options.submitBtn},t=e.innerText||this.$handle.api.t("submit")||"提交";return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"fc-submit-btn",style:{width:e.width},on:{click:()=>{const e=this.$handle.api;this.options.submitBtn.click?this.options.submitBtn.click(e):e.submit().catch(()=>{})}},key:this.key+"b1"},[t])}};const Pe={};var Te;!function(e){["treeSelect","upload","frame","autoComplete","cascader","datePicker","frame","inputNumber","inputPassword","radio","rate","switch","rate","slider","timePicker"].reduce((e,t)=>(e[t]=P(t),e),e),e.auto=e.autoComplete,e.number=e.inputNumber,e.time=e.timePicker,e.password=e.inputPassword}(Pe),function(e){e.sliderRange=P("slider",{range:!0})}(Pe),function(e){const t={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(t).reduce((e,r)=>(e[r]=P("frame",e=>e.props({type:t[r][0],maxLength:t[r][1]})),e),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(Pe),function(e){const t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((e,r)=>(e[r]=P("upload",e=>e.props({uploadType:t[r][0],maxLength:t[r][1]})),e),e),e.uploadImage=e.image,e.uploadFile=e.file}(Pe),(Te=Pe).selectMultiple=P("select",{mode:"multiple"}),Te.selectTags=P("select",{mode:"tags"}),Te.selectCombobox=P("select",{mode:"combobox"}),function(e){e.cusStoreSelect=P("cusStoreSelect"),e.storeSelect=e.cusStoreSelect}(Pe),function(e){e.cusUserSelect=P("cusUserSelect"),e.userSelect=e.cusUserSelect}(Pe),function(e){e.text=P("text")}(Pe),function(e){e.flex=P("flex")}(Pe),function(e){e.space=P("space")}(Pe),function(e){e.spin=P("spin")}(Pe);const Oe=new class{mobile(e,t=!1){if(!e)return!1;const r=String(e).trim();return t?/^1[3-9]\d{9}$/.test(r):/^1\d{10,11}$/.test(r)}email(e){if(!e)return!1;const t=String(e).trim();return/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t)}idCard(e,t=!0){if(!e)return!1;const r=String(e).trim().toUpperCase();if(!/^\d{17}[\dX]$/.test(r))return!1;if(!t)return!0;const l=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let a=0;for(let e=0;e<17;e++)a+=parseInt(r[e])*l[e];const o=a%11;return r[17]===["1","0","X","9","8","7","6","5","4","3","2"][o]}url(e,t={}){if(!e)return!1;const r=String(e).trim(),{requireProtocol:l=!1}=t;return l?/^https?:\/\/.+\..+/.test(r):/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/.test(r)}ip(e){if(!e)return!1;const t=String(e).trim().split(".");return 4===t.length&&t.every(e=>{const t=parseInt(e,10);return t>=0&&t<=255&&String(t)===e})}number(e,t={}){if(null==e||""===e)return!1;const r=Number(e);if(isNaN(r))return!1;const{integer:l=!1,positive:a=!1,negative:o=!1,min:i,max:n}=t;return!(l&&!Number.isInteger(r))&&(!(a&&r<=0)&&(!(o&&r>=0)&&(!(void 0!==i&&r<i)&&!(void 0!==n&&r>n))))}length(e,t={}){if(null==e)return!1;const r=String(e),{min:l,max:a,len:o}=t;return void 0!==o?r.length===o:!(void 0!==l&&r.length<l)&&!(void 0!==a&&r.length>a)}pattern(e,t){if(!e||!t)return!1;const r=String(e);let l;if(t instanceof RegExp)l=t;else try{l=new RegExp(t)}catch(e){return!1}return l.test(r)}date(e,t={}){if(!e)return!1;let r;if(e instanceof Date)r=e;else if(r=new Date(e),isNaN(r.getTime()))return!1;const{min:l,max:a}=t;if(l){if(r<(l instanceof Date?l:new Date(l)))return!1}if(a){if(r>(a instanceof Date?a:new Date(a)))return!1}return!0}empty(e,t=!0){return null==e||("string"==typeof e?t?""===e.trim():""===e:Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)}notEmpty(e,t=!0){return!this.empty(e,t)}chinese(e){return!!e&&/^[\u4e00-\u9fa5]+$/.test(String(e))}alpha(e,t=!1){if(!e)return!1;const r=String(e);return t?/^[a-zA-Z]+$/.test(r):/^[a-z]+$/i.test(r)}alphanumeric(e){return!!e&&/^[a-zA-Z0-9]+$/.test(String(e))}integer(e){return this.number(e,{integer:!0})}positive(e){return this.number(e,{positive:!0})}negative(e){return this.number(e,{negative:!0})}bankCard(e){if(!e)return!1;const t=String(e).replace(/\s/g,"");return/^\d{16,19}$/.test(t)}postcode(e){return!!e&&/^\d{6}$/.test(String(e).trim())}licensePlate(e){if(!e)return!1;const t=String(e).trim().toUpperCase();return/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-Z0-9]{4,5}[A-Z0-9挂学警港澳]$/.test(t)||/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z]((\d{5}[DF])|([DF][A-Z0-9]\d{4}))$/.test(t)}creditCode(e){if(!e)return!1;const t=String(e).trim().toUpperCase();return/^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/.test(t)}enum(e,t){return!(!Array.isArray(t)||0===t.length)&&t.includes(e)}equal(e,t,r=!1){return r?e===t:e==t}notEqual(e,t,r=!0){return!this.equal(e,t,r)}uppercase(e){if(!e)return!1;const t=String(e);return t===t.toUpperCase()&&/[A-Z]/.test(t)}lowercase(e){if(!e)return!1;const t=String(e);return t===t.toLowerCase()&&/[a-z]/.test(t)}username(e,t={}){if(!e)return!1;const r=String(e).trim(),{min:l=3,max:a=20}=t;return!(r.length<l||r.length>a)&&/^[a-zA-Z0-9_]+$/.test(r)}password(e,t={}){if(!e)return!1;const r=String(e),{min:l=6,max:a=20,requireNumber:o=!1,requireLetter:i=!1,requireSpecial:n=!1}=t;return!(r.length<l||r.length>a)&&(!(o&&!/\d/.test(r))&&(!(i&&!/[a-zA-Z]/.test(r))&&!(n&&!/[!@#$%^&*(),.?":{}|<>]/.test(r))))}hexColor(e){return!!e&&/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(String(e).trim())}qq(e){return!!e&&/^[1-9]\d{4,10}$/.test(String(e).trim())}wechat(e){return!!e&&/^[a-zA-Z0-9_-]{6,20}$/.test(String(e).trim())}tel(e){if(!e)return!1;const t=String(e).trim();return/^(0\d{2,3}-?)?\d{7,8}$/.test(t)}mac(e){if(!e)return!1;const t=String(e).trim().toUpperCase();return/^([0-9A-F]{2}:){5}[0-9A-F]{2}$/.test(t)}base64(e){if(!e)return!1;const t=String(e).trim();if(t.length%4!=0)return!1;try{return btoa(atob(t))===t}catch(e){return!1}}json(e){if(!e)return!1;try{return JSON.parse(String(e)),!0}catch(e){return!1}}numeric(e){return null!=e&&/^\d+$/.test(String(e))}path(e){return!!e&&/^\/[^\s]*$/.test(String(e).trim())}port(e){return this.number(e,{integer:!0,min:1,max:65535})}};let Ee=null;try{var De,Be,Re;if(null!==(De=parent)&&void 0!==De&&null!==(De=De.window)&&void 0!==De&&De.location)Ee="https://zxgj.zhixianai.com"==(null===(Be=parent)||void 0===Be||null===(Be=Be.window)||void 0===Be?void 0:Be.location.origin)||"http://zxgj.zhixianai.com"==(null===(Re=parent)||void 0===Re||null===(Re=Re.window)||void 0===Re?void 0:Re.location.origin)}catch(e){Ee=null}const ze=null!==Ee&&Ee?"https://merchant-api.zhixianai.com/api":!1===Ee?"https://sandbox-merchant-api.zhixianai.com/api":"";function Ke(e,t){return A.Boolean(e)?e={show:e}:A.Undef(e)||A.Object(e)||(e={show:t}),e}function Me(e,t){return{formEl:()=>t.$manager.form(),wrapEl(e){const r=t.getFieldCtx(e);if(r)return t.vm.refs[r.wrapRef]},validate:r=>new Promise((l,a)=>{const o=e.children,i=[t.$manager.validate()];o.filter(e=>!e.isScope).forEach(e=>{i.push(e.validate())}),Promise.all(i).then(()=>{l(!0),r&&r(!0)}).catch(l=>{a(l),r&&r(l),t.vm.emit("validate-fail",l,{api:e}),t.emitEvent("validate-fail",l,{api:e})})}),validateField:(r,l)=>new Promise((a,o)=>{const i=t.getFieldCtx(r);if(!i)return;const n=t.subForm[i.id],s=[t.$manager.validateField(i.id)];D(n).filter(e=>!e.isScope).forEach(e=>{s.push(e.validate())}),Promise.all(s).then(()=>{a(null),l&&l(null)}).catch(a=>{o(a),l&&l(a),t.vm.emit("validate-field-fail",a,{field:r,api:e})})}),clearValidateState(r,l=!0){e.helper.tidyFields(r).forEach(e=>{l&&this.clearSubValidateState(e),t.getCtxs(e).forEach(e=>{t.$manager.clearValidateState(e)})})},clearSubValidateState(r){e.helper.tidyFields(r).forEach(e=>{t.getCtxs(e).forEach(e=>{const r=t.subForm[e.id];r&&(Array.isArray(r)?r.forEach(e=>{e.clearValidateState()}):r&&r.clearValidateState())})})},btn:{loading:(t=!0)=>{e.submitBtnProps({loading:!!t})},disabled:(t=!0)=>{e.submitBtnProps({disabled:!!t})},show:(t=!0)=>{e.submitBtnProps({show:!!t})}},resetBtn:{loading:(t=!0)=>{e.resetBtnProps({loading:!!t})},disabled:(t=!0)=>{e.resetBtnProps({disabled:!!t})},show:(t=!0)=>{e.resetBtnProps({show:!!t})}},submitBtnProps:(r={})=>{let l=Ke(t.options.submitBtn,!0);O(l,r),t.options.submitBtn=l,e.refreshOptions()},resetBtnProps:(r={})=>{let l=Ke(t.options.resetBtn,!1);O(l,r),t.options.resetBtn=l,e.refreshOptions()},submit:(r,l)=>new Promise((a,o)=>{(!1===t.options.validateOnSubmit?Promise.resolve():e.validate()).then(()=>{let l=e.formData();t.beforeSubmit(l).then(()=>{A.Function(r)&&E(()=>r(l,e)),A.Function(t.options.onSubmit)&&E(()=>t.options.onSubmit(l,e)),t.vm.emit("submit",l,e),a(l)}).catch(e=>{})}).catch((...t)=>{A.Function(l)&&E(()=>l(e,...t)),o(...t)})}),request:t=>("string"==typeof t&&(t={action:t}),e.fetch(t)),getStoreInfo(t){if(!t)return Promise.resolve(null);let r={action:ze+"/storeInfo/page",method:"post",dataType:"json",data:{current:1,size:1,params:{storeId:t||""}}};return new Promise((t,l)=>{e.fetch(r).then(e=>{var r;0===(null==e?void 0:e.code)?t((null==e||null===(r=e.data)||void 0===r||null===(r=r.records)||void 0===r?void 0:r[0])||null):t(null)}).catch(e=>{l(e)})})},throttle(e,t){let r=0;return function(...l){const a=this,o=Date.now();o-r>=(t||0)&&(r=o,e.call(a,...l))}},debounce(e,t){let r=null;return function(...l){const a=this;null!==r&&clearTimeout(r),r=setTimeout(()=>{e.call(a,...l)},t||0)}},$validator:Oe,$moment:B}}var Ne={autoComplete:"value",cascader:"value",inputNumber:"value",inputPassword:"value",textarea:"value",rate:"value",slider:"value",treeSelect:"value",switch:"checked",cusStoreSelect:"modelValue",cusUserSelect:"modelValue"};const _e={name:"required",load(e,t,r){const l=function(e){return A.Boolean(e)?{required:e}:A.String(e)?{message:e}:A.Undef(e)?{required:!1}:A.Function(e)?{validator:e}:A.Object(e)?e:{}}(e.getValue());if(!1===l.required)e.clearProp(),r.clearValidateState([t.field]);else{var a;const o={required:!0,validator:(e,t)=>new Promise((e,r)=>{A.empty(t)?r(o.message):e()}),...l},i=null===(a=t.__fc__.refRule)||void 0===a||null===(a=a.__$title)||void 0===a?void 0:a.value;if(o.message){const e=o.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);e&&(o.message=r.t(e[1],{title:i}))}else o.message=r.t("required",{title:i})||i+("en"===r.getLocale()?" is required":"不能为空");e.getProp().validate=[o]}r.sync(t)},watch(...e){_e.load(...e)}};function Le(e){e.componentAlias(Ae),Object.keys(Ne).forEach(t=>{e.setModelField(t,Ne[t])}),ce.forEach(t=>{e.component(t.name,t)}),e.register(_e),$e.forEach(t=>{e.parser(t)}),Object.keys(Pe).forEach(t=>{e.maker[t]=Pe[t]}),"undefined"!=typeof window&&window.antd&&e.useApp((e,t)=>{t.use(window.antd)})}const Ue=j({ui:'"ant-design-vue"',version:'"3.2.84"',manager:je,install:Le,extendApi:Me,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});"undefined"!=typeof window&&(window.formCreate=Ue);const qe=Ue.maker;export{Ue as default,qe as maker};
|
|
8
8
|
//# sourceMappingURL=form-create.esm.js.map
|