@longhongguo/form-create-ant-design-vue 3.4.56 → 3.4.58
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.4.
|
|
2
|
+
* @longhongguo/form-create-ant-design-vue v3.4.58
|
|
3
3
|
* (c) 2018-2026 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 o from"@form-create/component-antdv-group/src/index";import r from"@form-create/component-subform/src/index";import{openBlock as l,createElementBlock as n,createElementVNode as a,defineComponent as i,Fragment as s,createCommentVNode as c,normalizeClass as p,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,mergeProps as x,toRef as $,watch as k,nextTick as A}from"vue";import j,{hasProperty as P}from"@form-create/utils/lib/type";import{message as T}from"ant-design-vue";import{parseFn as R}from"@form-create/utils/lib/json";import F from"@form-create/utils/lib/deepset";import I,{creatorFactory as V}from"@longhongguo/form-create-core/src/index";import D from"dayjs";import O from"@form-create/utils/lib/mergeprops";import E from"@form-create/utils/lib/extend";import"@longhongguo/component-antdv-upload/dist/index.css";import{invoke as _}from"@longhongguo/form-create-core/src/frame/util";import B from"@form-create/utils/lib/toarray";import z from"moment";var N={name:"QuestionCircleOutlined"};const M={class:"anticon"};N.render=function(e,t,o,r,i,s){return l(),n("span",M,[...t[0]||(t[0]=[a("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a("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"}),a("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=i({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 o="object"==typeof t?t[this.valueKey]:t;return o===e||String(o)===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 o=this.currentValue;if(Array.isArray(o)){const t=o.filter(t=>{if("object"==typeof t&&null!==t){return(t[this.valueKey]||t.value)!==e}return t!==e}),r=this.sourceItems.filter(e=>!t.some(t=>t[this.valueKey]===e[this.valueKey]));this.$emit("update:sourceItems",r),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 L=["tabindex"],q=["title"],U={key:1,class:"fc-cus-select-selection-placeholder"},H={key:3,class:"fc-cus-select-arrow"},G=["tabindex"],W={class:"fc-cus-select-selection-overflow"},Y=["title"],J={class:"fc-cus-select-selection-item-content"},Q=["onClick"],Z={key:0,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},X={class:"fc-cus-select-selection-item"},ee={class:"fc-cus-select-selection-item-content"},te={key:1,class:"fc-cus-select-selection-placeholder"},oe={key:1,class:"fc-cus-select-arrow"};K.render=function(e,t,o,r,i,f){return l(),n(s,null,[c(" 单个展示模式 "),e.multiple?(l(),n(s,{key:1},[c(" 多个展示模式 "),a("div",{class:p(["fc-cus-select fc-cus-select-multiple",{"fc-cus-select-disabled":e.disabled}]),style:d(e.style),tabindex:e.disabled?-1:0},[a("div",{class:p(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[a("div",W,[c(" 显示的 tags "),(l(!0),n(s,null,h(e.displayItems,(o,r)=>(l(),n("div",{key:r,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},[a("span",{class:"fc-cus-select-selection-item",title:o.label},[a("span",J,u(o.label),1),a("span",{class:"fc-cus-select-selection-item-remove",onClick:t=>e.removeItem(o.value,t)},[...t[4]||(t[4]=[a("span",{role:"img","aria-label":"close",class:"anticon anticon-close"},[a("svg",{focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[a("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,Q)],8,Y)]))),128)),c(" 折叠提示 "),e.remainingCount>0?(l(),n("div",Z,[a("span",X,[a("span",ee," +"+u(e.remainingCount),1)])])):c("v-if",!0),c(" 空值占位符 "),e.hasValue?c("v-if",!0):(l(),n("span",te,u(e.placeholder||"请选择"),1))]),e.showClear?(l(),n("span",{key:0,class:"fc-cus-select-clear",onClick:t[1]||(t[1]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[5]||(t[5]=[a("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[a("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[a("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)])])):(l(),n("span",oe,[...t[6]||(t[6]=[a("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[a("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[a("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,G)],2112)):(l(),n("div",{key:0,class:p(["fc-cus-select fc-cus-select-single",{"fc-cus-select-disabled":e.disabled}]),style:d(e.style),tabindex:e.disabled?-1:0},[a("div",{class:p(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[e.displayValue?(l(),n("span",{key:0,class:"fc-cus-select-selection-item",title:e.displayLabel},u(e.displayLabel),9,q)):(l(),n("span",U,u(e.placeholder||"请选择"),1)),e.showClear?(l(),n("span",{key:2,class:"fc-cus-select-clear",onClick:t[0]||(t[0]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[2]||(t[2]=[a("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[a("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[a("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)])])):(l(),n("span",H,[...t[3]||(t[3]=[a("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[a("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[a("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,L))],2112)};var re=i({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 o="object"==typeof t?t[this.valueKey]:t;e.set(o,t)}),this.internalOptions.forEach(t=>{const o="object"==typeof t?t[this.valueKey]:t;e.set(o,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 o in e)if(Object.prototype.hasOwnProperty.call(e,o))try{t[o]=this.serializeForPostMessage(e[o])}catch(e){console.warn("CusStoreSelect: 跳过无法序列化的属性: "+o,e)}return t}return e}},handleClick(){if(this.disabled)return;if(this.formCreateInject&&this.formCreateInject.preview)return;const e=`store-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let o=null;t.length>0&&(o=t);const r=null==o?null:this.serializeForPostMessage(o),l={...this.extraQuery};this.extraQueryFn&&Object.assign(l,this.extraQueryFn());const n={type:"OPEN_STORE_SELECT",field:this.field||"",multiple:this.multiple,currentValue:r,valueKey:this.valueKey,labelKey:this.labelKey,extraQuery:l,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(n,"*")}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:o,sourceItems:r,messageId:l}=t;if(e!==this.field)return;const n=this.pendingCallbacks[l];n&&(n(o,r),delete this.pendingCallbacks[l])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const o="object"==typeof e?e[this.valueKey]:e;t.set(o,e)}),e.forEach(e=>{const o="object"==typeof e?e[this.valueKey]:e;t.set(o,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)}})})}}});re.render=function(e,t,o,r,a,i){const s=f("CusSelect");return l(),n("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 le=i({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 o="object"==typeof t?t[this.valueKey]:t;e.set(o,t)}),this.internalOptions.forEach(t=>{const o="object"==typeof t?t[this.valueKey]:t;e.set(o,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 o in e)if(Object.prototype.hasOwnProperty.call(e,o))try{t[o]=this.serializeForPostMessage(e[o])}catch(e){console.warn("CusUserSelect: 跳过无法序列化的属性: "+o,e)}return t}return e}},handleClick(){if(this.disabled)return;if(this.formCreateInject&&this.formCreateInject.preview)return;const e=`user-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let o=null;t.length>0&&(o=t);const r=null==o?null:this.serializeForPostMessage(o),l={...this.extraQuery};this.extraQueryFn&&Object.assign(l,this.extraQueryFn());const n={type:"OPEN_USER_SELECT",field:this.field||"",multiple:this.multiple,currentValue:r,valueKey:this.valueKey,labelKey:this.labelKey,selectType:this.selectType,extraQuery:l,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(n,"*")}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:o,sourceItems:r,messageId:l}=t;if(e!==this.field)return;const n=this.pendingCallbacks[l];n&&(n(o,r),delete this.pendingCallbacks[l])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const o="object"==typeof e?e[this.valueKey]:e;t.set(o,e)}),e.forEach(e=>{const o="object"==typeof e?e[this.valueKey]:e;t.set(o,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)}})})}}});le.render=function(e,t,o,r,a,i){const s=f("CusSelect");return l(),n("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 ne={name:"TableForm",emits:["change","add","delete","update:modelValue","select-change"],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,showIndexColumn:{type:Boolean,default:!0},showSelectColumn:{type:Boolean,default:!1},selectField:{type:String,default:"checked"},showOperationColumn:{type:Boolean,default:!0},headerBackgroundColor:{type:String,default:""},emptyText:{type:String,default:""}},watch:{modelValue:{handler(){this.updateTable()},deep:!0},"formCreateInject.preview":function(e){this.emptyRule.children[0].props.colspan=this.getEmptyColspan()},showIndexColumn(){this.loadRule(),this.updateTable()},showSelectColumn(){this.loadRule(),this.updateTable()},showOperationColumn(){this.loadRule(),this.updateTable()},headerBackgroundColor(){this.loadRule()},emptyText(){this.updateEmptyRule()}},data(){return{rule:[],trs:[],fapi:{},Form:g(this.formCreateInject.form.$form()),copyTrs:"",oldValue:"",selectedRows:new Set,emptyRule:{type:"tr",_isEmpty:!0,native:!0,subRule:!0,children:[{type:"td",style:{textAlign:"center"},native:!0,subRule:!0,props:{colspan:this.getEmptyColspan()},children:[this.emptyText||this.formCreateInject.t("dataEmpty")||"暂无数据"]}]}}},methods:{getEmptyColspan(){return this.columns.length+(this.showIndexColumn?1:0)+(this.showSelectColumn?1:0)+(this.showOperationColumn?this.formCreateInject.preview?0:1:0)},formChange(){this.updateValue()},updateValue(){const e=this.trs.map((e,t)=>{const o={...this.modelValue[t]||{},...this.fapi.getChildrenFormData(e)};return this.showSelectColumn&&(o[this.selectField]=this.selectedRows.has(t)),o}).filter(e=>{if(!this.filterEmptyColumn)return!0;if(null==e)return!1;let t=!1;return Object.keys(e).forEach(o=>{t=t||void 0!==e[o]&&""!==e[o]&&null!==e[o]}),t}),t=JSON.stringify(e);t!==this.oldValue&&(this.oldValue=t,this.$emit("update:modelValue",e),this.$emit("change",e))},setRawData(e,t){const o=this.trs[e];this.fapi.setChildrenFormData(o,t,!0)},updateTable(){const e=JSON.stringify(this.modelValue);this.oldValue!==e&&(this.oldValue=e,this.showSelectColumn&&(this.selectedRows.clear(),this.modelValue.forEach((e,t)=>{e&&!0===e[this.selectField]&&this.selectedRows.add(t)})),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,this.showSelectColumn&&this.updateSelectAllState())},updateEmptyRule(){const e=this.emptyText||this.formCreateInject.t("dataEmpty")||"暂无数据";this.emptyRule&&this.emptyRule.children&&this.emptyRule.children[0]&&(this.emptyRule.children[0].children=[e]),this.trs.forEach(t=>{t._isEmpty&&t.children&&t.children[0]&&(t.children[0].children=[e])}),this.rule[0]&&this.rule[0].children&&this.rule[0].children[1]&&(this.rule[0].children[1].children=this.trs)},addEmpty(){this.trs.length&&this.trs.splice(0,this.trs.length),this.updateEmptyRule(),this.trs.push(this.emptyRule)},clearEmpty(){this.trs[0]&&this.trs[0]._isEmpty&&this.trs.splice(0,1)},delRaw(e){if(this.disabled||!this.deletable||this.min>0&&this.trs.length<=this.min)return;this.trs.splice(e,1),this.selectedRows.delete(e);const t=new Set;this.selectedRows.forEach(o=>{o<e?t.add(o):o>e&&t.add(o-1)}),this.selectedRows=t,this.updateValue(),this.trs.length?this.trs.forEach(e=>this.updateRaw(e)):this.addEmpty(),this.$emit("delete",e),this.$emit("select-change",Array.from(this.selectedRows))},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()),this.updateSelectAllState()},isRowSelectable:e=>!e||!0!==e.disabled&&!1!==e.selectable,updateRaw(e){const t=this.trs.indexOf(e),o=this.modelValue[t]||{};let r=0;if(this.showIndexColumn&&e.children[r]&&(e.children[r].props.innerText=t+1,r++),this.showSelectColumn&&e.children[r]){const l=e.children[r],n=o&&!0===o[this.selectField],a=!this.isRowSelectable(o);if(l.children&&l.children[0]){const e=l.children[0];e.props.checked=n,e.props.disabled=a,e.props.onClick=e=>{e.stopPropagation(),a||this.toggleRowSelect(t,e.target.checked)}}this.$nextTick(()=>{var e;const o=null===(e=this.$el)||void 0===e?void 0:e.querySelector("._fc-tf-table");if(o){const e=o.querySelectorAll("tbody tr");if(e[t]){const o=e[t].querySelector('._fc-tf-select input[type="checkbox"]');o&&(o.checked=n,o.disabled=a)}}}),r++}if(this.columns.forEach((l,n)=>{const a=r+n;if(e.children[a]&&e.children[a].children){const r=e.children[a].children.find(e=>"checkbox"===e.type);if(r&&l.optionsFn&&"function"==typeof l.optionsFn){const e=l.optionsFn(o,t);Array.isArray(e)&&(r.options=e,r.props&&(r.props.options=e))}}}),this.showOperationColumn&&e.children[e.children.length-1]){const o=e.children[e.children.length-1];o.children&&o.children[0]&&(o.children[0].props.onClick=()=>{this.delRaw(t)})}},toggleRowSelect(e,t){const o=this.modelValue[e];o&&this.isRowSelectable(o)&&(t?(this.selectedRows.add(e),o[this.selectField]=!0):(this.selectedRows.delete(e),o[this.selectField]=!1),this.updateValue(),this.updateSelectAllState(),this.$emit("select-change",Array.from(this.selectedRows)))},toggleSelectAll(e){this.modelValue.forEach((t,o)=>{t&&this.isRowSelectable(t)&&(e?(this.selectedRows.add(o),t[this.selectField]=!0):(this.selectedRows.delete(o),t[this.selectField]=!1))}),this.updateValue(),this.trs.forEach(e=>{e._isEmpty||this.updateRaw(e)}),this.$emit("select-change",Array.from(this.selectedRows))},updateSelectAllState(){if(!this.showSelectColumn)return;const e=this.modelValue.filter((e,t)=>{const o=this.trs[t];return o&&!o._isEmpty&&this.isRowSelectable(e)});if(0===e.length)return;const t=e.every(e=>e&&!0===e[this.selectField]),o=e.some(e=>e&&!0===e[this.selectField]);this.$nextTick(()=>{var e;const r=null===(e=this.$el)||void 0===e?void 0:e.querySelector("._fc-tf-table");if(r){const e=r.querySelector('._fc-tf-head-select input[type="checkbox"]');e&&(e.checked=t,e.indeterminate=!t&&o)}})},loadRule(){const e=[];let t=[];this.showIndexColumn&&(e.push({type:"th",native:!0,class:"_fc-tf-head-idx",style:this.headerBackgroundColor?{backgroundColor:this.headerBackgroundColor}:{},props:{innerText:"#"}}),t.push({type:"td",class:"_fc-tf-idx",native:!0,props:{innerText:"0"}})),this.showSelectColumn&&(e.push({type:"th",native:!0,class:"_fc-tf-head-select",style:{width:"40px",minWidth:"40px",maxWidth:"40px",textAlign:"center",...this.headerBackgroundColor?{backgroundColor:this.headerBackgroundColor}:{}},children:[{type:"input",native:!0,props:{type:"checkbox",id:"_fc-tf-select-all-"+(this._uid||Date.now()),onClick:e=>{this.toggleSelectAll(e.target.checked)}}}]}),t.push({type:"td",class:"_fc-tf-select",native:!0,style:{width:"40px",minWidth:"40px",maxWidth:"40px",textAlign:"center"},children:[{type:"input",native:!0,props:{type:"checkbox",onClick:e=>{}}}]})),this.columns.forEach(o=>{e.push({type:"th",native:!0,style:{...o.style||{},textAlign:o.align||"center",...this.headerBackgroundColor?{backgroundColor:this.headerBackgroundColor}:{}},class:o.required?"_fc-tf-head-required":"",props:{innerText:o.label||""}}),t.push({type:"td",native:!0,children:[...o.rule||[]]})}),this.showOperationColumn&&(e.push({type:"th",native:!0,class:"_fc-tf-edit fc-clock",style:this.headerBackgroundColor?{backgroundColor:this.headerBackgroundColor}:{},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()}};ne.render=function(e,t,o,r,i,s){const d=f("a-button");return l(),n("div",{class:p(["_fc-table-form",{"_fc-disabled":o.disabled}])},[(l(),v(b(i.Form),{option:o.options,rule:i.rule,extendOption:!0,disabled:o.disabled,onChange:s.formChange,api:i.fapi,"onUpdate:api":t[0]||(t[0]=e=>i.fapi=e),onEmitEvent:e.$emit},null,40,["option","rule","disabled","onChange","api","onEmitEvent"])),o.addable&&(!o.max||o.max>this.trs.length)?(l(),v(d,{key:0,type:"link",class:"fc-clock",onClick:t[1]||(t[1]=e=>s.addRaw(!0)),disabled:o.disabled},{default:w(()=>[t[2]||(t[2]=a("i",{class:"fc-icon icon-add-circle",style:{"font-weight":"700"}},null,-1)),C(" "+u(o.formCreateInject.t("add")||"添加"),1)]),_:1},8,["disabled"])):c("v-if",!0)],2)};var ae=i({name:"TableFormView",data:()=>({})});const ie={class:"_fd-table-form"},se={key:0,class:"_fd-tf-wrap"},ce={key:1,class:"_fc-child-empty"};ae.render=function(e,t,o,r,a,i){return l(),n("div",ie,[e.$slots.default?(l(),n("div",se,[S(e.$slots,"default")])):(l(),n("div",ce))])};var pe=i({name:"TableFormColumnView",props:{label:String,align:String,width:[Number,String],color:String,required:Boolean},computed:{colStyle(){const e=this.width,t={width:j.Number(e)?e+"px":e&&"auto"!==e?e:"180px"};return this.color&&(t.color=this.color),t}},data:()=>({})});const de={key:0,class:"_fd-tf-required"},ue={class:"_fd-tf-con"};pe.render=function(e,t,o,r,i,s){return l(),n("div",{class:"_fd-tf-col",style:d(e.colStyle)},[a("div",{class:"_fd-tf-title",style:d({textAlign:e.align||"center"})},[e.required?(l(),n("span",de,"*")):c("v-if",!0),C(u(e.label||""),1)],4),a("div",ue,[S(e.$slots,"default")])],4)};var he={name:"FcTable",props:{mini:Boolean,label:String,width:[Number,String],border:{type:Boolean,default:!0},borderWidth:String,borderColor:String,rule:{type:Object,default:()=>({row:1,col:1})}},watch:{rule:{handler(){this.initRule(),this.loadRule(),this.tdStyle=this.rule.style||{},this.tdClass=this.rule.class||{}},immediate:!0,deep:!0}},data:()=>({tdStyle:{},tdClass:{},lattice:{}}),computed:{tableColor(){const e={};return!1===this.border?e.border="0 none":(this.borderColor&&(e.borderColor=this.borderColor),this.borderWidth&&(e.borderWidth=this.borderWidth)),e}},methods:{initRule(){const e=this.rule;e.style||(e.style={}),e.layout||(e.layout=[]),e.row||(e.row=1),e.col||(e.col=1)},loadRule(){const e=[],t=this.rule||{row:1,col:1};for(let o=0;o<t.row;o++){const o=[];e.push(o);for(let e=0;e<t.col;e++)o.push({rowspan:1,colspan:1,slot:[],show:!0})}[...t.layout||[]].forEach((o,r)=>{if((!o.row||o.row<=0)&&(!o.col||o.col<=0)||!e[o.top]||!e[o.top][o.left]||!e[o.top][o.left].show)return void t.layout.splice(r,1);const l=e[o.top][o.left];l.layout=o;let n=1,a=1;if(o.col&&(n=o.col+o.left>t.col?t.col-o.left:o.col,l.colspan=n),o.row&&(a=o.row+o.top>t.row?t.row-o.top:o.row,l.rowspan=a),a&&n)for(let t=0;t<a;t++){const r=e[o.top+t];if(r)for(let e=0;e<n;e++)(e||t)&&(r[o.left+e]&&(r[o.left+e].show=!1),l.slot.push(`${o.top+t}:${o.left+e}`))}});const o=e=>!(e&&!e.layout&&e.show);e.forEach((t,r)=>{t.forEach((l,n)=>{let a=!1,i=!1;if(l.layout){const t=l.layout.col||1,s=l.layout.row||1;for(let l=0;l<t;l++)e[r+s]&&!o(e[r+s][n+l])||(i=!0);for(let l=0;l<s;l++)e[r+l]&&!o(e[r+l][n+t])||(a=!0)}else a=o(t[n+1]),i=!e[r+1]||o(e[r+1][n]);l.right=a,l.bottom=i})}),this.lattice=e}}};he.render=function(e,t,o,r,i,u){const m=f("a-col");return l(),v(m,{span:24},{default:w(()=>[a("div",{class:p(["_fc-table",{"is-mini":o.mini}])},[a("table",{border:"1",cellspacing:"0",cellpadding:"0",style:d(u.tableColor)},[(l(!0),n(s,null,h(o.rule.row,(t,r)=>(l(),n("tr",{key:r},[(l(!0),n(s,null,h(o.rule.col,(t,o)=>(l(),n(s,{key:`${r}${o}`},[i.lattice[r][o].show?(l(),n("td",x({key:0,ref_for:!0},i.lattice[r][o]?{colspan:i.lattice[r][o].colspan,rowspan:i.lattice[r][o].rowspan}:{},{valign:"top",class:i.tdClass&&i.tdClass[`${r}:${o}`]||"",style:[u.tableColor,i.tdStyle&&i.tdStyle[`${r}:${o}`]||{}]}),[S(e.$slots,`${r}:${o}`),(l(!0),n(s,null,h(i.lattice[r][o].slot,t=>S(e.$slots,""+t)),256))],16)):c("v-if",!0)],64))),128))]))),128))],4)],2)]),_:3})};var fe=i({name:"ExportExcel",props:{formCreateInject:{type:Object,default:null},buttonType:{type:String,default:"primary",validator:e=>["primary","ghost","dashed","link","text","default"].includes(e)},text:{type:String,default:"导出Excel"},disabled:{type:Boolean,default:!1},action:{type:String,default:""},method:{type:String,default:"post"},data:{type:Object,default:()=>({})},query:{type:Object,default:()=>({})},headers:{type:Object,default:()=>({})},withCredentials:{type:Boolean,default:!1},fileName:{type:String,default:""},beforeFetch:{type:Function,default:null},dataType:{type:String,default:"json",validator:e=>["json","formData"].includes(e)}},data:()=>({loading:!1}),methods:{async handleExport(){if(!this.loading&&!this.disabled)if(this.action){this.loading=!0;try{let e={action:this.action,method:this.method,data:this.data,query:this.query,headers:this.headers,withCredentials:this.withCredentials,dataType:this.dataType};if(this.beforeFetch&&"function"==typeof this.beforeFetch){const t=this.formCreateInject||{},o=t.api,r=t.rule,l=this.beforeFetch(e,{api:o,rule:r});if(l&&"function"==typeof l.then)await l;else{if(!1===l)return void(this.loading=!1);l&&"object"==typeof l&&(e=l)}}const t=await this.fetchBlob(e);let o=this.fileName||t.fileName||(new Date).getTime()+".xlsx";o.endsWith(".xlsx")||o.endsWith(".xls")||(o+=".xlsx"),this.exportFile(o,t.blob),T.success("导出成功")}catch(e){console.error("导出失败:",e),T.error(e.message||"导出失败,请稍后重试")}finally{this.loading=!1}}else T.warning("请配置导出接口地址")},fetchBlob:e=>new Promise((t,o)=>{const r=new XMLHttpRequest;let l=e.action||"",n="";if(e.query){const t="string"==typeof e.query?e.query:Object.keys(e.query).reduce((t,o)=>(t[o]=null===e.query[o]||void 0===e.query[o]?"":e.query[o],t),{}),o=new URLSearchParams(t).toString();o&&(l.includes("?")?l+="&"+o:l+="?"+o)}r.onerror=()=>{o(new Error("请求失败"))},r.onload=()=>{if(r.status<200||r.status>=300){if((r.getResponseHeader("content-type")||"").includes("application/json")){const e=new FileReader;return e.onload=e=>{try{const t=JSON.parse(e.target.result);o(new Error(t.message||"导出失败"))}catch(e){o(new Error("导出失败: "+r.status))}},void e.readAsText(r.response)}return void o(new Error("导出失败: "+r.status))}const e=r.getResponseHeader("content-disposition");if(e){const t=e.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);t&&t[1]&&(n=t[1].replace(/['"]/g,""),n=decodeURIComponent(n))}const l=r.response;if(l.type&&l.type.includes("application/json")){const e=new FileReader;return e.onload=e=>{try{const t=JSON.parse(e.target.result);o(new Error(t.message||"导出失败"))}catch(e){o(new Error("导出失败"))}},void e.readAsText(l)}t({blob:r.response,fileName:n})},r.open(e.method||"get",l,!0),r.responseType="blob";try{if(window.parent&&window.parent.window){const e=window.parent.window.localStorage.getItem("authorizationKey"),t=window.parent.window.localStorage.getItem("authorizationValue");e&&t&&r.setRequestHeader(e,t)}else{const e=window.localStorage.getItem("authorizationKey"),t=window.localStorage.getItem("authorizationValue");e&&t&&r.setRequestHeader(e,t)}}catch(e){console.warn("获取token失败",e)}const a=e.headers||{};Object.keys(a).forEach(e=>{null!=a[e]&&r.setRequestHeader(e,a[e])}),e.withCredentials&&"withCredentials"in r&&(r.withCredentials=!0);const i=e.dataType||"json";if(e.data&&Object.keys(e.data).length>0)if("formData"===i){const t=new FormData;Object.keys(e.data).forEach(o=>{const r=e.data[o];null!=r&&(Array.isArray(r)?r.forEach(e=>{t.append(o,e)}):t.append(o,r))}),r.send(t)}else r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.send(JSON.stringify(e.data));else r.send()}),exportFile(e,t){const o=new Blob([t],{type:"application/vnd.ms-excel"});if("download"in document.createElement("a")){const t=document.createElement("a");t.download=e,t.style.display="none",t.href=URL.createObjectURL(o),document.body.appendChild(t),t.click(),URL.revokeObjectURL(t.href),document.body.removeChild(t)}else navigator.msSaveBlob(o,e)}}});fe.render=function(e,t,o,r,n,a){const i=f("a-button");return l(),v(i,{type:e.buttonType,loading:e.loading,disabled:e.disabled,onClick:e.handleExport},{default:w(()=>[S(e.$slots,"default",{},()=>[C(u(e.text||"导出Excel"),1)])]),_:3},8,["type","loading","disabled","onClick"])};var me=[e,t,o,r,N,K,re,le,ne,ae,pe,fe,he],ye={name:"checkbox",modelField:"value",mergeProp(e){const t=e.prop.props;P(t,"options")||(t.options=e.prop.options||[])}},ge={...ye,name:"radio"},ve={...ye,name:"select",mergeProp(e){var t;const o=e.prop.props;P(o,"options")||(o.options=e.prop.options||[]),P(o,"getPopupContainer")||(o.getPopupContainer=e=>{var t;return null!==(t=null==e?void 0:e.parentNode)&&void 0!==t?t:document.body});const r=e.effectData("fetch");r&&!0===r.loading&&(o.disabled=!0,o.loading=!0);(!0===(null===(t=e.rule.props)||void 0===t?void 0:t.readOnly)||!0===o.readOnly)&&(o.disabled=!0,o._fcReadOnly=!0)},render(e,t){const o=t.effectData("fetch");if(o&&!0===o.loading&&e.loading){const o={...e};return o.notFoundContent=e.loading,t.$render.defaultRender(t,o)}return(t.prop.props||{})._fcReadOnly&&(t.prop.class||(t.prop.class=[]),Array.isArray(t.prop.class)||(t.prop.class=[t.prop.class]),t.prop.class.includes("fc-select-readonly")||t.prop.class.push("fc-select-readonly")),t.$render.defaultRender(t,e)}},be={name:"cascader",mergeProp(e){const t=e.prop.props;P(t,"options")||(t.options=e.prop.options||[]);const o=e.effectData("fetch");if(o&&!0===o.loading&&(t.disabled=!0,t.loading=!0),t.loadData){var r;const o=null===(r=e.$handle)||void 0===r?void 0:r.api,l=e.rule,n=e;let a=j.String(t.loadData)?R(t.loadData):t.loadData;if(!j.Function(a)&&j.String(t.loadData))try{const e=t.loadData.trim();e.startsWith("function")||e.startsWith("[[FORM-CREATE-PREFIX-function")||e.startsWith("$FNX:")||(a=new Function("selectedOptions","options","updateOptions","api","rule",e))}catch(e){}j.Function(a)&&(t.loadData=function(e){if(!e||0===e.length)return;const r=e[e.length-1];if(!0===(null==r?void 0:r.isLeaf))return;const i=t.options||[],s=()=>{var a,i;const s=t.options||[],c=(e,t,o,r)=>{if(!t||0===t.length)return e.map(e=>({...e,children:e.children?e.children.map(e=>({...e})):void 0}));const l=t[o],n=o===t.length-1;return e.map(e=>{const a={...e};return void 0!==e.value&&e.value===l||void 0!==e.id&&e.id===l?n?(a.children=r?[...r]:void 0,a.loading=!1,a):(e.children&&e.children.length>0?a.children=c(e.children,t,o+1,r):a.children=void 0,a):(e.children&&e.children.length>0?a.children=c(e.children,t,o,r):a.children=void 0,a)})},p=e.map(e=>e.value||e.id),d=c(s,p,0,r?r.children:void 0),u=n.effectData("fetch");u&&F(u,"props.options",d),t.options=d,null!==(a=n.prop)&&void 0!==a&&a.props&&(n.prop.props.options=d),null!==(i=n.rule)&&void 0!==i&&i.props&&(n.rule.props.options=d),o&&l&&o.sync(l),n.$handle&&n.$handle.refresh()};r&&(r.loading=!0,s());const c=a.call(this,e,i,s,o,l);return c&&"function"==typeof c.then?c.finally(()=>{s()}):c});const i=o=>{if(!o||!Array.isArray(o)||o.length<=1||!t.loadData||"function"!=typeof t.loadData)return;const r="_loadDataTimer_"+(e.rule._fc_id||Date.now());e.rule[r]&&clearTimeout(e.rule[r]),e.rule[r]=setTimeout(()=>{let e=0;const r=async()=>{e++;const l=n.effectData("fetch");if(e>50)return;if(l&&!0===l.loading)return void setTimeout(r,100);let a=t.options||[];if(!a||0===a.length){if(!(l&&l.props&&l.props.options))return void setTimeout(r,100);a=l.props.options,t.options=a}if(!a||0===a.length)return;const i=async(e,o)=>{if(o>=e.length-1)return;a=t.options||[];const r=[];let l=a;for(let t=0;t<=o;t++){const o=e[t],n=l.find(e=>e.value===o||e.id===o);if(!n)return;r.push(n),l=n.children||[]}const n=r[o];if(!0===n.isLeaf)return;const s=e[o+1];if(null==s)return;if(n.children&&Array.isArray(n.children)&&n.children.length>0)await i(e,o+1);else{n.loading=!0;try{const l=t.loadData(r);l&&"function"==typeof l.then&&await l,await new Promise(e=>setTimeout(e,300)),o+1<e.length-1&&await i(e,o+1)}catch(e){n.loading=!1}}};i(o,0).catch(()=>{})};r()},500)},s=e.rule.value,c=JSON.stringify(s||[]);c!==e.rule._lastLoadDataValueKey&&s&&Array.isArray(s)&&(e.rule._lastLoadDataValueKey=c,i(s))}},render(e,t){const o=t.effectData("fetch");if(o&&!0===o.loading&&e.loading){const o={...e};return o.notFoundContent=e.loading,t.$render.defaultRender(t,o)}return t.$render.defaultRender(t,e)},mounted(e){const t=e.rule.value,o=e.prop.props;t&&Array.isArray(t)&&t.length>1&&o.loadData&&setTimeout(()=>{const t=e.prop.props.loadData;t&&"function"==typeof t&&(e.rule._lastLoadDataValueKey=null)},100)}};const we={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",quarter:"YYYY-qQ",year:"YYYY"},Ce="datePicker";var Se={name:Ce,maker:["date","month","week"].reduce((e,t)=>(e[t]=V(Ce,{type:t}),e),{dateRange:V(Ce,{type:"range"}),datetimeRange:V(Ce,e=>e.props({type:"range",showTime:!0}))}),modelField:"value",mergeProp(e){const t=e.prop.props,o=t.type||t.picker;P(t,"getPopupContainer")||(t.getPopupContainer=e=>{var t;return null!==(t=null==e?void 0:e.parentNode)&&void 0!==t?t:document.body}),t.valueFormat||(t.valueFormat=(we[o]||we.date)+(!t.showTime||o&&"date"!==o?"":" HH:mm:ss")),t.showTime&&(!0===t.showTime?t.showTime={defaultValue:D("00:00:00","HH:mm:ss")}:"object"!=typeof t.showTime||t.showTime.defaultValue||(t.showTime={...t.showTime,defaultValue:D("00:00:00","HH:mm:ss")}))},render:(e,t)=>t.$render.vNode[(!0===t.prop.props.range?"range":"date")+"Picker"](t.prop,e)};var xe={name:"hidden",maker:{hidden:(e,t)=>V("hidden")("",e,t)},render:()=>[]},$e={name:"text",loadChildren:!1,mounted(e){var t,o;const r=e.rule.props||{},l=e.rule.bindField||r.bindField||(null===(t=e.prop.props)||void 0===t?void 0:t.bindField),n=e.rule.template||r.template||(null===(o=e.prop.props)||void 0===o?void 0:o.template);if(n||l){const t=e.getParentGroup&&e.getParentGroup(),o=t&&e.$handle&&e.$handle.subRuleData;if(console.log("[text mounted] bindField:",l,"template:",n),console.log("[text mounted] isInSubForm:",o),console.log("[text mounted] group:",t),o&&t&&t.id){const o=()=>{if(e.$handle&&e.$handle.api)try{let o="";if(l){if(e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const r=e.$handle.subRuleData[t.id];o=void 0!==r[l]?String(r[l]||""):""}}else if(n&&e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const r=e.$handle.subRuleData[t.id];o=e.$handle.loadStrVar(n,t=>r&&void 0!==r[t]?r[t]:e.$handle.api.getValue(t),{rule:t.rule,value:r})}void 0!==o&&(e.rule.children||(e.rule.children=[]),e.rule.children[0]=String(o),e.$handle.api.sync(e.rule),e.$handle.refresh())}catch(e){console.error("[text mounted] 立即更新错误:",e)}};o(),e.$handle.api.nextTick(()=>{o()})}setTimeout(()=>{if(e.$handle&&e.$handle.api)try{let r="";if(o&&t&&t.id){if(console.log("[text mounted] 在tableForm中,从当前行数据获取"),l){if(e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const o=e.$handle.subRuleData[t.id];r=void 0!==o[l]?String(o[l]||""):"",console.log("[text mounted] 从subRuleData获取值:",r,"rowData:",o)}}else if(n&&e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const o=e.$handle.subRuleData[t.id];r=e.$handle.loadStrVar(n,t=>o&&void 0!==o[t]?o[t]:e.$handle.api.getValue(t),{rule:t.rule,value:o}),console.log("[text mounted] 从行数据解析模板,值:",r)}}else if(n){const t=e.$handle.api.formData();r=e.$handle.loadStrVar(n,o=>{const r=e.$handle.api.getValue(o);return void 0===r&&t&&void 0!==t[o]?t[o]:r},null)}else l&&(r=e.$handle.api.getValue(l)||"");if(null!=r&&(e.rule.children||(e.rule.children=[]),e.rule.children[0]=String(r),e.$handle.api.sync(e.rule),e.$handle.refresh(),console.log("[text mounted] 更新children:",e.rule.children)),o&&t&&t.id&&l){const o=()=>{if(e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const o=e.$handle.subRuleData[t.id],r=void 0!==o[l]?String(o[l]||""):"";e.rule.children&&e.rule.children[0]!==r&&(e.rule.children[0]=r,e.$handle.api.sync(e.rule),e.$handle.refresh(),console.log("[text mounted watch] 字段值变化,更新为:",r))}};if(e.$handle.bus){e.$handle.bus.$on("change-"+l,o),console.log("[text mounted] 监听字段变化事件: change-"+l);const r=$(e.$handle.subRuleData,t.id);e.watch.push(k(()=>{var e;return null===(e=r.value)||void 0===e?void 0:e[l]},t=>{const o=void 0!==t?String(t||""):"";e.rule.children||(e.rule.children=[]),e.rule.children[0]=o,e.$handle.api.sync(e.rule),e.$handle.refresh(),console.log("[text mounted watch subRuleData] 字段值变化,更新为:",o)},{immediate:!0})),e.watch.push(k(()=>r.value,t=>{if(t&&l){const o=void 0!==t[l]?String(t[l]||""):"";e.rule.children||(e.rule.children=[]),e.rule.children[0]!==o&&(e.rule.children[0]=o,e.$handle.api.sync(e.rule),e.$handle.refresh(),console.log("[text mounted watch rowData] 行数据变化,更新为:",o))}},{immediate:!0,deep:!0}))}}}catch(e){console.error("[text mounted] 错误:",e)}},500)}},renderChildren:(e,t)=>({default:()=>{var o,r;const l=t.getParentGroup&&t.getParentGroup();if(l&&t.$handle&&t.$handle.subRuleData&&l&&l.id){var n,a;const e=t.rule.props||{},o=t.rule.bindField||e.bindField||(null===(n=t.prop.props)||void 0===n?void 0:n.bindField),r=t.rule.template||e.template||(null===(a=t.prop.props)||void 0===a?void 0:a.template);if(o||r)try{if(t.$handle.subRuleData&&t.$handle.subRuleData[l.id]){const e=t.$handle.subRuleData[l.id];let n="";o?n=void 0!==e[o]?String(e[o]||""):"":r&&(n=t.$handle.loadStrVar(r,o=>e&&void 0!==e[o]?e[o]:t.$handle.api.getValue(o),{rule:l.rule,value:e})),void 0!==n&&(t.rule.children||(t.rule.children=[]),t.rule.children[0]!==n&&(t.rule.children[0]=n))}}catch(e){}}let i=null===(o=t.rule)||void 0===o?void 0:o.children;i||(i=e);let s=(Array.isArray(i)?i:[i]).filter(e=>null!=e).map(e=>j.String(e)?e:String(e)).join("");s=null==s||void 0===s?"":String(s);const c=t.rule.props||{},p=t._formatFn||t.rule.formatFn||c.formatFn||(null===(r=t.prop.props)||void 0===r?void 0:r.formatFn);if(p){let e=null;if(j.String(p))try{e=R(p)}catch(e){console.warn("[text] 解析 formatFn 函数失败:",e)}else j.Function(p)&&(e=p);if(e&&j.Function(e))try{var d;const o=(null===(d=t.$handle)||void 0===d?void 0:d.api)||{},r=e(s,o,t.rule);null!=r&&(s=String(r))}catch(e){console.warn("[text] 执行 formatFn 函数失败:",e)}}return s||""}}),mergeProp(e){var t,o,r,l,n,a;const i=e.rule.props||{},s=e.rule.bindField||i.bindField||(null===(t=e.prop.props)||void 0===t?void 0:t.bindField),c=e.rule.template||i.template||(null===(o=e.prop.props)||void 0===o?void 0:o.template);let p=e.rule.bindMode||i.bindMode||(null===(r=e.prop.props)||void 0===r?void 0:r.bindMode);if(p||(p=c?"template":s?"field":"static"),"field"===p&&s){var d;console.log("[text mergeProp] bindField模式,fieldName:",s),console.log("[text mergeProp] ctx:",e),console.log("[text mergeProp] ctx.getParentGroup:",e.getParentGroup);const t=e.getParentGroup&&e.getParentGroup();console.log("[text mergeProp] group:",t),console.log("[text mergeProp] ctx.$handle:",e.$handle),console.log("[text mergeProp] ctx.$handle.subRuleData:",null===(d=e.$handle)||void 0===d?void 0:d.subRuleData);const o=t&&e.$handle&&e.$handle.subRuleData;let r;if(console.log("[text mergeProp] isInSubForm:",o),o){const e=s;r={handler:(t,o,r)=>{console.log("[text handler] 开始执行,fieldName:",e),console.log("[text handler] rule:",o),console.log("[text handler] rule.__fc__:",null==o?void 0:o.__fc__);const l=null==o?void 0:o.__fc__;if(console.log("[text handler] ruleCtx:",l),console.log("[text handler] ruleCtx.getParentGroup:",null==l?void 0:l.getParentGroup),console.log("[text handler] ruleCtx.$handle:",null==l?void 0:l.$handle),l&&l.getParentGroup&&l.$handle){const t=l.getParentGroup();if(console.log("[text handler] rowGroup:",t),console.log("[text handler] rowGroup.id:",null==t?void 0:t.id),console.log("[text handler] rowGroup.rule:",null==t?void 0:t.rule),t){if(console.log("[text handler] 尝试方法1: 从 subRuleData 获取"),console.log("[text handler] subRuleData:",l.$handle.subRuleData),t.id&&l.$handle.subRuleData&&l.$handle.subRuleData[t.id]){const o=l.$handle.subRuleData[t.id];if(console.log("[text handler] rowData:",o),console.log("[text handler] rowData[fieldName]:",o[e]),o&&void 0!==o[e]){const t=null!==o[e]?String(o[e]):"";return console.log("[text handler] 方法1成功,返回值:",t),t}}if(console.log("[text handler] 尝试方法2: 遍历 rowGroup.rule.children"),t.rule&&Array.isArray(t.rule.children)){const o=t=>{for(const r of t)if(r&&"object"==typeof r){if(r.field===e&&void 0!==r.value)return null!==r.value?String(r.value):"";if(Array.isArray(r.children)){const e=o(r.children);if(void 0!==e)return e}}},r=o(t.rule.children);if(void 0!==r)return console.log("[text handler] 方法2成功,返回值:",r),r}if(console.log("[text handler] 尝试方法3: 使用 api.getChildrenFormData"),r&&r.getChildrenFormData&&t.rule)try{const o=r.getChildrenFormData(t.rule);if(console.log("[text handler] getChildrenFormData 结果:",o),o&&void 0!==o[e]){const t=null!==o[e]?String(o[e]):"";return console.log("[text handler] 方法3成功,返回值:",t),t}}catch(e){console.error("[text handler] 方法3失败:",e)}}}console.log("[text handler] 所有方法都失败,使用回退方法 get");const n=t?t(e):(r.getValue?r.getValue(e):"")||"";return console.log("[text handler] 回退方法返回值:",n),n},to:"child",modify:!0,wait:300,watch:!0}}else r={attr:s,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===s||e.handler&&e.bindField===s)&&"child"===e.to)||(r.handler&&(r.bindField=s),e.rule.effect.loadData.push(r),e.$handle&&e.$handle.effect&&e.$handle.effect(e,"loaded"))}else if("template"===p&&c){let t;if(e.getParentGroup&&e.getParentGroup()&&e.$handle&&e.$handle.subRuleData){const e=c;t={handler:(t,o,r)=>{const l=null==o?void 0:o.__fc__;let n=null;if(l&&l.getParentGroup&&l.$handle){const e=l.getParentGroup();e&&e.rule&&(n=r.getChildrenFormData?r.getChildrenFormData(e.rule):null,!n&&e.id&&l.$handle.subRuleData&&l.$handle.subRuleData[e.id]&&(n=l.$handle.subRuleData[e.id]))}return n&&l&&l.$handle&&l.$handle.loadStrVar?l.$handle.loadStrVar(e,e=>n&&void 0!==n[e]?n[e]:t?t(e):r.getValue?r.getValue(e):void 0,{rule:o,value:n}):l&&l.$handle&&l.$handle.loadStrVar?l.$handle.loadStrVar(e,t,null):""},to:"child",modify:!0,wait:300,watch:!0}}else t={template:c,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===c||e.handler&&e.template===c)&&"child"===e.to)&&(t.handler&&(t.template=c),e.rule.effect.loadData.push(t),e.$handle&&e.$handle.effect&&(e.$handle.effect(e,"loaded"),!e._textLoadDataWatched))){e._textLoadDataWatched=!0;const t=$(e.rule.effect,"loadData");e.watch.push(k(t,(t,o)=>{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=[]);const u=e.rule.tooltipEnabled||i.tooltipEnabled||(null===(l=e.prop.props)||void 0===l?void 0:l.tooltipEnabled),h=e.rule.tooltipContent||i.tooltipContent||(null===(n=e.prop.props)||void 0===n?void 0:n.tooltipContent);u?(e._tooltipEnabled=!0,e._tooltipContent=h):(e._tooltipEnabled=!1,e._tooltipContent=null);const f=e.rule.formatFn||i.formatFn||(null===(a=e.prop.props)||void 0===a?void 0:a.formatFn);if(e._formatFn=f||null,"field"===p&&s||"template"===p&&c){const t=e.getParentGroup&&e.getParentGroup();if(t&&e.$handle&&e.$handle.subRuleData&&t&&t.id)if(e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const o=e.$handle.subRuleData[t.id];let r="";if("field"===p&&s)r=void 0!==o[s]?String(o[s]||""):"";else if("template"===p&&c)try{r=e.$handle.loadStrVar(c,t=>o&&void 0!==o[t]?o[t]:e.$handle.api.getValue(t),{rule:t.rule,value:o})}catch(e){r=""}e.rule.children||(e.rule.children=[]),e.rule.children[0]=r,console.log("[text mergeProp] 在tableForm中,设置初始值:",r)}else(!e.rule.children||Array.isArray(e.rule.children)&&0===e.rule.children.length)&&(e.rule.children=[""]);else(!e.rule.children||Array.isArray(e.rule.children)&&0===e.rule.children.length)&&(e.rule.children="template"===p?[""]:[" "])}},render(e,t){let o="";if(e&&"function"==typeof e.default)try{o=e.default()||""}catch(e){o=""}o=null==o||void 0===o?"":String(o);const r={...t.prop};r.props||(r.props={}),"text"===r.type&&(r.type="div"),delete r.props.innerHTML;if(r.onClick||r.on&&(r.on.click||r.on.onClick)||t.rule.on&&(t.rule.on.click||t.rule.on.onClick)||t.rule.props&&(t.rule.props.onClick||t.rule.props.click)){const e=r.class;r.class=Array.isArray(e)?[...e,"fc-text-clickable"]:e?[e,"fc-text-clickable"]:["fc-text-clickable"]}const l=t.vNode.make("div",r,[o]);if(t._tooltipEnabled&&t._tooltipContent){var n;let e=null;if(j.String(t._tooltipContent))try{e=R(t._tooltipContent)}catch(e){console.warn("[text] 解析 tooltipContent 函数失败:",e)}else j.Function(t._tooltipContent)&&(e=t._tooltipContent);if(!e&&!j.String(t._tooltipContent))return l;const o=e,r=j.String(t._tooltipContent)?t._tooltipContent:null,a=(null===(n=t.$handle)||void 0===n?void 0:n.api)||{},i=t.rule;return t.vNode.make("aTooltip",{},{title:()=>{let e="";if(o&&j.Function(o))try{const t=o(a,i);e=null!=t?String(t):""}catch(t){console.warn("[text] 执行 tooltipContent 函数失败:",t),e=""}else r&&(e=r);return e?t.vNode.h("div",{innerHTML:e,style:{maxWidth:"300px",wordBreak:"break-word"}}):null},default:()=>l})}return l}};var ke={name:"input",maker:["password","url","email","text","textarea","search"].reduce((e,t)=>(e[t]=V("input",{type:t}),e),{idate:V("input",{type:"date"})}),modelField:"value",render(e,t){let o=t.prop.props.type;return-1===["textarea","search","password"].indexOf(o)&&(o="input"),o={textarea:"aTextarea",search:"aInputSearch",password:"aInputPassword"}[o]||"aInput",t.$render.vNode.make(o,t.prop,e)},mounted(e){var t,o,r;if("textarea"===(null===(t=e.prop.props)||void 0===t?void 0:t.type)&&null!==(o=e.prop.props)&&void 0!==o&&o.readOnly&&!0===(null===(r=e.$handle)||void 0===r?void 0:r.preview)){const t=e=>{if(!e)return;e.style.height="auto";const t=e.scrollHeight;t>0&&(e.style.height=t+"px"),e.style.overflow="hidden"};setTimeout(()=>{const o=e.el;if(!o)return;const r=o.querySelector("textarea.ant-input")||o.querySelector("textarea");if(r&&(t(r),"undefined"!=typeof MutationObserver)){const o=new MutationObserver(()=>{t(r)});o.observe(r,{attributes:!0,attributeFilter:["value"],childList:!0,subtree:!0,characterData:!0});const l=setInterval(()=>{t(r)},200);e.$handle&&e.$handle.vm&&e.$handle.vm.$once("hook:beforeUnmount",()=>{o.disconnect(),clearInterval(l)})}},100)}}},Ae={name:"timePicker",modelField:"value",mergeProp(e){const t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss"),P(t,"getPopupContainer")||(t.getPopupContainer=e=>{var t;return null!==(t=null==e?void 0:e.parentNode)&&void 0!==t?t:document.body})},render:(e,t)=>t.$render.vNode["time"+(!0===t.prop.props.range?"Range":"")+"Picker"](t.prop,e)},je={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}},Pe={name:"FcRow",render:(e,t)=>t.vNode.col({props:{span:24}},{default:()=>[t.vNode.row(t.prop,e)]})};var Te={...Se,name:"rangePicker",maker:{},render:(e,t)=>t.$render.vNode.rangePicker(t.prop,e)};var Re={...Ae,name:"timeRangePicker",mergeProp(e){Ae.mergeProp(e)},render:(e,t)=>t.$render.vNode.timeRangePicker(t.prop,e)};const Fe=(e,t)=>{if(!e||!t)return;const o=t.split(".");let r=e;for(const e of o){if(null==r)return;r=r[e]}return r};const Ie="__FORM_CREATE_BUSINESS_COMPONENTS__";let Ve=null;function De(){return"undefined"!=typeof window?(window[Ie]||(window[Ie]=new Map),window[Ie]):(Ve||(Ve=new Map),Ve)}function Oe(e,t){De().set(e,t)}var Ee=[ye,Se,Te,xe,$e,ke,Ae,Re,je,ge,ve,be,Pe,{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(P(t,"options")||(t.options=e.prop.options||[]),P(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 o=t.$render.defaultRender(t,e);if(o&&o.props&&o.props.on){const e=o.props.on["update:modelValue"],r=()=>{A(()=>{A(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const o=t.$handle.getFieldCtx(t.rule.field);o&&o.id&&t.$handle.$manager.validateField(o.id).catch(()=>{})}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})};o.props.on["update:modelValue"]=(...t)=>{e&&e(...t),r()};const l=o.props.on.change;o.props.on.change=l?(...e)=>{l(...e),r()}:r}return o}},{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(P(t,"options")||(t.options=e.prop.options||[]),P(t,"field")||(t.field=e.rule.field||""),P(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 o=t.$render.defaultRender(t,e);if(o&&o.props&&o.props.on){const e=o.props.on["update:modelValue"],r=()=>{A(()=>{A(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const o=t.$handle.getFieldCtx(t.rule.field);o&&o.id&&t.$handle.$manager.validateField(o.id).catch(()=>{})}catch(e){console.warn("CusUserSelect: 触发校验失败",e)}})})};o.props.on["update:modelValue"]=(...t)=>{e&&e(...t),r()};const l=o.props.on.change;o.props.on.change=l?(...e)=>{l(...e),r()}:r}return o}},{name:"flex",mergeProp(e){var t,o,r;const l=e.rule.props||{},n=l.flexDirection||e.rule.flexDirection||"row",a=l.flexWrap||e.rule.flexWrap||"nowrap",i=l.justifyContent||e.rule.justifyContent||"flex-start",s=l.alignItems||e.rule.alignItems||"flex-start",c=l.alignContent||e.rule.alignContent||"flex-start",p="column"===n||"column-reverse"===n,d={"flex-start":"start","flex-end":"end",center:"center","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"}[i]||"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=p,e.prop.props.justify=d,e.prop.props.align=u,void 0!==l.gap&&(e.prop.props.gap=l.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:a,...w};c&&"flex-start"!==c&&(C.alignContent=c);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!==(o=null!==(r=l.resetMarginBottom)&&void 0!==r?r:e.rule.resetMarginBottom)&&void 0!==o&&o){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 o,r;const l={...t.prop};"flex"===l.type&&(l.type="a-flex");const n=(t.rule.props||{}).flexDirection||t.rule.flexDirection||"row",a="column"===n||"column-reverse"===n;l.props||(l.props={});const i=()=>{l.class||(l.class=[]),Array.isArray(l.class)||(l.class=[l.class])},s=null!==(o=null===(r=t.rule.props)||void 0===r?void 0:r.childFlex)&&void 0!==o?o:t.rule.childFlex;if(null!=s&&""!==s){i(),l.class.includes("_fc-flex-container")||l.class.push("_fc-flex-container");const e=String(s).trim();l.props.style||(l.props.style={}),l.props.style["--fc-child-flex"]=e,l.style||(l.style={}),l.style["--fc-child-flex"]=e}if(a){var c,p,d;const e=null!==(c=null!==(p=null===(d=t.rule.props)||void 0===d?void 0:d.childWidth)&&void 0!==p?p:t.rule.childWidth)&&void 0!==c?c:"100%";i(),l.class.includes("_fc-flex-container")||l.class.push("_fc-flex-container"),l.class.includes("_fc-flex-vertical")||l.class.push("_fc-flex-vertical");const o=String(e).trim();l.props.style||(l.props.style={}),l.props.style["--fc-child-width"]=o,l.style||(l.style={}),l.style["--fc-child-width"]=o}const u=e||[],h=t._componentStyle||{};return t.vNode.col({props:{span:24},style:h},{default:()=>[t.vNode.make("a-flex",l,u)]})}},{name:"space",mergeProp(e){var t,o;const r=e.rule.props||{},l=r.direction||e.rule.direction||"horizontal",n=r.size||e.rule.size||"small",a=r.align||e.rule.align,i=r.wrap||e.rule.wrap||!1;e.prop.props||(e.prop.props={}),e.prop.props.direction=l,e.prop.props.size=n,null!=a&&""!==a&&(e.prop.props.align=a),e.prop.props.wrap=i;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!==(o=r.resetMarginBottom)&&void 0!==o?o: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 o={...t.prop};(t.rule.props||{}).compact||t.rule.compact||!1?o.type="a-space-compact":"space"===o.type&&(o.type="a-space");const r=e||[],l=t._componentStyle||{};return t.vNode.col({props:{span:24},style:l},{default:()=>[t.vNode.make(o.type,o,r)]})}},{name:"spin",mergeProp(e){var t,o,r,l,n,a,i,s,c;e.rule.wrap||(e.rule.wrap={}),e.rule.wrap.title=!1;const p=e.prop.props||{},d=null===(t=null!==(o=null!==(r=e.rule.containerMode)&&void 0!==r?r:null===(l=e.rule.props)||void 0===l?void 0:l.containerMode)&&void 0!==o?o:null===(n=e.prop.props)||void 0===n?void 0:n.containerMode)||void 0===t||t;var u,h,f,m;(d||(e.rule.children=[]),P(p,"spinning"))||(p.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&&p.spinning;const g=e.rule.bindField||(null===(a=e.rule.props)||void 0===a?void 0:a.bindField)||(null===(i=e.prop.props)||void 0===i?void 0:i.bindField);let v=e.rule.bindMode||(null===(s=e.rule.props)||void 0===s?void 0:s.bindMode)||(null===(c=e.prop.props)||void 0===c?void 0:c.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 o,r,l,n,a,i,s,c,p,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===(o=t.rule.props)||void 0===o?void 0:o.tip)||(null===(r=t.prop.props)||void 0===r?void 0:r.tip);f&&(t.prop.props.tip=f);const m=t.rule.delay||(null===(l=t.rule.props)||void 0===l?void 0:l.delay)||(null===(n=t.prop.props)||void 0===n?void 0:n.delay);null!=m&&(t.prop.props.delay=m);const y=t.rule.size||(null===(a=t.rule.props)||void 0===a?void 0:a.size)||(null===(i=t.prop.props)||void 0===i?void 0:i.size);y&&(t.prop.props.size=y),"spin"===t.prop.type&&(t.prop.type="a-spin");if(!(null===(s=null!==(c=null!==(p=t.rule.containerMode)&&void 0!==p?p:null===(d=t.rule.props)||void 0===d?void 0:d.containerMode)&&void 0!==c?c: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 o={...t.prop};"div"===o.type&&(o.type="div");const r=e||[];return o.props||(o.props={}),o.props.style||(o.props.style={}),t.vNode.make("div",o,r)}},{name:"aAlert",mergeProp(e){const t=e.prop.props||{};t.message&&""!==t.message||!t.description||(t.message=t.description,delete t.description)},render:(e,t)=>t.$render.defaultRender(t,e)},{name:"aCard",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)=>t.$render.defaultRender(t,e)},{name:"accTable",init(e){var t,o;const r=e.rule;if(null!==(t=r.effect)&&void 0!==t&&t.fetch&&null!==(o=r.props)&&void 0!==o&&o.pagination&&"object"==typeof r.props.pagination&&void 0!==r.props.pagination.current){const e=r.effect.fetch;if("object"==typeof e){const t=e.beforeFetch;if(!(t&&!0===t._accTablePaginationHook)){var l,n,a;const o=(null===(l=r.props)||void 0===l?void 0:l.paginationPageParam)||"page",i=(null===(n=r.props)||void 0===n?void 0:n.paginationPageSizeParam)||"pageSize",s=(null===(a=r.props)||void 0===a?void 0:a.paginationParamType)||"query",c=r;e.beforeFetch=(e,{api:r})=>{var l;const n=null==c||null===(l=c.props)||void 0===l?void 0:l.pagination;if(n&&"object"==typeof n){const t=n.current||1,r=n.pageSize||10;"query"===s?e.query={...e.query||{},[o]:t,[i]:r}:e.data={...e.data||{},[o]:t,[i]:r}}if(t&&"function"==typeof t)try{const o=t(e,{api:r});return o&&"function"==typeof o.then?o.catch(e=>(console.error("[accTable] 原始 beforeFetch 钩子执行出错:",e),Promise.resolve())):o}catch(e){console.error("[accTable] 原始 beforeFetch 钩子执行出错:",e)}},e.beforeFetch._accTablePaginationHook=!0}}}},mergeProp(e){var t,o,r,l,n;const a=e.prop.props||{},i=e.rule;e.api;let s=(null===(t=i.props)||void 0===t?void 0:t.columns)||[];if("string"==typeof s)try{const e=JSON.parse(s);Array.isArray(e)&&(s=e)}catch(e){console.warn("accTable columns parse error:",e),s=[]}Array.isArray(s)||(s=[]);const c=s.filter(e=>!e||!e.hidden).map(t=>{const o={...t};if(void 0!==o.width&&null!==o.width&&""!==o.width&&"string"==typeof o.width){const e=Number(o.width);!isNaN(e)&&isFinite(e)&&o.width.trim()===String(e)&&(o.width=e)}const r=!0===o.titleTooltipEnabled;let l=null,n=null;if(r&&o.titleTooltipContent)if(j.String(o.titleTooltipContent))if(o.titleTooltipContent.trim().startsWith("function")||o.titleTooltipContent.trim().startsWith("("))try{l=R(o.titleTooltipContent)}catch(e){console.warn("[accTable] 解析列标题 Tooltip 内容函数失败:",e),n=o.titleTooltipContent}else n=o.titleTooltipContent;else j.Function(o.titleTooltipContent)&&(l=o.titleTooltipContent);if(r&&(l||n)){const t=o.title,r=l,a=n,i=e;o.title=()=>{let e=t;if(j.Function(t))try{e=t()}catch(t){console.warn("[accTable] 执行原始标题函数失败:",t),e=""}null==e&&(e="");let o="";if(r&&j.Function(r))try{const e=r();o=null!=e?String(e):""}catch(e){console.warn("[accTable] 执行列标题 Tooltip 内容函数失败:",e),o=""}else a&&(o=a);if(!o)return e;let l=null;return l=j.String(e)&&e.includes("<")?i.$render.vNode.h("span",{innerHTML:e}):e,i.$render.vNode.make("aTooltip",{},{title:()=>j.String(o)&&o.includes("<")?i.$render.vNode.h("div",{innerHTML:o,style:{maxWidth:"300px",wordBreak:"break-word"}}):o,default:()=>l})}}let s=null;if(o.formatter)if(j.String(o.formatter))try{s=R(o.formatter)}catch(e){console.warn("[accTable] 解析列格式化函数失败:",e)}else j.Function(o.formatter)&&(s=o.formatter);const c=!0===o.tooltipEnabled;let p=null;if(c&&o.tooltipContent)if(j.String(o.tooltipContent))try{p=R(o.tooltipContent)}catch(e){console.warn("[accTable] 解析列 Tooltip 内容函数失败:",e)}else j.Function(o.tooltipContent)&&(p=o.tooltipContent);const d=o.cellType&&["input","select","radio"].includes(o.cellType),u=s&&j.Function(s),h=c&&(p||j.String(o.tooltipContent));if(d||u||h){const t=o.cellType,r=o.dataIndex,l=o.cellProps||{};o.customRender=(()=>{const n=e,c=s,f=p,m=j.String(o.tooltipContent)?o.tooltipContent:null;return({text:e,record:s,index:p})=>{var y;const g=s&&r?s[r]:e,v=n.api||(null===(y=n.$handle)||void 0===y?void 0:y.api)||{};s||console.warn("[accTable] record 未定义,使用空对象");const b=s||{};if(d){let e=[];const c=o.cellOptions;if(Array.isArray(c)?e=c:c&&"object"==typeof c&&(e=Object.keys(c).map(e=>({label:e,value:c[e]}))),"input"===t)return n.$render.vNode.make("aInput",{value:g,"onUpdate:value":e=>{s&&r&&(s[r]=e,n.api&&n.api.form&&i.field&&(n.api.form[i.field]=a.dataSource))},placeholder:l.placeholder||"",disabled:l.disabled||!1,size:l.size||"small",...l});if("select"===t)return n.$render.vNode.make("aSelect",{value:g,"onUpdate:value":e=>{s&&r&&(s[r]=e,n.api&&n.api.form&&i.field&&(n.api.form[i.field]=a.dataSource))},placeholder:l.placeholder||"",disabled:l.disabled||!1,size:l.size||"small",...l},e.map(e=>n.$render.vNode.make("aSelectOption",{key:e.value,value:e.value,label:e.label})));if("radio"===t){const t=null!=g?g:void 0,o=e.map(e=>n.$render.vNode.h("aRadio",{key:e.value,value:e.value},{default:()=>e.label||e.value})),c=e=>{s&&r&&(s[r]=e,n.api&&n.api.form&&i.field&&(n.api.form[i.field]=a.dataSource),n.api&&n.api.sync&&n.api.sync(i))};return n.$render.vNode.h("aRadioGroup",{value:t,onChange:e=>{var t;const o="object"==typeof e&&void 0!==(null==e||null===(t=e.target)||void 0===t?void 0:t.value)?e.target.value:e;c(o)},disabled:l.disabled||!1,size:l.size||"small",...l},{default:()=>o})}}let w=e;if(u&&c)try{const e=c(b,v);null!=e&&(w=j.String(e)?e:String(e))}catch(t){console.warn("[accTable] 执行列格式化函数失败:",t),w=e}let C=null;if(C=j.String(w)&&w.includes("<")?n.$render.vNode.h("span",{innerHTML:w}):w,h){const e=b,t=v;return n.$render.vNode.make("aTooltip",{},{title:()=>{let o="";if(f&&j.Function(f))try{const r=f(e,t);o=null!=r?String(r):""}catch(e){console.warn("[accTable] 执行列 Tooltip 内容函数失败:",e),o=""}else m&&(o=m);return o?n.$render.vNode.h("div",{innerHTML:o,style:{maxWidth:"300px",wordBreak:"break-word"}}):null},default:()=>C})}return C}})()}return o});a.columns=c;let p=0,d=!0;if(c.forEach(e=>{if(void 0!==e.width&&null!==e.width&&""!==e.width){let t=e.width;if("string"==typeof t){const e=t.match(/^(\d+(?:\.\d+)?)/);if(!e)return void(d=!1);t=parseFloat(e[1])}"number"==typeof t&&t>0&&(p+=t)}else d=!1}),P(i.props,"scroll")){const e=i.props.scroll;if(e&&"object"==typeof e&&void 0===e.x&&p>0){const t=d?p+50:Math.max(p+50,800);a.scroll={...e,x:t}}else a.scroll=e}else if(p>0){const e=d?p+50:Math.max(p+50,800);a.scroll={x:e}}else a.scroll=void 0;if(!P(a,"dataSource")){var u,h;let e=i.value||(null===(u=i.props)||void 0===u?void 0:u.dataSource)||[];if("string"==typeof e&&(null===(h=i.effect)||void 0===h||!h.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=[]),a.dataSource=e}const f=e.effectData("fetch"),m=f&&!0===f.loading;var y;P(a,"loading")?a.loading=void 0!==(null===(y=i.props)||void 0===y?void 0:y.loading)?i.props.loading:m:a.loading=m;const g=null===(o=i.props)||void 0===o?void 0:o.pagination;if(!P(a,"pagination"))if(!1===g)a.pagination=!1;else if(g&&"object"==typeof g){const e={current:g.current||1,pageSize:g.pageSize||10,total:g.total||0,showSizeChanger:!1!==g.showSizeChanger,showQuickJumper:g.showQuickJumper||!1,showTotal:g.showTotal,...g};a.pagination=e}else a.pagination=!1;if(null!==(r=i.effect)&&void 0!==r&&r.fetch&&g&&"object"==typeof g&&void 0!==g.current){var v,b,w,C,S;const t=(null===(v=i.props)||void 0===v?void 0:v.paginationPageParam)||"page",o=(null===(b=i.props)||void 0===b?void 0:b.paginationPageSizeParam)||"pageSize",r=(null===(w=i.props)||void 0===w?void 0:w.paginationParamType)||"query";null===(C=i.props)||void 0===C||C.paginationResponseDataPath,null===(S=i.props)||void 0===S||S.paginationResponseTotalPath,a.pagination;const l=i.effect.fetch;if("object"==typeof l){const e=r,n=t,a=o,s=l.beforeFetch,c=i;s&&!0===s._accTablePaginationHook||(l.beforeFetch=(t,{api:o})=>{var r;const l=null==c||null===(r=c.props)||void 0===r?void 0:r.pagination;if(l&&"object"==typeof l){const o=l.current||1,r=l.pageSize||10;"query"===e?t.query={...t.query||{},[n]:o,[a]:r}:t.data={...t.data||{},[n]:o,[a]:r}}else console.warn("[accTable] 分页配置无效,无法添加分页参数:",{currentPagination:l,type:typeof l});if(s&&"function"==typeof s)try{const e=s(t,{api:o});return e&&"function"==typeof e.then?e.catch(e=>(console.error("[accTable] 原始 beforeFetch 钩子执行出错:",e),Promise.resolve())):e}catch(e){console.error("[accTable] 原始 beforeFetch 钩子执行出错:",e)}},l.beforeFetch._accTablePaginationHook=!0)}else console.warn("[accTable] fetch 配置不是对象类型:",{type:typeof l,originalFetch:l});const n=a.pagination||g;n&&"object"==typeof n&&(n._accTableHandlersSet||(n.onChange||(n.onChange=(t,o)=>{var r;null!==(r=i.props)&&void 0!==r&&r.pagination&&(i.props.pagination.current=t,i.props.pagination.pageSize=o),e.api.sync(i),setTimeout(()=>{e.api.refresh()},0)}),n.onShowSizeChange||(n.onShowSizeChange=(t,o)=>{var r;null!==(r=i.props)&&void 0!==r&&r.pagination&&(i.props.pagination.current=1,i.props.pagination.pageSize=o),e.api.sync(i),setTimeout(()=>{e.api.refresh()},0)}),n._accTableHandlersSet=!0,a.pagination||(a.pagination=n)))}if(null!==(l=i.effect)&&void 0!==l&&l.fetch&&null!==(n=i.props)&&void 0!==n&&n.pagination){const t=e.effectData("fetch");if(t&&t.value){var x,$;const e=(null===(x=i.props)||void 0===x?void 0:x.paginationResponseDataPath)||"data",o=(null===($=i.props)||void 0===$?void 0:$.paginationResponseTotalPath)||"total";try{const r=Fe(t.value,e);Array.isArray(r)&&(a.dataSource=r,i.value=r,i.props.dataSource=r);const l=Fe(t.value,o);"number"==typeof l&&i.props.pagination&&"object"==typeof i.props.pagination&&(i.props.pagination.total=l,a.pagination&&"object"==typeof a.pagination&&(a.pagination.total=l))}catch(e){console.warn("accTable parse response error:",e)}}}P(i.props,"bordered")&&(a.bordered=i.props.bordered),P(i.props,"size")&&(a.size=i.props.size),P(i.props,"rowKey")&&(a.rowKey=i.props.rowKey||"id"),P(i.props,"rowSelection")&&(a.rowSelection=i.props.rowSelection),P(i.props,"sticky")&&(a.sticky=i.props.sticky),P(i.props,"virtual")&&(a.virtual=i.props.virtual)},render:(e,t)=>t.$render.defaultRender(t,e)},{name:"tableForm"},{name:"fcTable"},{name:"exportExcel"},{name:"businessComponent",modelField:"modelValue",mergeProp(e){var t,o,r;const l=e.rule,n=e.prop.props||(e.prop.props={}),a=null===(t=e.inject)||void 0===t?void 0:t.$handle,i=e.id,s=null===(o=e.rule)||void 0===o?void 0:o.field,c=null==a?void 0:a.vm;console.warn("[fc-bc] ① parser.mergeProp",{ctxId:i,field:s,hasHandle:!!a,hasBcVm:!!c,ctxInjectKeys:e.inject?Object.keys(e.inject):"no inject"});const p=a||(null===(r=e.inject)||void 0===r?void 0:r.$handle),d=!0===(null==p?void 0:p.preview),u=a&&c?{...e.inject,businessComponentId:i,$bcVm:c,$handle:a,preview:d}:a?{...e.inject,businessComponentId:i,$handle:a,preview:d}:{...e.inject,preview:d};P(n,"formCreateInject")?n.formCreateInject={...n.formCreateInject,...u}:n.formCreateInject=u,e.prop.formCreateInject=u,console.warn("[fc-bc] ① parser 写入后 props.formCreateInject keys",{keys:Object.keys(n.formCreateInject||{}),hasBusinessComponentId:"businessComponentId"in(n.formCreateInject||{}),hasBcVm:"$bcVm"in(n.formCreateInject||{}),hasHandle:"$handle"in(n.formCreateInject||{})});const h=function(e){if(e.component&&"object"==typeof e.component)return e.component;const t=e.componentName;if(!t||"string"!=typeof t)return null;return De().get(t)||null}(l);if(h&&(e.prop.component=h),l.props&&"object"==typeof l.props){const e={...l.props};null!=e.props&&"object"==typeof e.props&&(Object.assign(e,e.props),delete e.props),Object.assign(n,e)}a&&c&&"function"!=typeof c.registerBusinessComponent&&(c.businessComponentRefs=c.businessComponentRefs||{},c.registerBusinessComponent=function(e,t){this.businessComponentRefs[e]=t,this.businessComponentIds=this.businessComponentIds||[],this.businessComponentIds.includes(e)||this.businessComponentIds.push(e)},c.unregisterBusinessComponent=function(e){this.businessComponentRefs&&delete this.businessComponentRefs[e]})},render:(e,t)=>t.prop.component?t.$render.defaultRender(t,e||[]):t.$render.vNode.h("div",{class:"fc-business-component-placeholder",style:{padding:"8px",color:"#999"}},"未找到业务组件: "+(t.rule.componentName||"(未设置 componentName)"))}];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",alert:"aAlert",aAlert:"aAlert",Alert:"aAlert",card:"aCard",aCard:"aCard",Card:"aCard",accTable:"aTable",accTableTable:"aTable",exportExcel:"ExportExcel"};function Be(e,t){P(e,t)&&j.String(e[t])&&(e[t]={[t]:e[t],show:!0})}function ze(e){return!1===e}function Ne(e){const t={...e};return delete t.children,t}var Me={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){P(e,t)&&!j.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)}),P(e,"beforeSubmit")&&j.String(e.beforeSubmit)&&(e.beforeSubmit=R(e.beforeSubmit)),P(e,"onSubmit")&&j.String(e.onSubmit)&&(e.onSubmit=R(e.onSubmit)),e),tidyRule:({prop:e})=>(Be(e,"title"),Be(e,"info"),e),mergeProp(e){var t,o;e.inject||(e.inject={}),e.inject.$handle||(e.inject.$handle=this.$handle);const r={info:{type:"popover",placement:"topLeft",icon:"QuestionCircleOutlined"},title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach(t=>{e.prop[t]=O([this.options[t]||{},e.prop[t]||{}],r[t])}),e.rule.componentStyle&&"object"==typeof e.rule.componentStyle&&(e._componentStyle=e.rule.componentStyle);const l=!0===this.$handle.preview,n=!0===(null===(t=e.rule.props)||void 0===t?void 0:t.readOnly)||!0===(null===(o=e.prop.props)||void 0===o?void 0:o.readOnly);var a;(l||n)&&("upload"===e.rule.type?e.prop.props&&(e.prop.props.disabled=!0):"inputNumber"===e.rule.type?e.prop.props&&(e.prop.props.readOnly=!0,e.prop.props.readonly=!0,delete e.prop.props.placeholder):"fcEditor"===e.rule.type?e.prop.props&&(e.prop.props.readOnly=!0,delete e.prop.props.placeholder,delete e.prop.props.height):"input"===e.rule.type&&"textarea"===(null===(a=e.prop.props)||void 0===a?void 0:a.type)?e.prop.props&&(e.prop.props.readOnly=!0,e.prop.props.autoSize=!0,delete e.prop.props.rows,delete e.prop.props.placeholder,e.prop.props.showCount=!1):"select"===e.rule.type?e.prop.props&&(e.prop.props.disabled=!0,delete e.prop.props.placeholder):"input"===e.rule.type?e.prop.props&&n?(e.prop.props.readOnly=!0,delete e.prop.props.placeholder,e.prop.props.showCount=!1):e.prop.props&&l&&("number"===e.prop.props.type&&(e.prop.props.readOnly=!0),delete e.prop.props.placeholder,e.prop.props.showCount=!1):"datePicker"!==e.rule.type&&"timePicker"!==e.rule.type&&"timeRangePicker"!==e.rule.type&&"rangePicker"!==e.rule.type&&"cascader"!==e.rule.type||e.prop.props&&("cascader"===e.rule.type&&(e.prop.props.disabled=!0),delete e.prop.props.placeholder));if(e.parent&&e.parent.rule){const t=e.parent.rule.type,o=e.parent.rule._menu;"flex"!==t&&"a-flex"!==t&&"flex"!==(null==o?void 0:o.name)&&"space"!==t&&"a-space"!==t&&"space"!==(null==o?void 0:o.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,o=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){o(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,o=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||"",l=null==t?void 0:t.onVisibleChange;e.prop.props.preview={...t,visible:t.visible||!1,src:t.src||r,onVisibleChange:(e,n)=>(e&&!n&&o(t.src||r),!(!l||"function"!=typeof l)&&l.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()},"*")},o=e.prop.props.src||"";e.prop.props.preview={visible:!1,src:o,onVisibleChange:(e,r)=>{if(e&&!r)return t(o),!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,o)=>new Promise((e,r)=>t(o,t=>{t?r(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:o}=this,r=this.options.form;E(this.rule,{key:e,ref:t,class:[r.className,r.class,"form-create",this.$handle.preview?"is-preview":""]}),E(this.rule.props,{model:o.formData})},render(e){return e.slotLen()&&!this.$handle.preview&&e.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,ze(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap(e,t){const o=e.prop,r=`${this.key}${e.key}`,l=o.col,n=this.isTitle(o)&&!1!==o.wrap.title,{layout:a,col:i}=this.rule.props,s=o.wrap.class;delete o.wrap.class,delete o.wrap.title;let c=!1;if(e.parent&&e.parent.rule){const t=e.parent.rule.type,o=e.parent.rule._menu;"flex"!==t&&"a-flex"!==t&&"flex"!==(null==o?void 0:o.name)&&"space"!==t&&"a-space"!==t&&"space"!==(null==o?void 0:o.name)||(c=!0)}const p=ze(o.wrap.show)?t:this.$r(O([o.wrap,{props:{...Ne(o.wrap||{}),hasFeedback:o.hasFeedback||!1,name:e.id,rules:e.injectValidate(),..."horizontal"!==a?{labelCol:{},wrapperCol:{}}:{}},class:this.$render.mergeClass(s||o.className,"fc-form-item"),key:r+"fi",ref:e.wrapRef,type:"formItem"}]),{default:()=>t,...n?{label:()=>this.makeInfo(o,r,e)}:{}});return"inline"===a||ze(i)||ze(l.show)||c?p:this.makeCol(o,r,[p],e)},isTitle(e){if(!1===this.options.form.title)return!1;const t=e.title;return!(!t.title&&!t.native||ze(t.show))},makeInfo(e,t,o){var r,l;const n={...e.title},a={...e.info};if(!1===this.options.form.title)return!1;if(!n.title&&!n.native||ze(n.show))return;const i="tooltip"===a.type;const s=this.getSlot("title"),c=[s?s({title:null===(r=o.refRule)||void 0===r||null===(r=r.__$title)||void 0===r?void 0:r.value,rule:o.rule,options:this.options}):null===(l=o.refRule)||void 0===l||null===(l=l.__$title)||void 0===l?void 0:l.value];if(!ze(a.show)&&(a.info||a.native)&&!ze(a.icon)){const e={type:a.type||"popover",props:Ne(a),key:t+"pop"};delete e.props.icon,delete e.props.show,delete e.props.info,delete e.props.align,delete e.props.native;const r=i?"title":"content";var p;if(a.info&&!P(e.props,r))e.props[r]=null===(p=o.refRule)||void 0===p||null===(p=p.__$info)||void 0===p?void 0:p.value;c["left"!==a.align?"unshift":"push"](this.$r(O([a,e]),{[n.slot||"default"]:()=>this.$r({type:!0===a.icon?"QuestionCircleOutlined":a.icon||"",props:{type:!0===a.icon?"QuestionCircleOutlined":a.icon},key:t+"i"})}))}const d=O([n,{props:Ne(n),key:t+"tit",class:"fc-form-title",type:n.type||"span"}]);return delete d.props.show,delete d.props.title,delete d.props.native,this.$r(d,c)},makeCol(e,t,o,r){const l=e.col,n=(null==r?void 0:r._componentStyle)||{};return this.$r({class:this.$render.mergeClass(l.class,"fc-form-col"),type:"col",props:l||{span:24},style:n,key:t+"col"},o)},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(ze(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),ze(this.options.resetBtn.show)||e.push(this.makeResetBtn()),!e.length)return;let{labelCol:t,wrapperCol:o,layout:r}=this.rule.props;"horizontal"!==r&&(t=o={});const l=this.$r({type:"formItem",class:"fc-form-item fc-form-footer",key:this.key+"fb",props:{labelCol:t,wrapperCol:o,label:" ",colon:!1}},e);return"inline"===r?l:this.$r({type:"col",class:"fc-form-col",props:{span:24},key:this.key+"fc"},[l])},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 Ke={};var Le;!function(e){["treeSelect","upload","frame","autoComplete","cascader","datePicker","frame","inputNumber","inputPassword","radio","rate","switch","rate","slider","timePicker"].reduce((e,t)=>(e[t]=V(t),e),e),e.auto=e.autoComplete,e.number=e.inputNumber,e.time=e.timePicker,e.password=e.inputPassword}(Ke),function(e){e.sliderRange=V("slider",{range:!0})}(Ke),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,o)=>(e[o]=V("frame",e=>e.props({type:t[o][0],maxLength:t[o][1]})),e),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(Ke),function(e){const t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((e,o)=>(e[o]=V("upload",e=>e.props({uploadType:t[o][0],maxLength:t[o][1]})),e),e),e.uploadImage=e.image,e.uploadFile=e.file}(Ke),(Le=Ke).selectMultiple=V("select",{mode:"multiple"}),Le.selectTags=V("select",{mode:"tags"}),Le.selectCombobox=V("select",{mode:"combobox"}),function(e){e.cusStoreSelect=V("cusStoreSelect"),e.storeSelect=e.cusStoreSelect}(Ke),function(e){e.cusUserSelect=V("cusUserSelect"),e.userSelect=e.cusUserSelect}(Ke),function(e){e.text=V("text")}(Ke),function(e){e.flex=V("flex")}(Ke),function(e){e.space=V("space")}(Ke),function(e){e.spin=V("spin")}(Ke);const qe=new class{mobile(e,t=!1){if(!e)return!1;const o=String(e).trim();return t?/^1[3-9]\d{9}$/.test(o):/^1\d{10,11}$/.test(o)}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 o=String(e).trim().toUpperCase();if(!/^\d{17}[\dX]$/.test(o))return!1;if(!t)return!0;const r=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let l=0;for(let e=0;e<17;e++)l+=parseInt(o[e])*r[e];const n=l%11;return o[17]===["1","0","X","9","8","7","6","5","4","3","2"][n]}url(e,t={}){if(!e)return!1;const o=String(e).trim(),{requireProtocol:r=!1}=t;return r?/^https?:\/\/.+\..+/.test(o):/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/.test(o)}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 o=Number(e);if(isNaN(o))return!1;const{integer:r=!1,positive:l=!1,negative:n=!1,min:a,max:i}=t;return!(r&&!Number.isInteger(o))&&(!(l&&o<=0)&&(!(n&&o>=0)&&(!(void 0!==a&&o<a)&&!(void 0!==i&&o>i))))}length(e,t={}){if(null==e)return!1;const o=String(e),{min:r,max:l,len:n}=t;return void 0!==n?o.length===n:!(void 0!==r&&o.length<r)&&!(void 0!==l&&o.length>l)}pattern(e,t){if(!e||!t)return!1;const o=String(e);let r;if(t instanceof RegExp)r=t;else try{r=new RegExp(t)}catch(e){return!1}return r.test(o)}date(e,t={}){if(!e)return!1;let o;if(e instanceof Date)o=e;else if(o=new Date(e),isNaN(o.getTime()))return!1;const{min:r,max:l}=t;if(r){if(o<(r instanceof Date?r:new Date(r)))return!1}if(l){if(o>(l instanceof Date?l:new Date(l)))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 o=String(e);return t?/^[a-zA-Z]+$/.test(o):/^[a-z]+$/i.test(o)}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,o=!1){return o?e===t:e==t}notEqual(e,t,o=!0){return!this.equal(e,t,o)}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 o=String(e).trim(),{min:r=3,max:l=20}=t;return!(o.length<r||o.length>l)&&/^[a-zA-Z0-9_]+$/.test(o)}password(e,t={}){if(!e)return!1;const o=String(e),{min:r=6,max:l=20,requireNumber:n=!1,requireLetter:a=!1,requireSpecial:i=!1}=t;return!(o.length<r||o.length>l)&&(!(n&&!/\d/.test(o))&&(!(a&&!/[a-zA-Z]/.test(o))&&!(i&&!/[!@#$%^&*(),.?":{}|<>]/.test(o))))}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 Ue=null;try{var He,Ge,We;if(null!==(He=parent)&&void 0!==He&&null!==(He=He.window)&&void 0!==He&&He.location)Ue="https://zxgj.zhixianai.com"==(null===(Ge=parent)||void 0===Ge||null===(Ge=Ge.window)||void 0===Ge?void 0:Ge.location.origin)||"http://zxgj.zhixianai.com"==(null===(We=parent)||void 0===We||null===(We=We.window)||void 0===We?void 0:We.location.origin)}catch(e){Ue=null}const Ye="undefined"!=typeof location?location.protocol:"https:",Je="undefined"!=typeof location&&location.host&&location.host.lastIndexOf("localhost")>-1,Qe="undefined"!=typeof location&&location.host&&location.host.lastIndexOf("sandbox")>-1||Je?"sandbox-":"",Ze={basicApi:`${Ye}//${Qe}zxgj.zhixianai.com/api/`,goodsApi:`${Ye}//${Qe}goods-api.zhixianai.com`,manageApi:`${Ye}//${Qe}manage-api.zhixianai.com`,billApi:`${Ye}//${Qe}finance.zhixianai.com`,orderApi:`${Ye}//${Qe}order-api.zhixianai.com`,payApi:`${Ye}//${Qe}pay.zhixianai.com`,operationApi:`${Ye}//${Qe}operation-api.zhixianai.com/api`,merchantApi:`${Ye}//${Qe}merchant-api.zhixianai.com/api`,ossApi:`${Ye}//${Qe}upload.zhixianai.com`,marketingApi:`${Ye}//${Qe}marketing-api.zhixianai.com/api`,customApi:`${Ye}//${Qe}custom-service.zhixianai.com/api`,engineApi:`${Ye}//${Qe}flow.zhixianai.com/api`,messageApi:`${Ye}//${Qe}message.zhixianai.com/api`,warehouseApi:`${Ye}//${Qe}data-warehouse.zhixianai.com/api`,materielApi:`${Ye}//${Qe}materiel-api.zhixianai.com/api`,crawlerApi:`${Ye}//${Qe}crawler.zhixianai.com/api`,imgUrl:"https://s1.zhixianai.com"};function Xe(e,t){const o=Ze[e]||"";if(!o)return t;const r=t.startsWith("/")?t:"/"+t;return o.replace(/\/$/,"")+r}function et(e){if(!e||"object"!=typeof e)return e;if("get"===(e.method||"get").toLowerCase()&&null!=e.params&&"object"==typeof e.params){const t={...e};return t.query=null!=t.query?{...t.query,...t.params}:t.params,delete t.params,t}return e}function tt(e,t){return j.Boolean(e)?e={show:e}:j.Undef(e)||j.Object(e)||(e={show:t}),e}const ot=new Map;let rt=0,lt=!1;function nt(e,t){var o,r,l,n;const a="api-"+(null!==(o=null!==(r=null===(l=t.fc)||void 0===l?void 0:l.id)&&void 0!==r?r:null===(n=t.fc)||void 0===n?void 0:n.name)&&void 0!==o?o:`fc-${Date.now()}-${Math.random()}`);return ot.has(a)||ot.set(a,new Map),lt||(window.addEventListener("message",e=>{const t=e.data;if(!t||"object"!=typeof t||!t.messageId)return;const o=t.messageId;let r=!1;for(const[e,l]of ot.entries()){const n=l.get(o);if(n){r=!0;try{let r=t;return void 0!==t.data&&(r=t.data),n(r,t),l.delete(o),void(0===l.size&&ot.delete(e))}catch(t){console.error("postMessageToParent: 执行回调失败",o,t),l.delete(o),0===l.size&&ot.delete(e)}}}if(!r&&o){const e=[];for(const[,t]of ot.entries())e.push(...t.keys());console.warn("postMessageToParent: 未找到匹配的回调函数",{receivedMessageId:o,availableMessageIds:e,totalCallbacks:e.length,apiInstances:ot.size})}}),lt=!0),{formEl:()=>t.$manager.form(),wrapEl(e){const o=t.getFieldCtx(e);if(o)return t.vm.refs[o.wrapRef]},validate:o=>(console.warn("[fc-bc] ④ api.validate 入口被调用"),new Promise((r,l)=>{const n=e.children,a=[t.$manager.validate()];n.filter(e=>!e.isScope).forEach(e=>{a.push(e.validate())});const i=t.vm,s=i&&i.businessComponentRefs||t.businessComponentRefs||{},c=Object.keys(s);console.warn("[fc-bc] ④ api.validate 读注册表",{hasH:!!t,hasHvm:!(null==t||!t.vm),bcVmRefsKeys:null!=i&&i.businessComponentRefs?Object.keys(i.businessComponentRefs):"none",hRefsKeys:null!=t&&t.businessComponentRefs?Object.keys(t.businessComponentRefs):"none",bcIdsCount:c.length,bcIds:c}),c.forEach(e=>{const t=s[e];t&&"function"==typeof t.validate&&a.push(t.validate())}),Promise.all(a).then(()=>{r(!0),o&&o(!0)}).catch(r=>{l(r),o&&o(r),t.vm.emit("validate-fail",r,{api:e}),t.emitEvent("validate-fail",r,{api:e})})})),validateField:(o,r)=>new Promise((l,n)=>{const a=t.getFieldCtx(o);if(!a)return;const i=t.subForm[a.id],s=[t.$manager.validateField(a.id)];B(i).filter(e=>!e.isScope).forEach(e=>{s.push(e.validate())}),Promise.all(s).then(()=>{l(null),r&&r(null)}).catch(l=>{n(l),r&&r(l),t.vm.emit("validate-field-fail",l,{field:o,api:e})})}),clearValidateState(o,r=!0){e.helper.tidyFields(o).forEach(e=>{r&&this.clearSubValidateState(e),t.getCtxs(e).forEach(e=>{t.$manager.clearValidateState(e)})})},clearSubValidateState(o){e.helper.tidyFields(o).forEach(e=>{t.getCtxs(e).forEach(e=>{const o=t.subForm[e.id];o&&(Array.isArray(o)?o.forEach(e=>{e.clearValidateState()}):o&&o.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:(o={})=>{let r=tt(t.options.submitBtn,!0);E(r,o),t.options.submitBtn=r,e.refreshOptions()},resetBtnProps:(o={})=>{let r=tt(t.options.resetBtn,!1);E(r,o),t.options.resetBtn=r,e.refreshOptions()},submit:(o,r)=>(console.warn("[fc-bc] api.submit 入口被调用"),new Promise((l,n)=>{(!1===t.options.validateOnSubmit?Promise.resolve():e.validate()).then(()=>{const o=t.vm,r=o&&o.businessComponentRefs||t.businessComponentRefs||{},l=Object.keys(r).map(e=>{const t=r[e];try{const e=t&&"function"==typeof t.onSubmitPhase?t.onSubmitPhase():void 0;return Promise.resolve(e)}catch(e){return Promise.reject(e)}});return Promise.all(l).then(()=>e.formData())}).then(e=>Promise.resolve(t.beforeSubmit(e)).then(()=>e)).then(r=>{j.Function(o)&&_(()=>o(r,e)),j.Function(t.options.onSubmit)&&_(()=>t.options.onSubmit(r,e)),t.vm.emit("submit",r,e),l(r)}).catch(t=>{j.Function(r)&&_(()=>r(e,t)),n(t)}).catch((...t)=>{j.Function(r)&&_(()=>r(e,...t)),n(...t)})})),request:t=>("string"==typeof t&&(t={action:t}),e.fetch(t)),getStoreInfo(t){if(!t)return Promise.resolve(null);const o=function(e={}){const{storeId:t,...o}=e;return{action:Xe("merchantApi","/storeInfo/page"),method:"post",data:{current:1,size:1,params:{storeId:null!=t?t:o.storeId},...o},dataType:"json"}}({storeId:t});return e.fetch(o).then(e=>{var t,o;return 0===(null==e?void 0:e.code)&&null!==(t=null==e||null===(o=e.data)||void 0===o||null===(o=o.records)||void 0===o?void 0:o[0])&&void 0!==t?t:null}).catch(e=>Promise.reject(e))},getStorePlatformStats(t,o){if(!t||null==o||""===o)return Promise.resolve(null);const r=et(function(e,t){return{action:Xe("merchantApi","/storeInfo/getStorePlatformStats"),method:"post",data:{storeId:null!=e?e:null,platformId:null!=t?t:null},dataType:"json"}}(t,o));return e.fetch(r).then(e=>{var t;return 0===(null==e?void 0:e.code)&&null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}).catch(e=>Promise.reject(e))},checkStoreAuthSuccess(t,o){const r=function(e,t){const o=Array.isArray(t)?t:[];return{action:Xe("merchantApi","/rpc/store/flowable/checkStoreAuthSuccess"),method:"post",data:{storeId:null!=e?e:null,platformIds:o},dataType:"json"}}(t,o);return e.fetch(r).then(e=>0===(null==e?void 0:e.code)?e.data:null)},getBuildStoreApplyDetail(t){if(!t)return Promise.resolve(null);const o=et((r=t,{action:Xe("merchantApi","/store/getApplyDetail"),method:"get",params:{id:null!=r?r:null}}));var r;return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)&&null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}).catch(e=>Promise.reject(e))},getScatterRecycleApplyDetail(t){if(null==t||""===t)return Promise.resolve(null);const o=et(function(e){if(null==e||""===e)return{action:Xe("merchantApi","/store/pc/scatterRecycle/getApplyDetail"),method:"post",data:{id:null},dataType:"json"};const t=Number(e),o=Number.isNaN(t)?e:t;return{action:Xe("merchantApi","/store/pc/scatterRecycle/getApplyDetail"),method:"post",data:{id:o},dataType:"json"}}(t));return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)&&null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}).catch(e=>Promise.reject(e))},checkNearbyBrandOrderRule(t){const o=function(e={}){var t,o,r,l,n,a;return{action:Xe("merchantApi","/rpc/store/storeInfo/checkNearbyBrandOrderRule"),method:"post",data:{applyId:null!==(t=e.applyId)&&void 0!==t?t:null,brandId:null!==(o=e.brandId)&&void 0!==o?o:null,longitude:null!==(r=e.longitude)&&void 0!==r?r:null,latitude:null!==(l=e.latitude)&&void 0!==l?l:null,maxDistanceKm:null!==(n=e.maxDistanceKm)&&void 0!==n?n:3,minValidOrderNum:null!==(a=e.minValidOrderNum)&&void 0!==a?a:100},dataType:"json"}}(t||{});return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"checkNearbyBrandOrderRule 请求失败"))}).catch(e=>Promise.reject(e))},storeBindingPage(t={},o={current:1,size:1}){var r,l;const n=function(e={}){var t,o,r;return{action:Xe("merchantApi","/store/storeBinding/pageStoreBinding"),method:"post",data:{current:null!==(t=e.current)&&void 0!==t?t:1,size:null!==(o=e.size)&&void 0!==o?o:10,params:null!==(r=e.params)&&void 0!==r?r:{}},dataType:"json"}}({current:null!==(r=o.current)&&void 0!==r?r:1,size:null!==(l=o.size)&&void 0!==l?l:1,params:t||{}});return e.fetch(n).then(e=>{var t,o;return 0===(null==e?void 0:e.code)?null!==(t=null==e||null===(o=e.data)||void 0===o||null===(o=o.records)||void 0===o?void 0:o[0])&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"storeBindingPage 请求失败"))}).catch(e=>Promise.reject(e))},getGoodsMonitorListV2(t){const o=function(e={}){return{action:Xe("goodsApi","/goodsMonitor/listV2"),method:"post",data:{...e},dataType:"json"}}(t||{});return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"goodsMonitor listV2 失败"))}).catch(e=>Promise.reject(e))},getAbnormalProductTotalByStoreId(t){if(null==t||""===t)return Promise.resolve(null);const o=et(function(e){return{action:Xe("goodsApi","/abnormal/product/getTotalNumberAbnormalProductByStoreId"),method:"get",query:{storeId:null!=e?e:void 0}}}(t));return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"异常商品总数失败"))}).catch(e=>Promise.reject(e))},pageStoreSetting(t={}){const o=function(e={}){return{action:Xe("merchantApi","/storeSetup/pageStoreSetting"),method:"post",data:e,dataType:"json"}}(t);return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"pageStoreSetting 请求失败"))}).catch(e=>Promise.reject(e))},queryStoreOrderConfigPageV2(t={}){const o=function(e={}){return{action:Xe("orderApi","/store/order/queryStoreOrderConfigPageV2"),method:"post",data:e,dataType:"json"}}(t);return e.fetch(o).then(e=>{var t;return 200===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"queryStoreOrderConfigPageV2 请求失败"))}).catch(e=>Promise.reject(e))},throttle(e,t){let o=0;return function(...r){const l=this,n=Date.now();n-o>=(t||0)&&(o=n,e.call(l,...r))}},debounce(e,t){let o=null;return function(...r){const l=this;null!==o&&clearTimeout(o),o=setTimeout(()=>{e.call(l,...r)},t||0)}},$validator:qe,$moment:z,$dayjs:D,previewMode(t=!0){e.updateOptions({preview:!!t}),e.refresh()},isPreviewMode:()=>!0===t.preview,postMessageToParent(e,t,o,r="api"){let l="CUSTOM_MESSAGE",n={},i=null;if("string"==typeof e)l=e,n=t||{},i="function"==typeof o?o:null;else{if("object"!=typeof e||null===e)return console.error("postMessageToParent: 第一个参数必须是字符串(messageType)或对象(data)"),null;n=e,i="function"==typeof t?t:null,l="string"==typeof o?o:"CUSTOM_MESSAGE"}const s=`${r}-${l}-${Date.now()}-${++rt}`,c={type:l,messageId:s,...function e(t){if(null==t)return t;try{return JSON.parse(JSON.stringify(t))}catch(o){if(console.warn("postMessageToParent: 数据序列化失败,尝试递归处理",o),Array.isArray(t))return 0===t.length?[]:t.map(t=>e(t));if("object"==typeof t){const o={};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r))try{o[r]=e(t[r])}catch(e){console.warn("postMessageToParent: 跳过无法序列化的属性: "+r,e)}return o}return t}}(n)};if(j.Function(i)){ot.has(a)||ot.set(a,new Map);const e=ot.get(a);e?(e.has(s)&&console.warn("postMessageToParent: 消息ID已存在,将覆盖旧的回调",s),e.set(s,i)):console.error("postMessageToParent: 无法获取回调存储,apiInstanceId:",a)}if(window.parent&&window.parent!==window)try{window.parent.postMessage(c,"*")}catch(e){if(j.Function(i)){const e=ot.get(a);e&&e.delete(s)}throw e}else if(console.warn("postMessageToParent: 当前不在 iframe 环境中,无法向父窗口发送消息",l,s),j.Function(i)){const e=ot.get(a);e&&e.delete(s)}return s}}}var at={autoComplete:"value",cascader:"value",inputNumber:"value",inputPassword:"value",textarea:"value",rate:"value",slider:"value",treeSelect:"value",switch:"checked",aTabs:"activeKey",cusStoreSelect:"modelValue",cusUserSelect:"modelValue",businessComponent:"modelValue"};const it={name:"required",load(e,t,o){const r=function(e){return j.Boolean(e)?{required:e}:j.String(e)?{message:e}:j.Undef(e)?{required:!1}:j.Function(e)?{validator:e}:j.Object(e)?e:{}}(e.getValue());if(!1===r.required)e.clearProp(),o.clearValidateState([t.field]);else{var l;const n={required:!0,validator:(e,t)=>new Promise((e,o)=>{j.empty(t)?o(n.message):e()}),...r},a=null===(l=t.__fc__.refRule)||void 0===l||null===(l=l.__$title)||void 0===l?void 0:l.value;if(n.message){const e=n.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);e&&(n.message=o.t(e[1],{title:a}))}else n.message=o.t("required",{title:a})||a+("en"===o.getLocale()?" is required":"不能为空");e.getProp().validate=[n]}o.sync(t)},watch(...e){it.load(...e)}};function st(e){const t=De();e.businessComponents=t,e.registerBusinessComponent=function(e,t){return De().set(e,t),this};const o=Object.getPrototypeOf(e);o&&(o.businessComponents=t,o.registerBusinessComponent=e.registerBusinessComponent),e.componentAlias(_e),Object.keys(at).forEach(t=>{e.setModelField(t,at[t])}),me.forEach(t=>{e.component(t.name,t)}),e.register(it),Ee.forEach(t=>{e.parser(t)}),Object.keys(Ke).forEach(t=>{e.maker[t]=Ke[t]}),"undefined"!=typeof window&&window.antd&&e.useApp((e,t)=>{t.use(window.antd)})}const ct=I({ui:'"ant-design-vue"',version:'"3.4.56"',manager:Me,install:st,extendApi:nt,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});ct.businessComponents=De(),ct.registerBusinessComponent=function(e,t){return Oe(e,t),this},"undefined"!=typeof window&&(window.formCreate=ct);const pt=ct.maker;export{ct as default,pt as maker,Oe as registerBusinessComponent};
|
|
7
|
+
import e from"@longhongguo/component-antdv-upload/src/index";import t from"@form-create/component-antdv-frame/src/index";import o from"@form-create/component-antdv-group/src/index";import r from"@form-create/component-subform/src/index";import{openBlock as l,createElementBlock as n,createElementVNode as a,defineComponent as i,Fragment as s,createCommentVNode as c,normalizeClass as p,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,mergeProps as x,toRef as $,watch as k,nextTick as A}from"vue";import j,{hasProperty as P}from"@form-create/utils/lib/type";import{message as T}from"ant-design-vue";import{parseFn as R}from"@form-create/utils/lib/json";import F from"@form-create/utils/lib/deepset";import I,{creatorFactory as V}from"@longhongguo/form-create-core/src/index";import D from"dayjs";import O from"@form-create/utils/lib/mergeprops";import E from"@form-create/utils/lib/extend";import"@longhongguo/component-antdv-upload/dist/index.css";import{invoke as _}from"@longhongguo/form-create-core/src/frame/util";import B from"@form-create/utils/lib/toarray";import z from"moment";var N={name:"QuestionCircleOutlined"};const M={class:"anticon"};N.render=function(e,t,o,r,i,s){return l(),n("span",M,[...t[0]||(t[0]=[a("svg",{height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a("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"}),a("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=i({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 o="object"==typeof t?t[this.valueKey]:t;return o===e||String(o)===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 o=this.currentValue;if(Array.isArray(o)){const t=o.filter(t=>{if("object"==typeof t&&null!==t){return(t[this.valueKey]||t.value)!==e}return t!==e}),r=this.sourceItems.filter(e=>!t.some(t=>t[this.valueKey]===e[this.valueKey]));this.$emit("update:sourceItems",r),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 L=["tabindex"],q=["title"],U={key:1,class:"fc-cus-select-selection-placeholder"},H={key:3,class:"fc-cus-select-arrow"},G=["tabindex"],W={class:"fc-cus-select-selection-overflow"},Y=["title"],J={class:"fc-cus-select-selection-item-content"},Q=["onClick"],Z={key:0,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},X={class:"fc-cus-select-selection-item"},ee={class:"fc-cus-select-selection-item-content"},te={key:1,class:"fc-cus-select-selection-placeholder"},oe={key:1,class:"fc-cus-select-arrow"};K.render=function(e,t,o,r,i,f){return l(),n(s,null,[c(" 单个展示模式 "),e.multiple?(l(),n(s,{key:1},[c(" 多个展示模式 "),a("div",{class:p(["fc-cus-select fc-cus-select-multiple",{"fc-cus-select-disabled":e.disabled}]),style:d(e.style),tabindex:e.disabled?-1:0},[a("div",{class:p(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[a("div",W,[c(" 显示的 tags "),(l(!0),n(s,null,h(e.displayItems,(o,r)=>(l(),n("div",{key:r,class:"fc-cus-select-selection-overflow-item",style:{opacity:"1"}},[a("span",{class:"fc-cus-select-selection-item",title:o.label},[a("span",J,u(o.label),1),a("span",{class:"fc-cus-select-selection-item-remove",onClick:t=>e.removeItem(o.value,t)},[...t[4]||(t[4]=[a("span",{role:"img","aria-label":"close",class:"anticon anticon-close"},[a("svg",{focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[a("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,Q)],8,Y)]))),128)),c(" 折叠提示 "),e.remainingCount>0?(l(),n("div",Z,[a("span",X,[a("span",ee," +"+u(e.remainingCount),1)])])):c("v-if",!0),c(" 空值占位符 "),e.hasValue?c("v-if",!0):(l(),n("span",te,u(e.placeholder||"请选择"),1))]),e.showClear?(l(),n("span",{key:0,class:"fc-cus-select-clear",onClick:t[1]||(t[1]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[5]||(t[5]=[a("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[a("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[a("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)])])):(l(),n("span",oe,[...t[6]||(t[6]=[a("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[a("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[a("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,G)],2112)):(l(),n("div",{key:0,class:p(["fc-cus-select fc-cus-select-single",{"fc-cus-select-disabled":e.disabled}]),style:d(e.style),tabindex:e.disabled?-1:0},[a("div",{class:p(["fc-cus-select-selector",{"fc-cus-select-selector-borderless":!e.bordered}])},[e.displayValue?(l(),n("span",{key:0,class:"fc-cus-select-selection-item",title:e.displayLabel},u(e.displayLabel),9,q)):(l(),n("span",U,u(e.placeholder||"请选择"),1)),e.showClear?(l(),n("span",{key:2,class:"fc-cus-select-clear",onClick:t[0]||(t[0]=(...t)=>e.clearValue&&e.clearValue(...t))},[...t[2]||(t[2]=[a("span",{role:"img","aria-label":"close-circle",class:"anticon anticon-close-circle"},[a("svg",{focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","fill-rule":"evenodd",viewBox:"64 64 896 896"},[a("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)])])):(l(),n("span",H,[...t[3]||(t[3]=[a("span",{role:"img","aria-label":"down",class:"anticon anticon-down"},[a("svg",{focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},[a("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,L))],2112)};var re=i({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 o="object"==typeof t?t[this.valueKey]:t;e.set(o,t)}),this.internalOptions.forEach(t=>{const o="object"==typeof t?t[this.valueKey]:t;e.set(o,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 o in e)if(Object.prototype.hasOwnProperty.call(e,o))try{t[o]=this.serializeForPostMessage(e[o])}catch(e){console.warn("CusStoreSelect: 跳过无法序列化的属性: "+o,e)}return t}return e}},handleClick(){if(this.disabled)return;if(this.formCreateInject&&this.formCreateInject.preview)return;const e=`store-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let o=null;t.length>0&&(o=t);const r=null==o?null:this.serializeForPostMessage(o),l={...this.extraQuery};this.extraQueryFn&&Object.assign(l,this.extraQueryFn());const n={type:"OPEN_STORE_SELECT",field:this.field||"",multiple:this.multiple,currentValue:r,valueKey:this.valueKey,labelKey:this.labelKey,extraQuery:l,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(n,"*")}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:o,sourceItems:r,messageId:l}=t;if(e!==this.field)return;const n=this.pendingCallbacks[l];n&&(n(o,r),delete this.pendingCallbacks[l])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const o="object"==typeof e?e[this.valueKey]:e;t.set(o,e)}),e.forEach(e=>{const o="object"==typeof e?e[this.valueKey]:e;t.set(o,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)}})})}}});re.render=function(e,t,o,r,a,i){const s=f("CusSelect");return l(),n("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 le=i({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 o="object"==typeof t?t[this.valueKey]:t;e.set(o,t)}),this.internalOptions.forEach(t=>{const o="object"==typeof t?t[this.valueKey]:t;e.set(o,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 o in e)if(Object.prototype.hasOwnProperty.call(e,o))try{t[o]=this.serializeForPostMessage(e[o])}catch(e){console.warn("CusUserSelect: 跳过无法序列化的属性: "+o,e)}return t}return e}},handleClick(){if(this.disabled)return;if(this.formCreateInject&&this.formCreateInject.preview)return;const e=`user-select-${this.field||"default"}-${Date.now()}-${++this.messageId}`,t=Array.isArray(this.modelValue)?this.modelValue:[];let o=null;t.length>0&&(o=t);const r=null==o?null:this.serializeForPostMessage(o),l={...this.extraQuery};this.extraQueryFn&&Object.assign(l,this.extraQueryFn());const n={type:"OPEN_USER_SELECT",field:this.field||"",multiple:this.multiple,currentValue:r,valueKey:this.valueKey,labelKey:this.labelKey,selectType:this.selectType,extraQuery:l,messageId:e};if(window.parent&&window.parent!==window)try{window.parent.postMessage(n,"*")}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:o,sourceItems:r,messageId:l}=t;if(e!==this.field)return;const n=this.pendingCallbacks[l];n&&(n(o,r),delete this.pendingCallbacks[l])}},mergeOptions(e){if(!Array.isArray(e)||0===e.length)return;const t=new Map;this.internalOptions.forEach(e=>{const o="object"==typeof e?e[this.valueKey]:e;t.set(o,e)}),e.forEach(e=>{const o="object"==typeof e?e[this.valueKey]:e;t.set(o,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)}})})}}});le.render=function(e,t,o,r,a,i){const s=f("CusSelect");return l(),n("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 ne={name:"TableForm",emits:["change","add","delete","update:modelValue","select-change"],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,showIndexColumn:{type:Boolean,default:!0},showSelectColumn:{type:Boolean,default:!1},selectField:{type:String,default:"checked"},showOperationColumn:{type:Boolean,default:!0},headerBackgroundColor:{type:String,default:""},emptyText:{type:String,default:""}},watch:{modelValue:{handler(){this.updateTable()},deep:!0},"formCreateInject.preview":function(e){this.emptyRule.children[0].props.colspan=this.getEmptyColspan()},showIndexColumn(){this.loadRule(),this.updateTable()},showSelectColumn(){this.loadRule(),this.updateTable()},showOperationColumn(){this.loadRule(),this.updateTable()},headerBackgroundColor(){this.loadRule()},emptyText(){this.updateEmptyRule()}},data(){return{rule:[],trs:[],fapi:{},Form:g(this.formCreateInject.form.$form()),copyTrs:"",oldValue:"",selectedRows:new Set,emptyRule:{type:"tr",_isEmpty:!0,native:!0,subRule:!0,children:[{type:"td",style:{textAlign:"center"},native:!0,subRule:!0,props:{colspan:this.getEmptyColspan()},children:[this.emptyText||this.formCreateInject.t("dataEmpty")||"暂无数据"]}]}}},methods:{getEmptyColspan(){return this.columns.length+(this.showIndexColumn?1:0)+(this.showSelectColumn?1:0)+(this.showOperationColumn?this.formCreateInject.preview?0:1:0)},formChange(){this.updateValue()},updateValue(){const e=this.trs.map((e,t)=>{const o={...this.modelValue[t]||{},...this.fapi.getChildrenFormData(e)};return this.showSelectColumn&&(o[this.selectField]=this.selectedRows.has(t)),o}).filter(e=>{if(!this.filterEmptyColumn)return!0;if(null==e)return!1;let t=!1;return Object.keys(e).forEach(o=>{t=t||void 0!==e[o]&&""!==e[o]&&null!==e[o]}),t}),t=JSON.stringify(e);t!==this.oldValue&&(this.oldValue=t,this.$emit("update:modelValue",e),this.$emit("change",e))},setRawData(e,t){const o=this.trs[e];this.fapi.setChildrenFormData(o,t,!0)},updateTable(){const e=JSON.stringify(this.modelValue);this.oldValue!==e&&(this.oldValue=e,this.showSelectColumn&&(this.selectedRows.clear(),this.modelValue.forEach((e,t)=>{e&&!0===e[this.selectField]&&this.selectedRows.add(t)})),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,this.showSelectColumn&&this.updateSelectAllState())},updateEmptyRule(){const e=this.emptyText||this.formCreateInject.t("dataEmpty")||"暂无数据";this.emptyRule&&this.emptyRule.children&&this.emptyRule.children[0]&&(this.emptyRule.children[0].children=[e]),this.trs.forEach(t=>{t._isEmpty&&t.children&&t.children[0]&&(t.children[0].children=[e])}),this.rule[0]&&this.rule[0].children&&this.rule[0].children[1]&&(this.rule[0].children[1].children=this.trs)},addEmpty(){this.trs.length&&this.trs.splice(0,this.trs.length),this.updateEmptyRule(),this.trs.push(this.emptyRule)},clearEmpty(){this.trs[0]&&this.trs[0]._isEmpty&&this.trs.splice(0,1)},delRaw(e){if(this.disabled||!this.deletable||this.min>0&&this.trs.length<=this.min)return;this.trs.splice(e,1),this.selectedRows.delete(e);const t=new Set;this.selectedRows.forEach(o=>{o<e?t.add(o):o>e&&t.add(o-1)}),this.selectedRows=t,this.updateValue(),this.trs.length?this.trs.forEach(e=>this.updateRaw(e)):this.addEmpty(),this.$emit("delete",e),this.$emit("select-change",Array.from(this.selectedRows))},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()),this.updateSelectAllState()},isRowSelectable:e=>!e||!0!==e.disabled&&!1!==e.selectable,updateRaw(e){const t=this.trs.indexOf(e),o=this.modelValue[t]||{};let r=0;if(this.showIndexColumn&&e.children[r]&&(e.children[r].props.innerText=t+1,r++),this.showSelectColumn&&e.children[r]){const l=e.children[r],n=o&&!0===o[this.selectField],a=!this.isRowSelectable(o);if(l.children&&l.children[0]){const e=l.children[0];e.props.checked=n,e.props.disabled=a,e.props.onClick=e=>{e.stopPropagation(),a||this.toggleRowSelect(t,e.target.checked)}}this.$nextTick(()=>{var e;const o=null===(e=this.$el)||void 0===e?void 0:e.querySelector("._fc-tf-table");if(o){const e=o.querySelectorAll("tbody tr");if(e[t]){const o=e[t].querySelector('._fc-tf-select input[type="checkbox"]');o&&(o.checked=n,o.disabled=a)}}}),r++}if(this.columns.forEach((l,n)=>{const a=r+n;if(e.children[a]&&e.children[a].children){const r=e.children[a].children.find(e=>"checkbox"===e.type);if(r&&l.optionsFn&&"function"==typeof l.optionsFn){const e=l.optionsFn(o,t);Array.isArray(e)&&(r.options=e,r.props&&(r.props.options=e))}}}),this.showOperationColumn&&e.children[e.children.length-1]){const o=e.children[e.children.length-1];o.children&&o.children[0]&&(o.children[0].props.onClick=()=>{this.delRaw(t)})}},toggleRowSelect(e,t){const o=this.modelValue[e];o&&this.isRowSelectable(o)&&(t?(this.selectedRows.add(e),o[this.selectField]=!0):(this.selectedRows.delete(e),o[this.selectField]=!1),this.updateValue(),this.updateSelectAllState(),this.$emit("select-change",Array.from(this.selectedRows)))},toggleSelectAll(e){this.modelValue.forEach((t,o)=>{t&&this.isRowSelectable(t)&&(e?(this.selectedRows.add(o),t[this.selectField]=!0):(this.selectedRows.delete(o),t[this.selectField]=!1))}),this.updateValue(),this.trs.forEach(e=>{e._isEmpty||this.updateRaw(e)}),this.$emit("select-change",Array.from(this.selectedRows))},updateSelectAllState(){if(!this.showSelectColumn)return;const e=this.modelValue.filter((e,t)=>{const o=this.trs[t];return o&&!o._isEmpty&&this.isRowSelectable(e)});if(0===e.length)return;const t=e.every(e=>e&&!0===e[this.selectField]),o=e.some(e=>e&&!0===e[this.selectField]);this.$nextTick(()=>{var e;const r=null===(e=this.$el)||void 0===e?void 0:e.querySelector("._fc-tf-table");if(r){const e=r.querySelector('._fc-tf-head-select input[type="checkbox"]');e&&(e.checked=t,e.indeterminate=!t&&o)}})},loadRule(){const e=[];let t=[];this.showIndexColumn&&(e.push({type:"th",native:!0,class:"_fc-tf-head-idx",style:this.headerBackgroundColor?{backgroundColor:this.headerBackgroundColor}:{},props:{innerText:"#"}}),t.push({type:"td",class:"_fc-tf-idx",native:!0,props:{innerText:"0"}})),this.showSelectColumn&&(e.push({type:"th",native:!0,class:"_fc-tf-head-select",style:{width:"40px",minWidth:"40px",maxWidth:"40px",textAlign:"center",...this.headerBackgroundColor?{backgroundColor:this.headerBackgroundColor}:{}},children:[{type:"input",native:!0,props:{type:"checkbox",id:"_fc-tf-select-all-"+(this._uid||Date.now()),onClick:e=>{this.toggleSelectAll(e.target.checked)}}}]}),t.push({type:"td",class:"_fc-tf-select",native:!0,style:{width:"40px",minWidth:"40px",maxWidth:"40px",textAlign:"center"},children:[{type:"input",native:!0,props:{type:"checkbox",onClick:e=>{}}}]})),this.columns.forEach(o=>{e.push({type:"th",native:!0,style:{...o.style||{},textAlign:o.align||"center",...this.headerBackgroundColor?{backgroundColor:this.headerBackgroundColor}:{}},class:o.required?"_fc-tf-head-required":"",props:{innerText:o.label||""}}),t.push({type:"td",native:!0,children:[...o.rule||[]]})}),this.showOperationColumn&&(e.push({type:"th",native:!0,class:"_fc-tf-edit fc-clock",style:this.headerBackgroundColor?{backgroundColor:this.headerBackgroundColor}:{},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()}};ne.render=function(e,t,o,r,i,s){const d=f("a-button");return l(),n("div",{class:p(["_fc-table-form",{"_fc-disabled":o.disabled}])},[(l(),v(b(i.Form),{option:o.options,rule:i.rule,extendOption:!0,disabled:o.disabled,onChange:s.formChange,api:i.fapi,"onUpdate:api":t[0]||(t[0]=e=>i.fapi=e),onEmitEvent:e.$emit},null,40,["option","rule","disabled","onChange","api","onEmitEvent"])),o.addable&&(!o.max||o.max>this.trs.length)?(l(),v(d,{key:0,type:"link",class:"fc-clock",onClick:t[1]||(t[1]=e=>s.addRaw(!0)),disabled:o.disabled},{default:w(()=>[t[2]||(t[2]=a("i",{class:"fc-icon icon-add-circle",style:{"font-weight":"700"}},null,-1)),C(" "+u(o.formCreateInject.t("add")||"添加"),1)]),_:1},8,["disabled"])):c("v-if",!0)],2)};var ae=i({name:"TableFormView",data:()=>({})});const ie={class:"_fd-table-form"},se={key:0,class:"_fd-tf-wrap"},ce={key:1,class:"_fc-child-empty"};ae.render=function(e,t,o,r,a,i){return l(),n("div",ie,[e.$slots.default?(l(),n("div",se,[S(e.$slots,"default")])):(l(),n("div",ce))])};var pe=i({name:"TableFormColumnView",props:{label:String,align:String,width:[Number,String],color:String,required:Boolean},computed:{colStyle(){const e=this.width,t={width:j.Number(e)?e+"px":e&&"auto"!==e?e:"180px"};return this.color&&(t.color=this.color),t}},data:()=>({})});const de={key:0,class:"_fd-tf-required"},ue={class:"_fd-tf-con"};pe.render=function(e,t,o,r,i,s){return l(),n("div",{class:"_fd-tf-col",style:d(e.colStyle)},[a("div",{class:"_fd-tf-title",style:d({textAlign:e.align||"center"})},[e.required?(l(),n("span",de,"*")):c("v-if",!0),C(u(e.label||""),1)],4),a("div",ue,[S(e.$slots,"default")])],4)};var he={name:"FcTable",props:{mini:Boolean,label:String,width:[Number,String],border:{type:Boolean,default:!0},borderWidth:String,borderColor:String,rule:{type:Object,default:()=>({row:1,col:1})}},watch:{rule:{handler(){this.initRule(),this.loadRule(),this.tdStyle=this.rule.style||{},this.tdClass=this.rule.class||{}},immediate:!0,deep:!0}},data:()=>({tdStyle:{},tdClass:{},lattice:{}}),computed:{tableColor(){const e={};return!1===this.border?e.border="0 none":(this.borderColor&&(e.borderColor=this.borderColor),this.borderWidth&&(e.borderWidth=this.borderWidth)),e}},methods:{initRule(){const e=this.rule;e.style||(e.style={}),e.layout||(e.layout=[]),e.row||(e.row=1),e.col||(e.col=1)},loadRule(){const e=[],t=this.rule||{row:1,col:1};for(let o=0;o<t.row;o++){const o=[];e.push(o);for(let e=0;e<t.col;e++)o.push({rowspan:1,colspan:1,slot:[],show:!0})}[...t.layout||[]].forEach((o,r)=>{if((!o.row||o.row<=0)&&(!o.col||o.col<=0)||!e[o.top]||!e[o.top][o.left]||!e[o.top][o.left].show)return void t.layout.splice(r,1);const l=e[o.top][o.left];l.layout=o;let n=1,a=1;if(o.col&&(n=o.col+o.left>t.col?t.col-o.left:o.col,l.colspan=n),o.row&&(a=o.row+o.top>t.row?t.row-o.top:o.row,l.rowspan=a),a&&n)for(let t=0;t<a;t++){const r=e[o.top+t];if(r)for(let e=0;e<n;e++)(e||t)&&(r[o.left+e]&&(r[o.left+e].show=!1),l.slot.push(`${o.top+t}:${o.left+e}`))}});const o=e=>!(e&&!e.layout&&e.show);e.forEach((t,r)=>{t.forEach((l,n)=>{let a=!1,i=!1;if(l.layout){const t=l.layout.col||1,s=l.layout.row||1;for(let l=0;l<t;l++)e[r+s]&&!o(e[r+s][n+l])||(i=!0);for(let l=0;l<s;l++)e[r+l]&&!o(e[r+l][n+t])||(a=!0)}else a=o(t[n+1]),i=!e[r+1]||o(e[r+1][n]);l.right=a,l.bottom=i})}),this.lattice=e}}};he.render=function(e,t,o,r,i,u){const m=f("a-col");return l(),v(m,{span:24},{default:w(()=>[a("div",{class:p(["_fc-table",{"is-mini":o.mini}])},[a("table",{border:"1",cellspacing:"0",cellpadding:"0",style:d(u.tableColor)},[(l(!0),n(s,null,h(o.rule.row,(t,r)=>(l(),n("tr",{key:r},[(l(!0),n(s,null,h(o.rule.col,(t,o)=>(l(),n(s,{key:`${r}${o}`},[i.lattice[r][o].show?(l(),n("td",x({key:0,ref_for:!0},i.lattice[r][o]?{colspan:i.lattice[r][o].colspan,rowspan:i.lattice[r][o].rowspan}:{},{valign:"top",class:i.tdClass&&i.tdClass[`${r}:${o}`]||"",style:[u.tableColor,i.tdStyle&&i.tdStyle[`${r}:${o}`]||{}]}),[S(e.$slots,`${r}:${o}`),(l(!0),n(s,null,h(i.lattice[r][o].slot,t=>S(e.$slots,""+t)),256))],16)):c("v-if",!0)],64))),128))]))),128))],4)],2)]),_:3})};var fe=i({name:"ExportExcel",props:{formCreateInject:{type:Object,default:null},buttonType:{type:String,default:"primary",validator:e=>["primary","ghost","dashed","link","text","default"].includes(e)},text:{type:String,default:"导出Excel"},disabled:{type:Boolean,default:!1},action:{type:String,default:""},method:{type:String,default:"post"},data:{type:Object,default:()=>({})},query:{type:Object,default:()=>({})},headers:{type:Object,default:()=>({})},withCredentials:{type:Boolean,default:!1},fileName:{type:String,default:""},beforeFetch:{type:Function,default:null},dataType:{type:String,default:"json",validator:e=>["json","formData"].includes(e)}},data:()=>({loading:!1}),methods:{async handleExport(){if(!this.loading&&!this.disabled)if(this.action){this.loading=!0;try{let e={action:this.action,method:this.method,data:this.data,query:this.query,headers:this.headers,withCredentials:this.withCredentials,dataType:this.dataType};if(this.beforeFetch&&"function"==typeof this.beforeFetch){const t=this.formCreateInject||{},o=t.api,r=t.rule,l=this.beforeFetch(e,{api:o,rule:r});if(l&&"function"==typeof l.then)await l;else{if(!1===l)return void(this.loading=!1);l&&"object"==typeof l&&(e=l)}}const t=await this.fetchBlob(e);let o=this.fileName||t.fileName||(new Date).getTime()+".xlsx";o.endsWith(".xlsx")||o.endsWith(".xls")||(o+=".xlsx"),this.exportFile(o,t.blob),T.success("导出成功")}catch(e){console.error("导出失败:",e),T.error(e.message||"导出失败,请稍后重试")}finally{this.loading=!1}}else T.warning("请配置导出接口地址")},fetchBlob:e=>new Promise((t,o)=>{const r=new XMLHttpRequest;let l=e.action||"",n="";if(e.query){const t="string"==typeof e.query?e.query:Object.keys(e.query).reduce((t,o)=>(t[o]=null===e.query[o]||void 0===e.query[o]?"":e.query[o],t),{}),o=new URLSearchParams(t).toString();o&&(l.includes("?")?l+="&"+o:l+="?"+o)}r.onerror=()=>{o(new Error("请求失败"))},r.onload=()=>{if(r.status<200||r.status>=300){if((r.getResponseHeader("content-type")||"").includes("application/json")){const e=new FileReader;return e.onload=e=>{try{const t=JSON.parse(e.target.result);o(new Error(t.message||"导出失败"))}catch(e){o(new Error("导出失败: "+r.status))}},void e.readAsText(r.response)}return void o(new Error("导出失败: "+r.status))}const e=r.getResponseHeader("content-disposition");if(e){const t=e.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);t&&t[1]&&(n=t[1].replace(/['"]/g,""),n=decodeURIComponent(n))}const l=r.response;if(l.type&&l.type.includes("application/json")){const e=new FileReader;return e.onload=e=>{try{const t=JSON.parse(e.target.result);o(new Error(t.message||"导出失败"))}catch(e){o(new Error("导出失败"))}},void e.readAsText(l)}t({blob:r.response,fileName:n})},r.open(e.method||"get",l,!0),r.responseType="blob";try{if(window.parent&&window.parent.window){const e=window.parent.window.localStorage.getItem("authorizationKey"),t=window.parent.window.localStorage.getItem("authorizationValue");e&&t&&r.setRequestHeader(e,t)}else{const e=window.localStorage.getItem("authorizationKey"),t=window.localStorage.getItem("authorizationValue");e&&t&&r.setRequestHeader(e,t)}}catch(e){console.warn("获取token失败",e)}const a=e.headers||{};Object.keys(a).forEach(e=>{null!=a[e]&&r.setRequestHeader(e,a[e])}),e.withCredentials&&"withCredentials"in r&&(r.withCredentials=!0);const i=e.dataType||"json";if(e.data&&Object.keys(e.data).length>0)if("formData"===i){const t=new FormData;Object.keys(e.data).forEach(o=>{const r=e.data[o];null!=r&&(Array.isArray(r)?r.forEach(e=>{t.append(o,e)}):t.append(o,r))}),r.send(t)}else r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.send(JSON.stringify(e.data));else r.send()}),exportFile(e,t){const o=new Blob([t],{type:"application/vnd.ms-excel"});if("download"in document.createElement("a")){const t=document.createElement("a");t.download=e,t.style.display="none",t.href=URL.createObjectURL(o),document.body.appendChild(t),t.click(),URL.revokeObjectURL(t.href),document.body.removeChild(t)}else navigator.msSaveBlob(o,e)}}});fe.render=function(e,t,o,r,n,a){const i=f("a-button");return l(),v(i,{type:e.buttonType,loading:e.loading,disabled:e.disabled,onClick:e.handleExport},{default:w(()=>[S(e.$slots,"default",{},()=>[C(u(e.text||"导出Excel"),1)])]),_:3},8,["type","loading","disabled","onClick"])};var me=[e,t,o,r,N,K,re,le,ne,ae,pe,fe,he],ye={name:"checkbox",modelField:"value",mergeProp(e){const t=e.prop.props;P(t,"options")||(t.options=e.prop.options||[])}},ge={...ye,name:"radio"},ve={...ye,name:"select",mergeProp(e){var t;const o=e.prop.props;P(o,"options")||(o.options=e.prop.options||[]),P(o,"getPopupContainer")||(o.getPopupContainer=e=>{var t;return null!==(t=null==e?void 0:e.parentNode)&&void 0!==t?t:document.body});const r=e.effectData("fetch");r&&!0===r.loading&&(o.disabled=!0,o.loading=!0);(!0===(null===(t=e.rule.props)||void 0===t?void 0:t.readOnly)||!0===o.readOnly)&&(o.disabled=!0,o._fcReadOnly=!0)},render(e,t){const o=t.effectData("fetch");if(o&&!0===o.loading&&e.loading){const o={...e};return o.notFoundContent=e.loading,t.$render.defaultRender(t,o)}return(t.prop.props||{})._fcReadOnly&&(t.prop.class||(t.prop.class=[]),Array.isArray(t.prop.class)||(t.prop.class=[t.prop.class]),t.prop.class.includes("fc-select-readonly")||t.prop.class.push("fc-select-readonly")),t.$render.defaultRender(t,e)}},be={name:"cascader",mergeProp(e){const t=e.prop.props;P(t,"options")||(t.options=e.prop.options||[]);const o=e.effectData("fetch");if(o&&!0===o.loading&&(t.disabled=!0,t.loading=!0),t.loadData){var r;const o=null===(r=e.$handle)||void 0===r?void 0:r.api,l=e.rule,n=e;let a=j.String(t.loadData)?R(t.loadData):t.loadData;if(!j.Function(a)&&j.String(t.loadData))try{const e=t.loadData.trim();e.startsWith("function")||e.startsWith("[[FORM-CREATE-PREFIX-function")||e.startsWith("$FNX:")||(a=new Function("selectedOptions","options","updateOptions","api","rule",e))}catch(e){}j.Function(a)&&(t.loadData=function(e){if(!e||0===e.length)return;const r=e[e.length-1];if(!0===(null==r?void 0:r.isLeaf))return;const i=t.options||[],s=()=>{var a,i;const s=t.options||[],c=(e,t,o,r)=>{if(!t||0===t.length)return e.map(e=>({...e,children:e.children?e.children.map(e=>({...e})):void 0}));const l=t[o],n=o===t.length-1;return e.map(e=>{const a={...e};return void 0!==e.value&&e.value===l||void 0!==e.id&&e.id===l?n?(a.children=r?[...r]:void 0,a.loading=!1,a):(e.children&&e.children.length>0?a.children=c(e.children,t,o+1,r):a.children=void 0,a):(e.children&&e.children.length>0?a.children=c(e.children,t,o,r):a.children=void 0,a)})},p=e.map(e=>e.value||e.id),d=c(s,p,0,r?r.children:void 0),u=n.effectData("fetch");u&&F(u,"props.options",d),t.options=d,null!==(a=n.prop)&&void 0!==a&&a.props&&(n.prop.props.options=d),null!==(i=n.rule)&&void 0!==i&&i.props&&(n.rule.props.options=d),o&&l&&o.sync(l),n.$handle&&n.$handle.refresh()};r&&(r.loading=!0,s());const c=a.call(this,e,i,s,o,l);return c&&"function"==typeof c.then?c.finally(()=>{s()}):c});const i=o=>{if(!o||!Array.isArray(o)||o.length<=1||!t.loadData||"function"!=typeof t.loadData)return;const r="_loadDataTimer_"+(e.rule._fc_id||Date.now());e.rule[r]&&clearTimeout(e.rule[r]),e.rule[r]=setTimeout(()=>{let e=0;const r=async()=>{e++;const l=n.effectData("fetch");if(e>50)return;if(l&&!0===l.loading)return void setTimeout(r,100);let a=t.options||[];if(!a||0===a.length){if(!(l&&l.props&&l.props.options))return void setTimeout(r,100);a=l.props.options,t.options=a}if(!a||0===a.length)return;const i=async(e,o)=>{if(o>=e.length-1)return;a=t.options||[];const r=[];let l=a;for(let t=0;t<=o;t++){const o=e[t],n=l.find(e=>e.value===o||e.id===o);if(!n)return;r.push(n),l=n.children||[]}const n=r[o];if(!0===n.isLeaf)return;const s=e[o+1];if(null==s)return;if(n.children&&Array.isArray(n.children)&&n.children.length>0)await i(e,o+1);else{n.loading=!0;try{const l=t.loadData(r);l&&"function"==typeof l.then&&await l,await new Promise(e=>setTimeout(e,300)),o+1<e.length-1&&await i(e,o+1)}catch(e){n.loading=!1}}};i(o,0).catch(()=>{})};r()},500)},s=e.rule.value,c=JSON.stringify(s||[]);c!==e.rule._lastLoadDataValueKey&&s&&Array.isArray(s)&&(e.rule._lastLoadDataValueKey=c,i(s))}},render(e,t){const o=t.effectData("fetch");if(o&&!0===o.loading&&e.loading){const o={...e};return o.notFoundContent=e.loading,t.$render.defaultRender(t,o)}return t.$render.defaultRender(t,e)},mounted(e){const t=e.rule.value,o=e.prop.props;t&&Array.isArray(t)&&t.length>1&&o.loadData&&setTimeout(()=>{const t=e.prop.props.loadData;t&&"function"==typeof t&&(e.rule._lastLoadDataValueKey=null)},100)}};const we={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",quarter:"YYYY-qQ",year:"YYYY"},Ce="datePicker";var Se={name:Ce,maker:["date","month","week"].reduce((e,t)=>(e[t]=V(Ce,{type:t}),e),{dateRange:V(Ce,{type:"range"}),datetimeRange:V(Ce,e=>e.props({type:"range",showTime:!0}))}),modelField:"value",mergeProp(e){const t=e.prop.props,o=t.type||t.picker;P(t,"getPopupContainer")||(t.getPopupContainer=e=>{var t;return null!==(t=null==e?void 0:e.parentNode)&&void 0!==t?t:document.body}),t.valueFormat||(t.valueFormat=(we[o]||we.date)+(!t.showTime||o&&"date"!==o?"":" HH:mm:ss")),t.showTime&&(!0===t.showTime?t.showTime={defaultValue:D("00:00:00","HH:mm:ss")}:"object"!=typeof t.showTime||t.showTime.defaultValue||(t.showTime={...t.showTime,defaultValue:D("00:00:00","HH:mm:ss")}))},render:(e,t)=>t.$render.vNode[(!0===t.prop.props.range?"range":"date")+"Picker"](t.prop,e)};var xe={name:"hidden",maker:{hidden:(e,t)=>V("hidden")("",e,t)},render:()=>[]},$e={name:"text",loadChildren:!1,mounted(e){var t,o;const r=e.rule.props||{},l=e.rule.bindField||r.bindField||(null===(t=e.prop.props)||void 0===t?void 0:t.bindField),n=e.rule.template||r.template||(null===(o=e.prop.props)||void 0===o?void 0:o.template);if(n||l){const t=e.getParentGroup&&e.getParentGroup(),o=t&&e.$handle&&e.$handle.subRuleData;if(console.log("[text mounted] bindField:",l,"template:",n),console.log("[text mounted] isInSubForm:",o),console.log("[text mounted] group:",t),o&&t&&t.id){const o=()=>{if(e.$handle&&e.$handle.api)try{let o="";if(l){if(e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const r=e.$handle.subRuleData[t.id];o=void 0!==r[l]?String(r[l]||""):""}}else if(n&&e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const r=e.$handle.subRuleData[t.id];o=e.$handle.loadStrVar(n,t=>r&&void 0!==r[t]?r[t]:e.$handle.api.getValue(t),{rule:t.rule,value:r})}void 0!==o&&(e.rule.children||(e.rule.children=[]),e.rule.children[0]=String(o),e.$handle.api.sync(e.rule),e.$handle.refresh())}catch(e){console.error("[text mounted] 立即更新错误:",e)}};o(),e.$handle.api.nextTick(()=>{o()})}setTimeout(()=>{if(e.$handle&&e.$handle.api)try{let r="";if(o&&t&&t.id){if(console.log("[text mounted] 在tableForm中,从当前行数据获取"),l){if(e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const o=e.$handle.subRuleData[t.id];r=void 0!==o[l]?String(o[l]||""):"",console.log("[text mounted] 从subRuleData获取值:",r,"rowData:",o)}}else if(n&&e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const o=e.$handle.subRuleData[t.id];r=e.$handle.loadStrVar(n,t=>o&&void 0!==o[t]?o[t]:e.$handle.api.getValue(t),{rule:t.rule,value:o}),console.log("[text mounted] 从行数据解析模板,值:",r)}}else if(n){const t=e.$handle.api.formData();r=e.$handle.loadStrVar(n,o=>{const r=e.$handle.api.getValue(o);return void 0===r&&t&&void 0!==t[o]?t[o]:r},null)}else l&&(r=e.$handle.api.getValue(l)||"");if(null!=r&&(e.rule.children||(e.rule.children=[]),e.rule.children[0]=String(r),e.$handle.api.sync(e.rule),e.$handle.refresh(),console.log("[text mounted] 更新children:",e.rule.children)),o&&t&&t.id&&l){const o=()=>{if(e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const o=e.$handle.subRuleData[t.id],r=void 0!==o[l]?String(o[l]||""):"";e.rule.children&&e.rule.children[0]!==r&&(e.rule.children[0]=r,e.$handle.api.sync(e.rule),e.$handle.refresh(),console.log("[text mounted watch] 字段值变化,更新为:",r))}};if(e.$handle.bus){e.$handle.bus.$on("change-"+l,o),console.log("[text mounted] 监听字段变化事件: change-"+l);const r=$(e.$handle.subRuleData,t.id);e.watch.push(k(()=>{var e;return null===(e=r.value)||void 0===e?void 0:e[l]},t=>{const o=void 0!==t?String(t||""):"";e.rule.children||(e.rule.children=[]),e.rule.children[0]=o,e.$handle.api.sync(e.rule),e.$handle.refresh(),console.log("[text mounted watch subRuleData] 字段值变化,更新为:",o)},{immediate:!0})),e.watch.push(k(()=>r.value,t=>{if(t&&l){const o=void 0!==t[l]?String(t[l]||""):"";e.rule.children||(e.rule.children=[]),e.rule.children[0]!==o&&(e.rule.children[0]=o,e.$handle.api.sync(e.rule),e.$handle.refresh(),console.log("[text mounted watch rowData] 行数据变化,更新为:",o))}},{immediate:!0,deep:!0}))}}}catch(e){console.error("[text mounted] 错误:",e)}},500)}},renderChildren:(e,t)=>({default:()=>{var o,r;const l=t.getParentGroup&&t.getParentGroup();if(l&&t.$handle&&t.$handle.subRuleData&&l&&l.id){var n,a;const e=t.rule.props||{},o=t.rule.bindField||e.bindField||(null===(n=t.prop.props)||void 0===n?void 0:n.bindField),r=t.rule.template||e.template||(null===(a=t.prop.props)||void 0===a?void 0:a.template);if(o||r)try{if(t.$handle.subRuleData&&t.$handle.subRuleData[l.id]){const e=t.$handle.subRuleData[l.id];let n="";o?n=void 0!==e[o]?String(e[o]||""):"":r&&(n=t.$handle.loadStrVar(r,o=>e&&void 0!==e[o]?e[o]:t.$handle.api.getValue(o),{rule:l.rule,value:e})),void 0!==n&&(t.rule.children||(t.rule.children=[]),t.rule.children[0]!==n&&(t.rule.children[0]=n))}}catch(e){}}let i=null===(o=t.rule)||void 0===o?void 0:o.children;i||(i=e);let s=(Array.isArray(i)?i:[i]).filter(e=>null!=e).map(e=>j.String(e)?e:String(e)).join("");s=null==s||void 0===s?"":String(s);const c=t.rule.props||{},p=t._formatFn||t.rule.formatFn||c.formatFn||(null===(r=t.prop.props)||void 0===r?void 0:r.formatFn);if(p){let e=null;if(j.String(p))try{e=R(p)}catch(e){console.warn("[text] 解析 formatFn 函数失败:",e)}else j.Function(p)&&(e=p);if(e&&j.Function(e))try{var d;const o=(null===(d=t.$handle)||void 0===d?void 0:d.api)||{},r=e(s,o,t.rule);null!=r&&(s=String(r))}catch(e){console.warn("[text] 执行 formatFn 函数失败:",e)}}return s||""}}),mergeProp(e){var t,o,r,l,n,a;const i=e.rule.props||{},s=e.rule.bindField||i.bindField||(null===(t=e.prop.props)||void 0===t?void 0:t.bindField),c=e.rule.template||i.template||(null===(o=e.prop.props)||void 0===o?void 0:o.template);let p=e.rule.bindMode||i.bindMode||(null===(r=e.prop.props)||void 0===r?void 0:r.bindMode);if(p||(p=c?"template":s?"field":"static"),"field"===p&&s){var d;console.log("[text mergeProp] bindField模式,fieldName:",s),console.log("[text mergeProp] ctx:",e),console.log("[text mergeProp] ctx.getParentGroup:",e.getParentGroup);const t=e.getParentGroup&&e.getParentGroup();console.log("[text mergeProp] group:",t),console.log("[text mergeProp] ctx.$handle:",e.$handle),console.log("[text mergeProp] ctx.$handle.subRuleData:",null===(d=e.$handle)||void 0===d?void 0:d.subRuleData);const o=t&&e.$handle&&e.$handle.subRuleData;let r;if(console.log("[text mergeProp] isInSubForm:",o),o){const e=s;r={handler:(t,o,r)=>{console.log("[text handler] 开始执行,fieldName:",e),console.log("[text handler] rule:",o),console.log("[text handler] rule.__fc__:",null==o?void 0:o.__fc__);const l=null==o?void 0:o.__fc__;if(console.log("[text handler] ruleCtx:",l),console.log("[text handler] ruleCtx.getParentGroup:",null==l?void 0:l.getParentGroup),console.log("[text handler] ruleCtx.$handle:",null==l?void 0:l.$handle),l&&l.getParentGroup&&l.$handle){const t=l.getParentGroup();if(console.log("[text handler] rowGroup:",t),console.log("[text handler] rowGroup.id:",null==t?void 0:t.id),console.log("[text handler] rowGroup.rule:",null==t?void 0:t.rule),t){if(console.log("[text handler] 尝试方法1: 从 subRuleData 获取"),console.log("[text handler] subRuleData:",l.$handle.subRuleData),t.id&&l.$handle.subRuleData&&l.$handle.subRuleData[t.id]){const o=l.$handle.subRuleData[t.id];if(console.log("[text handler] rowData:",o),console.log("[text handler] rowData[fieldName]:",o[e]),o&&void 0!==o[e]){const t=null!==o[e]?String(o[e]):"";return console.log("[text handler] 方法1成功,返回值:",t),t}}if(console.log("[text handler] 尝试方法2: 遍历 rowGroup.rule.children"),t.rule&&Array.isArray(t.rule.children)){const o=t=>{for(const r of t)if(r&&"object"==typeof r){if(r.field===e&&void 0!==r.value)return null!==r.value?String(r.value):"";if(Array.isArray(r.children)){const e=o(r.children);if(void 0!==e)return e}}},r=o(t.rule.children);if(void 0!==r)return console.log("[text handler] 方法2成功,返回值:",r),r}if(console.log("[text handler] 尝试方法3: 使用 api.getChildrenFormData"),r&&r.getChildrenFormData&&t.rule)try{const o=r.getChildrenFormData(t.rule);if(console.log("[text handler] getChildrenFormData 结果:",o),o&&void 0!==o[e]){const t=null!==o[e]?String(o[e]):"";return console.log("[text handler] 方法3成功,返回值:",t),t}}catch(e){console.error("[text handler] 方法3失败:",e)}}}console.log("[text handler] 所有方法都失败,使用回退方法 get");const n=t?t(e):(r.getValue?r.getValue(e):"")||"";return console.log("[text handler] 回退方法返回值:",n),n},to:"child",modify:!0,wait:300,watch:!0}}else r={attr:s,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===s||e.handler&&e.bindField===s)&&"child"===e.to)||(r.handler&&(r.bindField=s),e.rule.effect.loadData.push(r),e.$handle&&e.$handle.effect&&e.$handle.effect(e,"loaded"))}else if("template"===p&&c){let t;if(e.getParentGroup&&e.getParentGroup()&&e.$handle&&e.$handle.subRuleData){const e=c;t={handler:(t,o,r)=>{const l=null==o?void 0:o.__fc__;let n=null;if(l&&l.getParentGroup&&l.$handle){const e=l.getParentGroup();e&&e.rule&&(n=r.getChildrenFormData?r.getChildrenFormData(e.rule):null,!n&&e.id&&l.$handle.subRuleData&&l.$handle.subRuleData[e.id]&&(n=l.$handle.subRuleData[e.id]))}return n&&l&&l.$handle&&l.$handle.loadStrVar?l.$handle.loadStrVar(e,e=>n&&void 0!==n[e]?n[e]:t?t(e):r.getValue?r.getValue(e):void 0,{rule:o,value:n}):l&&l.$handle&&l.$handle.loadStrVar?l.$handle.loadStrVar(e,t,null):""},to:"child",modify:!0,wait:300,watch:!0}}else t={template:c,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===c||e.handler&&e.template===c)&&"child"===e.to)&&(t.handler&&(t.template=c),e.rule.effect.loadData.push(t),e.$handle&&e.$handle.effect&&(e.$handle.effect(e,"loaded"),!e._textLoadDataWatched))){e._textLoadDataWatched=!0;const t=$(e.rule.effect,"loadData");e.watch.push(k(t,(t,o)=>{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=[]);const u=e.rule.tooltipEnabled||i.tooltipEnabled||(null===(l=e.prop.props)||void 0===l?void 0:l.tooltipEnabled),h=e.rule.tooltipContent||i.tooltipContent||(null===(n=e.prop.props)||void 0===n?void 0:n.tooltipContent);u?(e._tooltipEnabled=!0,e._tooltipContent=h):(e._tooltipEnabled=!1,e._tooltipContent=null);const f=e.rule.formatFn||i.formatFn||(null===(a=e.prop.props)||void 0===a?void 0:a.formatFn);if(e._formatFn=f||null,"field"===p&&s||"template"===p&&c){const t=e.getParentGroup&&e.getParentGroup();if(t&&e.$handle&&e.$handle.subRuleData&&t&&t.id)if(e.$handle.subRuleData&&e.$handle.subRuleData[t.id]){const o=e.$handle.subRuleData[t.id];let r="";if("field"===p&&s)r=void 0!==o[s]?String(o[s]||""):"";else if("template"===p&&c)try{r=e.$handle.loadStrVar(c,t=>o&&void 0!==o[t]?o[t]:e.$handle.api.getValue(t),{rule:t.rule,value:o})}catch(e){r=""}e.rule.children||(e.rule.children=[]),e.rule.children[0]=r,console.log("[text mergeProp] 在tableForm中,设置初始值:",r)}else(!e.rule.children||Array.isArray(e.rule.children)&&0===e.rule.children.length)&&(e.rule.children=[""]);else(!e.rule.children||Array.isArray(e.rule.children)&&0===e.rule.children.length)&&(e.rule.children="template"===p?[""]:[" "])}},render(e,t){let o="";if(e&&"function"==typeof e.default)try{o=e.default()||""}catch(e){o=""}o=null==o||void 0===o?"":String(o);const r={...t.prop};r.props||(r.props={}),"text"===r.type&&(r.type="div"),delete r.props.innerHTML;if(r.onClick||r.on&&(r.on.click||r.on.onClick)||t.rule.on&&(t.rule.on.click||t.rule.on.onClick)||t.rule.props&&(t.rule.props.onClick||t.rule.props.click)){const e=r.class;r.class=Array.isArray(e)?[...e,"fc-text-clickable"]:e?[e,"fc-text-clickable"]:["fc-text-clickable"]}const l=t.vNode.make("div",r,[o]);if(t._tooltipEnabled&&t._tooltipContent){var n;let e=null;if(j.String(t._tooltipContent))try{e=R(t._tooltipContent)}catch(e){console.warn("[text] 解析 tooltipContent 函数失败:",e)}else j.Function(t._tooltipContent)&&(e=t._tooltipContent);if(!e&&!j.String(t._tooltipContent))return l;const o=e,r=j.String(t._tooltipContent)?t._tooltipContent:null,a=(null===(n=t.$handle)||void 0===n?void 0:n.api)||{},i=t.rule;return t.vNode.make("aTooltip",{},{title:()=>{let e="";if(o&&j.Function(o))try{const t=o(a,i);e=null!=t?String(t):""}catch(t){console.warn("[text] 执行 tooltipContent 函数失败:",t),e=""}else r&&(e=r);return e?t.vNode.h("div",{innerHTML:e,style:{maxWidth:"300px",wordBreak:"break-word"}}):null},default:()=>l})}return l}};var ke={name:"input",maker:["password","url","email","text","textarea","search"].reduce((e,t)=>(e[t]=V("input",{type:t}),e),{idate:V("input",{type:"date"})}),modelField:"value",render(e,t){let o=t.prop.props.type;return-1===["textarea","search","password"].indexOf(o)&&(o="input"),o={textarea:"aTextarea",search:"aInputSearch",password:"aInputPassword"}[o]||"aInput",t.$render.vNode.make(o,t.prop,e)},mounted(e){var t,o,r;if("textarea"===(null===(t=e.prop.props)||void 0===t?void 0:t.type)&&null!==(o=e.prop.props)&&void 0!==o&&o.readOnly&&!0===(null===(r=e.$handle)||void 0===r?void 0:r.preview)){const t=e=>{if(!e)return;e.style.height="auto";const t=e.scrollHeight;t>0&&(e.style.height=t+"px"),e.style.overflow="hidden"};setTimeout(()=>{const o=e.el;if(!o)return;const r=o.querySelector("textarea.ant-input")||o.querySelector("textarea");if(r&&(t(r),"undefined"!=typeof MutationObserver)){const o=new MutationObserver(()=>{t(r)});o.observe(r,{attributes:!0,attributeFilter:["value"],childList:!0,subtree:!0,characterData:!0});const l=setInterval(()=>{t(r)},200);e.$handle&&e.$handle.vm&&e.$handle.vm.$once("hook:beforeUnmount",()=>{o.disconnect(),clearInterval(l)})}},100)}}},Ae={name:"timePicker",modelField:"value",mergeProp(e){const t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss"),P(t,"getPopupContainer")||(t.getPopupContainer=e=>{var t;return null!==(t=null==e?void 0:e.parentNode)&&void 0!==t?t:document.body})},render:(e,t)=>t.$render.vNode["time"+(!0===t.prop.props.range?"Range":"")+"Picker"](t.prop,e)},je={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}},Pe={name:"FcRow",render:(e,t)=>t.vNode.col({props:{span:24}},{default:()=>[t.vNode.row(t.prop,e)]})};var Te={...Se,name:"rangePicker",maker:{},render:(e,t)=>t.$render.vNode.rangePicker(t.prop,e)};var Re={...Ae,name:"timeRangePicker",mergeProp(e){Ae.mergeProp(e)},render:(e,t)=>t.$render.vNode.timeRangePicker(t.prop,e)};const Fe=(e,t)=>{if(!e||!t)return;const o=t.split(".");let r=e;for(const e of o){if(null==r)return;r=r[e]}return r};const Ie="__FORM_CREATE_BUSINESS_COMPONENTS__";let Ve=null;function De(){return"undefined"!=typeof window?(window[Ie]||(window[Ie]=new Map),window[Ie]):(Ve||(Ve=new Map),Ve)}function Oe(e,t){De().set(e,t)}var Ee=[ye,Se,Te,xe,$e,ke,Ae,Re,je,ge,ve,be,Pe,{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(P(t,"options")||(t.options=e.prop.options||[]),P(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 o=t.$render.defaultRender(t,e);if(o&&o.props&&o.props.on){const e=o.props.on["update:modelValue"],r=()=>{A(()=>{A(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const o=t.$handle.getFieldCtx(t.rule.field);o&&o.id&&t.$handle.$manager.validateField(o.id).catch(()=>{})}catch(e){console.warn("CusStoreSelect: 触发校验失败",e)}})})};o.props.on["update:modelValue"]=(...t)=>{e&&e(...t),r()};const l=o.props.on.change;o.props.on.change=l?(...e)=>{l(...e),r()}:r}return o}},{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(P(t,"options")||(t.options=e.prop.options||[]),P(t,"field")||(t.field=e.rule.field||""),P(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 o=t.$render.defaultRender(t,e);if(o&&o.props&&o.props.on){const e=o.props.on["update:modelValue"],r=()=>{A(()=>{A(()=>{try{const e=t.rule.field;if(e)return void t.$handle.api.validateField(e).catch(()=>{});const o=t.$handle.getFieldCtx(t.rule.field);o&&o.id&&t.$handle.$manager.validateField(o.id).catch(()=>{})}catch(e){console.warn("CusUserSelect: 触发校验失败",e)}})})};o.props.on["update:modelValue"]=(...t)=>{e&&e(...t),r()};const l=o.props.on.change;o.props.on.change=l?(...e)=>{l(...e),r()}:r}return o}},{name:"flex",mergeProp(e){var t,o,r;const l=e.rule.props||{},n=l.flexDirection||e.rule.flexDirection||"row",a=l.flexWrap||e.rule.flexWrap||"nowrap",i=l.justifyContent||e.rule.justifyContent||"flex-start",s=l.alignItems||e.rule.alignItems||"flex-start",c=l.alignContent||e.rule.alignContent||"flex-start",p="column"===n||"column-reverse"===n,d={"flex-start":"start","flex-end":"end",center:"center","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"}[i]||"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=p,e.prop.props.justify=d,e.prop.props.align=u,void 0!==l.gap&&(e.prop.props.gap=l.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:a,...w};c&&"flex-start"!==c&&(C.alignContent=c);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!==(o=null!==(r=l.resetMarginBottom)&&void 0!==r?r:e.rule.resetMarginBottom)&&void 0!==o&&o){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 o,r;const l={...t.prop};"flex"===l.type&&(l.type="a-flex");const n=(t.rule.props||{}).flexDirection||t.rule.flexDirection||"row",a="column"===n||"column-reverse"===n;l.props||(l.props={});const i=()=>{l.class||(l.class=[]),Array.isArray(l.class)||(l.class=[l.class])},s=null!==(o=null===(r=t.rule.props)||void 0===r?void 0:r.childFlex)&&void 0!==o?o:t.rule.childFlex;if(null!=s&&""!==s){i(),l.class.includes("_fc-flex-container")||l.class.push("_fc-flex-container");const e=String(s).trim();l.props.style||(l.props.style={}),l.props.style["--fc-child-flex"]=e,l.style||(l.style={}),l.style["--fc-child-flex"]=e}if(a){var c,p,d;const e=null!==(c=null!==(p=null===(d=t.rule.props)||void 0===d?void 0:d.childWidth)&&void 0!==p?p:t.rule.childWidth)&&void 0!==c?c:"100%";i(),l.class.includes("_fc-flex-container")||l.class.push("_fc-flex-container"),l.class.includes("_fc-flex-vertical")||l.class.push("_fc-flex-vertical");const o=String(e).trim();l.props.style||(l.props.style={}),l.props.style["--fc-child-width"]=o,l.style||(l.style={}),l.style["--fc-child-width"]=o}const u=e||[],h=t._componentStyle||{};return t.vNode.col({props:{span:24},style:h},{default:()=>[t.vNode.make("a-flex",l,u)]})}},{name:"space",mergeProp(e){var t,o;const r=e.rule.props||{},l=r.direction||e.rule.direction||"horizontal",n=r.size||e.rule.size||"small",a=r.align||e.rule.align,i=r.wrap||e.rule.wrap||!1;e.prop.props||(e.prop.props={}),e.prop.props.direction=l,e.prop.props.size=n,null!=a&&""!==a&&(e.prop.props.align=a),e.prop.props.wrap=i;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!==(o=r.resetMarginBottom)&&void 0!==o?o: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 o={...t.prop};(t.rule.props||{}).compact||t.rule.compact||!1?o.type="a-space-compact":"space"===o.type&&(o.type="a-space");const r=e||[],l=t._componentStyle||{};return t.vNode.col({props:{span:24},style:l},{default:()=>[t.vNode.make(o.type,o,r)]})}},{name:"spin",mergeProp(e){var t,o,r,l,n,a,i,s,c;e.rule.wrap||(e.rule.wrap={}),e.rule.wrap.title=!1;const p=e.prop.props||{},d=null===(t=null!==(o=null!==(r=e.rule.containerMode)&&void 0!==r?r:null===(l=e.rule.props)||void 0===l?void 0:l.containerMode)&&void 0!==o?o:null===(n=e.prop.props)||void 0===n?void 0:n.containerMode)||void 0===t||t;var u,h,f,m;(d||(e.rule.children=[]),P(p,"spinning"))||(p.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&&p.spinning;const g=e.rule.bindField||(null===(a=e.rule.props)||void 0===a?void 0:a.bindField)||(null===(i=e.prop.props)||void 0===i?void 0:i.bindField);let v=e.rule.bindMode||(null===(s=e.rule.props)||void 0===s?void 0:s.bindMode)||(null===(c=e.prop.props)||void 0===c?void 0:c.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 o,r,l,n,a,i,s,c,p,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===(o=t.rule.props)||void 0===o?void 0:o.tip)||(null===(r=t.prop.props)||void 0===r?void 0:r.tip);f&&(t.prop.props.tip=f);const m=t.rule.delay||(null===(l=t.rule.props)||void 0===l?void 0:l.delay)||(null===(n=t.prop.props)||void 0===n?void 0:n.delay);null!=m&&(t.prop.props.delay=m);const y=t.rule.size||(null===(a=t.rule.props)||void 0===a?void 0:a.size)||(null===(i=t.prop.props)||void 0===i?void 0:i.size);y&&(t.prop.props.size=y),"spin"===t.prop.type&&(t.prop.type="a-spin");if(!(null===(s=null!==(c=null!==(p=t.rule.containerMode)&&void 0!==p?p:null===(d=t.rule.props)||void 0===d?void 0:d.containerMode)&&void 0!==c?c: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 o={...t.prop};"div"===o.type&&(o.type="div");const r=e||[];return o.props||(o.props={}),o.props.style||(o.props.style={}),t.vNode.make("div",o,r)}},{name:"aAlert",mergeProp(e){const t=e.prop.props||{};t.message&&""!==t.message||!t.description||(t.message=t.description,delete t.description)},render:(e,t)=>t.$render.defaultRender(t,e)},{name:"aCard",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)=>t.$render.defaultRender(t,e)},{name:"accTable",init(e){var t,o;const r=e.rule;if(null!==(t=r.effect)&&void 0!==t&&t.fetch&&null!==(o=r.props)&&void 0!==o&&o.pagination&&"object"==typeof r.props.pagination&&void 0!==r.props.pagination.current){const e=r.effect.fetch;if("object"==typeof e){const t=e.beforeFetch;if(!(t&&!0===t._accTablePaginationHook)){var l,n,a;const o=(null===(l=r.props)||void 0===l?void 0:l.paginationPageParam)||"page",i=(null===(n=r.props)||void 0===n?void 0:n.paginationPageSizeParam)||"pageSize",s=(null===(a=r.props)||void 0===a?void 0:a.paginationParamType)||"query",c=r;e.beforeFetch=(e,{api:r})=>{var l;const n=null==c||null===(l=c.props)||void 0===l?void 0:l.pagination;if(n&&"object"==typeof n){const t=n.current||1,r=n.pageSize||10;"query"===s?e.query={...e.query||{},[o]:t,[i]:r}:e.data={...e.data||{},[o]:t,[i]:r}}if(t&&"function"==typeof t)try{const o=t(e,{api:r});return o&&"function"==typeof o.then?o.catch(e=>(console.error("[accTable] 原始 beforeFetch 钩子执行出错:",e),Promise.resolve())):o}catch(e){console.error("[accTable] 原始 beforeFetch 钩子执行出错:",e)}},e.beforeFetch._accTablePaginationHook=!0}}}},mergeProp(e){var t,o,r,l,n;const a=e.prop.props||{},i=e.rule;e.api;let s=(null===(t=i.props)||void 0===t?void 0:t.columns)||[];if("string"==typeof s)try{const e=JSON.parse(s);Array.isArray(e)&&(s=e)}catch(e){console.warn("accTable columns parse error:",e),s=[]}Array.isArray(s)||(s=[]);const c=s.filter(e=>!e||!e.hidden).map(t=>{const o={...t};if(void 0!==o.width&&null!==o.width&&""!==o.width&&"string"==typeof o.width){const e=Number(o.width);!isNaN(e)&&isFinite(e)&&o.width.trim()===String(e)&&(o.width=e)}const r=!0===o.titleTooltipEnabled;let l=null,n=null;if(r&&o.titleTooltipContent)if(j.String(o.titleTooltipContent))if(o.titleTooltipContent.trim().startsWith("function")||o.titleTooltipContent.trim().startsWith("("))try{l=R(o.titleTooltipContent)}catch(e){console.warn("[accTable] 解析列标题 Tooltip 内容函数失败:",e),n=o.titleTooltipContent}else n=o.titleTooltipContent;else j.Function(o.titleTooltipContent)&&(l=o.titleTooltipContent);if(r&&(l||n)){const t=o.title,r=l,a=n,i=e;o.title=()=>{let e=t;if(j.Function(t))try{e=t()}catch(t){console.warn("[accTable] 执行原始标题函数失败:",t),e=""}null==e&&(e="");let o="";if(r&&j.Function(r))try{const e=r();o=null!=e?String(e):""}catch(e){console.warn("[accTable] 执行列标题 Tooltip 内容函数失败:",e),o=""}else a&&(o=a);if(!o)return e;let l=null;return l=j.String(e)&&e.includes("<")?i.$render.vNode.h("span",{innerHTML:e}):e,i.$render.vNode.make("aTooltip",{},{title:()=>j.String(o)&&o.includes("<")?i.$render.vNode.h("div",{innerHTML:o,style:{maxWidth:"300px",wordBreak:"break-word"}}):o,default:()=>l})}}let s=null;if(o.formatter)if(j.String(o.formatter))try{s=R(o.formatter)}catch(e){console.warn("[accTable] 解析列格式化函数失败:",e)}else j.Function(o.formatter)&&(s=o.formatter);const c=!0===o.tooltipEnabled;let p=null;if(c&&o.tooltipContent)if(j.String(o.tooltipContent))try{p=R(o.tooltipContent)}catch(e){console.warn("[accTable] 解析列 Tooltip 内容函数失败:",e)}else j.Function(o.tooltipContent)&&(p=o.tooltipContent);const d=o.cellType&&["input","select","radio"].includes(o.cellType),u=s&&j.Function(s),h=c&&(p||j.String(o.tooltipContent));if(d||u||h){const t=o.cellType,r=o.dataIndex,l=o.cellProps||{};o.customRender=(()=>{const n=e,c=s,f=p,m=j.String(o.tooltipContent)?o.tooltipContent:null;return({text:e,record:s,index:p})=>{var y;const g=s&&r?s[r]:e,v=n.api||(null===(y=n.$handle)||void 0===y?void 0:y.api)||{};s||console.warn("[accTable] record 未定义,使用空对象");const b=s||{};if(d){let e=[];const c=o.cellOptions;if(Array.isArray(c)?e=c:c&&"object"==typeof c&&(e=Object.keys(c).map(e=>({label:e,value:c[e]}))),"input"===t)return n.$render.vNode.make("aInput",{value:g,"onUpdate:value":e=>{s&&r&&(s[r]=e,n.api&&n.api.form&&i.field&&(n.api.form[i.field]=a.dataSource))},placeholder:l.placeholder||"",disabled:l.disabled||!1,size:l.size||"small",...l});if("select"===t)return n.$render.vNode.make("aSelect",{value:g,"onUpdate:value":e=>{s&&r&&(s[r]=e,n.api&&n.api.form&&i.field&&(n.api.form[i.field]=a.dataSource))},placeholder:l.placeholder||"",disabled:l.disabled||!1,size:l.size||"small",...l},e.map(e=>n.$render.vNode.make("aSelectOption",{key:e.value,value:e.value,label:e.label})));if("radio"===t){const t=null!=g?g:void 0,o=e.map(e=>n.$render.vNode.h("aRadio",{key:e.value,value:e.value},{default:()=>e.label||e.value})),c=e=>{s&&r&&(s[r]=e,n.api&&n.api.form&&i.field&&(n.api.form[i.field]=a.dataSource),n.api&&n.api.sync&&n.api.sync(i))};return n.$render.vNode.h("aRadioGroup",{value:t,onChange:e=>{var t;const o="object"==typeof e&&void 0!==(null==e||null===(t=e.target)||void 0===t?void 0:t.value)?e.target.value:e;c(o)},disabled:l.disabled||!1,size:l.size||"small",...l},{default:()=>o})}}let w=e;if(u&&c)try{const e=c(b,v);null!=e&&(w=j.String(e)?e:String(e))}catch(t){console.warn("[accTable] 执行列格式化函数失败:",t),w=e}let C=null;if(C=j.String(w)&&w.includes("<")?n.$render.vNode.h("span",{innerHTML:w}):w,h){const e=b,t=v;return n.$render.vNode.make("aTooltip",{},{title:()=>{let o="";if(f&&j.Function(f))try{const r=f(e,t);o=null!=r?String(r):""}catch(e){console.warn("[accTable] 执行列 Tooltip 内容函数失败:",e),o=""}else m&&(o=m);return o?n.$render.vNode.h("div",{innerHTML:o,style:{maxWidth:"300px",wordBreak:"break-word"}}):null},default:()=>C})}return C}})()}return o});a.columns=c;let p=0,d=!0;if(c.forEach(e=>{if(void 0!==e.width&&null!==e.width&&""!==e.width){let t=e.width;if("string"==typeof t){const e=t.match(/^(\d+(?:\.\d+)?)/);if(!e)return void(d=!1);t=parseFloat(e[1])}"number"==typeof t&&t>0&&(p+=t)}else d=!1}),P(i.props,"scroll")){const e=i.props.scroll;if(e&&"object"==typeof e&&void 0===e.x&&p>0){const t=d?p+50:Math.max(p+50,800);a.scroll={...e,x:t}}else a.scroll=e}else if(p>0){const e=d?p+50:Math.max(p+50,800);a.scroll={x:e}}else a.scroll=void 0;if(!P(a,"dataSource")){var u,h;let e=i.value||(null===(u=i.props)||void 0===u?void 0:u.dataSource)||[];if("string"==typeof e&&(null===(h=i.effect)||void 0===h||!h.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=[]),a.dataSource=e}const f=e.effectData("fetch"),m=f&&!0===f.loading;var y;P(a,"loading")?a.loading=void 0!==(null===(y=i.props)||void 0===y?void 0:y.loading)?i.props.loading:m:a.loading=m;const g=null===(o=i.props)||void 0===o?void 0:o.pagination;if(!P(a,"pagination"))if(!1===g)a.pagination=!1;else if(g&&"object"==typeof g){const e={current:g.current||1,pageSize:g.pageSize||10,total:g.total||0,showSizeChanger:!1!==g.showSizeChanger,showQuickJumper:g.showQuickJumper||!1,showTotal:g.showTotal,...g};a.pagination=e}else a.pagination=!1;if(null!==(r=i.effect)&&void 0!==r&&r.fetch&&g&&"object"==typeof g&&void 0!==g.current){var v,b,w,C,S;const t=(null===(v=i.props)||void 0===v?void 0:v.paginationPageParam)||"page",o=(null===(b=i.props)||void 0===b?void 0:b.paginationPageSizeParam)||"pageSize",r=(null===(w=i.props)||void 0===w?void 0:w.paginationParamType)||"query";null===(C=i.props)||void 0===C||C.paginationResponseDataPath,null===(S=i.props)||void 0===S||S.paginationResponseTotalPath,a.pagination;const l=i.effect.fetch;if("object"==typeof l){const e=r,n=t,a=o,s=l.beforeFetch,c=i;s&&!0===s._accTablePaginationHook||(l.beforeFetch=(t,{api:o})=>{var r;const l=null==c||null===(r=c.props)||void 0===r?void 0:r.pagination;if(l&&"object"==typeof l){const o=l.current||1,r=l.pageSize||10;"query"===e?t.query={...t.query||{},[n]:o,[a]:r}:t.data={...t.data||{},[n]:o,[a]:r}}else console.warn("[accTable] 分页配置无效,无法添加分页参数:",{currentPagination:l,type:typeof l});if(s&&"function"==typeof s)try{const e=s(t,{api:o});return e&&"function"==typeof e.then?e.catch(e=>(console.error("[accTable] 原始 beforeFetch 钩子执行出错:",e),Promise.resolve())):e}catch(e){console.error("[accTable] 原始 beforeFetch 钩子执行出错:",e)}},l.beforeFetch._accTablePaginationHook=!0)}else console.warn("[accTable] fetch 配置不是对象类型:",{type:typeof l,originalFetch:l});const n=a.pagination||g;n&&"object"==typeof n&&(n._accTableHandlersSet||(n.onChange||(n.onChange=(t,o)=>{var r;null!==(r=i.props)&&void 0!==r&&r.pagination&&(i.props.pagination.current=t,i.props.pagination.pageSize=o),e.api.sync(i),setTimeout(()=>{e.api.refresh()},0)}),n.onShowSizeChange||(n.onShowSizeChange=(t,o)=>{var r;null!==(r=i.props)&&void 0!==r&&r.pagination&&(i.props.pagination.current=1,i.props.pagination.pageSize=o),e.api.sync(i),setTimeout(()=>{e.api.refresh()},0)}),n._accTableHandlersSet=!0,a.pagination||(a.pagination=n)))}if(null!==(l=i.effect)&&void 0!==l&&l.fetch&&null!==(n=i.props)&&void 0!==n&&n.pagination){const t=e.effectData("fetch");if(t&&t.value){var x,$;const e=(null===(x=i.props)||void 0===x?void 0:x.paginationResponseDataPath)||"data",o=(null===($=i.props)||void 0===$?void 0:$.paginationResponseTotalPath)||"total";try{const r=Fe(t.value,e);Array.isArray(r)&&(a.dataSource=r,i.value=r,i.props.dataSource=r);const l=Fe(t.value,o);"number"==typeof l&&i.props.pagination&&"object"==typeof i.props.pagination&&(i.props.pagination.total=l,a.pagination&&"object"==typeof a.pagination&&(a.pagination.total=l))}catch(e){console.warn("accTable parse response error:",e)}}}P(i.props,"bordered")&&(a.bordered=i.props.bordered),P(i.props,"size")&&(a.size=i.props.size),P(i.props,"rowKey")&&(a.rowKey=i.props.rowKey||"id"),P(i.props,"rowSelection")&&(a.rowSelection=i.props.rowSelection),P(i.props,"sticky")&&(a.sticky=i.props.sticky),P(i.props,"virtual")&&(a.virtual=i.props.virtual)},render:(e,t)=>t.$render.defaultRender(t,e)},{name:"tableForm"},{name:"fcTable"},{name:"exportExcel"},{name:"businessComponent",modelField:"modelValue",mergeProp(e){var t,o,r;const l=e.rule,n=e.prop.props||(e.prop.props={}),a=null===(t=e.inject)||void 0===t?void 0:t.$handle,i=e.id,s=null===(o=e.rule)||void 0===o?void 0:o.field,c=null==a?void 0:a.vm;console.warn("[fc-bc] ① parser.mergeProp",{ctxId:i,field:s,hasHandle:!!a,hasBcVm:!!c,ctxInjectKeys:e.inject?Object.keys(e.inject):"no inject"});const p=a||(null===(r=e.inject)||void 0===r?void 0:r.$handle),d=!0===(null==p?void 0:p.preview),u=a&&c?{...e.inject,businessComponentId:i,$bcVm:c,$handle:a,preview:d}:a?{...e.inject,businessComponentId:i,$handle:a,preview:d}:{...e.inject,preview:d};P(n,"formCreateInject")?n.formCreateInject={...n.formCreateInject,...u}:n.formCreateInject=u,e.prop.formCreateInject=u,console.warn("[fc-bc] ① parser 写入后 props.formCreateInject keys",{keys:Object.keys(n.formCreateInject||{}),hasBusinessComponentId:"businessComponentId"in(n.formCreateInject||{}),hasBcVm:"$bcVm"in(n.formCreateInject||{}),hasHandle:"$handle"in(n.formCreateInject||{})});const h=function(e){if(e.component&&"object"==typeof e.component)return e.component;const t=e.componentName;if(!t||"string"!=typeof t)return null;return De().get(t)||null}(l);if(h&&(e.prop.component=h),l.props&&"object"==typeof l.props){const e={...l.props};null!=e.props&&"object"==typeof e.props&&(Object.assign(e,e.props),delete e.props),Object.assign(n,e)}a&&c&&"function"!=typeof c.registerBusinessComponent&&(c.businessComponentRefs=c.businessComponentRefs||{},c.registerBusinessComponent=function(e,t){this.businessComponentRefs[e]=t,this.businessComponentIds=this.businessComponentIds||[],this.businessComponentIds.includes(e)||this.businessComponentIds.push(e)},c.unregisterBusinessComponent=function(e){this.businessComponentRefs&&delete this.businessComponentRefs[e]})},render:(e,t)=>t.prop.component?t.$render.defaultRender(t,e||[]):t.$render.vNode.h("div",{class:"fc-business-component-placeholder",style:{padding:"8px",color:"#999"}},"未找到业务组件: "+(t.rule.componentName||"(未设置 componentName)"))}];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",alert:"aAlert",aAlert:"aAlert",Alert:"aAlert",card:"aCard",aCard:"aCard",Card:"aCard",accTable:"aTable",accTableTable:"aTable",exportExcel:"ExportExcel"};function Be(e,t){P(e,t)&&j.String(e[t])&&(e[t]={[t]:e[t],show:!0})}function ze(e){return!1===e}function Ne(e){const t={...e};return delete t.children,t}var Me={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){P(e,t)&&!j.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)}),P(e,"beforeSubmit")&&j.String(e.beforeSubmit)&&(e.beforeSubmit=R(e.beforeSubmit)),P(e,"onSubmit")&&j.String(e.onSubmit)&&(e.onSubmit=R(e.onSubmit)),e),tidyRule:({prop:e})=>(Be(e,"title"),Be(e,"info"),e),mergeProp(e){var t,o;e.inject||(e.inject={}),e.inject.$handle||(e.inject.$handle=this.$handle);const r={info:{type:"popover",placement:"topLeft",icon:"QuestionCircleOutlined"},title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach(t=>{e.prop[t]=O([this.options[t]||{},e.prop[t]||{}],r[t])}),e.rule.componentStyle&&"object"==typeof e.rule.componentStyle&&(e._componentStyle=e.rule.componentStyle);const l=!0===this.$handle.preview,n=!0===(null===(t=e.rule.props)||void 0===t?void 0:t.readOnly)||!0===(null===(o=e.prop.props)||void 0===o?void 0:o.readOnly);var a;(l||n)&&("upload"===e.rule.type?e.prop.props&&(e.prop.props.disabled=!0):"inputNumber"===e.rule.type?e.prop.props&&(e.prop.props.readOnly=!0,e.prop.props.readonly=!0,delete e.prop.props.placeholder):"fcEditor"===e.rule.type?e.prop.props&&(e.prop.props.readOnly=!0,delete e.prop.props.placeholder,delete e.prop.props.height):"input"===e.rule.type&&"textarea"===(null===(a=e.prop.props)||void 0===a?void 0:a.type)?e.prop.props&&(e.prop.props.readOnly=!0,e.prop.props.autoSize=!0,delete e.prop.props.rows,delete e.prop.props.placeholder,e.prop.props.showCount=!1):"select"===e.rule.type?e.prop.props&&(e.prop.props.disabled=!0,delete e.prop.props.placeholder):"input"===e.rule.type?e.prop.props&&n?(e.prop.props.readOnly=!0,delete e.prop.props.placeholder,e.prop.props.showCount=!1):e.prop.props&&l&&("number"===e.prop.props.type&&(e.prop.props.readOnly=!0),delete e.prop.props.placeholder,e.prop.props.showCount=!1):"datePicker"!==e.rule.type&&"timePicker"!==e.rule.type&&"timeRangePicker"!==e.rule.type&&"rangePicker"!==e.rule.type&&"cascader"!==e.rule.type||e.prop.props&&("cascader"===e.rule.type&&(e.prop.props.disabled=!0),delete e.prop.props.placeholder));if(e.parent&&e.parent.rule){const t=e.parent.rule.type,o=e.parent.rule._menu;"flex"!==t&&"a-flex"!==t&&"flex"!==(null==o?void 0:o.name)&&"space"!==t&&"a-space"!==t&&"space"!==(null==o?void 0:o.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,o=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){o(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,o=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||"",l=null==t?void 0:t.onVisibleChange;e.prop.props.preview={...t,visible:t.visible||!1,src:t.src||r,onVisibleChange:(e,n)=>(e&&!n&&o(t.src||r),!(!l||"function"!=typeof l)&&l.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()},"*")},o=e.prop.props.src||"";e.prop.props.preview={visible:!1,src:o,onVisibleChange:(e,r)=>{if(e&&!r)return t(o),!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,o)=>new Promise((e,r)=>t(o,t=>{t?r(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:o}=this,r=this.options.form;E(this.rule,{key:e,ref:t,class:[r.className,r.class,"form-create",this.$handle.preview?"is-preview":""]}),E(this.rule.props,{model:o.formData})},render(e){return e.slotLen()&&!this.$handle.preview&&e.setSlot(void 0,()=>this.makeFormBtn()),this.$r(this.rule,ze(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap(e,t){const o=e.prop,r=`${this.key}${e.key}`,l=o.col,n=this.isTitle(o)&&!1!==o.wrap.title,{layout:a,col:i}=this.rule.props,s=o.wrap.class;delete o.wrap.class,delete o.wrap.title;let c=!1;if(e.parent&&e.parent.rule){const t=e.parent.rule.type,o=e.parent.rule._menu;"flex"!==t&&"a-flex"!==t&&"flex"!==(null==o?void 0:o.name)&&"space"!==t&&"a-space"!==t&&"space"!==(null==o?void 0:o.name)||(c=!0)}const p=ze(o.wrap.show)?t:this.$r(O([o.wrap,{props:{...Ne(o.wrap||{}),hasFeedback:o.hasFeedback||!1,name:e.id,rules:e.injectValidate(),..."horizontal"!==a?{labelCol:{},wrapperCol:{}}:{}},class:this.$render.mergeClass(s||o.className,"fc-form-item"),key:r+"fi",ref:e.wrapRef,type:"formItem"}]),{default:()=>t,...n?{label:()=>this.makeInfo(o,r,e)}:{}});return"inline"===a||ze(i)||ze(l.show)||c?p:this.makeCol(o,r,[p],e)},isTitle(e){if(!1===this.options.form.title)return!1;const t=e.title;return!(!t.title&&!t.native||ze(t.show))},makeInfo(e,t,o){var r,l;const n={...e.title},a={...e.info};if(!1===this.options.form.title)return!1;if(!n.title&&!n.native||ze(n.show))return;const i="tooltip"===a.type;const s=this.getSlot("title"),c=[s?s({title:null===(r=o.refRule)||void 0===r||null===(r=r.__$title)||void 0===r?void 0:r.value,rule:o.rule,options:this.options}):null===(l=o.refRule)||void 0===l||null===(l=l.__$title)||void 0===l?void 0:l.value];if(!ze(a.show)&&(a.info||a.native)&&!ze(a.icon)){const e={type:a.type||"popover",props:Ne(a),key:t+"pop"};delete e.props.icon,delete e.props.show,delete e.props.info,delete e.props.align,delete e.props.native;const r=i?"title":"content";var p;if(a.info&&!P(e.props,r))e.props[r]=null===(p=o.refRule)||void 0===p||null===(p=p.__$info)||void 0===p?void 0:p.value;c["left"!==a.align?"unshift":"push"](this.$r(O([a,e]),{[n.slot||"default"]:()=>this.$r({type:!0===a.icon?"QuestionCircleOutlined":a.icon||"",props:{type:!0===a.icon?"QuestionCircleOutlined":a.icon},key:t+"i"})}))}const d=O([n,{props:Ne(n),key:t+"tit",class:"fc-form-title",type:n.type||"span"}]);return delete d.props.show,delete d.props.title,delete d.props.native,this.$r(d,c)},makeCol(e,t,o,r){const l=e.col,n=(null==r?void 0:r._componentStyle)||{};return this.$r({class:this.$render.mergeClass(l.class,"fc-form-col"),type:"col",props:l||{span:24},style:n,key:t+"col"},o)},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(ze(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),ze(this.options.resetBtn.show)||e.push(this.makeResetBtn()),!e.length)return;let{labelCol:t,wrapperCol:o,layout:r}=this.rule.props;"horizontal"!==r&&(t=o={});const l=this.$r({type:"formItem",class:"fc-form-item fc-form-footer",key:this.key+"fb",props:{labelCol:t,wrapperCol:o,label:" ",colon:!1}},e);return"inline"===r?l:this.$r({type:"col",class:"fc-form-col",props:{span:24},key:this.key+"fc"},[l])},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 Ke={};var Le;!function(e){["treeSelect","upload","frame","autoComplete","cascader","datePicker","frame","inputNumber","inputPassword","radio","rate","switch","rate","slider","timePicker"].reduce((e,t)=>(e[t]=V(t),e),e),e.auto=e.autoComplete,e.number=e.inputNumber,e.time=e.timePicker,e.password=e.inputPassword}(Ke),function(e){e.sliderRange=V("slider",{range:!0})}(Ke),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,o)=>(e[o]=V("frame",e=>e.props({type:t[o][0],maxLength:t[o][1]})),e),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(Ke),function(e){const t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((e,o)=>(e[o]=V("upload",e=>e.props({uploadType:t[o][0],maxLength:t[o][1]})),e),e),e.uploadImage=e.image,e.uploadFile=e.file}(Ke),(Le=Ke).selectMultiple=V("select",{mode:"multiple"}),Le.selectTags=V("select",{mode:"tags"}),Le.selectCombobox=V("select",{mode:"combobox"}),function(e){e.cusStoreSelect=V("cusStoreSelect"),e.storeSelect=e.cusStoreSelect}(Ke),function(e){e.cusUserSelect=V("cusUserSelect"),e.userSelect=e.cusUserSelect}(Ke),function(e){e.text=V("text")}(Ke),function(e){e.flex=V("flex")}(Ke),function(e){e.space=V("space")}(Ke),function(e){e.spin=V("spin")}(Ke);const qe=new class{mobile(e,t=!1){if(!e)return!1;const o=String(e).trim();return t?/^1[3-9]\d{9}$/.test(o):/^1\d{10,11}$/.test(o)}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 o=String(e).trim().toUpperCase();if(!/^\d{17}[\dX]$/.test(o))return!1;if(!t)return!0;const r=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let l=0;for(let e=0;e<17;e++)l+=parseInt(o[e])*r[e];const n=l%11;return o[17]===["1","0","X","9","8","7","6","5","4","3","2"][n]}url(e,t={}){if(!e)return!1;const o=String(e).trim(),{requireProtocol:r=!1}=t;return r?/^https?:\/\/.+\..+/.test(o):/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/.test(o)}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 o=Number(e);if(isNaN(o))return!1;const{integer:r=!1,positive:l=!1,negative:n=!1,min:a,max:i}=t;return!(r&&!Number.isInteger(o))&&(!(l&&o<=0)&&(!(n&&o>=0)&&(!(void 0!==a&&o<a)&&!(void 0!==i&&o>i))))}length(e,t={}){if(null==e)return!1;const o=String(e),{min:r,max:l,len:n}=t;return void 0!==n?o.length===n:!(void 0!==r&&o.length<r)&&!(void 0!==l&&o.length>l)}pattern(e,t){if(!e||!t)return!1;const o=String(e);let r;if(t instanceof RegExp)r=t;else try{r=new RegExp(t)}catch(e){return!1}return r.test(o)}date(e,t={}){if(!e)return!1;let o;if(e instanceof Date)o=e;else if(o=new Date(e),isNaN(o.getTime()))return!1;const{min:r,max:l}=t;if(r){if(o<(r instanceof Date?r:new Date(r)))return!1}if(l){if(o>(l instanceof Date?l:new Date(l)))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 o=String(e);return t?/^[a-zA-Z]+$/.test(o):/^[a-z]+$/i.test(o)}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,o=!1){return o?e===t:e==t}notEqual(e,t,o=!0){return!this.equal(e,t,o)}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 o=String(e).trim(),{min:r=3,max:l=20}=t;return!(o.length<r||o.length>l)&&/^[a-zA-Z0-9_]+$/.test(o)}password(e,t={}){if(!e)return!1;const o=String(e),{min:r=6,max:l=20,requireNumber:n=!1,requireLetter:a=!1,requireSpecial:i=!1}=t;return!(o.length<r||o.length>l)&&(!(n&&!/\d/.test(o))&&(!(a&&!/[a-zA-Z]/.test(o))&&!(i&&!/[!@#$%^&*(),.?":{}|<>]/.test(o))))}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 Ue=null;try{var He,Ge,We;if(null!==(He=parent)&&void 0!==He&&null!==(He=He.window)&&void 0!==He&&He.location)Ue="https://zxgj.zhixianai.com"==(null===(Ge=parent)||void 0===Ge||null===(Ge=Ge.window)||void 0===Ge?void 0:Ge.location.origin)||"http://zxgj.zhixianai.com"==(null===(We=parent)||void 0===We||null===(We=We.window)||void 0===We?void 0:We.location.origin)}catch(e){Ue=null}const Ye="undefined"!=typeof location?location.protocol:"https:",Je="undefined"!=typeof location&&location.host&&location.host.lastIndexOf("localhost")>-1,Qe="undefined"!=typeof location&&location.host&&location.host.lastIndexOf("sandbox")>-1||Je?"sandbox-":"",Ze={basicApi:`${Ye}//${Qe}zxgj.zhixianai.com/api/`,goodsApi:`${Ye}//${Qe}goods-api.zhixianai.com`,manageApi:`${Ye}//${Qe}manage-api.zhixianai.com`,billApi:`${Ye}//${Qe}finance.zhixianai.com`,orderApi:`${Ye}//${Qe}order-api.zhixianai.com`,payApi:`${Ye}//${Qe}pay.zhixianai.com`,operationApi:`${Ye}//${Qe}operation-api.zhixianai.com/api`,merchantApi:`${Ye}//${Qe}merchant-api.zhixianai.com/api`,ossApi:`${Ye}//${Qe}upload.zhixianai.com`,marketingApi:`${Ye}//${Qe}marketing-api.zhixianai.com/api`,customApi:`${Ye}//${Qe}custom-service.zhixianai.com/api`,engineApi:`${Ye}//${Qe}flow.zhixianai.com/api`,messageApi:`${Ye}//${Qe}message.zhixianai.com/api`,warehouseApi:`${Ye}//${Qe}data-warehouse.zhixianai.com/api`,materielApi:`${Ye}//${Qe}materiel-api.zhixianai.com/api`,crawlerApi:`${Ye}//${Qe}crawler.zhixianai.com/api`,imgUrl:"https://s1.zhixianai.com"};function Xe(e,t){const o=Ze[e]||"";if(!o)return t;const r=t.startsWith("/")?t:"/"+t;return o.replace(/\/$/,"")+r}function et(e){if(!e||"object"!=typeof e)return e;if("get"===(e.method||"get").toLowerCase()&&null!=e.params&&"object"==typeof e.params){const t={...e};return t.query=null!=t.query?{...t.query,...t.params}:t.params,delete t.params,t}return e}function tt(e,t){return j.Boolean(e)?e={show:e}:j.Undef(e)||j.Object(e)||(e={show:t}),e}const ot=new Map;let rt=0,lt=!1;function nt(e,t){var o,r,l,n;const a="api-"+(null!==(o=null!==(r=null===(l=t.fc)||void 0===l?void 0:l.id)&&void 0!==r?r:null===(n=t.fc)||void 0===n?void 0:n.name)&&void 0!==o?o:`fc-${Date.now()}-${Math.random()}`);return ot.has(a)||ot.set(a,new Map),lt||(window.addEventListener("message",e=>{const t=e.data;if(!t||"object"!=typeof t||!t.messageId)return;const o=t.messageId;let r=!1;for(const[e,l]of ot.entries()){const n=l.get(o);if(n){r=!0;try{let r=t;return void 0!==t.data&&(r=t.data),n(r,t),l.delete(o),void(0===l.size&&ot.delete(e))}catch(t){console.error("postMessageToParent: 执行回调失败",o,t),l.delete(o),0===l.size&&ot.delete(e)}}}if(!r&&o){const e=[];for(const[,t]of ot.entries())e.push(...t.keys());console.warn("postMessageToParent: 未找到匹配的回调函数",{receivedMessageId:o,availableMessageIds:e,totalCallbacks:e.length,apiInstances:ot.size})}}),lt=!0),{formEl:()=>t.$manager.form(),wrapEl(e){const o=t.getFieldCtx(e);if(o)return t.vm.refs[o.wrapRef]},validate:o=>(console.warn("[fc-bc] ④ api.validate 入口被调用"),new Promise((r,l)=>{const n=e.children,a=[t.$manager.validate()];n.filter(e=>!e.isScope).forEach(e=>{a.push(e.validate())});const i=t.vm,s=i&&i.businessComponentRefs||t.businessComponentRefs||{},c=Object.keys(s);console.warn("[fc-bc] ④ api.validate 读注册表",{hasH:!!t,hasHvm:!(null==t||!t.vm),bcVmRefsKeys:null!=i&&i.businessComponentRefs?Object.keys(i.businessComponentRefs):"none",hRefsKeys:null!=t&&t.businessComponentRefs?Object.keys(t.businessComponentRefs):"none",bcIdsCount:c.length,bcIds:c}),c.forEach(e=>{const t=s[e];t&&"function"==typeof t.validate&&a.push(t.validate())}),Promise.all(a).then(()=>{r(!0),o&&o(!0)}).catch(r=>{l(r),o&&o(r),t.vm.emit("validate-fail",r,{api:e}),t.emitEvent("validate-fail",r,{api:e})})})),validateField:(o,r)=>new Promise((l,n)=>{const a=t.getFieldCtx(o);if(!a)return;const i=t.subForm[a.id],s=[t.$manager.validateField(a.id)];B(i).filter(e=>!e.isScope).forEach(e=>{s.push(e.validate())}),Promise.all(s).then(()=>{l(null),r&&r(null)}).catch(l=>{n(l),r&&r(l),t.vm.emit("validate-field-fail",l,{field:o,api:e})})}),clearValidateState(o,r=!0){e.helper.tidyFields(o).forEach(e=>{r&&this.clearSubValidateState(e),t.getCtxs(e).forEach(e=>{t.$manager.clearValidateState(e)})})},clearSubValidateState(o){e.helper.tidyFields(o).forEach(e=>{t.getCtxs(e).forEach(e=>{const o=t.subForm[e.id];o&&(Array.isArray(o)?o.forEach(e=>{e.clearValidateState()}):o&&o.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:(o={})=>{let r=tt(t.options.submitBtn,!0);E(r,o),t.options.submitBtn=r,e.refreshOptions()},resetBtnProps:(o={})=>{let r=tt(t.options.resetBtn,!1);E(r,o),t.options.resetBtn=r,e.refreshOptions()},submit:(o,r)=>(console.warn("[fc-bc] api.submit 入口被调用"),new Promise((l,n)=>{(!1===t.options.validateOnSubmit?Promise.resolve():e.validate()).then(()=>{const o=t.vm,r=o&&o.businessComponentRefs||t.businessComponentRefs||{},l=Object.keys(r).map(e=>{const t=r[e];try{const e=t&&"function"==typeof t.onSubmitPhase?t.onSubmitPhase():void 0;return Promise.resolve(e)}catch(e){return Promise.reject(e)}});return Promise.all(l).then(()=>e.formData())}).then(e=>Promise.resolve(t.beforeSubmit(e)).then(()=>e)).then(r=>{j.Function(o)&&_(()=>o(r,e)),j.Function(t.options.onSubmit)&&_(()=>t.options.onSubmit(r,e)),t.vm.emit("submit",r,e),l(r)}).catch(t=>{j.Function(r)&&_(()=>r(e,t)),n(t)}).catch((...t)=>{j.Function(r)&&_(()=>r(e,...t)),n(...t)})})),request:t=>("string"==typeof t&&(t={action:t}),e.fetch(t)),getStoreInfo(t){if(!t)return Promise.resolve(null);const o=function(e={}){const{storeId:t,...o}=e;return{action:Xe("merchantApi","/storeInfo/page"),method:"post",data:{current:1,size:1,params:{storeId:null!=t?t:o.storeId},...o},dataType:"json"}}({storeId:t});return e.fetch(o).then(e=>{var t,o;return 0===(null==e?void 0:e.code)&&null!==(t=null==e||null===(o=e.data)||void 0===o||null===(o=o.records)||void 0===o?void 0:o[0])&&void 0!==t?t:null}).catch(e=>Promise.reject(e))},getStorePlatformStats(t,o){if(!t||null==o||""===o)return Promise.resolve(null);const r=et(function(e,t){return{action:Xe("merchantApi","/storeInfo/getStorePlatformStats"),method:"post",data:{storeId:null!=e?e:null,platformId:null!=t?t:null},dataType:"json"}}(t,o));return e.fetch(r).then(e=>{var t;return 0===(null==e?void 0:e.code)&&null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}).catch(e=>Promise.reject(e))},checkStoreAuthSuccess(t,o){const r=function(e,t){const o=Array.isArray(t)?t:[];return{action:Xe("merchantApi","/rpc/store/flowable/checkStoreAuthSuccess"),method:"post",data:{storeId:null!=e?e:null,platformIds:o},dataType:"json"}}(t,o);return e.fetch(r).then(e=>0===(null==e?void 0:e.code)?e.data:null)},getBuildStoreApplyDetail(t){if(!t)return Promise.resolve(null);const o=et((r=t,{action:Xe("merchantApi","/store/getApplyDetail"),method:"get",params:{id:null!=r?r:null}}));var r;return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)&&null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}).catch(e=>Promise.reject(e))},getScatterRecycleApplyDetail(t){if(null==t||""===t)return Promise.resolve(null);const o=et(function(e){if(null==e||""===e)return{action:Xe("merchantApi","/store/pc/scatterRecycle/getApplyDetail"),method:"post",data:{id:null},dataType:"json"};const t=Number(e),o=Number.isNaN(t)?e:t;return{action:Xe("merchantApi","/store/pc/scatterRecycle/getApplyDetail"),method:"post",data:{id:o},dataType:"json"}}(t));return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)&&null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}).catch(e=>Promise.reject(e))},checkNearbyBrandOrderRule(t){const o=function(e={}){var t,o,r,l,n,a;return{action:Xe("merchantApi","/rpc/store/storeInfo/checkNearbyBrandOrderRule"),method:"post",data:{applyId:null!==(t=e.applyId)&&void 0!==t?t:null,brandId:null!==(o=e.brandId)&&void 0!==o?o:null,longitude:null!==(r=e.longitude)&&void 0!==r?r:null,latitude:null!==(l=e.latitude)&&void 0!==l?l:null,maxDistanceKm:null!==(n=e.maxDistanceKm)&&void 0!==n?n:3,minValidOrderNum:null!==(a=e.minValidOrderNum)&&void 0!==a?a:100},dataType:"json"}}(t||{});return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"checkNearbyBrandOrderRule 请求失败"))}).catch(e=>Promise.reject(e))},storeBindingPage(t={},o={current:1,size:1}){var r,l;const n=function(e={}){var t,o,r;return{action:Xe("merchantApi","/store/storeBinding/pageStoreBinding"),method:"post",data:{current:null!==(t=e.current)&&void 0!==t?t:1,size:null!==(o=e.size)&&void 0!==o?o:10,params:null!==(r=e.params)&&void 0!==r?r:{}},dataType:"json"}}({current:null!==(r=o.current)&&void 0!==r?r:1,size:null!==(l=o.size)&&void 0!==l?l:1,params:t||{}});return e.fetch(n).then(e=>{var t,o;return 0===(null==e?void 0:e.code)?null!==(t=null==e||null===(o=e.data)||void 0===o||null===(o=o.records)||void 0===o?void 0:o[0])&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"storeBindingPage 请求失败"))}).catch(e=>Promise.reject(e))},getGoodsMonitorListV2(t){const o=function(e={}){return{action:Xe("goodsApi","/goodsMonitor/listV2"),method:"post",data:{...e},dataType:"json"}}(t||{});return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"goodsMonitor listV2 失败"))}).catch(e=>Promise.reject(e))},getAbnormalProductTotalByStoreId(t){if(null==t||""===t)return Promise.resolve(null);const o=et(function(e){return{action:Xe("goodsApi","/abnormal/product/getTotalNumberAbnormalProductByStoreId"),method:"get",query:{storeId:null!=e?e:void 0}}}(t));return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"异常商品总数失败"))}).catch(e=>Promise.reject(e))},pageStoreSetting(t={}){const o=function(e={}){return{action:Xe("merchantApi","/storeSetup/pageStoreSetting"),method:"post",data:e,dataType:"json"}}(t);return e.fetch(o).then(e=>{var t;return 0===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"pageStoreSetting 请求失败"))}).catch(e=>Promise.reject(e))},queryStoreOrderConfigPageV2(t={}){const o=function(e={}){return{action:Xe("orderApi","/store/order/queryStoreOrderConfigPageV2"),method:"post",data:e,dataType:"json"}}(t);return e.fetch(o).then(e=>{var t;return 200===(null==e?void 0:e.code)?null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null:Promise.reject(new Error((null==e?void 0:e.message)||"queryStoreOrderConfigPageV2 请求失败"))}).catch(e=>Promise.reject(e))},throttle(e,t){let o=0;return function(...r){const l=this,n=Date.now();n-o>=(t||0)&&(o=n,e.call(l,...r))}},debounce(e,t){let o=null;return function(...r){const l=this;null!==o&&clearTimeout(o),o=setTimeout(()=>{e.call(l,...r)},t||0)}},$validator:qe,$moment:z,$dayjs:D,previewMode(t=!0){e.updateOptions({preview:!!t}),e.refresh()},isPreviewMode:()=>!0===t.preview,postMessageToParent(e,t,o,r="api"){let l="CUSTOM_MESSAGE",n={},i=null;if("string"==typeof e)l=e,n=t||{},i="function"==typeof o?o:null;else{if("object"!=typeof e||null===e)return console.error("postMessageToParent: 第一个参数必须是字符串(messageType)或对象(data)"),null;n=e,i="function"==typeof t?t:null,l="string"==typeof o?o:"CUSTOM_MESSAGE"}const s=`${r}-${l}-${Date.now()}-${++rt}`,c={type:l,messageId:s,...function e(t){if(null==t)return t;try{return JSON.parse(JSON.stringify(t))}catch(o){if(console.warn("postMessageToParent: 数据序列化失败,尝试递归处理",o),Array.isArray(t))return 0===t.length?[]:t.map(t=>e(t));if("object"==typeof t){const o={};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r))try{o[r]=e(t[r])}catch(e){console.warn("postMessageToParent: 跳过无法序列化的属性: "+r,e)}return o}return t}}(n)};if(j.Function(i)){ot.has(a)||ot.set(a,new Map);const e=ot.get(a);e?(e.has(s)&&console.warn("postMessageToParent: 消息ID已存在,将覆盖旧的回调",s),e.set(s,i)):console.error("postMessageToParent: 无法获取回调存储,apiInstanceId:",a)}if(window.parent&&window.parent!==window)try{window.parent.postMessage(c,"*")}catch(e){if(j.Function(i)){const e=ot.get(a);e&&e.delete(s)}throw e}else if(console.warn("postMessageToParent: 当前不在 iframe 环境中,无法向父窗口发送消息",l,s),j.Function(i)){const e=ot.get(a);e&&e.delete(s)}return s}}}var at={autoComplete:"value",cascader:"value",inputNumber:"value",inputPassword:"value",textarea:"value",rate:"value",slider:"value",treeSelect:"value",switch:"checked",aTabs:"activeKey",cusStoreSelect:"modelValue",cusUserSelect:"modelValue",businessComponent:"modelValue"};const it={name:"required",load(e,t,o){const r=function(e){return j.Boolean(e)?{required:e}:j.String(e)?{message:e}:j.Undef(e)?{required:!1}:j.Function(e)?{validator:e}:j.Object(e)?e:{}}(e.getValue());if(!1===r.required)e.clearProp(),o.clearValidateState([t.field]);else{var l;const n={required:!0,validator:(e,t)=>new Promise((e,o)=>{j.empty(t)?o(n.message):e()}),...r},a=null===(l=t.__fc__.refRule)||void 0===l||null===(l=l.__$title)||void 0===l?void 0:l.value;if(n.message){const e=n.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);e&&(n.message=o.t(e[1],{title:a}))}else n.message=o.t("required",{title:a})||a+("en"===o.getLocale()?" is required":"不能为空");e.getProp().validate=[n]}o.sync(t)},watch(...e){it.load(...e)}};function st(e){const t=De();e.businessComponents=t,e.registerBusinessComponent=function(e,t){return De().set(e,t),this};const o=Object.getPrototypeOf(e);o&&(o.businessComponents=t,o.registerBusinessComponent=e.registerBusinessComponent),e.componentAlias(_e),Object.keys(at).forEach(t=>{e.setModelField(t,at[t])}),me.forEach(t=>{e.component(t.name,t)}),e.register(it),Ee.forEach(t=>{e.parser(t)}),Object.keys(Ke).forEach(t=>{e.maker[t]=Ke[t]}),"undefined"!=typeof window&&window.antd&&e.useApp((e,t)=>{t.use(window.antd)})}const ct=I({ui:'"ant-design-vue"',version:'"3.4.58"',manager:Me,install:st,extendApi:nt,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});ct.businessComponents=De(),ct.registerBusinessComponent=function(e,t){return Oe(e,t),this},"undefined"!=typeof window&&(window.formCreate=ct);const pt=ct.maker;export{ct as default,pt as maker,Oe as registerBusinessComponent};
|
|
8
8
|
//# sourceMappingURL=form-create.esm.js.map
|