@aspire-ui/element-component-pro 1.0.1 → 1.0.2
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/README.md +141 -7
- package/dist/ProTable/ProTable.vue.d.ts +421 -0
- package/dist/ProTable/TableAction.vue.d.ts +43 -0
- package/dist/ProTable/index.d.ts +8 -0
- package/dist/ProTable/types/index.d.ts +252 -0
- package/dist/ProTable/useProTable.d.ts +12 -0
- package/dist/element-component-pro.es.js +741 -296
- package/dist/element-component-pro.es.js.map +1 -1
- package/dist/element-component-pro.umd.js +2 -2
- package/dist/element-component-pro.umd.js.map +1 -1
- package/dist/index.d.ts +1325 -0
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +0 -49
- package/dist/useComponentSetting.d.ts +12 -0
- package/package.json +7 -5
- package/src/ProForm/ProForm.vue +3 -1
- package/src/ProForm/useForm.ts +0 -1
- package/src/ProTable/ProTable.vue +773 -0
- package/src/ProTable/TableAction.vue +193 -0
- package/src/ProTable/index.ts +20 -0
- package/src/ProTable/types/index.ts +236 -0
- package/src/ProTable/useProTable.ts +79 -0
- package/src/index.ts +13 -10
- package/src/types/index.ts +0 -44
- package/src/useComponentSetting.ts +35 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-component-pro.es.js","sources":["../src/ProForm/ProFormItem.vue","../src/ProForm/ProForm.vue","../src/ProForm/useForm.ts","../src/index.ts"],"sourcesContent":["<template>\n <el-form-item\n v-if=\"shouldRender\"\n v-show=\"shouldShow\"\n :prop=\"schema.field\"\n :required=\"schema.required\"\n :rules=\"effectiveRules\"\n >\n <template slot=\"label\">\n <span>{{ schema.label }}</span>\n <el-tooltip\n v-if=\"schema.helpMessage\"\n placement=\"top\"\n effect=\"light\"\n v-bind=\"schema.helpComponentProps || {}\"\n >\n <template slot=\"content\">\n <template v-if=\"Array.isArray(schema.helpMessage)\">\n <div v-for=\"(msg, i) in schema.helpMessage\" :key=\"i\" class=\"ecp-pro-form-item__help-item\">\n {{ msg }}\n </div>\n </template>\n <span v-else>{{ schema.helpMessage }}</span>\n </template>\n <i class=\"el-icon-question ecp-pro-form-item__help-icon\" />\n </el-tooltip>\n </template>\n <!-- render 自定义渲染 -->\n <template v-if=\"schema.render\">\n <component :is=\"renderComponent\" />\n </template>\n <!-- slot 自定义插槽(由 ProForm 传入 default slot) -->\n <slot v-else-if=\"hasSlot\" :model=\"formModel\" :schema=\"schema\" :field=\"schema.field\" :values=\"formModel\" />\n <!-- 默认组件渲染 -->\n <template v-else>\n <el-input\n v-if=\"schema.component === 'input' || !schema.component\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder || (autoPlaceholder ? `请输入${schema.label}` : undefined)\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-input-number\n v-else-if=\"schema.component === 'input-number'\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-select\n class=\"ecp-pro-form-item__select\"\n v-else-if=\"schema.component === 'select'\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder || (autoPlaceholder ? `请选择${schema.label}` : undefined)\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n >\n <el-option\n v-for=\"opt in (getOptions(effectiveComponentProps) || [])\"\n :key=\"String(opt.value)\"\n :label=\"opt.label\"\n :value=\"opt.value\"\n />\n </el-select>\n <el-date-picker\n v-else-if=\"schema.component === 'date-picker'\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder || (autoPlaceholder ? `请选择${schema.label}` : undefined)\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-date-picker\n v-else-if=\"schema.component === 'date-range'\"\n v-model=\"formModel[schema.field]\"\n type=\"daterange\"\n range-separator=\"至\"\n start-placeholder=\"开始日期\"\n end-placeholder=\"结束日期\"\n value-format=\"yyyy-MM-dd\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-switch\n v-else-if=\"schema.component === 'switch'\"\n v-model=\"formModel[schema.field]\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-cascader\n v-else-if=\"schema.component === 'cascader'\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder || (autoPlaceholder ? `请选择${schema.label}` : undefined)\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-checkbox-group\n v-else-if=\"schema.component === 'checkbox'\"\n v-model=\"formModel[schema.field]\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n >\n <el-checkbox\n v-for=\"opt in (getOptions(effectiveComponentProps) || [])\"\n :key=\"String(opt.value)\"\n :label=\"opt.value\"\n >\n {{ opt.label }}\n </el-checkbox>\n </el-checkbox-group>\n <el-radio-group\n v-else-if=\"schema.component === 'radio'\"\n v-model=\"formModel[schema.field]\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n >\n <el-radio\n v-for=\"opt in (getOptions(effectiveComponentProps) || [])\"\n :key=\"String(opt.value)\"\n :label=\"opt.value\"\n >\n {{ opt.label }}\n </el-radio>\n </el-radio-group>\n </template>\n </el-form-item>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots, h } from 'vue'\nimport type { ProFormSchema, RenderCallbackParams } from '../types'\n\nconst props = defineProps<{\n schema: ProFormSchema\n formModel: Record<string, unknown>\n formDisabled?: boolean\n autoPlaceholder?: boolean\n formActionType?: import('../types').FormActionType\n}>()\n\nconst slots = useSlots()\n\nconst renderParams = computed<RenderCallbackParams>(() => ({\n schema: props.schema,\n values: props.formModel,\n model: props.formModel,\n field: props.schema.field,\n}))\n\nconst shouldRender = computed(() => {\n const ifShow = props.schema.ifShow\n if (ifShow === undefined) return true\n if (typeof ifShow === 'boolean') return ifShow\n return ifShow(renderParams.value)\n})\n\nconst shouldShow = computed(() => {\n const show = props.schema.show\n if (show === undefined) return true\n if (typeof show === 'boolean') return show\n return show(renderParams.value)\n})\n\nconst effectiveDisabled = computed(() => {\n if (props.formDisabled) return true\n const dyn = props.schema.dynamicDisabled\n if (dyn === undefined) return false\n if (typeof dyn === 'boolean') return dyn\n return dyn(renderParams.value)\n})\n\nconst effectiveRules = computed(() => {\n const dyn = props.schema.dynamicRules\n if (!dyn) return props.schema.rules\n if (Array.isArray(dyn)) return dyn\n return dyn(renderParams.value)\n})\n\nconst effectiveComponentPropsAndListeners = computed(() => {\n const cp = props.schema.componentProps\n if (!cp) return { props: {}, listeners: {} }\n const raw = typeof cp === 'function'\n ? cp({\n ...renderParams.value,\n formActionType: props.formActionType,\n })\n : { ...cp }\n const propsOnly: Record<string, unknown> = {}\n const listeners: Record<string, (...args: unknown[]) => unknown> = {}\n for (const [key, value] of Object.entries(raw)) {\n if (key.length > 2 && /^on[A-Za-z]/.test(key) && typeof value === 'function') {\n const eventName = key.slice(2).charAt(0).toLowerCase() + key.slice(3)\n listeners[eventName] = value as (...args: unknown[]) => unknown\n } else {\n propsOnly[key] = value\n }\n }\n return { props: propsOnly, listeners }\n})\n\nconst effectiveComponentProps = computed(() => effectiveComponentPropsAndListeners.value.props)\nconst effectiveComponentListeners = computed(() => effectiveComponentPropsAndListeners.value.listeners)\n\nconst hasSlot = computed(() => !!slots.default)\n\nconst getOptions = (props: Record<string, unknown>): Array<{ label: string; value: unknown }> | undefined => {\n const opts = props?.options\n return Array.isArray(opts) ? opts : undefined\n}\n\nconst renderComponent = computed(() => {\n const renderFn = props.schema.render\n if (!renderFn) return null\n return {\n render() {\n const result = renderFn(renderParams.value)\n if (Array.isArray(result)) {\n return h('span', result)\n }\n return result\n },\n }\n})\n</script>\n\n<style scoped>\n.ecp-pro-form-item__help-icon {\n margin-left: 4px;\n color: #909399;\n cursor: help;\n font-size: 14px;\n}\n.ecp-pro-form-item__help-icon:hover {\n color: #409eff;\n}\n.ecp-pro-form-item__help-item {\n margin-bottom: 4px;\n}\n.ecp-pro-form-item__help-item:last-child {\n margin-bottom: 0;\n}\n</style>\n","<template>\n <div ref=\"formWrapRef\" class=\"ecp-pro-form\">\n <el-form class=\"ecp-pro-form\" ref=\"formRef\" :model=\"formModel\" :rules=\"formRules\" :label-width=\"effectiveProps.labelWidth\"\n :label-position=\"effectiveProps.labelPosition\" :size=\"effectiveProps.size\" :disabled=\"effectiveProps.disabled\"\n v-bind=\"$attrs\" v-on=\"formListeners\">\n <slot name=\"formHeader\" />\n <el-row :gutter=\"effectiveProps.gutter\" :style=\"effectiveProps.baseRowStyle\">\n <template v-for=\"schema in displaySchemas\">\n <el-col v-if=\"shouldShow(schema)\" :key=\"schema.field\" v-bind=\"getColProps(schema)\"\n :offset=\"schema.colProps?.offset ?? effectiveProps.baseColProps?.offset ?? 0\" :data-field=\"schema.field\">\n <ProFormItem :schema=\"schema\" :form-model=\"formModel\" :form-disabled=\"effectiveProps.disabled\"\n :auto-placeholder=\"effectiveProps.autoSetPlaceholder\" :form-action-type=\"formActionRef\">\n <template v-if=\"slots[getSlotName(schema)]\">\n <slot :name=\"getSlotName(schema)\" :model=\"formModel\" :schema=\"schema\" :field=\"schema.field\"\n :values=\"formModel\" />\n </template>\n </ProFormItem>\n </el-col>\n </template>\n <el-col class=\"ecp-pro-form_col\" v-if=\"effectiveProps.showActionButtonGroup\"\n v-bind=\"hasMoreFields ? { span: 24 } : effectiveProps.actionColOptions || { span: 6 }\">\n <FormActions :show-action-button-group=\"effectiveProps.showActionButtonGroup\"\n :show-submit-button=\"effectiveProps.showSubmitButton\" :show-reset-button=\"effectiveProps.showResetButton\"\n :submit-button-text=\"effectiveProps.submitButtonText\" :reset-button-text=\"effectiveProps.resetButtonText\"\n :submit-button-icon=\"effectiveProps.submitButtonIcon\" :reset-button-icon=\"effectiveProps.resetButtonIcon\"\n :submit-loading=\"submitLoading\" :show-advanced-button=\"effectiveProps.showAdvancedButton\"\n :has-more-fields=\"hasMoreFields\" :collapsed=\"collapsed\" :action-col-options=\"effectiveActionColOptions\"\n @submit=\"handleSubmit\" @reset=\"handleReset\" @toggle=\"collapsed = !collapsed\">\n <template slot=\"submitBefore\">\n <slot name=\"submitBefore\" />\n </template>\n <template slot=\"resetBefore\">\n <slot name=\"resetBefore\" />\n </template>\n <template slot=\"advanceBefore\">\n <slot name=\"advanceBefore\" />\n </template>\n <template slot=\"advanceAfter\">\n <slot name=\"advanceAfter\" />\n </template>\n <template slot=\"actions\">\n <slot name=\"actions\" />\n </template>\n </FormActions>\n </el-col>\n </el-row>\n <el-button v-if=\"effectiveProps.showAdvancedButton && hasMoreFields\" type=\"text\" class=\"ecp-form-actions__advance\"\n @click=\"collapsed = !collapsed\">\n <i class=\"el-icon-d-arrow-left\" :class=\"collapsed ? 'down' : 'up'\" />\n {{ collapsed ? '展开' : '收起' }}\n </el-button>\n <slot name=\"formFooter\" />\n </el-form>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch, useSlots, onMounted, onUnmounted } from 'vue'\nimport ProFormItem from './ProFormItem.vue'\nimport FormActions from './FormActions.vue'\nimport type { ProFormSchema, ProFormProps, FormActionType, ColEx, ScrollToFieldOptions, FormListeners } from '../types'\n\nconst props = withDefaults(\n defineProps<{\n schemas?: ProFormSchema[]\n initialValues?: Record<string, unknown>\n labelWidth?: string\n labelPosition?: 'left' | 'right' | 'top'\n gutter?: number\n size?: 'medium' | 'small' | 'large'\n disabled?: boolean\n baseColProps?: ColEx\n baseRowStyle?: Record<string, string | number>\n autoSetPlaceholder?: boolean\n showSubmitButton?: boolean\n showResetButton?: boolean\n submitButtonText?: string\n resetButtonText?: string\n submitButtonIcon?: string\n resetButtonIcon?: string\n showActionButtonGroup?: boolean\n actionColOptions?: ColEx\n showAdvancedButton?: boolean\n autoAdvancedLine?: number\n alwaysShowLines?: number\n submitFunc?: () => Promise<void>\n resetFunc?: () => Promise<void>\n submitOnReset?: boolean\n formListeners?: FormListeners\n }>(),\n {\n labelWidth: '120px',\n labelPosition: 'right',\n gutter: 24,\n size: 'medium',\n autoSetPlaceholder: true,\n showSubmitButton: true,\n showResetButton: true,\n submitButtonText: '提交',\n resetButtonText: '重置',\n submitButtonIcon: 'el-icon-search',\n resetButtonIcon: 'el-icon-refresh-left',\n showActionButtonGroup: true,\n showAdvancedButton: false,\n autoAdvancedLine: 3,\n alwaysShowLines: 1,\n baseColProps: () => ({ xs: 24, sm: 12, md: 12, lg: 8, xl: 6 }),\n actionColOptions: () => ({ xs: 24, sm: 12, md: 12, lg: 8, xl: 6 }),\n submitOnReset: false,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'submit', values: Record<string, unknown>): void\n (e: 'reset'): void\n (e: 'register', formAction: FormActionType): void\n}>()\nconst slots = useSlots()\nconst formRef = ref()\nconst formWrapRef = ref()\nconst submitLoading = ref(false)\nconst collapsed = ref(true)\nconst formModel = ref<Record<string, unknown>>({})\nconst formRules = ref<Record<string, unknown[]>>({})\nconst innerSchemas = ref<ProFormSchema[]>([])\nconst innerProps = ref<Partial<ProFormProps>>({})\n\n/** Element UI 栅格断点 (px) */\nconst BREAKPOINTS = { xl: 1920, lg: 1200, md: 992, sm: 768 }\n\n/** 根据当前视口宽度获取 ColEx 的有效 span(与 el-col 断点逻辑一致) */\nconst getEffectiveSpan = (colProps?: ColEx | null, baseColProps?: ColEx | null, width?: number): number => {\n const w = width ?? (typeof window !== 'undefined' ? window.innerWidth : 1920)\n const col = colProps ?? {}\n const base = baseColProps ?? {}\n const fallback = base.span ?? 8\n if (w >= BREAKPOINTS.xl) return col.xl ?? base.xl ?? col.lg ?? base.lg ?? col.md ?? base.md ?? col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n if (w >= BREAKPOINTS.lg) return col.lg ?? base.lg ?? col.md ?? base.md ?? col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n if (w >= BREAKPOINTS.md) return col.md ?? base.md ?? col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n if (w >= BREAKPOINTS.sm) return col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n // if (w < BREAKPOINTS.sm) return col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n return col.xs ?? base.xs ?? col.span ?? fallback\n}\n\nconst effectiveProps = computed(() => ({ ...props, ...innerProps.value }))\nconst effectiveActionColOptions = computed(() => effectiveProps.value.actionColOptions ?? { span: 24 })\n\n/** 当前视口宽度,用于响应式计算 span */\nconst windowWidth = ref(typeof window !== 'undefined' ? window.innerWidth : 1920)\n\n/** 计算前 maxLines 行能容纳的 schema 数量(考虑栅格断点,每个 field 可有自己的 span) */\nconst getVisibleSchemaCount = (\n schemas: ProFormSchema[],\n baseColProps: ColEx | undefined,\n maxLines: number,\n width: number\n) => {\n let remaining = 24\n let rows = 1\n let count = 0\n for (const schema of schemas) {\n const span = getEffectiveSpan(schema.colProps, baseColProps, width)\n if (span > remaining) {\n rows++\n if (rows > maxLines) break\n remaining = 24 - span\n } else {\n remaining -= span\n }\n count++\n }\n return count\n}\n\nconst hasMoreFields = computed(() => {\n const schemas = innerSchemas.value.filter((s) => shouldShow(s))\n\n if (!effectiveProps.value.showAdvancedButton) return false\n const lines = effectiveProps.value.alwaysShowLines ?? 1\n const baseColProps = effectiveProps.value.baseColProps\n const maxVisible = getVisibleSchemaCount(schemas, baseColProps, lines, windowWidth.value)\n console.log(schemas.length, maxVisible)\n return schemas.length > maxVisible\n})\n\nconst formListeners = computed((): FormListeners => {\n return effectiveProps.value.formListeners ?? {}\n})\n\nconst displaySchemas = computed(() => {\n const schemas = innerSchemas.value.filter((s) => {\n return shouldShow(s)\n })\n if (!effectiveProps.value.showAdvancedButton || !collapsed.value) return schemas\n const lines = effectiveProps.value.alwaysShowLines ?? 1\n const baseColProps = effectiveProps.value.baseColProps\n const maxVisible = getVisibleSchemaCount(schemas, baseColProps, lines, windowWidth.value)\n return schemas.slice(0, maxVisible)\n})\n\nconst shouldShow = (schema: ProFormSchema) => {\n let ifShow = true\n let show = true\n if (typeof schema.ifShow === 'function') {\n ifShow = schema.ifShow({ schema, values: formModel.value, model: formModel.value, field: schema.field })\n }\n if (typeof schema.ifShow === 'boolean') {\n ifShow = schema.ifShow\n }\n if (typeof schema.show === 'function') {\n show = schema.show({ schema, values: formModel.value, model: formModel.value, field: schema.field })\n }\n if (typeof schema.show === 'boolean') {\n show = schema.show\n }\n return ifShow && show\n}\nconst getColProps = (schema: ProFormSchema) => {\n return schema.colProps ?? effectiveProps.value.baseColProps ?? {}\n}\nconst getSlotName = (schema: ProFormSchema) => schema.slot || schema.field\n\nconst initForm = () => {\n const model: Record<string, unknown> = {}\n const rules: Record<string, unknown[]> = {}\n const initialValues = effectiveProps.value.initialValues ?? props.initialValues\n innerSchemas.value.forEach((schema) => {\n model[schema.field] = schema.defaultValue ?? initialValues?.[schema.field]\n if (schema.rules?.length) rules[schema.field] = schema.rules\n })\n formModel.value = { ...formModel.value, ...model }\n formRules.value = rules\n}\n\nconst filterByIfShow = (values: Record<string, unknown>) => {\n const result = { ...values }\n innerSchemas.value.forEach((schema) => {\n const ifShow = schema.ifShow\n if (ifShow === undefined) return\n const visible = typeof ifShow === 'boolean' ? ifShow : ifShow({ schema, values, model: values, field: schema.field })\n if (!visible) delete result[schema.field]\n })\n return result\n}\n\nconst processFieldMapToTime = (values: Record<string, unknown>) => {\n const filtered = filterByIfShow(values)\n const fieldMap = innerProps.value.fieldMapToTime\n if (!fieldMap?.length) return filtered\n const result = { ...filtered }\n fieldMap.forEach(([field, [startKey, endKey]]) => {\n const val = result[field]\n if (Array.isArray(val) && val.length === 2) {\n delete result[field]\n ; (result as Record<string, unknown>)[startKey] = val[0]\n ; (result as Record<string, unknown>)[endKey] = val[1]\n }\n })\n return result\n}\n\nconst handleSubmit = async () => {\n try {\n await formRef.value?.validate()\n if (effectiveProps.value.submitFunc) {\n await effectiveProps.value.submitFunc()\n } else {\n submitLoading.value = true\n emit('submit', processFieldMapToTime({ ...formModel.value }))\n }\n } catch (e) {\n console.error('Form validation failed:', e)\n } finally {\n submitLoading.value = false\n }\n}\n\nconst handleReset = async () => {\n if (effectiveProps.value.resetFunc) {\n await effectiveProps.value.resetFunc()\n } else {\n formRef.value?.resetFields()\n initForm()\n emit('reset')\n if (effectiveProps.value.submitOnReset) await handleSubmit()\n }\n}\n\nconst setFieldsValue = (values: Record<string, unknown>) => {\n formModel.value = { ...formModel.value, ...values }\n return Promise.resolve()\n}\n\nconst getFieldsValue = () => processFieldMapToTime({ ...formModel.value })\n\nconst resetFields = async () => {\n formRef.value?.resetFields()\n initForm()\n}\n\nconst validate = (nameList?: string[]) =>\n formRef.value?.validate(nameList) ?? Promise.resolve()\n\nconst validateFields = (nameList?: string[]) => {\n if (!formRef.value) return Promise.resolve()\n if (!nameList?.length) return formRef.value.validate()\n return Promise.all(nameList.map((prop) => new Promise((resolve, reject) => {\n formRef.value.validateField(prop, (valid: boolean) => (valid ? resolve(undefined) : reject(new Error('Validation failed'))))\n })))\n}\n\nconst scrollToField = async (name: string, options?: ScrollToFieldOptions) => {\n const el = formWrapRef.value?.querySelector(`[data-field=\"${name}\"]`)\n if (el) {\n el.scrollIntoView({ behavior: options?.behavior ?? 'smooth', block: options?.block ?? 'nearest' })\n }\n return Promise.resolve()\n}\n\nconst clearValidate = (name?: string | string[]) => {\n formRef.value?.clearValidate(name)\n}\n\nconst updateSchema = async (data: Partial<ProFormSchema> | Partial<ProFormSchema>[]) => {\n const list = Array.isArray(data) ? data : [data]\n list.forEach((item) => {\n const idx = innerSchemas.value.findIndex((s) => s.field === item.field)\n if (idx >= 0) innerSchemas.value[idx] = { ...innerSchemas.value[idx], ...item }\n })\n}\n\nconst appendSchemaByField = async (schema: ProFormSchema, prefixField?: string, first?: boolean) => {\n if (first) innerSchemas.value.unshift(schema)\n else if (prefixField) {\n const idx = innerSchemas.value.findIndex((s) => s.field === prefixField)\n innerSchemas.value.splice(idx + 1, 0, schema)\n } else innerSchemas.value.push(schema)\n initForm()\n}\n\nconst removeSchemaByField = async (field: string | string[]) => {\n const fields = Array.isArray(field) ? field : [field]\n innerSchemas.value = innerSchemas.value.filter((s) => !fields.includes(s.field))\n}\n\nconst setProps = async (formProps: Partial<ProFormProps>) => {\n innerProps.value = { ...innerProps.value, ...formProps }\n if (formProps.schemas) {\n innerSchemas.value = [...formProps.schemas]\n debugger\n initForm()\n }\n}\n\nconst formActionRef: FormActionType = {\n getFieldsValue,\n setFieldsValue,\n resetFields,\n validate,\n validateFields,\n submit: handleSubmit,\n scrollToField,\n clearValidate,\n updateSchema,\n appendSchemaByField,\n removeSchemaByField,\n setProps,\n}\n\ndefineExpose(formActionRef)\n\nconst syncSchemas = () => {\n innerSchemas.value = [...(props.schemas ?? [])]\n initForm()\n}\n\nconst handleResize = () => {\n if (typeof window !== 'undefined') windowWidth.value = window.innerWidth\n}\n\nonMounted(() => {\n syncSchemas()\n emit('register', formActionRef)\n if (typeof window !== 'undefined') window.addEventListener('resize', handleResize)\n})\n\nonUnmounted(() => {\n if (typeof window !== 'undefined') window.removeEventListener('resize', handleResize)\n})\n\nwatch(() => [props.schemas, props.initialValues], syncSchemas, { deep: true })\n</script>\n\n<style scoped>\n.ecp-pro-form {\n padding: 16px;\n position: relative;\n}\n\n.ecp-pro-form__advance {\n margin-bottom: 16px;\n}\n\n.ecp-pro-form_col {\n position: relative;\n float: right;\n}\n\n.el-icon-d-arrow-left.up {\n transform: rotate(90deg);\n}\n\n.el-icon-d-arrow-left.down {\n transform: rotate(-90deg);\n}\n\n.ecp-form-actions__advance {\n position: absolute;\n bottom: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n</style>\n","import { ref, watch, unref, type Ref } from 'vue'\nimport type { ProFormSchema, ProFormProps, FormActionType } from '../types'\n\nexport interface UseFormProps extends ProFormProps {\n schemas?: ProFormSchema[]\n}\n\n/** 支持 ref/computed 的 props(参考 Vben Admin:参数 props 内的值可以是 computed 或者 ref 类型) */\nexport type UseFormPropsReactive = UseFormProps | Ref<UseFormProps | undefined>\n\nexport interface UseFormReturn {\n /** 用于 @register,接收表单实例的 formAction */\n register: (formAction: FormActionType) => void\n formAction: { value: FormActionType | null }\n getFieldsValue: () => Record<string, unknown>\n setFieldsValue: (values: Record<string, unknown>) => Promise<void>\n resetFields: () => Promise<void>\n validate: (nameList?: string[]) => Promise<unknown>\n validateFields: (nameList?: string[]) => Promise<unknown>\n submit: () => Promise<void>\n scrollToField: (name: string, options?: import('../types').ScrollToFieldOptions) => Promise<void>\n clearValidate: (name?: string | string[]) => void\n updateSchema: (data: Partial<ProFormSchema> | Partial<ProFormSchema>[]) => Promise<void>\n appendSchemaByField: (schema: ProFormSchema, prefixField?: string, first?: boolean) => Promise<void>\n removeSchemaByField: (field: string | string[]) => Promise<void>\n setProps: (props: Partial<ProFormProps>) => Promise<void>\n}\n\nexport function useForm(props?: UseFormPropsReactive): [UseFormReturn['register'], Omit<UseFormReturn, 'register'>] {\n const formAction = ref<FormActionType | null>(null)\n const formPropsRef = ref<UseFormProps | undefined>(props ? unref(props as Ref<UseFormProps | undefined>) : undefined)\n\n const getFormProps = () => (props ? unref(props as Ref<UseFormProps | undefined>) : undefined) as UseFormProps | undefined\n\n const register = (action: FormActionType) => {\n formAction.value = action\n const formProps = getFormProps()\n debugger\n if (formProps && Object.keys(formProps).length > 0) {\n action.setProps(formProps)\n }\n }\n\n if (props) {\n watch(\n () => getFormProps(),\n (formProps) => {\n formPropsRef.value = formProps\n if (formProps && formAction.value) {\n formAction.value.setProps(formProps)\n }\n },\n { deep: true }\n )\n }\n\n const getFieldsValue = () => formAction.value?.getFieldsValue() ?? {}\n\n const setFieldsValue = async (values: Record<string, unknown>) => {\n await formAction.value?.setFieldsValue(values)\n }\n\n const resetFields = async () => {\n await formAction.value?.resetFields()\n }\n\n const validate = (nameList?: string[]) =>\n formAction.value?.validate(nameList) ?? Promise.resolve()\n\n const validateFields = (nameList?: string[]) =>\n formAction.value?.validateFields(nameList) ?? Promise.resolve()\n\n const submit = () => formAction.value?.submit() ?? Promise.resolve()\n\n const scrollToField = (name: string, options?: import('../types').ScrollToFieldOptions) =>\n formAction.value?.scrollToField(name, options) ?? Promise.resolve()\n\n const clearValidate = (name?: string | string[]) => {\n formAction.value?.clearValidate(name)\n }\n\n const updateSchema = (data: Partial<ProFormSchema> | Partial<ProFormSchema>[]) =>\n formAction.value?.updateSchema(data) ?? Promise.resolve()\n\n const appendSchemaByField = (schema: ProFormSchema, prefixField?: string, first?: boolean) =>\n formAction.value?.appendSchemaByField(schema, prefixField, first) ?? Promise.resolve()\n\n const removeSchemaByField = (field: string | string[]) =>\n formAction.value?.removeSchemaByField(field) ?? Promise.resolve()\n\n const setProps = async (formProps: Partial<ProFormProps>) => {\n formPropsRef.value = { ...formPropsRef.value, ...formProps }\n await formAction.value?.setProps(formProps)\n }\n\n const result: UseFormReturn = {\n register,\n formAction,\n getFieldsValue,\n setFieldsValue,\n resetFields,\n validate,\n validateFields,\n submit,\n scrollToField,\n clearValidate,\n updateSchema,\n appendSchemaByField,\n removeSchemaByField,\n setProps,\n }\n\n return [register, result]\n}\n","import type { VueConstructor } from 'vue'\n// import ProTable from './ProTable'\nimport ProForm, { ProFormItem, FormActions } from './ProForm'\n// import ProCard from './ProCard'\n// import ProDescriptions from './ProDescriptions'\nimport { useForm } from './ProForm/useForm'\n\nexport { ProForm, ProFormItem, FormActions, useForm }\nexport * from './types'\n\nconst components = [\n // { name: 'ProTable', component: ProTable },\n { name: 'ProForm', component: ProForm },\n { name: 'ProFormItem', component: ProFormItem },\n { name: 'FormActions', component: FormActions }\n // { name: 'ProCard', component: ProCard },\n // { name: 'ProDescriptions', component: ProDescriptions },\n]\n\nexport function install(Vue: VueConstructor) {\n components.forEach(({ name, component }) => {\n Vue.component(name, component)\n })\n}\n\nexport default {\n install,\n // ProTable,\n ProForm,\n // ProCard,\n // ProDescriptions,\n}\n"],"names":["slots","useSlots","renderParams","computed","props","shouldRender","ifShow","shouldShow","show","effectiveDisabled","dyn","effectiveRules","effectiveComponentPropsAndListeners","cp","raw","propsOnly","listeners","key","value","eventName","effectiveComponentProps","effectiveComponentListeners","hasSlot","getOptions","opts","renderComponent","renderFn","result","h","formRef","ref","formWrapRef","submitLoading","collapsed","formModel","formRules","innerSchemas","innerProps","BREAKPOINTS","getEffectiveSpan","colProps","baseColProps","width","w","col","base","fallback","effectiveProps","effectiveActionColOptions","windowWidth","getVisibleSchemaCount","schemas","maxLines","remaining","rows","count","schema","span","hasMoreFields","s","lines","maxVisible","formListeners","displaySchemas","getColProps","getSlotName","initForm","model","rules","initialValues","_a","filterByIfShow","values","processFieldMapToTime","filtered","fieldMap","field","startKey","endKey","val","handleSubmit","emit","e","handleReset","setFieldsValue","getFieldsValue","resetFields","validate","nameList","validateFields","prop","resolve","reject","valid","scrollToField","name","options","el","clearValidate","updateSchema","data","item","idx","appendSchemaByField","prefixField","first","removeSchemaByField","fields","setProps","formProps","formActionRef","expose","syncSchemas","handleResize","onMounted","onUnmounted","watch","useForm","formAction","formPropsRef","unref","getFormProps","register","action","components","ProForm","ProFormItem","FormActions","install","Vue","component","index"],"mappings":";;;;;;;;;;;iBAoJMA,IAAQC,MAERC,IAAeC,EAA+B,OAAO;AAAA,MACzD,QAAQC,EAAM;AAAA,MACd,QAAQA,EAAM;AAAA,MACd,OAAOA,EAAM;AAAA,MACb,OAAOA,EAAM,OAAO;AAAA,IACpB,EAAA,GAEIC,IAAeF,EAAS,MAAM;AAC5B,YAAAG,IAASF,EAAM,OAAO;AAC5B,aAAIE,MAAW,SAAkB,KAC7B,OAAOA,KAAW,YAAkBA,IACj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;AACvC,OAAAzB,IAAAgD,EAAA,UAAA,QAAAhD,EAAO,cAAcyB;AAAA,IAAI;AAAA,IA4BpC,cAzBmB,CAACK,MACpB;;AAAA,eAAA9B,IAAAgD,EAAW,UAAX,gBAAAhD,EAAkB,aAAa8B,OAAS,QAAQ;;IAyBhD,qBAvB0B,CAAC5C,GAAuBgD,GAAsBC,MACxE;;AAAA,eAAAnC,IAAAgD,EAAW,UAAX,gBAAAhD,EAAkB,oBAAoBd,GAAQgD,GAAaC,OAAU,QAAQ,QAAQ;AAAA;AAAA,IAuBrF,qBArB0B,CAAC7B,MAC3B;;AAAA,eAAAN,IAAAgD,EAAW,UAAX,gBAAAhD,EAAkB,oBAAoBM,OAAU,QAAQ;;IAqBxD,UAnBe,OAAOiC,MAAqC;;AAC3D,MAAAU,EAAa,QAAQ,EAAE,GAAGA,EAAa,OAAO,GAAGV,KAC3C,QAAAvC,IAAAgD,EAAW,UAAX,gBAAAhD,EAAkB,SAASuC;AAAA,IAAS;AAAA,EAiB1C,CAGsB;AAC1B;ACvGA,MAAMe,KAAa;AAAA;AAAA,EAEjB,EAAE,MAAM,WAAW,WAAWC,GAAQ;AAAA,EACtC,EAAE,MAAM,eAAe,WAAWC,GAAY;AAAA,EAC9C,EAAE,MAAM,eAAe,WAAWC,GAAY;AAAA;AAAA;AAGhD;AAEO,SAASC,GAAQC,GAAqB;AAC3C,EAAAL,GAAW,QAAQ,CAAC,EAAE,MAAA7B,GAAM,WAAAmC,QAAgB;AACtC,IAAAD,EAAA,UAAUlC,GAAMmC,CAAS;AAAA,EAAA,CAC9B;AACH;AAEA,MAAeC,KAAA;AAAA,EACb,SAAAH;AAAA;AAAA,EAEA,SAAAH;AAAA;AAAA;AAGF;"}
|
|
1
|
+
{"version":3,"file":"element-component-pro.es.js","sources":["../src/useComponentSetting.ts","../src/ProTable/ProTable.vue","../src/ProTable/TableAction.vue","../src/ProTable/useProTable.ts","../src/ProForm/ProFormItem.vue","../src/ProForm/ProForm.vue","../src/ProForm/useForm.ts","../src/index.ts"],"sourcesContent":["import { reactive } from 'vue'\n\n/** 组件默认配置存储:组件名 -> 默认 props/配置 */\nconst componentSettings = reactive<Record<string, Record<string, unknown>>>({})\n\nexport interface UseComponentSettingReturn {\n /** 获取组件默认配置;不传参时返回全部组件的配置 */\n getSetting: (componentName?: string) => Record<string, unknown>\n /** 设置组件默认配置(与已有配置浅合并) */\n setSetting: (componentName: string, config: Record<string, unknown>) => void\n}\n\n/**\n * 组件默认配置:供所有组件统一获取/设置默认配置\n * - getSetting:获取组件默认配置,用于初始化或合并 props\n * - setSetting:设置组件默认配置,可在应用入口或按需调用\n */\nexport function useComponentSetting(): UseComponentSettingReturn {\n const getSetting = (componentName?: string): Record<string, unknown> => {\n if (componentName === undefined) {\n return { ...componentSettings }\n }\n return { ...(componentSettings[componentName] ?? {}) }\n }\n\n const setSetting = (componentName: string, config: Record<string, unknown>): void => {\n const current = componentSettings[componentName]\n componentSettings[componentName] = current ? { ...current, ...config } : { ...config }\n }\n\n return {\n getSetting,\n setSetting,\n }\n}\n","<template>\n <div class=\"ecp-pro-table\">\n <!-- 标题栏 -->\n <div v-if=\"showTitleBar\" class=\"ecp-pro-table__header\">\n <div class=\"ecp-pro-table__title-wrapper\">\n <span class=\"ecp-pro-table__title\">{{ effectiveProps.title }}</span>\n <el-tooltip v-if=\"effectiveProps.titleHelpMessage\" class=\"ecp-pro-table__help\" placement=\"top\">\n <template slot=\"content\">\n <span v-if=\"Array.isArray(effectiveProps.titleHelpMessage)\">\n <div v-for=\"(msg, i) in effectiveProps.titleHelpMessage\" :key=\"i\">{{ msg }}</div>\n </span>\n <span v-else>{{ effectiveProps.titleHelpMessage }}</span>\n </template>\n <i class=\"el-icon-question\" />\n </el-tooltip>\n </div>\n <div class=\"ecp-pro-table__toolbar\">\n <slot name=\"tableTitle\" />\n <slot name=\"toolbar\" />\n <slot name=\"toolbar-right\">\n <el-button\n v-if=\"effectiveProps.tableSetting?.redo !== false\"\n type=\"text\"\n icon=\"el-icon-refresh\"\n size=\"small\"\n @click=\"handleReload\"\n >\n 刷新\n </el-button>\n </slot>\n </div>\n </div>\n\n <!-- 表格主体(Element UI el-table 无 loading 属性,使用 v-loading 指令) -->\n <div ref=\"tableWrapRef\" class=\"ecp-pro-table__body\" v-loading=\"loading\">\n <el-table\n ref=\"tableRef\"\n :data=\"innerData\"\n :row-key=\"effectiveProps.rowKey\"\n :border=\"effectiveProps.bordered\"\n :stripe=\"effectiveProps.striped\"\n :size=\"effectiveProps.size\"\n :max-height=\"effectiveProps.maxHeight\"\n :height=\"effectiveProps.height\"\n :default-sort=\"effectiveProps.defaultSort\"\n :span-method=\"effectiveProps.spanMethod\"\n :tree-props=\"effectiveProps.treeProps\"\n :default-expand-all=\"effectiveProps.defaultExpandAll\"\n :expand-row-keys=\"effectiveProps.expandRowKeys || []\"\n :lazy=\"effectiveProps.lazy\"\n :load=\"effectiveProps.load\"\n v-bind=\"effectiveProps.tableProps\"\n :row-class-name=\"effectiveProps.rowClassName\"\n @row-click=\"handleRowClick\"\n @row-dblclick=\"handleRowDblclick\"\n @sort-change=\"handleSortChange\"\n @expand-change=\"handleExpandChange\"\n >\n <!-- 选择列:自定义实现,参考 VbenAdmin,支持单选/多选/禁用/跨页 -->\n <el-table-column\n v-if=\"effectiveProps.rowSelection\"\n :width=\"effectiveProps.rowSelection.width || 48\"\n :fixed=\"effectiveProps.rowSelection.fixed\"\n align=\"center\"\n >\n <template slot=\"header\" slot-scope=\"_\">\n <!-- 多选:表头全选 -->\n <el-checkbox\n v-if=\"effectiveProps.rowSelection.type !== 'radio'\"\n :value=\"isAllCurrentPageSelected\"\n :indeterminate=\"isIndeterminate\"\n :disabled=\"!hasSelectableRows\"\n @change=\"handleSelectAll\"\n />\n <span v-else />\n </template>\n <template slot-scope=\"scope\">\n <!-- 多选 -->\n <el-checkbox\n v-if=\"effectiveProps.rowSelection.type !== 'radio'\"\n :value=\"isRowSelected(scope.row)\"\n :disabled=\"getCheckboxDisabled(scope.row)\"\n @change=\"(val) => handleCheckboxChange(scope.row, val)\"\n @click.native.stop\n />\n <!-- 单选 -->\n <el-radio\n v-else\n :value=\"selectedRows[0]?.[rowKeyField]\"\n :label=\"scope.row[rowKeyField]\"\n :disabled=\"getRadioDisabled(scope.row)\"\n @change=\"handleRadioSelect(scope.row)\"\n @click.native.stop\n >\n <span />\n </el-radio>\n </template>\n </el-table-column>\n <!-- 序号列 -->\n <el-table-column\n v-if=\"effectiveProps.showIndexColumn\"\n type=\"index\"\n :label=\"effectiveProps.indexColumnProps?.title || '序号'\"\n :width=\"effectiveProps.indexColumnProps?.width || 60\"\n :fixed=\"effectiveProps.indexColumnProps?.fixed\"\n :align=\"effectiveProps.indexColumnProps?.align || 'center'\"\n />\n <!-- 数据列 -->\n <template v-for=\"col in displayColumns\">\n <el-table-column\n v-if=\"shouldShowColumn(col)\"\n :key=\"col.dataIndex || col.key || col.title\"\n :prop=\"col.dataIndex\"\n :label=\"col.title\"\n :width=\"getColumnWidth(col)\"\n :min-width=\"isRatioWidth(col.width) ? undefined : col.minWidth\"\n :fixed=\"col.fixed\"\n :align=\"col.align || 'left'\"\n :sortable=\"col.sortable\"\n :formatter=\"col.formatter\"\n :show-overflow-tooltip=\"col.ellipsis !== false && effectiveProps.ellipsis !== false\"\n >\n <template slot=\"header\" slot-scope=\"_\">\n <!-- 1. 列级自定义表头:header-[dataIndex],例如 #header-age -->\n <slot\n v-if=\"col.dataIndex && $scopedSlots[`header-${col.dataIndex}`]\"\n :name=\"`header-${col.dataIndex}`\"\n :column=\"col\"\n />\n <!-- 2. 全局表头渲染:headerCell,类似 Vben 的 headerCell 用法 -->\n <slot\n v-else-if=\"$scopedSlots['headerCell']\"\n name=\"headerCell\"\n :column=\"col\"\n />\n <!-- 3. 默认表头渲染:标题 + helpMessage 提示 -->\n <template v-else>\n <span>{{ col.title }}</span>\n <el-tooltip v-if=\"col.helpMessage\" class=\"ecp-pro-table__col-help\" placement=\"top\" effect=\"dark\">\n <template slot=\"content\">\n <span v-if=\"Array.isArray(col.helpMessage)\">\n <div v-for=\"(msg, i) in col.helpMessage\" :key=\"i\">{{ msg }}</div>\n </span>\n <span v-else>{{ col.helpMessage }}</span>\n </template>\n <i class=\"el-icon-question\" />\n </el-tooltip>\n </template>\n </template>\n <template slot-scope=\"scope\">\n <slot\n v-if=\"col.dataIndex && $scopedSlots[col.dataIndex]\"\n :name=\"col.dataIndex\"\n :row=\"scope.row\"\n :column=\"col\"\n :index=\"scope.$index\"\n :value=\"scope.row[col.dataIndex]\"\n />\n <BodyCellRenderer\n v-else-if=\"$scopedSlots['bodyCell']\"\n :slot-render=\"$scopedSlots['bodyCell']\"\n :column=\"col\"\n :record=\"scope.row\"\n :index=\"scope.$index\"\n :value=\"scope.row[col.dataIndex]\"\n :custom-render=\"col.customRender\"\n :value-enum=\"col.valueEnum\"\n />\n <DefaultCellRenderer v-else :column=\"col\" :record=\"scope.row\" :index=\"scope.$index\" :value=\"scope.row[col.dataIndex]\" />\n </template>\n </el-table-column>\n </template>\n <!-- 操作列 -->\n <el-table-column\n v-if=\"effectiveProps.actionColumn\"\n :label=\"effectiveProps.actionColumn.title || '操作'\"\n :width=\"effectiveProps.actionColumn.width || 150\"\n :fixed=\"effectiveProps.actionColumn.fixed || 'right'\"\n :align=\"effectiveProps.actionColumn.align || 'center'\"\n >\n <template slot-scope=\"scope\">\n <slot\n v-if=\"$scopedSlots['action']\"\n name=\"action\"\n :record=\"scope.row\"\n :column=\"effectiveProps.actionColumn\"\n :index=\"scope.$index\"\n />\n <BodyCellRenderer\n v-else-if=\"$scopedSlots['bodyCell']\"\n :slot-render=\"$scopedSlots['bodyCell']\"\n :column=\"effectiveProps.actionColumn\"\n :record=\"scope.row\"\n :index=\"scope.$index\"\n :value=\"undefined\"\n :custom-render=\"effectiveProps.actionColumn.customRender\"\n :value-enum=\"effectiveProps.actionColumn.valueEnum\"\n />\n </template>\n </el-table-column>\n </el-table>\n </div>\n\n <!-- 分页 -->\n <div v-if=\"showPagination\" class=\"ecp-pro-table__pagination\">\n <el-pagination\n :current-page=\"pagination.page\"\n :page-sizes=\"pagination.pageSizes\"\n :page-size=\"pagination.pageSize\"\n :total=\"pagination.total\"\n :layout=\"(effectiveProps.pagination && typeof effectiveProps.pagination === 'object' ? effectiveProps.pagination.layout : null) || 'total, sizes, prev, pager, next, jumper'\"\n v-bind=\"(effectiveProps.pagination && typeof effectiveProps.pagination === 'object' && effectiveProps.pagination.props) || {}\"\n @size-change=\"handleSizeChange\"\n @current-change=\"handleCurrentChange\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n// @ts-nocheck - Vue 2 el-table-column slot-scope 类型推断存在已知限制,暂用此方式消除模板内 scope 相关告警\nimport { ref, computed, watch, onMounted, onUnmounted, useSlots, nextTick, defineComponent, h } from 'vue'\nimport { useComponentSetting } from '../useComponentSetting'\nimport type { ProColumn, ProTableProps, TableActionType, FetchSetting, FetchParams } from './types'\n\nconst DefaultCellRenderer = defineComponent({\n name: 'EcpProTableDefaultCellRenderer',\n props: {\n column: { type: Object, required: true },\n record: { type: Object, required: true },\n index: { type: Number, required: true },\n value: { required: false },\n },\n setup(p) {\n return () => {\n const col = p.column as any\n if (col?.customRender) {\n const r = col.customRender({ text: p.value, record: p.record, index: p.index })\n if (typeof r === 'string' || typeof r === 'number') return h('span', String(r))\n return r as any\n }\n if (col?.valueEnum) {\n const text = col.valueEnum?.[p.value]?.text ?? p.value\n return h('span', text == null ? '' : String(text))\n }\n return h('span', p.value == null ? '' : String(p.value))\n }\n },\n})\n\nconst BodyCellRenderer = defineComponent({\n name: 'EcpProTableBodyCellRenderer',\n props: {\n slotRender: { type: Function, required: true },\n column: { type: Object, required: true },\n record: { type: Object, required: true },\n index: { type: Number, required: true },\n value: { required: false },\n customRender: { type: Function, required: false },\n valueEnum: { type: Object, required: false },\n },\n setup(p) {\n return () => {\n const slot = p.slotRender as any\n const nodes = slot?.({ column: p.column, record: p.record, index: p.index, value: p.value })\n\n const normalize = (n: any) => {\n if (n == null) return []\n if (Array.isArray(n)) return n.filter((x) => x != null && x !== false && !x.isComment)\n return [n]\n }\n const normalized = normalize(nodes)\n if (normalized.length > 0) return nodes\n\n // slot 未返回内容时,回退到默认渲染(对齐 vbenAdmin bodyCell 用法)\n const col = { ...(p.column as any) }\n if (p.customRender) col.customRender = p.customRender\n if (p.valueEnum) col.valueEnum = p.valueEnum\n return h(DefaultCellRenderer as any, { props: { column: col, record: p.record, index: p.index, value: p.value } })\n }\n },\n})\n\nconst props = withDefaults(\n defineProps<{\n columns?: ProColumn[]\n dataSource?: Record<string, unknown>[]\n api?: (params: Record<string, unknown>) => Promise<{ list?: unknown[]; items?: unknown[]; total?: number }>\n rowKey?: string\n title?: string\n titleHelpMessage?: string | string[]\n bordered?: boolean\n striped?: boolean\n size?: 'medium' | 'small' | 'large'\n loading?: boolean\n maxHeight?: number | string\n height?: number | string\n ellipsis?: boolean\n showIndexColumn?: boolean\n indexColumnProps?: Partial<ProColumn>\n actionColumn?: Partial<ProColumn>\n rowSelection?: { type?: 'checkbox' | 'radio'; width?: number; fixed?: 'left' | 'right'; getCheckboxProps?: (r: Record<string, unknown>) => { disabled?: boolean }; getRadioProps?: (r: Record<string, unknown>) => { disabled?: boolean } }\n clearSelectOnPageChange?: boolean\n pagination?: false | { pageSize?: number; pageSizes?: number[]; layout?: string; props?: Record<string, unknown> } | Record<string, unknown>\n tableSetting?: { redo?: boolean; size?: boolean; setting?: boolean; fullScreen?: boolean }\n fetchSetting?: FetchSetting\n beforeFetch?: (params: Record<string, unknown>) => Record<string, unknown>\n afterFetch?: (data: unknown) => unknown\n immediate?: boolean\n searchInfo?: Record<string, unknown>\n defaultSort?: { prop: string; order: 'ascending' | 'descending' }\n tableProps?: Record<string, unknown>\n rowClassName?: string | ((params: { row: Record<string, unknown>; rowIndex: number }) => string)\n spanMethod?: (params: { row: Record<string, unknown>; column: Record<string, unknown>; rowIndex: number; columnIndex: number }) => [number, number] | { rowspan: number; colspan: number }\n treeProps?: { hasChildren?: string; children?: string }\n defaultExpandAll?: boolean\n expandRowKeys?: (string | number)[]\n lazy?: boolean\n load?: (row: Record<string, unknown>, treeNode: { level: number; expanded: boolean; loaded: boolean }, resolve: (data: Record<string, unknown>[]) => void) => void\n }>(),\n {\n rowKey: 'id',\n clearSelectOnPageChange: false,\n bordered: false,\n striped: true,\n size: 'medium',\n loading: false,\n ellipsis: true,\n showIndexColumn: true,\n pagination: () => ({ pageSize: 10, pageSizes: [10, 20, 50, 100] }),\n tableSetting: () => ({ redo: true }),\n fetchSetting: () => ({\n pageField: 'page',\n sizeField: 'pageSize',\n listField: 'list',\n totalField: 'total',\n }),\n immediate: true,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'register', action: TableActionType): void\n (e: 'fetch-success', data: { items: unknown[]; total: number }): void\n (e: 'fetch-error', error: unknown): void\n (e: 'selection-change', data: { keys: (string | number)[]; rows: Record<string, unknown>[] }): void\n (e: 'row-click', record: Record<string, unknown>, event: Event): void\n (e: 'row-dblclick', record: Record<string, unknown>, event: Event): void\n (e: 'sort-change', sortInfo: { prop: string; order: string }): void\n (e: 'expand-change', row: Record<string, unknown>, expanded: boolean | Record<string, unknown>[]): void\n}>()\n\nconst slots = useSlots()\nconst tableRef = ref()\nconst tableWrapRef = ref()\nconst containerWidth = ref(0)\nconst loading = ref(props.loading ?? false)\nconst innerData = ref<Record<string, unknown>[]>([])\nconst rawDataSource = ref<Record<string, unknown>>({})\nconst innerColumns = ref<ProColumn[]>([])\nconst innerProps = ref<Partial<ProTableProps>>({})\nconst selectedRows = ref<Record<string, unknown>[]>([])\nconst showPaginationRef = ref<boolean | null>(null)\n\nconst pagination = ref({\n page: 1,\n pageSize: (props.pagination && typeof props.pagination === 'object') ? (props.pagination.pageSize ?? 10) : 10,\n pageSizes: (props.pagination && typeof props.pagination === 'object') ? (props.pagination.pageSizes ?? [10, 20, 50, 100]) : [10, 20, 50, 100],\n total: 0,\n})\n\nconst { getSetting: getComponentSetting } = useComponentSetting()\nconst effectiveProps = computed(() => ({ ...getComponentSetting('ProTable'), ...props, ...innerProps.value }))\nconst showTitleBar = computed(() => !!effectiveProps.value.title || !!slots.tableTitle || !!slots.toolbar)\nconst showPagination = computed(() => {\n if (showPaginationRef.value !== null) return showPaginationRef.value\n return !!props.pagination && typeof props.pagination === 'object'\n})\n\nconst rowKeyField = computed(() => effectiveProps.value.rowKey || 'id')\n\n/** 选中行 key 集合(用于快速判断) */\nconst selectedKeysSet = computed(() => new Set(selectedRows.value.map((r) => r[rowKeyField.value] as string | number)))\n\n/** 显示列 */\nconst displayColumns = computed(() =>\n innerColumns.value.filter((c) => !c.hideInTable && !c.defaultHidden)\n)\n\n/** 固定列总宽度 */\nconst fixedColumnsWidth = computed(() => {\n let w = 0\n if (effectiveProps.value.rowSelection) w += Number(effectiveProps.value.rowSelection.width) || 48\n if (effectiveProps.value.showIndexColumn) w += Number(effectiveProps.value.indexColumnProps?.width) || 60\n if (effectiveProps.value.actionColumn) w += Number(effectiveProps.value.actionColumn?.width) || 150\n return w\n})\n\nconst isRatioWidth = (w: number | string | undefined) => typeof w === 'number' && w > 0\nconst totalRatio = computed(() => {\n const cols = displayColumns.value.filter((c) => shouldShowColumn(c) && isRatioWidth(c.width))\n return cols.reduce((sum, c) => sum + (typeof c.width === 'number' ? c.width : 0), 0)\n})\n\nconst fixedDataColumnsWidth = computed(() => {\n const cols = displayColumns.value.filter((c) => shouldShowColumn(c) && typeof c.width === 'string')\n return cols.reduce((sum, c) => sum + (Number(getColumnWidth(c)) || 80), 0)\n})\n\nconst parseWidthPx = (v: number | string | undefined): number | null =>\n v == null ? null : typeof v === 'number' ? v : parseInt(String(v).replace(/px$/i, ''), 10) || null\n\nconst getColumnWidth = (col: ProColumn): number | string | undefined => {\n const w = col.width\n if (isRatioWidth(w) && totalRatio.value > 0 && containerWidth.value > 0 && typeof w === 'number') {\n const available = containerWidth.value - fixedColumnsWidth.value - fixedDataColumnsWidth.value\n let result = Math.floor((available * w) / totalRatio.value)\n const minPx = parseWidthPx(col.minWidth) ?? 60\n const maxPx = parseWidthPx(col.maxWidth)\n result = Math.max(minPx, result)\n if (maxPx != null) result = Math.min(maxPx, result)\n return result\n }\n if (typeof w === 'string') {\n const basePx = parseWidthPx(w) ?? 80\n const minPx = parseWidthPx(col.minWidth)\n const maxPx = parseWidthPx(col.maxWidth)\n let result = basePx\n if (minPx != null) result = Math.max(minPx, result)\n if (maxPx != null) result = Math.min(maxPx, result)\n return result\n }\n return col.width\n}\n\nconst shouldShowColumn = (col: ProColumn) => {\n if (col.ifShow === false) return false\n if (typeof col.ifShow === 'function') return col.ifShow({ column: col })\n return true\n}\n\n/** 当前页可选行(未禁用) */\nconst selectableRows = computed(() => {\n const getDisabled = effectiveProps.value.rowSelection?.getCheckboxProps\n if (!getDisabled) return innerData.value\n return innerData.value.filter((row) => !getDisabled(row)?.disabled)\n})\n\nconst hasSelectableRows = computed(() => selectableRows.value.length > 0)\n\n/** 当前页是否全选 */\nconst isAllCurrentPageSelected = computed(() => {\n if (selectableRows.value.length === 0) return false\n return selectableRows.value.every((row) => selectedKeysSet.value.has(row[rowKeyField.value] as string | number))\n})\n\n/** 半选状态 */\nconst isIndeterminate = computed(() => {\n const selectedCount = selectableRows.value.filter((row) => selectedKeysSet.value.has(row[rowKeyField.value] as string | number)).length\n return selectedCount > 0 && selectedCount < selectableRows.value.length\n})\n\nconst isRowSelected = (row: Record<string, unknown>) =>\n selectedKeysSet.value.has(row[rowKeyField.value] as string | number)\n\nconst getCheckboxDisabled = (row: Record<string, unknown>) =>\n effectiveProps.value.rowSelection?.getCheckboxProps?.(row)?.disabled ?? false\n\nconst getRadioDisabled = (row: Record<string, unknown>) =>\n effectiveProps.value.rowSelection?.getRadioProps?.(row)?.disabled ?? false\n\nconst emitSelectionChange = () => {\n const keys = selectedRows.value.map((r) => r[rowKeyField.value] as string | number)\n emit('selection-change', { keys, rows: selectedRows.value })\n}\n\nconst handleCheckboxChange = (row: Record<string, unknown>, checked: boolean) => {\n const key = row[rowKeyField.value] as string | number\n if (checked) {\n selectedRows.value = [...selectedRows.value.filter((r) => r[rowKeyField.value] !== key), row]\n } else {\n selectedRows.value = selectedRows.value.filter((r) => r[rowKeyField.value] !== key)\n }\n emitSelectionChange()\n}\n\nconst handleRadioSelect = (row: Record<string, unknown>) => {\n selectedRows.value = [row]\n emitSelectionChange()\n}\n\nconst handleSelectAll = (checked: boolean) => {\n if (checked) {\n const keySet = new Set(selectedRows.value.map((r) => r[rowKeyField.value]))\n const toAdd = selectableRows.value.filter((row) => !keySet.has(row[rowKeyField.value]))\n selectedRows.value = [...selectedRows.value, ...toAdd]\n } else {\n const currentPageKeys = new Set(innerData.value.map((r) => r[rowKeyField.value]))\n selectedRows.value = selectedRows.value.filter((r) => !currentPageKeys.has(r[rowKeyField.value]))\n }\n emitSelectionChange()\n}\n\nconst fetchData = async (opt?: FetchParams) => {\n if (!props.api) {\n if (props.dataSource) return\n innerData.value = []\n return\n }\n loading.value = true\n try {\n const fs = effectiveProps.value.fetchSetting ?? {}\n const pageField = fs.pageField ?? 'page'\n const sizeField = fs.sizeField ?? 'pageSize'\n const listField = fs.listField ?? 'list'\n const totalField = fs.totalField ?? 'total'\n const params: Record<string, unknown> = {\n [pageField]: opt?.page ?? pagination.value.page,\n [sizeField]: opt?.pageSize ?? pagination.value.pageSize,\n ...props.searchInfo,\n ...opt?.searchInfo,\n }\n if (opt?.page != null) pagination.value.page = opt.page\n if (opt?.pageSize != null) pagination.value.pageSize = opt.pageSize\n const processedParams = props.beforeFetch ? props.beforeFetch(params) : params\n const res = await props.api!(processedParams)\n rawDataSource.value = (res || {}) as Record<string, unknown>\n const data = (props.afterFetch ? props.afterFetch(res) : res) as Record<string, unknown>\n const list = (data[listField] ?? data.items ?? data.list ?? []) as unknown[]\n const total = (data[totalField] ?? 0) as number\n innerData.value = list as Record<string, unknown>[]\n pagination.value.total = total\n emit('fetch-success', { items: list, total })\n } catch (e) {\n emit('fetch-error', e)\n } finally {\n loading.value = false\n }\n}\n\nconst handleReload = () => fetchData(undefined)\nconst handleSizeChange = (size: number) => {\n if (effectiveProps.value.clearSelectOnPageChange) {\n selectedRows.value = []\n }\n pagination.value.pageSize = size\n pagination.value.page = 1\n fetchData(undefined)\n}\nconst handleCurrentChange = (page: number) => {\n if (effectiveProps.value.clearSelectOnPageChange) {\n selectedRows.value = []\n }\n pagination.value.page = page\n fetchData(undefined)\n}\nconst handleRowClick = (row: Record<string, unknown>, _column: unknown, event: Event) => emit('row-click', row, event)\nconst handleRowDblclick = (row: Record<string, unknown>, _column: unknown, event: Event) => emit('row-dblclick', row, event)\nconst handleSortChange = ({ prop, order }: { prop: string; order: string }) => emit('sort-change', { prop, order })\nconst handleExpandChange = (row: Record<string, unknown>, expanded: boolean | Record<string, unknown>[]) => emit('expand-change', row, expanded)\n\nconst findRowIndex = (key: string | number) =>\n innerData.value.findIndex((r) => r[rowKeyField.value] === key)\n\nconst tableAction: TableActionType = {\n setProps: (p) => { innerProps.value = { ...innerProps.value, ...p } },\n reload: (opt) => fetchData(opt),\n redoHeight: () => { tableRef.value?.doLayout?.() },\n setLoading: (v) => { loading.value = v },\n getDataSource: () => innerData.value,\n getRawDataSource: () => rawDataSource.value,\n setTableData: (data) => { innerData.value = data ?? [] },\n getColumns: () => innerColumns.value,\n setColumns: (cols) => {\n if (Array.isArray(cols) && cols.length > 0 && typeof cols[0] === 'string') {\n const keyList = cols as string[]\n const fromProps = (props.columns ?? []).filter((c) => keyList.includes((c.key ?? c.dataIndex) as string))\n const ordered = keyList.map((k) => fromProps.find((c) => (c.key ?? c.dataIndex) === k)).filter(Boolean) as ProColumn[]\n if (ordered.length) innerColumns.value = ordered\n } else {\n innerColumns.value = (cols as ProColumn[]) ?? []\n }\n },\n setPagination: (info) => {\n if (info?.page) pagination.value.page = info.page\n if (info?.pageSize) pagination.value.pageSize = info.pageSize\n if (info?.total !== undefined) pagination.value.total = info.total\n },\n getSelectRowKeys: () => selectedRows.value.map((r) => r[rowKeyField.value] as string | number),\n getSelectRows: () => selectedRows.value,\n clearSelectedRowKeys: () => { selectedRows.value = []; emitSelectionChange() },\n setSelectedRowKeys: (keys) => {\n const keySet = new Set(keys)\n const rows = innerData.value.filter((r) => keySet.has(r[rowKeyField.value] as string | number))\n keys.forEach((k) => {\n if (!rows.some((r) => r[rowKeyField.value] === k)) {\n rows.push({ [rowKeyField.value]: k } as Record<string, unknown>)\n }\n })\n selectedRows.value = rows\n emitSelectionChange()\n },\n deleteSelectRowByKey: (key) => {\n selectedRows.value = selectedRows.value.filter((r) => r[rowKeyField.value] !== key)\n emitSelectionChange()\n },\n updateTableData: (index, key, value) => {\n if (index < 0 || index >= innerData.value.length) return\n innerData.value = [...innerData.value]\n innerData.value[index] = { ...innerData.value[index], [key]: value }\n },\n updateTableDataRecord: (rowKey, record) => {\n const idx = findRowIndex(rowKey)\n if (idx < 0) return\n innerData.value = [...innerData.value]\n innerData.value[idx] = { ...innerData.value[idx], ...record }\n return innerData.value[idx]\n },\n deleteTableDataRecord: (rowKey) => {\n const keys = Array.isArray(rowKey) ? rowKey : [rowKey]\n const keySet = new Set(keys)\n innerData.value = innerData.value.filter((r) => !keySet.has(r[rowKeyField.value] as string | number))\n },\n insertTableDataRecord: (record, index) => {\n const arr = [...innerData.value]\n if (index == null || index >= arr.length) arr.push(record)\n else arr.splice(index, 0, record)\n innerData.value = arr\n return record\n },\n getPaginationRef: () =>\n showPagination.value\n ? { page: pagination.value.page, pageSize: Number(pagination.value.pageSize) || 10, total: pagination.value.total }\n : false,\n getShowPagination: () => showPagination.value,\n setShowPagination: (show) => { showPaginationRef.value = show },\n getRowSelection: () => effectiveProps.value.rowSelection,\n expandAll: () => {\n const childrenKey = effectiveProps.value.treeProps?.children ?? 'children'\n const flattenRows = (rows: Record<string, unknown>[]): Record<string, unknown>[] => {\n const result: Record<string, unknown>[] = []\n rows.forEach((row) => {\n result.push(row)\n const children = row[childrenKey] as Record<string, unknown>[] | undefined\n if (Array.isArray(children) && children.length > 0) {\n result.push(...flattenRows(children))\n }\n })\n return result\n }\n const allRows = flattenRows(innerData.value)\n allRows.forEach((row) => tableRef.value?.toggleRowExpansion?.(row, true))\n },\n collapseAll: () => {\n const childrenKey = effectiveProps.value.treeProps?.children ?? 'children'\n const flattenRows = (rows: Record<string, unknown>[]): Record<string, unknown>[] => {\n const result: Record<string, unknown>[] = []\n rows.forEach((row) => {\n result.push(row)\n const children = row[childrenKey] as Record<string, unknown>[] | undefined\n if (Array.isArray(children) && children.length > 0) {\n result.push(...flattenRows(children))\n }\n })\n return result\n }\n const allRows = flattenRows(innerData.value)\n allRows.forEach((row) => tableRef.value?.toggleRowExpansion?.(row, false))\n },\n}\n\ndefineExpose(tableAction)\n\nconst syncColumns = () => { innerColumns.value = [...(props.columns ?? [])] }\n\nconst loadData = () => {\n if (props.api && effectiveProps.value.immediate !== false) {\n fetchData(undefined)\n } else if (props.dataSource) {\n innerData.value = [...props.dataSource]\n if (!props.api && props.pagination !== false) {\n pagination.value.total = props.dataSource.length\n }\n }\n}\n\nconst updateContainerWidth = () => {\n if (tableWrapRef.value) containerWidth.value = tableWrapRef.value.offsetWidth || 0\n}\n\nlet resizeObserver: ResizeObserver | null = null\nlet observedEl: Element | null = null\n\nonMounted(() => {\n syncColumns()\n emit('register', tableAction)\n loadData()\n if (typeof window !== 'undefined') {\n window.addEventListener('resize', updateContainerWidth)\n resizeObserver = new ResizeObserver(updateContainerWidth)\n nextTick(() => {\n updateContainerWidth()\n observedEl = tableWrapRef.value\n if (observedEl) resizeObserver?.observe(observedEl)\n })\n }\n})\n\nonUnmounted(() => {\n if (typeof window !== 'undefined') {\n window.removeEventListener('resize', updateContainerWidth)\n if (resizeObserver && observedEl) {\n resizeObserver.unobserve(observedEl)\n observedEl = null\n }\n }\n})\n\nwatch(() => props.columns, syncColumns, { deep: true })\nwatch(() => props.dataSource, () => {\n if (!props.api && props.dataSource) innerData.value = [...props.dataSource]\n}, { deep: true })\nwatch(() => props.loading, (v) => { loading.value = v ?? false })\n</script>\n\n<style scoped>\n.ecp-pro-table {\n padding: 16px;\n background: #fff;\n width: 100%;\n box-sizing: border-box;\n}\n.ecp-pro-table :deep(.el-table) {\n width: 100% !important;\n}\n.ecp-pro-table__header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n}\n.ecp-pro-table__title-wrapper {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.ecp-pro-table__title {\n font-size: 16px;\n font-weight: 600;\n}\n.ecp-pro-table__help {\n color: #909399;\n cursor: help;\n}\n.ecp-pro-table__toolbar {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.ecp-pro-table__body {\n width: 100%;\n}\n.ecp-pro-table__pagination {\n margin-top: 16px;\n display: flex;\n justify-content: flex-end;\n}\n.ecp-pro-table__col-help {\n margin-left: 4px;\n color: #909399;\n cursor: help;\n}\n</style>\n","<template>\n <div class=\"ecp-table-action\">\n <!-- 主操作按钮组 -->\n <span\n v-for=\"(action, index) in visibleActions\"\n :key=\"`action-${index}`\"\n class=\"ecp-table-action__item\"\n >\n <!-- 气泡确认 -->\n <el-popconfirm\n v-if=\"action.popConfirm\"\n :title=\"action.popConfirm.title\"\n :confirm-button-text=\"action.popConfirm.okText || '确定'\"\n :cancel-button-text=\"action.popConfirm.cancelText || '取消'\"\n @confirm=\"(e) => handlePopConfirm(action, 'confirm', e)\"\n @cancel=\"(e) => handlePopConfirm(action, 'cancel', e)\"\n >\n <span slot=\"reference\">\n <component\n :is=\"action.tooltip ? 'el-tooltip' : 'span'\"\n v-bind=\"action.tooltip ? normalizeTooltip(action.tooltip) : {}\"\n >\n <el-button\n :type=\"getButtonType(action)\"\n size=\"small\"\n :disabled=\"action.disabled\"\n v-bind=\"action.props\"\n @click=\"(e) => handleClick(action, e)\"\n >\n <i v-if=\"action.icon\" :class=\"['ecp-table-action__icon', action.icon]\" />\n <span>{{ action.label }}</span>\n </el-button>\n </component>\n </span>\n </el-popconfirm>\n\n <!-- 普通按钮 -->\n <component\n v-else\n :is=\"action.tooltip ? 'el-tooltip' : 'span'\"\n v-bind=\"action.tooltip ? normalizeTooltip(action.tooltip) : {}\"\n >\n <el-button\n :type=\"getButtonType(action)\"\n size=\"small\"\n :disabled=\"action.disabled\"\n v-bind=\"action.props\"\n @click=\"(e) => handleClick(action, e)\"\n >\n <i v-if=\"action.icon\" :class=\"['ecp-table-action__icon', action.icon]\" />\n <span>{{ action.label }}</span>\n </el-button>\n </component>\n\n <el-divider v-if=\"action.divider\" direction=\"vertical\" />\n </span>\n\n <!-- 下拉更多操作 -->\n <el-dropdown v-if=\"visibleDropDownActions.length\" trigger=\"click\" @command=\"handleDropdownCommand\">\n <span class=\"ecp-table-action__more\">\n <el-button type=\"text\" size=\"small\">\n 更多<i class=\"el-icon-arrow-down el-icon--right\" />\n </el-button>\n </span>\n <el-dropdown-menu slot=\"dropdown\">\n <el-dropdown-item\n v-for=\"(action, index) in visibleDropDownActions\"\n :key=\"`dropdown-${index}`\"\n :command=\"index\"\n :disabled=\"action.disabled\"\n :divided=\"!!action.divider\"\n >\n <span class=\"ecp-table-action__dropdown-item\">\n <i v-if=\"action.icon\" :class=\"['ecp-table-action__icon', action.icon]\" />\n <span>{{ action.label }}</span>\n </span>\n </el-dropdown-item>\n </el-dropdown-menu>\n </el-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { MessageBox } from 'element-ui'\nimport type { TableActionItem } from './types'\n\nconst props = withDefaults(\n defineProps<{\n actions?: TableActionItem[]\n dropDownActions?: TableActionItem[]\n /** 是否阻止按钮 click 冒泡,参考 VbenAdmin stopButtonPropagation */\n stopButtonPropagation?: boolean\n }>(),\n {\n actions: () => [],\n dropDownActions: () => [],\n stopButtonPropagation: false,\n }\n)\n\nconst normalizeTooltip = (tooltip?: TableActionItem['tooltip']) => {\n if (!tooltip) return {}\n if (typeof tooltip === 'string') {\n return { content: tooltip }\n }\n return tooltip as Record<string, unknown>\n}\n\nconst getButtonType = (action: TableActionItem) => {\n if (action.type) return action.type\n if (action.color === 'error') return 'danger'\n if (action.color === 'success') return 'success'\n if (action.color === 'warning') return 'warning'\n return 'text'\n}\n\nconst filterVisible = (list: TableActionItem[]) =>\n list.filter((item) => {\n const { ifShow } = item\n if (typeof ifShow === 'boolean') return ifShow\n if (typeof ifShow === 'function') return ifShow(item)\n return true\n })\n\nconst visibleActions = computed(() => filterVisible(props.actions || []))\nconst visibleDropDownActions = computed(() => filterVisible(props.dropDownActions || []))\n\nconst handleClick = (action: TableActionItem, e: MouseEvent) => {\n if (props.stopButtonPropagation) {\n e.stopPropagation()\n }\n action.onClick?.(e)\n}\n\nconst handlePopConfirm = (action: TableActionItem, type: 'confirm' | 'cancel', e: MouseEvent) => {\n if (props.stopButtonPropagation) {\n e.stopPropagation()\n }\n if (!action.popConfirm) return\n if (type === 'confirm') {\n action.popConfirm.confirm?.()\n } else {\n action.popConfirm.cancel?.()\n }\n}\n\nconst handleDropdownCommand = (index: number | string) => {\n const idx = Number(index)\n const action = visibleDropDownActions.value[idx]\n if (!action || action.disabled) return\n if (action.popConfirm) {\n const title = action.popConfirm.title\n const okText = action.popConfirm.okText || '确定'\n const cancelText = action.popConfirm.cancelText || '取消'\n MessageBox.confirm(title, '提示', {\n confirmButtonText: okText,\n cancelButtonText: cancelText,\n type: 'warning',\n })\n .then(() => action.popConfirm?.confirm?.())\n .catch(() => action.popConfirm?.cancel?.())\n return\n }\n action.onClick?.({} as MouseEvent)\n}\n</script>\n\n<style scoped>\n.ecp-table-action {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n.ecp-table-action__item {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n.ecp-table-action__icon {\n margin-right: 4px;\n}\n.ecp-table-action__more {\n display: inline-flex;\n align-items: center;\n}\n.ecp-table-action__dropdown-item {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n</style>\n\n","import { ref, unref, type Ref } from 'vue'\nimport type { ProTableProps, TableActionType } from './types'\n\nexport type UseProTableReturn = [\n (instance: TableActionType) => void,\n TableActionType\n]\n\n/**\n * 用于 ProTable 的 useProTable,支持通过 ref 调用表格方法\n * @param props ProTable 的 props 配置\n */\nexport function useProTable(props?: ProTableProps | Ref<ProTableProps | undefined>): UseProTableReturn {\n const tableActionRef = ref<TableActionType | null>(null)\n\n const getTableAction = (): TableActionType => {\n const action = unref(tableActionRef)\n if (!action) {\n throw new Error('ProTable instance has not been registered')\n }\n return action\n }\n\n const register = (instance: TableActionType) => {\n tableActionRef.value = instance\n }\n\n const tableActions: UseProTableReturn[1] = {\n setProps: (p) => getTableAction().setProps(p),\n reload: (opt) => getTableAction().reload(opt),\n setLoading: (v) => getTableAction().setLoading(v),\n getDataSource: () => getTableAction().getDataSource(),\n getRawDataSource: () => getTableAction().getRawDataSource(),\n setTableData: (data) => getTableAction().setTableData(data),\n getColumns: () => getTableAction().getColumns(),\n setColumns: (cols) => getTableAction().setColumns(cols),\n setPagination: (info) => getTableAction().setPagination(info),\n getSelectRowKeys: () => getTableAction().getSelectRowKeys(),\n getSelectRows: () => getTableAction().getSelectRows(),\n clearSelectedRowKeys: () => getTableAction().clearSelectedRowKeys(),\n setSelectedRowKeys: (keys) => getTableAction().setSelectedRowKeys(keys),\n deleteSelectRowByKey: (key) => getTableAction().deleteSelectRowByKey(key),\n updateTableDataRecord: (rowKey, record) => getTableAction().updateTableDataRecord(rowKey, record),\n deleteTableDataRecord: (rowKey) => getTableAction().deleteTableDataRecord(rowKey),\n insertTableDataRecord: (record, index) => getTableAction().insertTableDataRecord(record, index),\n getPaginationRef: () => getTableAction().getPaginationRef(),\n getShowPagination: () => getTableAction().getShowPagination(),\n setShowPagination: (show) => getTableAction().setShowPagination(show),\n expandAll: () => getTableAction().expandAll?.(),\n collapseAll: () => getTableAction().collapseAll?.(),\n }\n\n return [register, tableActions]\n}\n","<template>\n <el-form-item\n v-if=\"shouldRender\"\n v-show=\"shouldShow\"\n :prop=\"schema.field\"\n :required=\"schema.required\"\n :rules=\"effectiveRules\"\n >\n <template slot=\"label\">\n <span>{{ schema.label }}</span>\n <el-tooltip\n v-if=\"schema.helpMessage\"\n placement=\"top\"\n effect=\"light\"\n v-bind=\"schema.helpComponentProps || {}\"\n >\n <template slot=\"content\">\n <template v-if=\"Array.isArray(schema.helpMessage)\">\n <div v-for=\"(msg, i) in schema.helpMessage\" :key=\"i\" class=\"ecp-pro-form-item__help-item\">\n {{ msg }}\n </div>\n </template>\n <span v-else>{{ schema.helpMessage }}</span>\n </template>\n <i class=\"el-icon-question ecp-pro-form-item__help-icon\" />\n </el-tooltip>\n </template>\n <!-- render 自定义渲染 -->\n <template v-if=\"schema.render\">\n <component :is=\"renderComponent\" />\n </template>\n <!-- slot 自定义插槽(由 ProForm 传入 default slot) -->\n <slot v-else-if=\"hasSlot\" :model=\"formModel\" :schema=\"schema\" :field=\"schema.field\" :values=\"formModel\" />\n <!-- 默认组件渲染 -->\n <template v-else>\n <el-input\n v-if=\"schema.component === 'input' || !schema.component\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder || (autoPlaceholder ? `请输入${schema.label}` : undefined)\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-input-number\n v-else-if=\"schema.component === 'input-number'\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-select\n class=\"ecp-pro-form-item__select\"\n v-else-if=\"schema.component === 'select'\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder || (autoPlaceholder ? `请选择${schema.label}` : undefined)\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n >\n <el-option\n v-for=\"opt in (getOptions(effectiveComponentProps) || [])\"\n :key=\"String(opt.value)\"\n :label=\"opt.label\"\n :value=\"opt.value\"\n />\n </el-select>\n <el-date-picker\n v-else-if=\"schema.component === 'date-picker'\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder || (autoPlaceholder ? `请选择${schema.label}` : undefined)\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-date-picker\n v-else-if=\"schema.component === 'date-range'\"\n v-model=\"formModel[schema.field]\"\n type=\"daterange\"\n range-separator=\"至\"\n start-placeholder=\"开始日期\"\n end-placeholder=\"结束日期\"\n value-format=\"yyyy-MM-dd\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-switch\n v-else-if=\"schema.component === 'switch'\"\n v-model=\"formModel[schema.field]\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-cascader\n v-else-if=\"schema.component === 'cascader'\"\n v-model=\"formModel[schema.field]\"\n :placeholder=\"schema.placeholder || (autoPlaceholder ? `请选择${schema.label}` : undefined)\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n />\n <el-checkbox-group\n v-else-if=\"schema.component === 'checkbox'\"\n v-model=\"formModel[schema.field]\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n >\n <el-checkbox\n v-for=\"opt in (getOptions(effectiveComponentProps) || [])\"\n :key=\"String(opt.value)\"\n :label=\"opt.value\"\n >\n {{ opt.label }}\n </el-checkbox>\n </el-checkbox-group>\n <el-radio-group\n v-else-if=\"schema.component === 'radio'\"\n v-model=\"formModel[schema.field]\"\n :disabled=\"effectiveDisabled\"\n v-bind=\"effectiveComponentProps\"\n v-on=\"effectiveComponentListeners\"\n >\n <el-radio\n v-for=\"opt in (getOptions(effectiveComponentProps) || [])\"\n :key=\"String(opt.value)\"\n :label=\"opt.value\"\n >\n {{ opt.label }}\n </el-radio>\n </el-radio-group>\n </template>\n </el-form-item>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots, h } from 'vue'\nimport type { ProFormSchema, RenderCallbackParams } from '../types'\n\nconst props = defineProps<{\n schema: ProFormSchema\n formModel: Record<string, unknown>\n formDisabled?: boolean\n autoPlaceholder?: boolean\n formActionType?: import('../types').FormActionType\n}>()\n\nconst slots = useSlots()\n\nconst renderParams = computed<RenderCallbackParams>(() => ({\n schema: props.schema,\n values: props.formModel,\n model: props.formModel,\n field: props.schema.field,\n}))\n\nconst shouldRender = computed(() => {\n const ifShow = props.schema.ifShow\n if (ifShow === undefined) return true\n if (typeof ifShow === 'boolean') return ifShow\n return ifShow(renderParams.value)\n})\n\nconst shouldShow = computed(() => {\n const show = props.schema.show\n if (show === undefined) return true\n if (typeof show === 'boolean') return show\n return show(renderParams.value)\n})\n\nconst effectiveDisabled = computed(() => {\n if (props.formDisabled) return true\n const dyn = props.schema.dynamicDisabled\n if (dyn === undefined) return false\n if (typeof dyn === 'boolean') return dyn\n return dyn(renderParams.value)\n})\n\nconst effectiveRules = computed(() => {\n const dyn = props.schema.dynamicRules\n if (!dyn) return props.schema.rules\n if (Array.isArray(dyn)) return dyn\n return dyn(renderParams.value)\n})\n\nconst effectiveComponentPropsAndListeners = computed(() => {\n const cp = props.schema.componentProps\n if (!cp) return { props: {}, listeners: {} }\n const raw = typeof cp === 'function'\n ? cp({\n ...renderParams.value,\n formActionType: props.formActionType,\n })\n : { ...cp }\n const propsOnly: Record<string, unknown> = {}\n const listeners: Record<string, (...args: unknown[]) => unknown> = {}\n for (const [key, value] of Object.entries(raw)) {\n if (key.length > 2 && /^on[A-Za-z]/.test(key) && typeof value === 'function') {\n const eventName = key.slice(2).charAt(0).toLowerCase() + key.slice(3)\n listeners[eventName] = value as (...args: unknown[]) => unknown\n } else {\n propsOnly[key] = value\n }\n }\n return { props: propsOnly, listeners }\n})\n\nconst effectiveComponentProps = computed(() => effectiveComponentPropsAndListeners.value.props)\nconst effectiveComponentListeners = computed(() => effectiveComponentPropsAndListeners.value.listeners)\n\nconst hasSlot = computed(() => !!slots.default)\n\nconst getOptions = (props: Record<string, unknown>): Array<{ label: string; value: unknown }> | undefined => {\n const opts = props?.options\n return Array.isArray(opts) ? opts : undefined\n}\n\nconst renderComponent = computed(() => {\n const renderFn = props.schema.render\n if (!renderFn) return null\n return {\n render() {\n const result = renderFn(renderParams.value)\n if (Array.isArray(result)) {\n return h('span', result)\n }\n return result\n },\n }\n})\n</script>\n\n<style scoped>\n.ecp-pro-form-item__help-icon {\n margin-left: 4px;\n color: #909399;\n cursor: help;\n font-size: 14px;\n}\n.ecp-pro-form-item__help-icon:hover {\n color: #409eff;\n}\n.ecp-pro-form-item__help-item {\n margin-bottom: 4px;\n}\n.ecp-pro-form-item__help-item:last-child {\n margin-bottom: 0;\n}\n</style>\n","<template>\n <div ref=\"formWrapRef\" class=\"ecp-pro-form\">\n <el-form class=\"ecp-pro-form\" ref=\"formRef\" :model=\"formModel\" :rules=\"formRules\" :label-width=\"effectiveProps.labelWidth\"\n :label-position=\"effectiveProps.labelPosition\" :size=\"effectiveProps.size\" :disabled=\"effectiveProps.disabled\"\n v-bind=\"$attrs\" v-on=\"formListeners\">\n <slot name=\"formHeader\" />\n <el-row :gutter=\"effectiveProps.gutter\" :style=\"effectiveProps.baseRowStyle\">\n <template v-for=\"schema in displaySchemas\">\n <el-col v-if=\"shouldShow(schema)\" :key=\"schema.field\" v-bind=\"getColProps(schema)\"\n :offset=\"schema.colProps?.offset ?? effectiveProps.baseColProps?.offset ?? 0\" :data-field=\"schema.field\">\n <ProFormItem :schema=\"schema\" :form-model=\"formModel\" :form-disabled=\"effectiveProps.disabled\"\n :auto-placeholder=\"effectiveProps.autoSetPlaceholder\" :form-action-type=\"formActionRef\">\n <template v-if=\"slots[getSlotName(schema)]\">\n <slot :name=\"getSlotName(schema)\" :model=\"formModel\" :schema=\"schema\" :field=\"schema.field\"\n :values=\"formModel\" />\n </template>\n </ProFormItem>\n </el-col>\n </template>\n <el-col class=\"ecp-pro-form_col\" v-if=\"effectiveProps.showActionButtonGroup\"\n v-bind=\"hasMoreFields ? { span: 24 } : effectiveProps.actionColOptions || { span: 6 }\">\n <FormActions :show-action-button-group=\"effectiveProps.showActionButtonGroup\"\n :show-submit-button=\"effectiveProps.showSubmitButton\" :show-reset-button=\"effectiveProps.showResetButton\"\n :submit-button-text=\"effectiveProps.submitButtonText\" :reset-button-text=\"effectiveProps.resetButtonText\"\n :submit-button-icon=\"effectiveProps.submitButtonIcon\" :reset-button-icon=\"effectiveProps.resetButtonIcon\"\n :submit-loading=\"submitLoading\" :show-advanced-button=\"effectiveProps.showAdvancedButton\"\n :has-more-fields=\"hasMoreFields\" :collapsed=\"collapsed\" :action-col-options=\"effectiveActionColOptions\"\n @submit=\"handleSubmit\" @reset=\"handleReset\" @toggle=\"collapsed = !collapsed\">\n <template slot=\"submitBefore\">\n <slot name=\"submitBefore\" />\n </template>\n <template slot=\"resetBefore\">\n <slot name=\"resetBefore\" />\n </template>\n <template slot=\"advanceBefore\">\n <slot name=\"advanceBefore\" />\n </template>\n <template slot=\"advanceAfter\">\n <slot name=\"advanceAfter\" />\n </template>\n <template slot=\"actions\">\n <slot name=\"actions\" />\n </template>\n </FormActions>\n </el-col>\n </el-row>\n <el-button v-if=\"effectiveProps.showAdvancedButton && hasMoreFields\" type=\"text\" class=\"ecp-form-actions__advance\"\n @click=\"collapsed = !collapsed\">\n <i class=\"el-icon-d-arrow-left\" :class=\"collapsed ? 'down' : 'up'\" />\n {{ collapsed ? '展开' : '收起' }}\n </el-button>\n <slot name=\"formFooter\" />\n </el-form>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch, useSlots, onMounted, onUnmounted } from 'vue'\nimport { useComponentSetting } from '../useComponentSetting'\nimport ProFormItem from './ProFormItem.vue'\nimport FormActions from './FormActions.vue'\nimport type { ProFormSchema, ProFormProps, FormActionType, ColEx, ScrollToFieldOptions, FormListeners } from '../types'\n\nconst props = withDefaults(\n defineProps<{\n schemas?: ProFormSchema[]\n initialValues?: Record<string, unknown>\n labelWidth?: string\n labelPosition?: 'left' | 'right' | 'top'\n gutter?: number\n size?: 'medium' | 'small' | 'large'\n disabled?: boolean\n baseColProps?: ColEx\n baseRowStyle?: Record<string, string | number>\n autoSetPlaceholder?: boolean\n showSubmitButton?: boolean\n showResetButton?: boolean\n submitButtonText?: string\n resetButtonText?: string\n submitButtonIcon?: string\n resetButtonIcon?: string\n showActionButtonGroup?: boolean\n actionColOptions?: ColEx\n showAdvancedButton?: boolean\n autoAdvancedLine?: number\n alwaysShowLines?: number\n submitFunc?: () => Promise<void>\n resetFunc?: () => Promise<void>\n submitOnReset?: boolean\n formListeners?: FormListeners\n }>(),\n {\n labelWidth: '120px',\n labelPosition: 'right',\n gutter: 24,\n size: 'medium',\n autoSetPlaceholder: true,\n showSubmitButton: true,\n showResetButton: true,\n submitButtonText: '提交',\n resetButtonText: '重置',\n submitButtonIcon: 'el-icon-search',\n resetButtonIcon: 'el-icon-refresh-left',\n showActionButtonGroup: true,\n showAdvancedButton: false,\n autoAdvancedLine: 3,\n alwaysShowLines: 1,\n baseColProps: () => ({ xs: 24, sm: 12, md: 12, lg: 8, xl: 6 }),\n actionColOptions: () => ({ xs: 24, sm: 12, md: 12, lg: 8, xl: 6 }),\n submitOnReset: false,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'submit', values: Record<string, unknown>): void\n (e: 'reset'): void\n (e: 'register', formAction: FormActionType): void\n}>()\nconst slots = useSlots()\nconst formRef = ref()\nconst formWrapRef = ref()\nconst submitLoading = ref(false)\nconst collapsed = ref(true)\nconst formModel = ref<Record<string, unknown>>({})\nconst formRules = ref<Record<string, unknown[]>>({})\nconst innerSchemas = ref<ProFormSchema[]>([])\nconst innerProps = ref<Partial<ProFormProps>>({})\n\n/** Element UI 栅格断点 (px) */\nconst BREAKPOINTS = { xl: 1920, lg: 1200, md: 992, sm: 768 }\n\n/** 根据当前视口宽度获取 ColEx 的有效 span(与 el-col 断点逻辑一致) */\nconst getEffectiveSpan = (colProps?: ColEx | null, baseColProps?: ColEx | null, width?: number): number => {\n const w = width ?? (typeof window !== 'undefined' ? window.innerWidth : 1920)\n const col = colProps ?? {}\n const base = baseColProps ?? {}\n const fallback = base.span ?? 8\n if (w >= BREAKPOINTS.xl) return col.xl ?? base.xl ?? col.lg ?? base.lg ?? col.md ?? base.md ?? col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n if (w >= BREAKPOINTS.lg) return col.lg ?? base.lg ?? col.md ?? base.md ?? col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n if (w >= BREAKPOINTS.md) return col.md ?? base.md ?? col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n if (w >= BREAKPOINTS.sm) return col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n // if (w < BREAKPOINTS.sm) return col.sm ?? base.sm ?? col.xs ?? base.xs ?? col.span ?? fallback\n return col.xs ?? base.xs ?? col.span ?? fallback\n}\n\nconst { getSetting: getComponentSetting } = useComponentSetting()\nconst effectiveProps = computed(() => ({ ...getComponentSetting('ProForm'), ...props, ...innerProps.value }))\nconst effectiveActionColOptions = computed(() => effectiveProps.value.actionColOptions ?? { span: 24 })\n\n/** 当前视口宽度,用于响应式计算 span */\nconst windowWidth = ref(typeof window !== 'undefined' ? window.innerWidth : 1920)\n\n/** 计算前 maxLines 行能容纳的 schema 数量(考虑栅格断点,每个 field 可有自己的 span) */\nconst getVisibleSchemaCount = (\n schemas: ProFormSchema[],\n baseColProps: ColEx | undefined,\n maxLines: number,\n width: number\n) => {\n let remaining = 24\n let rows = 1\n let count = 0\n for (const schema of schemas) {\n const span = getEffectiveSpan(schema.colProps, baseColProps, width)\n if (span > remaining) {\n rows++\n if (rows > maxLines) break\n remaining = 24 - span\n } else {\n remaining -= span\n }\n count++\n }\n return count\n}\n\nconst hasMoreFields = computed(() => {\n const schemas = innerSchemas.value.filter((s) => shouldShow(s))\n\n if (!effectiveProps.value.showAdvancedButton) return false\n const lines = effectiveProps.value.alwaysShowLines ?? 1\n const baseColProps = effectiveProps.value.baseColProps\n const maxVisible = getVisibleSchemaCount(schemas, baseColProps, lines, windowWidth.value)\n console.log(schemas.length, maxVisible)\n return schemas.length > maxVisible\n})\n\nconst formListeners = computed((): FormListeners => {\n return effectiveProps.value.formListeners ?? {}\n})\n\nconst displaySchemas = computed(() => {\n const schemas = innerSchemas.value.filter((s) => {\n return shouldShow(s)\n })\n if (!effectiveProps.value.showAdvancedButton || !collapsed.value) return schemas\n const lines = effectiveProps.value.alwaysShowLines ?? 1\n const baseColProps = effectiveProps.value.baseColProps\n const maxVisible = getVisibleSchemaCount(schemas, baseColProps, lines, windowWidth.value)\n return schemas.slice(0, maxVisible)\n})\n\nconst shouldShow = (schema: ProFormSchema) => {\n let ifShow = true\n let show = true\n if (typeof schema.ifShow === 'function') {\n ifShow = schema.ifShow({ schema, values: formModel.value, model: formModel.value, field: schema.field })\n }\n if (typeof schema.ifShow === 'boolean') {\n ifShow = schema.ifShow\n }\n if (typeof schema.show === 'function') {\n show = schema.show({ schema, values: formModel.value, model: formModel.value, field: schema.field })\n }\n if (typeof schema.show === 'boolean') {\n show = schema.show\n }\n return ifShow && show\n}\nconst getColProps = (schema: ProFormSchema) => {\n return schema.colProps ?? effectiveProps.value.baseColProps ?? {}\n}\nconst getSlotName = (schema: ProFormSchema) => schema.slot || schema.field\n\nconst initForm = () => {\n const model: Record<string, unknown> = {}\n const rules: Record<string, unknown[]> = {}\n const initialValues = effectiveProps.value.initialValues ?? props.initialValues\n innerSchemas.value.forEach((schema) => {\n model[schema.field] = schema.defaultValue ?? initialValues?.[schema.field]\n if (schema.rules?.length) rules[schema.field] = schema.rules\n })\n formModel.value = { ...formModel.value, ...model }\n formRules.value = rules\n}\n\nconst filterByIfShow = (values: Record<string, unknown>) => {\n const result = { ...values }\n innerSchemas.value.forEach((schema) => {\n const ifShow = schema.ifShow\n if (ifShow === undefined) return\n const visible = typeof ifShow === 'boolean' ? ifShow : ifShow({ schema, values, model: values, field: schema.field })\n if (!visible) delete result[schema.field]\n })\n return result\n}\n\nconst processFieldMapToTime = (values: Record<string, unknown>) => {\n const filtered = filterByIfShow(values)\n const fieldMap = innerProps.value.fieldMapToTime\n if (!fieldMap?.length) return filtered\n const result = { ...filtered }\n fieldMap.forEach(([field, [startKey, endKey]]) => {\n const val = result[field]\n if (Array.isArray(val) && val.length === 2) {\n delete result[field]\n ; (result as Record<string, unknown>)[startKey] = val[0]\n ; (result as Record<string, unknown>)[endKey] = val[1]\n }\n })\n return result\n}\n\nconst handleSubmit = async () => {\n try {\n await formRef.value?.validate()\n if (effectiveProps.value.submitFunc) {\n await effectiveProps.value.submitFunc()\n } else {\n submitLoading.value = true\n emit('submit', processFieldMapToTime({ ...formModel.value }))\n }\n } catch (e) {\n console.error('Form validation failed:', e)\n } finally {\n submitLoading.value = false\n }\n}\n\nconst handleReset = async () => {\n if (effectiveProps.value.resetFunc) {\n await effectiveProps.value.resetFunc()\n } else {\n formRef.value?.resetFields()\n initForm()\n emit('reset')\n if (effectiveProps.value.submitOnReset) await handleSubmit()\n }\n}\n\nconst setFieldsValue = (values: Record<string, unknown>) => {\n formModel.value = { ...formModel.value, ...values }\n return Promise.resolve()\n}\n\nconst getFieldsValue = () => processFieldMapToTime({ ...formModel.value })\n\nconst resetFields = async () => {\n formRef.value?.resetFields()\n initForm()\n}\n\nconst validate = (nameList?: string[]) =>\n formRef.value?.validate(nameList) ?? Promise.resolve()\n\nconst validateFields = (nameList?: string[]) => {\n if (!formRef.value) return Promise.resolve()\n if (!nameList?.length) return formRef.value.validate()\n return Promise.all(nameList.map((prop) => new Promise((resolve, reject) => {\n formRef.value.validateField(prop, (valid: boolean) => (valid ? resolve(undefined) : reject(new Error('Validation failed'))))\n })))\n}\n\nconst scrollToField = async (name: string, options?: ScrollToFieldOptions) => {\n const el = formWrapRef.value?.querySelector(`[data-field=\"${name}\"]`)\n if (el) {\n el.scrollIntoView({ behavior: options?.behavior ?? 'smooth', block: options?.block ?? 'nearest' })\n }\n return Promise.resolve()\n}\n\nconst clearValidate = (name?: string | string[]) => {\n formRef.value?.clearValidate(name)\n}\n\nconst updateSchema = async (data: Partial<ProFormSchema> | Partial<ProFormSchema>[]) => {\n const list = Array.isArray(data) ? data : [data]\n list.forEach((item) => {\n const idx = innerSchemas.value.findIndex((s) => s.field === item.field)\n if (idx >= 0) innerSchemas.value[idx] = { ...innerSchemas.value[idx], ...item }\n })\n}\n\nconst appendSchemaByField = async (schema: ProFormSchema, prefixField?: string, first?: boolean) => {\n if (first) innerSchemas.value.unshift(schema)\n else if (prefixField) {\n const idx = innerSchemas.value.findIndex((s) => s.field === prefixField)\n innerSchemas.value.splice(idx + 1, 0, schema)\n } else innerSchemas.value.push(schema)\n initForm()\n}\n\nconst removeSchemaByField = async (field: string | string[]) => {\n const fields = Array.isArray(field) ? field : [field]\n innerSchemas.value = innerSchemas.value.filter((s) => !fields.includes(s.field))\n}\n\nconst setProps = async (formProps: Partial<ProFormProps>) => {\n innerProps.value = { ...innerProps.value, ...formProps }\n if (formProps.schemas) {\n innerSchemas.value = [...formProps.schemas]\n debugger\n initForm()\n }\n}\n\nconst formActionRef: FormActionType = {\n getFieldsValue,\n setFieldsValue,\n resetFields,\n validate,\n validateFields,\n submit: handleSubmit,\n scrollToField,\n clearValidate,\n updateSchema,\n appendSchemaByField,\n removeSchemaByField,\n setProps,\n}\n\ndefineExpose(formActionRef)\n\nconst syncSchemas = () => {\n innerSchemas.value = [...(props.schemas ?? [])]\n initForm()\n}\n\nconst handleResize = () => {\n if (typeof window !== 'undefined') windowWidth.value = window.innerWidth\n}\n\nonMounted(() => {\n syncSchemas()\n emit('register', formActionRef)\n if (typeof window !== 'undefined') window.addEventListener('resize', handleResize)\n})\n\nonUnmounted(() => {\n if (typeof window !== 'undefined') window.removeEventListener('resize', handleResize)\n})\n\nwatch(() => [props.schemas, props.initialValues], syncSchemas, { deep: true })\n</script>\n\n<style scoped>\n.ecp-pro-form {\n padding: 16px;\n position: relative;\n}\n\n.ecp-pro-form__advance {\n margin-bottom: 16px;\n}\n\n.ecp-pro-form_col {\n position: relative;\n float: right;\n}\n\n.el-icon-d-arrow-left.up {\n transform: rotate(90deg);\n}\n\n.el-icon-d-arrow-left.down {\n transform: rotate(-90deg);\n}\n\n.ecp-form-actions__advance {\n position: absolute;\n bottom: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n</style>\n","import { ref, watch, unref, type Ref } from 'vue'\nimport type { ProFormSchema, ProFormProps, FormActionType } from '../types'\n\nexport interface UseFormProps extends ProFormProps {\n schemas?: ProFormSchema[]\n}\n\n/** 支持 ref/computed 的 props(参考 Vben Admin:参数 props 内的值可以是 computed 或者 ref 类型) */\nexport type UseFormPropsReactive = UseFormProps | Ref<UseFormProps | undefined>\n\nexport interface UseFormReturn {\n /** 用于 @register,接收表单实例的 formAction */\n register: (formAction: FormActionType) => void\n formAction: { value: FormActionType | null }\n getFieldsValue: () => Record<string, unknown>\n setFieldsValue: (values: Record<string, unknown>) => Promise<void>\n resetFields: () => Promise<void>\n validate: (nameList?: string[]) => Promise<unknown>\n validateFields: (nameList?: string[]) => Promise<unknown>\n submit: () => Promise<void>\n scrollToField: (name: string, options?: import('../types').ScrollToFieldOptions) => Promise<void>\n clearValidate: (name?: string | string[]) => void\n updateSchema: (data: Partial<ProFormSchema> | Partial<ProFormSchema>[]) => Promise<void>\n appendSchemaByField: (schema: ProFormSchema, prefixField?: string, first?: boolean) => Promise<void>\n removeSchemaByField: (field: string | string[]) => Promise<void>\n setProps: (props: Partial<ProFormProps>) => Promise<void>\n}\n\nexport function useForm(props?: UseFormPropsReactive): [UseFormReturn['register'], Omit<UseFormReturn, 'register'>] {\n const formAction = ref<FormActionType | null>(null)\n const formPropsRef = ref<UseFormProps | undefined>(props ? unref(props as Ref<UseFormProps | undefined>) : undefined)\n\n const getFormProps = () => (props ? unref(props as Ref<UseFormProps | undefined>) : undefined) as UseFormProps | undefined\n\n const register = (action: FormActionType) => {\n formAction.value = action\n const formProps = getFormProps()\n debugger\n if (formProps && Object.keys(formProps).length > 0) {\n action.setProps(formProps)\n }\n }\n\n if (props) {\n watch(\n () => getFormProps(),\n (formProps) => {\n formPropsRef.value = formProps\n if (formProps && formAction.value) {\n formAction.value.setProps(formProps)\n }\n },\n { deep: true }\n )\n }\n\n const getFieldsValue = () => formAction.value?.getFieldsValue() ?? {}\n\n const setFieldsValue = async (values: Record<string, unknown>) => {\n await formAction.value?.setFieldsValue(values)\n }\n\n const resetFields = async () => {\n await formAction.value?.resetFields()\n }\n\n const validate = (nameList?: string[]) =>\n formAction.value?.validate(nameList) ?? Promise.resolve()\n\n const validateFields = (nameList?: string[]) =>\n formAction.value?.validateFields(nameList) ?? Promise.resolve()\n\n const submit = () => formAction.value?.submit() ?? Promise.resolve()\n\n const scrollToField = (name: string, options?: import('../types').ScrollToFieldOptions) =>\n formAction.value?.scrollToField(name, options) ?? Promise.resolve()\n\n const clearValidate = (name?: string | string[]) => {\n formAction.value?.clearValidate(name)\n }\n\n const updateSchema = (data: Partial<ProFormSchema> | Partial<ProFormSchema>[]) =>\n formAction.value?.updateSchema(data) ?? Promise.resolve()\n\n const appendSchemaByField = (schema: ProFormSchema, prefixField?: string, first?: boolean) =>\n formAction.value?.appendSchemaByField(schema, prefixField, first) ?? Promise.resolve()\n\n const removeSchemaByField = (field: string | string[]) =>\n formAction.value?.removeSchemaByField(field) ?? Promise.resolve()\n\n const setProps = async (formProps: Partial<ProFormProps>) => {\n formPropsRef.value = { ...formPropsRef.value, ...formProps }\n await formAction.value?.setProps(formProps)\n }\n\n const result: UseFormReturn = {\n register,\n formAction,\n getFieldsValue,\n setFieldsValue,\n resetFields,\n validate,\n validateFields,\n submit,\n scrollToField,\n clearValidate,\n updateSchema,\n appendSchemaByField,\n removeSchemaByField,\n setProps,\n }\n\n return [register, result]\n}\n","import type { VueConstructor } from 'vue'\nimport ProTable, { TableAction } from './ProTable'\nimport ProForm, { ProFormItem, FormActions } from './ProForm'\nimport { useForm } from './ProForm/useForm'\nimport { useProTable } from './ProTable/useProTable'\nimport { useComponentSetting } from './useComponentSetting'\n\nexport { ProForm, ProFormItem, FormActions, useForm }\nexport { ProTable, useProTable, TableAction }\nexport { useComponentSetting }\nexport type { UseComponentSettingReturn } from './useComponentSetting'\nexport * from './ProTable/types'\nexport * from './types'\n\nconst components = [\n { name: 'ProTable', component: ProTable },\n { name: 'TableAction', component: TableAction },\n { name: 'ProForm', component: ProForm },\n { name: 'ProFormItem', component: ProFormItem },\n { name: 'FormActions', component: FormActions },\n]\n\nexport function install(Vue: VueConstructor) {\n components.forEach(({ name, component }) => {\n Vue.component(name, component)\n })\n}\n\nexport default {\n install,\n ProTable,\n ProForm,\n TableAction,\n}\n"],"names":["componentSettings","reactive","useComponentSetting","componentName","config","current","DefaultCellRenderer","defineComponent","p","col","r","h","text","_b","_a","BodyCellRenderer","slot","nodes","n","x","slots","useSlots","tableRef","ref","tableWrapRef","containerWidth","loading","props","innerData","rawDataSource","innerColumns","innerProps","selectedRows","showPaginationRef","pagination","getComponentSetting","effectiveProps","computed","showTitleBar","showPagination","rowKeyField","selectedKeysSet","displayColumns","c","fixedColumnsWidth","w","isRatioWidth","totalRatio","shouldShowColumn","sum","fixedDataColumnsWidth","getColumnWidth","parseWidthPx","v","available","result","minPx","maxPx","basePx","selectableRows","getDisabled","row","hasSelectableRows","isAllCurrentPageSelected","isIndeterminate","selectedCount","isRowSelected","getCheckboxDisabled","_c","getRadioDisabled","emitSelectionChange","keys","emit","handleCheckboxChange","checked","key","handleRadioSelect","handleSelectAll","keySet","toAdd","currentPageKeys","fetchData","opt","fs","pageField","sizeField","listField","totalField","params","processedParams","res","data","list","total","e","handleReload","handleSizeChange","size","handleCurrentChange","page","handleRowClick","_column","event","handleRowDblclick","handleSortChange","prop","order","handleExpandChange","expanded","findRowIndex","tableAction","cols","keyList","fromProps","ordered","k","info","rows","index","value","rowKey","record","idx","arr","show","childrenKey","flattenRows","children","expose","syncColumns","loadData","updateContainerWidth","resizeObserver","observedEl","onMounted","nextTick","onUnmounted","watch","normalizeTooltip","tooltip","getButtonType","action","filterVisible","item","ifShow","visibleActions","visibleDropDownActions","type","_d","title","okText","cancelText","MessageBox","useProTable","tableActionRef","getTableAction","unref","instance","renderParams","shouldRender","shouldShow","effectiveDisabled","dyn","effectiveRules","effectiveComponentPropsAndListeners","cp","raw","propsOnly","listeners","eventName","effectiveComponentProps","effectiveComponentListeners","hasSlot","getOptions","opts","renderComponent","renderFn","formRef","formWrapRef","submitLoading","collapsed","formModel","formRules","innerSchemas","BREAKPOINTS","getEffectiveSpan","colProps","baseColProps","width","base","fallback","effectiveActionColOptions","windowWidth","getVisibleSchemaCount","schemas","maxLines","remaining","count","schema","span","hasMoreFields","s","lines","maxVisible","formListeners","displaySchemas","getColProps","getSlotName","initForm","model","rules","initialValues","filterByIfShow","values","processFieldMapToTime","filtered","fieldMap","field","startKey","endKey","val","handleSubmit","handleReset","setFieldsValue","getFieldsValue","resetFields","validate","nameList","validateFields","resolve","reject","valid","scrollToField","name","options","el","clearValidate","updateSchema","appendSchemaByField","prefixField","first","removeSchemaByField","fields","setProps","formProps","formActionRef","syncSchemas","handleResize","useForm","formAction","formPropsRef","getFormProps","register","components","ProTable","TableAction","ProForm","ProFormItem","FormActions","install","Vue","component"],"mappings":";;AAGA,MAAMA,KAAoBC,GAAkD,CAAA,CAAE;AAcvE,SAASC,KAAiD;AAaxD,SAAA;AAAA,IACL,YAbiB,CAACC,MACdA,MAAkB,SACb,EAAE,GAAGH,OAEP,EAAE,GAAIA,GAAkBG,CAAa,KAAK,CAAI,EAAA;AAAA,IAUrD,YAPiB,CAACA,GAAuBC,MAA0C;AAC7E,YAAAC,IAAUL,GAAkBG,CAAa;AAC7B,MAAAH,GAAAG,CAAa,IAAIE,IAAU,EAAE,GAAGA,GAAS,GAAGD,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AAU,QAAQ;;IAqBxD,UAnBe,OAAO2B,MAAqC;;AAC3D,MAAAM,EAAa,QAAQ,EAAE,GAAGA,EAAa,OAAO,GAAGN,KAC3C,QAAAtO,IAAA2O,EAAW,UAAX,gBAAA3O,EAAkB,SAASsO;AAAA,IAAS;AAAA,EAiB1C,CAGsB;AAC1B;ACnGA,MAAMS,KAAa;AAAA,EACjB,EAAE,MAAM,YAAY,WAAWC,GAAS;AAAA,EACxC,EAAE,MAAM,eAAe,WAAWC,GAAY;AAAA,EAC9C,EAAE,MAAM,WAAW,WAAWC,GAAQ;AAAA,EACtC,EAAE,MAAM,eAAe,WAAWC,GAAY;AAAA,EAC9C,EAAE,MAAM,eAAe,WAAWC,GAAY;AAChD;AAEO,SAASC,GAAQC,GAAqB;AAC3C,EAAAP,GAAW,QAAQ,CAAC,EAAE,MAAApB,GAAM,WAAA4B,QAAgB;AACtC,IAAAD,EAAA,UAAU3B,GAAM4B,CAAS;AAAA,EAAA,CAC9B;AACH;AAEA,MAAe/I,KAAA;AAAA,EACb,SAAA6I;AAAA,EACA,UAAAL;AAAA,EACA,SAAAE;AAAA,EACA,aAAAD;AACF;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`,document.head.appendChild(G);const le=r.defineComponent({__name:"ProFormItem",props:{schema:null,formModel:null,formDisabled:{type:Boolean},autoPlaceholder:{type:Boolean},formActionType:null},setup(b){const e=b,l=r.useSlots(),t=r.computed(()=>({schema:e.schema,values:e.formModel,model:e.formModel,field:e.schema.field})),s=r.computed(()=>{const f=e.schema.ifShow;return f===void 0?!0:typeof f=="boolean"?f:f(t.value)}),y=r.computed(()=>{const f=e.schema.show;return f===void 0?!0:typeof f=="boolean"?f:f(t.value)}),P=r.computed(()=>{if(e.formDisabled)return!0;const f=e.schema.dynamicDisabled;return f===void 0?!1:typeof f=="boolean"?f:f(t.value)}),C=r.computed(()=>{const f=e.schema.dynamicRules;return f?Array.isArray(f)?f:f(t.value):e.schema.rules}),v=r.computed(()=>{const f=e.schema.componentProps;if(!f)return{props:{},listeners:{}};const m=typeof f=="function"?f({...t.value,formActionType:e.formActionType}):{...f},R={},S={};for(const[n,u]of Object.entries(m))if(n.length>2&&/^on[A-Za-z]/.test(n)&&typeof u=="function"){const x=n.slice(2).charAt(0).toLowerCase()+n.slice(3);S[x]=u}else R[n]=u;return{props:R,listeners:S}}),p=r.computed(()=>v.value.props),M=r.computed(()=>v.value.listeners),h=r.computed(()=>!!l.default),w=f=>{const m=f==null?void 0:f.options;return Array.isArray(m)?m:void 0},F=r.computed(()=>{const f=e.schema.render;return f?{render(){const m=f(t.value);return Array.isArray(m)?r.h("span",m):m}}:null});return{__sfc:!0,props:e,slots:l,renderParams:t,shouldRender:s,shouldShow:y,effectiveDisabled:P,effectiveRules:C,effectiveComponentPropsAndListeners:v,effectiveComponentProps:p,effectiveComponentListeners:M,hasSlot:h,getOptions:w,renderComponent:F}}}),Pe="";function T(b,e,l,t,s,y,P,C){var v=typeof b=="function"?b.options:b;e&&(v.render=e,v.staticRenderFns=l,v._compiled=!0),t&&(v.functional=!0),y&&(v._scopeId="data-v-"+y);var p;if(P?(p=function(w){w=w||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!w&&typeof __VUE_SSR_CONTEXT__<"u"&&(w=__VUE_SSR_CONTEXT__),s&&s.call(this,w),w&&w._registeredComponents&&w._registeredComponents.add(P)},v._ssrRegister=p):s&&(p=C?function(){s.call(this,(v.functional?this.parent:this).$root.$options.shadowRoot)}:s),p)if(v.functional){v._injectStyles=p;var M=v.render;v.render=function(F,f){return p.call(f),M(F,f)}}else{var h=v.beforeCreate;v.beforeCreate=h?[].concat(h,p):[p]}return{exports:b,options:v}}var ne=function(){var e=this,l=e._self._c,t=e._self._setupProxy;return t.shouldRender?l("el-form-item",{directives:[{name:"show",rawName:"v-show",value:t.shouldShow,expression:"shouldShow"}],attrs:{prop:e.schema.field,required:e.schema.required,rules:t.effectiveRules}},[l("template",{slot:"label"},[l("span",[e._v(e._s(e.schema.label))]),e.schema.helpMessage?l("el-tooltip",e._b({attrs:{placement:"top",effect:"light"}},"el-tooltip",e.schema.helpComponentProps||{},!1),[l("template",{slot:"content"},[Array.isArray(e.schema.helpMessage)?e._l(e.schema.helpMessage,function(s,y){return l("div",{key:y,staticClass:"ecp-pro-form-item__help-item"},[e._v(" "+e._s(s)+" ")])}):l("span",[e._v(e._s(e.schema.helpMessage))])],2),l("i",{staticClass:"el-icon-question ecp-pro-form-item__help-icon"})],2):e._e()],1),e.schema.render?[l(t.renderComponent,{tag:"component"})]:t.hasSlot?e._t("default",null,{model:e.formModel,schema:e.schema,field:e.schema.field,values:e.formModel}):[e.schema.component==="input"||!e.schema.component?l("el-input",e._g(e._b({attrs:{placeholder:e.schema.placeholder||(e.autoPlaceholder?`请输入${e.schema.label}`:void 0),disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(s){e.$set(e.formModel,e.schema.field,s)},expression:"formModel[schema.field]"}},"el-input",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="input-number"?l("el-input-number",e._g(e._b({attrs:{placeholder:e.schema.placeholder,disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(s){e.$set(e.formModel,e.schema.field,s)},expression:"formModel[schema.field]"}},"el-input-number",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="select"?l("el-select",e._g(e._b({staticClass:"ecp-pro-form-item__select",attrs:{placeholder:e.schema.placeholder||(e.autoPlaceholder?`请选择${e.schema.label}`:void 0),disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(s){e.$set(e.formModel,e.schema.field,s)},expression:"formModel[schema.field]"}},"el-select",t.effectiveComponentProps,!1),t.effectiveComponentListeners),e._l(t.getOptions(t.effectiveComponentProps)||[],function(s){return l("el-option",{key:String(s.value),attrs:{label:s.label,value:s.value}})}),1):e.schema.component==="date-picker"?l("el-date-picker",e._g(e._b({attrs:{placeholder:e.schema.placeholder||(e.autoPlaceholder?`请选择${e.schema.label}`:void 0),disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(s){e.$set(e.formModel,e.schema.field,s)},expression:"formModel[schema.field]"}},"el-date-picker",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="date-range"?l("el-date-picker",e._g(e._b({attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy-MM-dd",disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(s){e.$set(e.formModel,e.schema.field,s)},expression:"formModel[schema.field]"}},"el-date-picker",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="switch"?l("el-switch",e._g(e._b({attrs:{disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(s){e.$set(e.formModel,e.schema.field,s)},expression:"formModel[schema.field]"}},"el-switch",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="cascader"?l("el-cascader",e._g(e._b({attrs:{placeholder:e.schema.placeholder||(e.autoPlaceholder?`请选择${e.schema.label}`:void 0),disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(s){e.$set(e.formModel,e.schema.field,s)},expression:"formModel[schema.field]"}},"el-cascader",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="checkbox"?l("el-checkbox-group",e._g(e._b({attrs:{disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(s){e.$set(e.formModel,e.schema.field,s)},expression:"formModel[schema.field]"}},"el-checkbox-group",t.effectiveComponentProps,!1),t.effectiveComponentListeners),e._l(t.getOptions(t.effectiveComponentProps)||[],function(s){return l("el-checkbox",{key:String(s.value),attrs:{label:s.value}},[e._v(" "+e._s(s.label)+" ")])}),1):e.schema.component==="radio"?l("el-radio-group",e._g(e._b({attrs:{disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(s){e.$set(e.formModel,e.schema.field,s)},expression:"formModel[schema.field]"}},"el-radio-group",t.effectiveComponentProps,!1),t.effectiveComponentListeners),e._l(t.getOptions(t.effectiveComponentProps)||[],function(s){return l("el-radio",{key:String(s.value),attrs:{label:s.value}},[e._v(" "+e._s(s.label)+" ")])}),1):e._e()]],2):e._e()},ae=[],re=T(le,ne,ae,!1,null,"cfc968c5",null,null);const V=re.exports,ie=r.defineComponent({__name:"FormActions",props:{showActionButtonGroup:{type:Boolean,default:!0},showSubmitButton:{type:Boolean,default:!0},showResetButton:{type:Boolean,default:!0},submitButtonText:{default:"提交"},resetButtonText:{default:"重置"},submitButtonIcon:{default:"el-icon-search"},resetButtonIcon:{default:"el-icon-refresh-left"},submitLoading:{type:Boolean,default:!1},showAdvancedButton:{type:Boolean,default:!1},hasMoreFields:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!0},actionColOptions:null},emits:["submit","reset","toggle"],setup(b){return{__sfc:!0}}}),Fe="";var ce=function(){var e=this,l=e._self._c;return e._self._setupProxy,l("div",{staticClass:"ecp-form-actions"},[e._t("submitBefore"),e.showSubmitButton?l("el-button",{attrs:{type:"primary",icon:e.submitButtonIcon,loading:e.submitLoading},on:{click:function(t){return e.$emit("submit")}}},[e._v(" "+e._s(e.submitButtonText)+" ")]):e._e(),e._t("resetBefore"),e.showResetButton?l("el-button",{attrs:{icon:e.resetButtonIcon},on:{click:function(t){return e.$emit("reset")}}},[e._v(" "+e._s(e.resetButtonText)+" ")]):e._e(),e._t("actions")],2)},fe=[],de=T(ie,ce,fe,!1,null,"489c88d2",null,null);const L=de.exports,ue=r.defineComponent({__name:"ProForm",props:{schemas:null,initialValues:null,labelWidth:{default:"120px"},labelPosition:{default:"right"},gutter:{default:24},size:{default:"medium"},disabled:{type:Boolean},baseColProps:{default:()=>({xs:24,sm:12,md:12,lg:8,xl:6})},baseRowStyle:null,autoSetPlaceholder:{type:Boolean,default:!0},showSubmitButton:{type:Boolean,default:!0},showResetButton:{type:Boolean,default:!0},submitButtonText:{default:"提交"},resetButtonText:{default:"重置"},submitButtonIcon:{default:"el-icon-search"},resetButtonIcon:{default:"el-icon-refresh-left"},showActionButtonGroup:{type:Boolean,default:!0},actionColOptions:{default:()=>({xs:24,sm:12,md:12,lg:8,xl:6})},showAdvancedButton:{type:Boolean,default:!1},autoAdvancedLine:{default:3},alwaysShowLines:{default:1},submitFunc:null,resetFunc:null,submitOnReset:{type:Boolean,default:!1},formListeners:null},emits:["submit","reset","register"],setup(b,{expose:e,emit:l}){const t=b,s=r.useSlots(),y=r.ref(),P=r.ref(),C=r.ref(!1),v=r.ref(!0),p=r.ref({}),M=r.ref({}),h=r.ref([]),w=r.ref({}),F={xl:1920,lg:1200,md:992,sm:768},f=(o,a,d)=>{const c=d??(typeof window<"u"?window.innerWidth:1920),i=o??{},_=a??{},B=_.span??8;return c>=F.xl?i.xl??_.xl??i.lg??_.lg??i.md??_.md??i.sm??_.sm??i.xs??_.xs??i.span??B:c>=F.lg?i.lg??_.lg??i.md??_.md??i.sm??_.sm??i.xs??_.xs??i.span??B:c>=F.md?i.md??_.md??i.sm??_.sm??i.xs??_.xs??i.span??B:c>=F.sm?i.sm??_.sm??i.xs??_.xs??i.span??B:i.xs??_.xs??i.span??B},m=r.computed(()=>({...t,...w.value})),R=r.computed(()=>m.value.actionColOptions??{span:24}),S=r.ref(typeof window<"u"?window.innerWidth:1920),n=(o,a,d,c)=>{let i=24,_=1,B=0;for(const $ of o){const q=f($.colProps,a,c);if(q>i){if(_++,_>d)break;i=24-q}else i-=q;B++}return B},u=r.computed(()=>{const o=h.value.filter(i=>I(i));if(!m.value.showAdvancedButton)return!1;const a=m.value.alwaysShowLines??1,d=m.value.baseColProps,c=n(o,d,a,S.value);return console.log(o.length,c),o.length>c}),x=r.computed(()=>m.value.formListeners??{}),k=r.computed(()=>{const o=h.value.filter(i=>I(i));if(!m.value.showAdvancedButton||!v.value)return o;const a=m.value.alwaysShowLines??1,d=m.value.baseColProps,c=n(o,d,a,S.value);return o.slice(0,c)}),I=o=>{let a=!0,d=!0;return typeof o.ifShow=="function"&&(a=o.ifShow({schema:o,values:p.value,model:p.value,field:o.field})),typeof o.ifShow=="boolean"&&(a=o.ifShow),typeof o.show=="function"&&(d=o.show({schema:o,values:p.value,model:p.value,field:o.field})),typeof o.show=="boolean"&&(d=o.show),a&&d},ye=o=>o.colProps??m.value.baseColProps??{},we=o=>o.slot||o.field,A=()=>{const o={},a={},d=m.value.initialValues??t.initialValues;h.value.forEach(c=>{var i;o[c.field]=c.defaultValue??(d==null?void 0:d[c.field]),(i=c.rules)!=null&&i.length&&(a[c.field]=c.rules)}),p.value={...p.value,...o},M.value=a},j=o=>{const a={...o};return h.value.forEach(d=>{const c=d.ifShow;if(c===void 0)return;(typeof c=="boolean"?c:c({schema:d,values:o,model:o,field:d.field}))||delete a[d.field]}),a},O=o=>{const a=j(o),d=w.value.fieldMapToTime;if(!(d!=null&&d.length))return a;const c={...a};return d.forEach(([i,[_,B]])=>{const $=c[i];Array.isArray($)&&$.length===2&&(delete c[i],c[_]=$[0],c[B]=$[1])}),c},D=async()=>{var o;try{await((o=y.value)==null?void 0:o.validate()),m.value.submitFunc?await m.value.submitFunc():(C.value=!0,l("submit",O({...p.value})))}catch(a){console.error("Form validation failed:",a)}finally{C.value=!1}},ge=async()=>{var o;m.value.resetFunc?await m.value.resetFunc():((o=y.value)==null||o.resetFields(),A(),l("reset"),m.value.submitOnReset&&await D())},X=o=>(p.value={...p.value,...o},Promise.resolve()),H=()=>O({...p.value}),K=async()=>{var o;(o=y.value)==null||o.resetFields(),A()},Z=o=>{var a;return((a=y.value)==null?void 0:a.validate(o))??Promise.resolve()},J=o=>y.value?o!=null&&o.length?Promise.all(o.map(a=>new Promise((d,c)=>{y.value.validateField(a,i=>i?d(void 0):c(new Error("Validation failed")))}))):y.value.validate():Promise.resolve(),Q=async(o,a)=>{var c;const d=(c=P.value)==null?void 0:c.querySelector(`[data-field="${o}"]`);return d&&d.scrollIntoView({behavior:(a==null?void 0:a.behavior)??"smooth",block:(a==null?void 0:a.block)??"nearest"}),Promise.resolve()},Y=o=>{var a;(a=y.value)==null||a.clearValidate(o)},ee=async o=>{(Array.isArray(o)?o:[o]).forEach(d=>{const c=h.value.findIndex(i=>i.field===d.field);c>=0&&(h.value[c]={...h.value[c],...d})})},te=async(o,a,d)=>{if(d)h.value.unshift(o);else if(a){const c=h.value.findIndex(i=>i.field===a);h.value.splice(c+1,0,o)}else h.value.push(o);A()},oe=async o=>{const a=Array.isArray(o)?o:[o];h.value=h.value.filter(d=>!a.includes(d.field))},se=async o=>{if(w.value={...w.value,...o},o.schemas){h.value=[...o.schemas];debugger;A()}},z={getFieldsValue:H,setFieldsValue:X,resetFields:K,validate:Z,validateFields:J,submit:D,scrollToField:Q,clearValidate:Y,updateSchema:ee,appendSchemaByField:te,removeSchemaByField:oe,setProps:se};e(z);const W=()=>{h.value=[...t.schemas??[]],A()},N=()=>{typeof window<"u"&&(S.value=window.innerWidth)};return r.onMounted(()=>{W(),l("register",z),typeof window<"u"&&window.addEventListener("resize",N)}),r.onUnmounted(()=>{typeof window<"u"&&window.removeEventListener("resize",N)}),r.watch(()=>[t.schemas,t.initialValues],W,{deep:!0}),{__sfc:!0,props:t,emit:l,slots:s,formRef:y,formWrapRef:P,submitLoading:C,collapsed:v,formModel:p,formRules:M,innerSchemas:h,innerProps:w,BREAKPOINTS:F,getEffectiveSpan:f,effectiveProps:m,effectiveActionColOptions:R,windowWidth:S,getVisibleSchemaCount:n,hasMoreFields:u,formListeners:x,displaySchemas:k,shouldShow:I,getColProps:ye,getSlotName:we,initForm:A,filterByIfShow:j,processFieldMapToTime:O,handleSubmit:D,handleReset:ge,setFieldsValue:X,getFieldsValue:H,resetFields:K,validate:Z,validateFields:J,scrollToField:Q,clearValidate:Y,updateSchema:ee,appendSchemaByField:te,removeSchemaByField:oe,setProps:se,formActionRef:z,syncSchemas:W,handleResize:N,ProFormItem:V,FormActions:L}}}),Be="";var me=function(){var e=this,l=e._self._c,t=e._self._setupProxy;return l("div",{ref:"formWrapRef",staticClass:"ecp-pro-form"},[l("el-form",e._g(e._b({ref:"formRef",staticClass:"ecp-pro-form",attrs:{model:t.formModel,rules:t.formRules,"label-width":t.effectiveProps.labelWidth,"label-position":t.effectiveProps.labelPosition,size:t.effectiveProps.size,disabled:t.effectiveProps.disabled}},"el-form",e.$attrs,!1),t.formListeners),[e._t("formHeader"),l("el-row",{style:t.effectiveProps.baseRowStyle,attrs:{gutter:t.effectiveProps.gutter}},[e._l(t.displaySchemas,function(s){var y,P;return[t.shouldShow(s)?l("el-col",e._b({key:s.field,attrs:{offset:((y=s.colProps)==null?void 0:y.offset)??((P=t.effectiveProps.baseColProps)==null?void 0:P.offset)??0,"data-field":s.field}},"el-col",t.getColProps(s),!1),[l(t.ProFormItem,{attrs:{schema:s,"form-model":t.formModel,"form-disabled":t.effectiveProps.disabled,"auto-placeholder":t.effectiveProps.autoSetPlaceholder,"form-action-type":t.formActionRef}},[t.slots[t.getSlotName(s)]?[e._t(t.getSlotName(s),null,{model:t.formModel,schema:s,field:s.field,values:t.formModel})]:e._e()],2)],1):e._e()]}),t.effectiveProps.showActionButtonGroup?l("el-col",e._b({staticClass:"ecp-pro-form_col"},"el-col",t.hasMoreFields?{span:24}:t.effectiveProps.actionColOptions||{span:6},!1),[l(t.FormActions,{attrs:{"show-action-button-group":t.effectiveProps.showActionButtonGroup,"show-submit-button":t.effectiveProps.showSubmitButton,"show-reset-button":t.effectiveProps.showResetButton,"submit-button-text":t.effectiveProps.submitButtonText,"reset-button-text":t.effectiveProps.resetButtonText,"submit-button-icon":t.effectiveProps.submitButtonIcon,"reset-button-icon":t.effectiveProps.resetButtonIcon,"submit-loading":t.submitLoading,"show-advanced-button":t.effectiveProps.showAdvancedButton,"has-more-fields":t.hasMoreFields,collapsed:t.collapsed,"action-col-options":t.effectiveActionColOptions},on:{submit:t.handleSubmit,reset:t.handleReset,toggle:function(s){t.collapsed=!t.collapsed}}},[l("template",{slot:"submitBefore"},[e._t("submitBefore")],2),l("template",{slot:"resetBefore"},[e._t("resetBefore")],2),l("template",{slot:"advanceBefore"},[e._t("advanceBefore")],2),l("template",{slot:"advanceAfter"},[e._t("advanceAfter")],2),l("template",{slot:"actions"},[e._t("actions")],2)],2)],1):e._e()],2),t.effectiveProps.showAdvancedButton&&t.hasMoreFields?l("el-button",{staticClass:"ecp-form-actions__advance",attrs:{type:"text"},on:{click:function(s){t.collapsed=!t.collapsed}}},[l("i",{staticClass:"el-icon-d-arrow-left",class:t.collapsed?"down":"up"}),e._v(" "+e._s(t.collapsed?"展开":"收起")+" ")]):e._e(),e._t("formFooter")],2)],1)},pe=[],ve=T(ue,me,pe,!1,null,"af9453ad",null,null);const E=ve.exports;function he(b){const e=r.ref(null),l=r.ref(b?r.unref(b):void 0),t=()=>b?r.unref(b):void 0,s=n=>{e.value=n;const u=t();debugger;u&&Object.keys(u).length>0&&n.setProps(u)};return b&&r.watch(()=>t(),n=>{l.value=n,n&&e.value&&e.value.setProps(n)},{deep:!0}),[s,{register:s,formAction:e,getFieldsValue:()=>{var n;return((n=e.value)==null?void 0:n.getFieldsValue())??{}},setFieldsValue:async n=>{var u;await((u=e.value)==null?void 0:u.setFieldsValue(n))},resetFields:async()=>{var n;await((n=e.value)==null?void 0:n.resetFields())},validate:n=>{var u;return((u=e.value)==null?void 0:u.validate(n))??Promise.resolve()},validateFields:n=>{var u;return((u=e.value)==null?void 0:u.validateFields(n))??Promise.resolve()},submit:()=>{var n;return((n=e.value)==null?void 0:n.submit())??Promise.resolve()},scrollToField:(n,u)=>{var x;return((x=e.value)==null?void 0:x.scrollToField(n,u))??Promise.resolve()},clearValidate:n=>{var u;(u=e.value)==null||u.clearValidate(n)},updateSchema:n=>{var u;return((u=e.value)==null?void 0:u.updateSchema(n))??Promise.resolve()},appendSchemaByField:(n,u,x)=>{var k;return((k=e.value)==null?void 0:k.appendSchemaByField(n,u,x))??Promise.resolve()},removeSchemaByField:n=>{var u;return((u=e.value)==null?void 0:u.removeSchemaByField(n))??Promise.resolve()},setProps:async n=>{var u;l.value={...l.value,...n},await((u=e.value)==null?void 0:u.setProps(n))}}]}const _e=[{name:"ProForm",component:E},{name:"ProFormItem",component:V},{name:"FormActions",component:L}];function U(b){_e.forEach(({name:e,component:l})=>{b.component(e,l)})}const be={install:U,ProForm:E};g.FormActions=L,g.ProForm=E,g.ProFormItem=V,g.default=be,g.install=U,g.useForm=he,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function($,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("element-ui")):typeof define=="function"&&define.amd?define(["exports","vue","element-ui"],s):($=typeof globalThis<"u"?globalThis:$||self,s($.ElementComponentPro={},$.Vue,$.ELEMENT))})(this,function($,s,Be){"use strict";var Ce=document.createElement("style");Ce.textContent=`.ecp-pro-table[data-v-c5638c20]{padding:16px;background:#fff;width:100%;box-sizing:border-box}.ecp-pro-table[data-v-c5638c20] .el-table{width:100%!important}.ecp-pro-table__header[data-v-c5638c20]{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.ecp-pro-table__title-wrapper[data-v-c5638c20]{display:flex;align-items:center;gap:4px}.ecp-pro-table__title[data-v-c5638c20]{font-size:16px;font-weight:600}.ecp-pro-table__help[data-v-c5638c20]{color:#909399;cursor:help}.ecp-pro-table__toolbar[data-v-c5638c20]{display:flex;align-items:center;gap:8px}.ecp-pro-table__body[data-v-c5638c20]{width:100%}.ecp-pro-table__pagination[data-v-c5638c20]{margin-top:16px;display:flex;justify-content:flex-end}.ecp-pro-table__col-help[data-v-c5638c20]{margin-left:4px;color:#909399;cursor:help}.ecp-table-action[data-v-1b2d6c42],.ecp-table-action__item[data-v-1b2d6c42]{display:inline-flex;align-items:center;gap:4px}.ecp-table-action__icon[data-v-1b2d6c42]{margin-right:4px}.ecp-table-action__more[data-v-1b2d6c42]{display:inline-flex;align-items:center}.ecp-table-action__dropdown-item[data-v-1b2d6c42]{display:inline-flex;align-items:center;gap:4px}.ecp-pro-form-item__help-icon[data-v-cfc968c5]{margin-left:4px;color:#909399;cursor:help;font-size:14px}.ecp-pro-form-item__help-icon[data-v-cfc968c5]:hover{color:#409eff}.ecp-pro-form-item__help-item[data-v-cfc968c5]{margin-bottom:4px}.ecp-pro-form-item__help-item[data-v-cfc968c5]:last-child{margin-bottom:0}.ecp-form-actions[data-v-489c88d2]{text-align:right}.ecp-form-actions__advance[data-v-489c88d2]{margin-right:8px}.el-icon-d-arrow-left.up[data-v-489c88d2]{transform:rotate(90deg)}.el-icon-d-arrow-left.down[data-v-489c88d2]{transform:rotate(-90deg)}.ecp-pro-form[data-v-140fc052]{padding:16px;position:relative}.ecp-pro-form__advance[data-v-140fc052]{margin-bottom:16px}.ecp-pro-form_col[data-v-140fc052]{position:relative;float:right}.el-icon-d-arrow-left.up[data-v-140fc052]{transform:rotate(90deg)}.el-icon-d-arrow-left.down[data-v-140fc052]{transform:rotate(-90deg)}.ecp-form-actions__advance[data-v-140fc052]{position:absolute;bottom:0;left:50%;transform:translate(-50%,-50%)}
|
|
2
|
+
`,document.head.appendChild(Ce);const ae=s.reactive({});function he(){return{getSetting:l=>l===void 0?{...ae}:{...ae[l]??{}},setSetting:(l,t)=>{const a=ae[l];ae[l]=a?{...a,...t}:{...t}}}}const Ae=s.defineComponent({__name:"ProTable",props:{columns:null,dataSource:null,api:null,rowKey:{default:"id"},title:null,titleHelpMessage:null,bordered:{type:Boolean,default:!1},striped:{type:Boolean,default:!0},size:{default:"medium"},loading:{type:Boolean,default:!1},maxHeight:null,height:null,ellipsis:{type:Boolean,default:!0},showIndexColumn:{type:Boolean,default:!0},indexColumnProps:null,actionColumn:null,rowSelection:null,clearSelectOnPageChange:{type:Boolean,default:!1},pagination:{type:[Boolean,Object],default:()=>({pageSize:10,pageSizes:[10,20,50,100]})},tableSetting:{default:()=>({redo:!0})},fetchSetting:{default:()=>({pageField:"page",sizeField:"pageSize",listField:"list",totalField:"total"})},beforeFetch:null,afterFetch:null,immediate:{type:Boolean,default:!0},searchInfo:null,defaultSort:null,tableProps:null,rowClassName:null,spanMethod:null,treeProps:null,defaultExpandAll:{type:Boolean},expandRowKeys:null,lazy:{type:Boolean},load:null},emits:["register","fetch-success","fetch-error","selection-change","row-click","row-dblclick","sort-change","expand-change"],setup(A,{expose:e,emit:l}){const t=A,a=s.defineComponent({name:"EcpProTableDefaultCellRenderer",props:{column:{type:Object,required:!0},record:{type:Object,required:!0},index:{type:Number,required:!0},value:{required:!1}},setup(o){return()=>{var u,v;const n=o.column;if(n!=null&&n.customRender){const B=n.customRender({text:o.value,record:o.record,index:o.index});return typeof B=="string"||typeof B=="number"?s.h("span",String(B)):B}if(n!=null&&n.valueEnum){const B=((v=(u=n.valueEnum)==null?void 0:u[o.value])==null?void 0:v.text)??o.value;return s.h("span",B==null?"":String(B))}return s.h("span",o.value==null?"":String(o.value))}}}),c=s.defineComponent({name:"EcpProTableBodyCellRenderer",props:{slotRender:{type:Function,required:!0},column:{type:Object,required:!0},record:{type:Object,required:!0},index:{type:Number,required:!0},value:{required:!1},customRender:{type:Function,required:!1},valueEnum:{type:Object,required:!1}},setup(o){return()=>{const n=o.slotRender,u=n==null?void 0:n({column:o.column,record:o.record,index:o.index,value:o.value});if((D=>D==null?[]:Array.isArray(D)?D.filter(I=>I!=null&&I!==!1&&!I.isComment):[D])(u).length>0)return u;const x={...o.column};return o.customRender&&(x.customRender=o.customRender),o.valueEnum&&(x.valueEnum=o.valueEnum),s.h(a,{props:{column:x,record:o.record,index:o.index,value:o.value}})}}}),C=s.useSlots(),z=s.ref(),r=s.ref(),h=s.ref(0),g=s.ref(t.loading??!1),d=s.ref([]),b=s.ref({}),k=s.ref([]),m=s.ref({}),P=s.ref([]),F=s.ref(null),R=s.ref({page:1,pageSize:t.pagination&&typeof t.pagination=="object"?t.pagination.pageSize??10:10,pageSizes:t.pagination&&typeof t.pagination=="object"?t.pagination.pageSizes??[10,20,50,100]:[10,20,50,100],total:0}),{getSetting:p}=he(),f=s.computed(()=>({...p("ProTable"),...t,...m.value})),O=s.computed(()=>!!f.value.title||!!C.tableTitle||!!C.toolbar),j=s.computed(()=>F.value!==null?F.value:!!t.pagination&&typeof t.pagination=="object"),M=s.computed(()=>f.value.rowKey||"id"),H=s.computed(()=>new Set(P.value.map(o=>o[M.value]))),ee=s.computed(()=>k.value.filter(o=>!o.hideInTable&&!o.defaultHidden)),ne=s.computed(()=>{var n,u;let o=0;return f.value.rowSelection&&(o+=Number(f.value.rowSelection.width)||48),f.value.showIndexColumn&&(o+=Number((n=f.value.indexColumnProps)==null?void 0:n.width)||60),f.value.actionColumn&&(o+=Number((u=f.value.actionColumn)==null?void 0:u.width)||150),o}),L=o=>typeof o=="number"&&o>0,Z=s.computed(()=>ee.value.filter(n=>Q(n)&&L(n.width)).reduce((n,u)=>n+(typeof u.width=="number"?u.width:0),0)),J=s.computed(()=>ee.value.filter(n=>Q(n)&&typeof n.width=="string").reduce((n,u)=>n+(Number(se(u))||80),0)),V=o=>o==null?null:typeof o=="number"?o:parseInt(String(o).replace(/px$/i,""),10)||null,se=o=>{const n=o.width;if(L(n)&&Z.value>0&&h.value>0&&typeof n=="number"){const u=h.value-ne.value-J.value;let v=Math.floor(u*n/Z.value);const B=V(o.minWidth)??60,x=V(o.maxWidth);return v=Math.max(B,v),x!=null&&(v=Math.min(x,v)),v}if(typeof n=="string"){const u=V(n)??80,v=V(o.minWidth),B=V(o.maxWidth);let x=u;return v!=null&&(x=Math.max(v,x)),B!=null&&(x=Math.min(B,x)),x}return o.width},Q=o=>o.ifShow===!1?!1:typeof o.ifShow=="function"?o.ifShow({column:o}):!0,W=s.computed(()=>{var n;const o=(n=f.value.rowSelection)==null?void 0:n.getCheckboxProps;return o?d.value.filter(u=>{var v;return!((v=o(u))!=null&&v.disabled)}):d.value}),re=s.computed(()=>W.value.length>0),ie=s.computed(()=>W.value.length===0?!1:W.value.every(o=>H.value.has(o[M.value]))),ce=s.computed(()=>{const o=W.value.filter(n=>H.value.has(n[M.value])).length;return o>0&&o<W.value.length}),de=o=>H.value.has(o[M.value]),ue=o=>{var n,u,v;return((v=(u=(n=f.value.rowSelection)==null?void 0:n.getCheckboxProps)==null?void 0:u.call(n,o))==null?void 0:v.disabled)??!1},fe=o=>{var n,u,v;return((v=(u=(n=f.value.rowSelection)==null?void 0:n.getRadioProps)==null?void 0:u.call(n,o))==null?void 0:v.disabled)??!1},K=()=>{const o=P.value.map(n=>n[M.value]);l("selection-change",{keys:o,rows:P.value})},pe=(o,n)=>{const u=o[M.value];n?P.value=[...P.value.filter(v=>v[M.value]!==u),o]:P.value=P.value.filter(v=>v[M.value]!==u),K()},me=o=>{P.value=[o],K()},te=o=>{if(o){const n=new Set(P.value.map(v=>v[M.value])),u=W.value.filter(v=>!n.has(v[M.value]));P.value=[...P.value,...u]}else{const n=new Set(d.value.map(u=>u[M.value]));P.value=P.value.filter(u=>!n.has(u[M.value]))}K()},q=async o=>{if(!t.api){if(t.dataSource)return;d.value=[];return}g.value=!0;try{const n=f.value.fetchSetting??{},u=n.pageField??"page",v=n.sizeField??"pageSize",B=n.listField??"list",x=n.totalField??"total",D={[u]:(o==null?void 0:o.page)??R.value.page,[v]:(o==null?void 0:o.pageSize)??R.value.pageSize,...t.searchInfo,...o==null?void 0:o.searchInfo};(o==null?void 0:o.page)!=null&&(R.value.page=o.page),(o==null?void 0:o.pageSize)!=null&&(R.value.pageSize=o.pageSize);const I=t.beforeFetch?t.beforeFetch(D):D,Pe=await t.api(I);b.value=Pe||{};const ve=t.afterFetch?t.afterFetch(Pe):Pe,Re=ve[B]??ve.items??ve.list??[],Fe=ve[x]??0;d.value=Re,R.value.total=Fe,l("fetch-success",{items:Re,total:Fe})}catch(n){l("fetch-error",n)}finally{g.value=!1}},oe=()=>q(void 0),i=o=>{f.value.clearSelectOnPageChange&&(P.value=[]),R.value.pageSize=o,R.value.page=1,q(void 0)},_=o=>{f.value.clearSelectOnPageChange&&(P.value=[]),R.value.page=o,q(void 0)},S=(o,n,u)=>l("row-click",o,u),y=(o,n,u)=>l("row-dblclick",o,u),w=({prop:o,order:n})=>l("sort-change",{prop:o,order:n}),T=(o,n)=>l("expand-change",o,n),E=o=>d.value.findIndex(n=>n[M.value]===o),N={setProps:o=>{m.value={...m.value,...o}},reload:o=>q(o),redoHeight:()=>{var o,n;(n=(o=z.value)==null?void 0:o.doLayout)==null||n.call(o)},setLoading:o=>{g.value=o},getDataSource:()=>d.value,getRawDataSource:()=>b.value,setTableData:o=>{d.value=o??[]},getColumns:()=>k.value,setColumns:o=>{if(Array.isArray(o)&&o.length>0&&typeof o[0]=="string"){const n=o,u=(t.columns??[]).filter(B=>n.includes(B.key??B.dataIndex)),v=n.map(B=>u.find(x=>(x.key??x.dataIndex)===B)).filter(Boolean);v.length&&(k.value=v)}else k.value=o??[]},setPagination:o=>{o!=null&&o.page&&(R.value.page=o.page),o!=null&&o.pageSize&&(R.value.pageSize=o.pageSize),(o==null?void 0:o.total)!==void 0&&(R.value.total=o.total)},getSelectRowKeys:()=>P.value.map(o=>o[M.value]),getSelectRows:()=>P.value,clearSelectedRowKeys:()=>{P.value=[],K()},setSelectedRowKeys:o=>{const n=new Set(o),u=d.value.filter(v=>n.has(v[M.value]));o.forEach(v=>{u.some(B=>B[M.value]===v)||u.push({[M.value]:v})}),P.value=u,K()},deleteSelectRowByKey:o=>{P.value=P.value.filter(n=>n[M.value]!==o),K()},updateTableData:(o,n,u)=>{o<0||o>=d.value.length||(d.value=[...d.value],d.value[o]={...d.value[o],[n]:u})},updateTableDataRecord:(o,n)=>{const u=E(o);if(!(u<0))return d.value=[...d.value],d.value[u]={...d.value[u],...n},d.value[u]},deleteTableDataRecord:o=>{const n=Array.isArray(o)?o:[o],u=new Set(n);d.value=d.value.filter(v=>!u.has(v[M.value]))},insertTableDataRecord:(o,n)=>{const u=[...d.value];return n==null||n>=u.length?u.push(o):u.splice(n,0,o),d.value=u,o},getPaginationRef:()=>j.value?{page:R.value.page,pageSize:Number(R.value.pageSize)||10,total:R.value.total}:!1,getShowPagination:()=>j.value,setShowPagination:o=>{F.value=o},getRowSelection:()=>f.value.rowSelection,expandAll:()=>{var v;const o=((v=f.value.treeProps)==null?void 0:v.children)??"children",n=B=>{const x=[];return B.forEach(D=>{x.push(D);const I=D[o];Array.isArray(I)&&I.length>0&&x.push(...n(I))}),x};n(d.value).forEach(B=>{var x,D;return(D=(x=z.value)==null?void 0:x.toggleRowExpansion)==null?void 0:D.call(x,B,!0)})},collapseAll:()=>{var v;const o=((v=f.value.treeProps)==null?void 0:v.children)??"children",n=B=>{const x=[];return B.forEach(D=>{x.push(D);const I=D[o];Array.isArray(I)&&I.length>0&&x.push(...n(I))}),x};n(d.value).forEach(B=>{var x,D;return(D=(x=z.value)==null?void 0:x.toggleRowExpansion)==null?void 0:D.call(x,B,!1)})}};e(N);const G=()=>{k.value=[...t.columns??[]]},xe=()=>{t.api&&f.value.immediate!==!1?q(void 0):t.dataSource&&(d.value=[...t.dataSource],!t.api&&t.pagination!==!1&&(R.value.total=t.dataSource.length))},le=()=>{r.value&&(h.value=r.value.offsetWidth||0)};let U=null,X=null;return s.onMounted(()=>{G(),l("register",N),xe(),typeof window<"u"&&(window.addEventListener("resize",le),U=new ResizeObserver(le),s.nextTick(()=>{le(),X=r.value,X&&(U==null||U.observe(X))}))}),s.onUnmounted(()=>{typeof window<"u"&&(window.removeEventListener("resize",le),U&&X&&(U.unobserve(X),X=null))}),s.watch(()=>t.columns,G,{deep:!0}),s.watch(()=>t.dataSource,()=>{!t.api&&t.dataSource&&(d.value=[...t.dataSource])},{deep:!0}),s.watch(()=>t.loading,o=>{g.value=o??!1}),{__sfc:!0,DefaultCellRenderer:a,BodyCellRenderer:c,props:t,emit:l,slots:C,tableRef:z,tableWrapRef:r,containerWidth:h,loading:g,innerData:d,rawDataSource:b,innerColumns:k,innerProps:m,selectedRows:P,showPaginationRef:F,pagination:R,getComponentSetting:p,effectiveProps:f,showTitleBar:O,showPagination:j,rowKeyField:M,selectedKeysSet:H,displayColumns:ee,fixedColumnsWidth:ne,isRatioWidth:L,totalRatio:Z,fixedDataColumnsWidth:J,parseWidthPx:V,getColumnWidth:se,shouldShowColumn:Q,selectableRows:W,hasSelectableRows:re,isAllCurrentPageSelected:ie,isIndeterminate:ce,isRowSelected:de,getCheckboxDisabled:ue,getRadioDisabled:fe,emitSelectionChange:K,handleCheckboxChange:pe,handleRadioSelect:me,handleSelectAll:te,fetchData:q,handleReload:oe,handleSizeChange:i,handleCurrentChange:_,handleRowClick:S,handleRowDblclick:y,handleSortChange:w,handleExpandChange:T,findRowIndex:E,tableAction:N,syncColumns:G,loadData:xe,updateContainerWidth:le,resizeObserver:U,observedEl:X}}}),Ye="";function Y(A,e,l,t,a,c,C,z){var r=typeof A=="function"?A.options:A;e&&(r.render=e,r.staticRenderFns=l,r._compiled=!0),t&&(r.functional=!0),c&&(r._scopeId="data-v-"+c);var h;if(C?(h=function(b){b=b||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!b&&typeof __VUE_SSR_CONTEXT__<"u"&&(b=__VUE_SSR_CONTEXT__),a&&a.call(this,b),b&&b._registeredComponents&&b._registeredComponents.add(C)},r._ssrRegister=h):a&&(h=z?function(){a.call(this,(r.functional?this.parent:this).$root.$options.shadowRoot)}:a),h)if(r.functional){r._injectStyles=h;var g=r.render;r.render=function(k,m){return h.call(m),g(k,m)}}else{var d=r.beforeCreate;r.beforeCreate=d?[].concat(d,h):[h]}return{exports:A,options:r}}var ke=function(){var a,c,C,z;var e=this,l=e._self._c,t=e._self._setupProxy;return l("div",{staticClass:"ecp-pro-table"},[t.showTitleBar?l("div",{staticClass:"ecp-pro-table__header"},[l("div",{staticClass:"ecp-pro-table__title-wrapper"},[l("span",{staticClass:"ecp-pro-table__title"},[e._v(e._s(t.effectiveProps.title))]),t.effectiveProps.titleHelpMessage?l("el-tooltip",{staticClass:"ecp-pro-table__help",attrs:{placement:"top"}},[l("template",{slot:"content"},[Array.isArray(t.effectiveProps.titleHelpMessage)?l("span",e._l(t.effectiveProps.titleHelpMessage,function(r,h){return l("div",{key:h},[e._v(e._s(r))])}),0):l("span",[e._v(e._s(t.effectiveProps.titleHelpMessage))])]),l("i",{staticClass:"el-icon-question"})],2):e._e()],1),l("div",{staticClass:"ecp-pro-table__toolbar"},[e._t("tableTitle"),e._t("toolbar"),e._t("toolbar-right",function(){var r;return[((r=t.effectiveProps.tableSetting)==null?void 0:r.redo)!==!1?l("el-button",{attrs:{type:"text",icon:"el-icon-refresh",size:"small"},on:{click:t.handleReload}},[e._v(" 刷新 ")]):e._e()]})],2)]):e._e(),l("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"tableWrapRef",staticClass:"ecp-pro-table__body"},[l("el-table",e._b({ref:"tableRef",attrs:{data:t.innerData,"row-key":t.effectiveProps.rowKey,border:t.effectiveProps.bordered,stripe:t.effectiveProps.striped,size:t.effectiveProps.size,"max-height":t.effectiveProps.maxHeight,height:t.effectiveProps.height,"default-sort":t.effectiveProps.defaultSort,"span-method":t.effectiveProps.spanMethod,"tree-props":t.effectiveProps.treeProps,"default-expand-all":t.effectiveProps.defaultExpandAll,"expand-row-keys":t.effectiveProps.expandRowKeys||[],lazy:t.effectiveProps.lazy,load:t.effectiveProps.load,"row-class-name":t.effectiveProps.rowClassName},on:{"row-click":t.handleRowClick,"row-dblclick":t.handleRowDblclick,"sort-change":t.handleSortChange,"expand-change":t.handleExpandChange}},"el-table",t.effectiveProps.tableProps,!1),[t.effectiveProps.rowSelection?l("el-table-column",{attrs:{width:t.effectiveProps.rowSelection.width||48,fixed:t.effectiveProps.rowSelection.fixed,align:"center"},scopedSlots:e._u([{key:"header",fn:function(r){return[t.effectiveProps.rowSelection.type!=="radio"?l("el-checkbox",{attrs:{value:t.isAllCurrentPageSelected,indeterminate:t.isIndeterminate,disabled:!t.hasSelectableRows},on:{change:t.handleSelectAll}}):l("span")]}},{key:"default",fn:function(r){var h;return[t.effectiveProps.rowSelection.type!=="radio"?l("el-checkbox",{attrs:{value:t.isRowSelected(r.row),disabled:t.getCheckboxDisabled(r.row)},on:{change:g=>t.handleCheckboxChange(r.row,g)},nativeOn:{click:function(g){g.stopPropagation()}}}):l("el-radio",{attrs:{value:(h=t.selectedRows[0])==null?void 0:h[t.rowKeyField],label:r.row[t.rowKeyField],disabled:t.getRadioDisabled(r.row)},on:{change:function(g){return t.handleRadioSelect(r.row)}},nativeOn:{click:function(g){g.stopPropagation()}}},[l("span")])]}}],null,!1,983730649)}):e._e(),t.effectiveProps.showIndexColumn?l("el-table-column",{attrs:{type:"index",label:((a=t.effectiveProps.indexColumnProps)==null?void 0:a.title)||"序号",width:((c=t.effectiveProps.indexColumnProps)==null?void 0:c.width)||60,fixed:(C=t.effectiveProps.indexColumnProps)==null?void 0:C.fixed,align:((z=t.effectiveProps.indexColumnProps)==null?void 0:z.align)||"center"}}):e._e(),e._l(t.displayColumns,function(r){return[t.shouldShowColumn(r)?l("el-table-column",{key:r.dataIndex||r.key||r.title,attrs:{prop:r.dataIndex,label:r.title,width:t.getColumnWidth(r),"min-width":t.isRatioWidth(r.width)?void 0:r.minWidth,fixed:r.fixed,align:r.align||"left",sortable:r.sortable,formatter:r.formatter,"show-overflow-tooltip":r.ellipsis!==!1&&t.effectiveProps.ellipsis!==!1},scopedSlots:e._u([{key:"header",fn:function(h){return[r.dataIndex&&e.$scopedSlots[`header-${r.dataIndex}`]?e._t(`header-${r.dataIndex}`,null,{column:r}):e.$scopedSlots.headerCell?e._t("headerCell",null,{column:r}):[l("span",[e._v(e._s(r.title))]),r.helpMessage?l("el-tooltip",{staticClass:"ecp-pro-table__col-help",attrs:{placement:"top",effect:"dark"}},[l("template",{slot:"content"},[Array.isArray(r.helpMessage)?l("span",e._l(r.helpMessage,function(g,d){return l("div",{key:d},[e._v(e._s(g))])}),0):l("span",[e._v(e._s(r.helpMessage))])]),l("i",{staticClass:"el-icon-question"})],2):e._e()]]}},{key:"default",fn:function(h){return[r.dataIndex&&e.$scopedSlots[r.dataIndex]?e._t(r.dataIndex,null,{row:h.row,column:r,index:h.$index,value:h.row[r.dataIndex]}):e.$scopedSlots.bodyCell?l(t.BodyCellRenderer,{attrs:{"slot-render":e.$scopedSlots.bodyCell,column:r,record:h.row,index:h.$index,value:h.row[r.dataIndex],"custom-render":r.customRender,"value-enum":r.valueEnum}}):l(t.DefaultCellRenderer,{attrs:{column:r,record:h.row,index:h.$index,value:h.row[r.dataIndex]}})]}}],null,!0)}):e._e()]}),t.effectiveProps.actionColumn?l("el-table-column",{attrs:{label:t.effectiveProps.actionColumn.title||"操作",width:t.effectiveProps.actionColumn.width||150,fixed:t.effectiveProps.actionColumn.fixed||"right",align:t.effectiveProps.actionColumn.align||"center"},scopedSlots:e._u([{key:"default",fn:function(r){return[e.$scopedSlots.action?e._t("action",null,{record:r.row,column:t.effectiveProps.actionColumn,index:r.$index}):e.$scopedSlots.bodyCell?l(t.BodyCellRenderer,{attrs:{"slot-render":e.$scopedSlots.bodyCell,column:t.effectiveProps.actionColumn,record:r.row,index:r.$index,value:void 0,"custom-render":t.effectiveProps.actionColumn.customRender,"value-enum":t.effectiveProps.actionColumn.valueEnum}}):e._e()]}}],null,!0)}):e._e()],2)],1),t.showPagination?l("div",{staticClass:"ecp-pro-table__pagination"},[l("el-pagination",e._b({attrs:{"current-page":t.pagination.page,"page-sizes":t.pagination.pageSizes,"page-size":t.pagination.pageSize,total:t.pagination.total,layout:(t.effectiveProps.pagination&&typeof t.effectiveProps.pagination=="object"?t.effectiveProps.pagination.layout:null)||"total, sizes, prev, pager, next, jumper"},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}},"el-pagination",t.effectiveProps.pagination&&typeof t.effectiveProps.pagination=="object"&&t.effectiveProps.pagination.props||{},!1))],1):e._e()])},Te=[],Me=Y(Ae,ke,Te,!1,null,"c5638c20",null,null);const ge=Me.exports,De=s.defineComponent({__name:"TableAction",props:{actions:{default:()=>[]},dropDownActions:{default:()=>[]},stopButtonPropagation:{type:Boolean,default:!1}},setup(A){const e=A,l=g=>g?typeof g=="string"?{content:g}:g:{},t=g=>g.type?g.type:g.color==="error"?"danger":g.color==="success"?"success":g.color==="warning"?"warning":"text",a=g=>g.filter(d=>{const{ifShow:b}=d;return typeof b=="boolean"?b:typeof b=="function"?b(d):!0}),c=s.computed(()=>a(e.actions||[])),C=s.computed(()=>a(e.dropDownActions||[]));return{__sfc:!0,props:e,normalizeTooltip:l,getButtonType:t,filterVisible:a,visibleActions:c,visibleDropDownActions:C,handleClick:(g,d)=>{var b;e.stopButtonPropagation&&d.stopPropagation(),(b=g.onClick)==null||b.call(g,d)},handlePopConfirm:(g,d,b)=>{var k,m,P,F;e.stopButtonPropagation&&b.stopPropagation(),g.popConfirm&&(d==="confirm"?(m=(k=g.popConfirm).confirm)==null||m.call(k):(F=(P=g.popConfirm).cancel)==null||F.call(P))},handleDropdownCommand:g=>{var k;const d=Number(g),b=C.value[d];if(!(!b||b.disabled)){if(b.popConfirm){const m=b.popConfirm.title,P=b.popConfirm.okText||"确定",F=b.popConfirm.cancelText||"取消";Be.MessageBox.confirm(m,"提示",{confirmButtonText:P,cancelButtonText:F,type:"warning"}).then(()=>{var R,p;return(p=(R=b.popConfirm)==null?void 0:R.confirm)==null?void 0:p.call(R)}).catch(()=>{var R,p;return(p=(R=b.popConfirm)==null?void 0:R.cancel)==null?void 0:p.call(R)});return}(k=b.onClick)==null||k.call(b,{})}}}}}),et="";var $e=function(){var e=this,l=e._self._c,t=e._self._setupProxy;return l("div",{staticClass:"ecp-table-action"},[e._l(t.visibleActions,function(a,c){return l("span",{key:`action-${c}`,staticClass:"ecp-table-action__item"},[a.popConfirm?l("el-popconfirm",{attrs:{title:a.popConfirm.title,"confirm-button-text":a.popConfirm.okText||"确定","cancel-button-text":a.popConfirm.cancelText||"取消"},on:{confirm:C=>t.handlePopConfirm(a,"confirm",C),cancel:C=>t.handlePopConfirm(a,"cancel",C)}},[l("span",{attrs:{slot:"reference"},slot:"reference"},[l(a.tooltip?"el-tooltip":"span",e._b({tag:"component"},"component",a.tooltip?t.normalizeTooltip(a.tooltip):{},!1),[l("el-button",e._b({attrs:{type:t.getButtonType(a),size:"small",disabled:a.disabled},on:{click:C=>t.handleClick(a,C)}},"el-button",a.props,!1),[a.icon?l("i",{class:["ecp-table-action__icon",a.icon]}):e._e(),l("span",[e._v(e._s(a.label))])])],1)],1)]):l(a.tooltip?"el-tooltip":"span",e._b({tag:"component"},"component",a.tooltip?t.normalizeTooltip(a.tooltip):{},!1),[l("el-button",e._b({attrs:{type:t.getButtonType(a),size:"small",disabled:a.disabled},on:{click:C=>t.handleClick(a,C)}},"el-button",a.props,!1),[a.icon?l("i",{class:["ecp-table-action__icon",a.icon]}):e._e(),l("span",[e._v(e._s(a.label))])])],1),a.divider?l("el-divider",{attrs:{direction:"vertical"}}):e._e()],1)}),t.visibleDropDownActions.length?l("el-dropdown",{attrs:{trigger:"click"},on:{command:t.handleDropdownCommand}},[l("span",{staticClass:"ecp-table-action__more"},[l("el-button",{attrs:{type:"text",size:"small"}},[e._v(" 更多"),l("i",{staticClass:"el-icon-arrow-down el-icon--right"})])],1),l("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(t.visibleDropDownActions,function(a,c){return l("el-dropdown-item",{key:`dropdown-${c}`,attrs:{command:c,disabled:a.disabled,divided:!!a.divider}},[l("span",{staticClass:"ecp-table-action__dropdown-item"},[a.icon?l("i",{class:["ecp-table-action__icon",a.icon]}):e._e(),l("span",[e._v(e._s(a.label))])])])}),1)],1):e._e()],2)},ze=[],Ee=Y(De,$e,ze,!1,null,"1b2d6c42",null,null);const _e=Ee.exports;function Ie(A){const e=s.ref(null),l=()=>{const c=s.unref(e);if(!c)throw new Error("ProTable instance has not been registered");return c};return[c=>{e.value=c},{setProps:c=>l().setProps(c),reload:c=>l().reload(c),setLoading:c=>l().setLoading(c),getDataSource:()=>l().getDataSource(),getRawDataSource:()=>l().getRawDataSource(),setTableData:c=>l().setTableData(c),getColumns:()=>l().getColumns(),setColumns:c=>l().setColumns(c),setPagination:c=>l().setPagination(c),getSelectRowKeys:()=>l().getSelectRowKeys(),getSelectRows:()=>l().getSelectRows(),clearSelectedRowKeys:()=>l().clearSelectedRowKeys(),setSelectedRowKeys:c=>l().setSelectedRowKeys(c),deleteSelectRowByKey:c=>l().deleteSelectRowByKey(c),updateTableDataRecord:(c,C)=>l().updateTableDataRecord(c,C),deleteTableDataRecord:c=>l().deleteTableDataRecord(c),insertTableDataRecord:(c,C)=>l().insertTableDataRecord(c,C),getPaginationRef:()=>l().getPaginationRef(),getShowPagination:()=>l().getShowPagination(),setShowPagination:c=>l().setShowPagination(c),expandAll:()=>{var c,C;return(C=(c=l()).expandAll)==null?void 0:C.call(c)},collapseAll:()=>{var c,C;return(C=(c=l()).collapseAll)==null?void 0:C.call(c)}}]}const Oe=s.defineComponent({__name:"ProFormItem",props:{schema:null,formModel:null,formDisabled:{type:Boolean},autoPlaceholder:{type:Boolean},formActionType:null},setup(A){const e=A,l=s.useSlots(),t=s.computed(()=>({schema:e.schema,values:e.formModel,model:e.formModel,field:e.schema.field})),a=s.computed(()=>{const m=e.schema.ifShow;return m===void 0?!0:typeof m=="boolean"?m:m(t.value)}),c=s.computed(()=>{const m=e.schema.show;return m===void 0?!0:typeof m=="boolean"?m:m(t.value)}),C=s.computed(()=>{if(e.formDisabled)return!0;const m=e.schema.dynamicDisabled;return m===void 0?!1:typeof m=="boolean"?m:m(t.value)}),z=s.computed(()=>{const m=e.schema.dynamicRules;return m?Array.isArray(m)?m:m(t.value):e.schema.rules}),r=s.computed(()=>{const m=e.schema.componentProps;if(!m)return{props:{},listeners:{}};const P=typeof m=="function"?m({...t.value,formActionType:e.formActionType}):{...m},F={},R={};for(const[p,f]of Object.entries(P))if(p.length>2&&/^on[A-Za-z]/.test(p)&&typeof f=="function"){const O=p.slice(2).charAt(0).toLowerCase()+p.slice(3);R[O]=f}else F[p]=f;return{props:F,listeners:R}}),h=s.computed(()=>r.value.props),g=s.computed(()=>r.value.listeners),d=s.computed(()=>!!l.default),b=m=>{const P=m==null?void 0:m.options;return Array.isArray(P)?P:void 0},k=s.computed(()=>{const m=e.schema.render;return m?{render(){const P=m(t.value);return Array.isArray(P)?s.h("span",P):P}}:null});return{__sfc:!0,props:e,slots:l,renderParams:t,shouldRender:a,shouldShow:c,effectiveDisabled:C,effectiveRules:z,effectiveComponentPropsAndListeners:r,effectiveComponentProps:h,effectiveComponentListeners:g,hasSlot:d,getOptions:b,renderComponent:k}}}),tt="";var Le=function(){var e=this,l=e._self._c,t=e._self._setupProxy;return t.shouldRender?l("el-form-item",{directives:[{name:"show",rawName:"v-show",value:t.shouldShow,expression:"shouldShow"}],attrs:{prop:e.schema.field,required:e.schema.required,rules:t.effectiveRules}},[l("template",{slot:"label"},[l("span",[e._v(e._s(e.schema.label))]),e.schema.helpMessage?l("el-tooltip",e._b({attrs:{placement:"top",effect:"light"}},"el-tooltip",e.schema.helpComponentProps||{},!1),[l("template",{slot:"content"},[Array.isArray(e.schema.helpMessage)?e._l(e.schema.helpMessage,function(a,c){return l("div",{key:c,staticClass:"ecp-pro-form-item__help-item"},[e._v(" "+e._s(a)+" ")])}):l("span",[e._v(e._s(e.schema.helpMessage))])],2),l("i",{staticClass:"el-icon-question ecp-pro-form-item__help-icon"})],2):e._e()],1),e.schema.render?[l(t.renderComponent,{tag:"component"})]:t.hasSlot?e._t("default",null,{model:e.formModel,schema:e.schema,field:e.schema.field,values:e.formModel}):[e.schema.component==="input"||!e.schema.component?l("el-input",e._g(e._b({attrs:{placeholder:e.schema.placeholder||(e.autoPlaceholder?`请输入${e.schema.label}`:void 0),disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(a){e.$set(e.formModel,e.schema.field,a)},expression:"formModel[schema.field]"}},"el-input",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="input-number"?l("el-input-number",e._g(e._b({attrs:{placeholder:e.schema.placeholder,disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(a){e.$set(e.formModel,e.schema.field,a)},expression:"formModel[schema.field]"}},"el-input-number",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="select"?l("el-select",e._g(e._b({staticClass:"ecp-pro-form-item__select",attrs:{placeholder:e.schema.placeholder||(e.autoPlaceholder?`请选择${e.schema.label}`:void 0),disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(a){e.$set(e.formModel,e.schema.field,a)},expression:"formModel[schema.field]"}},"el-select",t.effectiveComponentProps,!1),t.effectiveComponentListeners),e._l(t.getOptions(t.effectiveComponentProps)||[],function(a){return l("el-option",{key:String(a.value),attrs:{label:a.label,value:a.value}})}),1):e.schema.component==="date-picker"?l("el-date-picker",e._g(e._b({attrs:{placeholder:e.schema.placeholder||(e.autoPlaceholder?`请选择${e.schema.label}`:void 0),disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(a){e.$set(e.formModel,e.schema.field,a)},expression:"formModel[schema.field]"}},"el-date-picker",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="date-range"?l("el-date-picker",e._g(e._b({attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy-MM-dd",disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(a){e.$set(e.formModel,e.schema.field,a)},expression:"formModel[schema.field]"}},"el-date-picker",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="switch"?l("el-switch",e._g(e._b({attrs:{disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(a){e.$set(e.formModel,e.schema.field,a)},expression:"formModel[schema.field]"}},"el-switch",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="cascader"?l("el-cascader",e._g(e._b({attrs:{placeholder:e.schema.placeholder||(e.autoPlaceholder?`请选择${e.schema.label}`:void 0),disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(a){e.$set(e.formModel,e.schema.field,a)},expression:"formModel[schema.field]"}},"el-cascader",t.effectiveComponentProps,!1),t.effectiveComponentListeners)):e.schema.component==="checkbox"?l("el-checkbox-group",e._g(e._b({attrs:{disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(a){e.$set(e.formModel,e.schema.field,a)},expression:"formModel[schema.field]"}},"el-checkbox-group",t.effectiveComponentProps,!1),t.effectiveComponentListeners),e._l(t.getOptions(t.effectiveComponentProps)||[],function(a){return l("el-checkbox",{key:String(a.value),attrs:{label:a.value}},[e._v(" "+e._s(a.label)+" ")])}),1):e.schema.component==="radio"?l("el-radio-group",e._g(e._b({attrs:{disabled:t.effectiveDisabled},model:{value:e.formModel[e.schema.field],callback:function(a){e.$set(e.formModel,e.schema.field,a)},expression:"formModel[schema.field]"}},"el-radio-group",t.effectiveComponentProps,!1),t.effectiveComponentListeners),e._l(t.getOptions(t.effectiveComponentProps)||[],function(a){return l("el-radio",{key:String(a.value),attrs:{label:a.value}},[e._v(" "+e._s(a.label)+" ")])}),1):e._e()]],2):e._e()},Ve=[],We=Y(Oe,Le,Ve,!1,null,"cfc968c5",null,null);const be=We.exports,Ke=s.defineComponent({__name:"FormActions",props:{showActionButtonGroup:{type:Boolean,default:!0},showSubmitButton:{type:Boolean,default:!0},showResetButton:{type:Boolean,default:!0},submitButtonText:{default:"提交"},resetButtonText:{default:"重置"},submitButtonIcon:{default:"el-icon-search"},resetButtonIcon:{default:"el-icon-refresh-left"},submitLoading:{type:Boolean,default:!1},showAdvancedButton:{type:Boolean,default:!1},hasMoreFields:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!0},actionColOptions:null},emits:["submit","reset","toggle"],setup(A){return{__sfc:!0}}}),ot="";var qe=function(){var e=this,l=e._self._c;return e._self._setupProxy,l("div",{staticClass:"ecp-form-actions"},[e._t("submitBefore"),e.showSubmitButton?l("el-button",{attrs:{type:"primary",icon:e.submitButtonIcon,loading:e.submitLoading},on:{click:function(t){return e.$emit("submit")}}},[e._v(" "+e._s(e.submitButtonText)+" ")]):e._e(),e._t("resetBefore"),e.showResetButton?l("el-button",{attrs:{icon:e.resetButtonIcon},on:{click:function(t){return e.$emit("reset")}}},[e._v(" "+e._s(e.resetButtonText)+" ")]):e._e(),e._t("actions")],2)},Ne=[],je=Y(Ke,qe,Ne,!1,null,"489c88d2",null,null);const we=je.exports,He=s.defineComponent({__name:"ProForm",props:{schemas:null,initialValues:null,labelWidth:{default:"120px"},labelPosition:{default:"right"},gutter:{default:24},size:{default:"medium"},disabled:{type:Boolean},baseColProps:{default:()=>({xs:24,sm:12,md:12,lg:8,xl:6})},baseRowStyle:null,autoSetPlaceholder:{type:Boolean,default:!0},showSubmitButton:{type:Boolean,default:!0},showResetButton:{type:Boolean,default:!0},submitButtonText:{default:"提交"},resetButtonText:{default:"重置"},submitButtonIcon:{default:"el-icon-search"},resetButtonIcon:{default:"el-icon-refresh-left"},showActionButtonGroup:{type:Boolean,default:!0},actionColOptions:{default:()=>({xs:24,sm:12,md:12,lg:8,xl:6})},showAdvancedButton:{type:Boolean,default:!1},autoAdvancedLine:{default:3},alwaysShowLines:{default:1},submitFunc:null,resetFunc:null,submitOnReset:{type:Boolean,default:!1},formListeners:null},emits:["submit","reset","register"],setup(A,{expose:e,emit:l}){const t=A,a=s.useSlots(),c=s.ref(),C=s.ref(),z=s.ref(!1),r=s.ref(!0),h=s.ref({}),g=s.ref({}),d=s.ref([]),b=s.ref({}),k={xl:1920,lg:1200,md:992,sm:768},m=(i,_,S)=>{const y=S??(typeof window<"u"?window.innerWidth:1920),w=i??{},T=_??{},E=T.span??8;return y>=k.xl?w.xl??T.xl??w.lg??T.lg??w.md??T.md??w.sm??T.sm??w.xs??T.xs??w.span??E:y>=k.lg?w.lg??T.lg??w.md??T.md??w.sm??T.sm??w.xs??T.xs??w.span??E:y>=k.md?w.md??T.md??w.sm??T.sm??w.xs??T.xs??w.span??E:y>=k.sm?w.sm??T.sm??w.xs??T.xs??w.span??E:w.xs??T.xs??w.span??E},{getSetting:P}=he(),F=s.computed(()=>({...P("ProForm"),...t,...b.value})),R=s.computed(()=>F.value.actionColOptions??{span:24}),p=s.ref(typeof window<"u"?window.innerWidth:1920),f=(i,_,S,y)=>{let w=24,T=1,E=0;for(const N of i){const G=m(N.colProps,_,y);if(G>w){if(T++,T>S)break;w=24-G}else w-=G;E++}return E},O=s.computed(()=>{const i=d.value.filter(w=>H(w));if(!F.value.showAdvancedButton)return!1;const _=F.value.alwaysShowLines??1,S=F.value.baseColProps,y=f(i,S,_,p.value);return console.log(i.length,y),i.length>y}),j=s.computed(()=>F.value.formListeners??{}),M=s.computed(()=>{const i=d.value.filter(w=>H(w));if(!F.value.showAdvancedButton||!r.value)return i;const _=F.value.alwaysShowLines??1,S=F.value.baseColProps,y=f(i,S,_,p.value);return i.slice(0,y)}),H=i=>{let _=!0,S=!0;return typeof i.ifShow=="function"&&(_=i.ifShow({schema:i,values:h.value,model:h.value,field:i.field})),typeof i.ifShow=="boolean"&&(_=i.ifShow),typeof i.show=="function"&&(S=i.show({schema:i,values:h.value,model:h.value,field:i.field})),typeof i.show=="boolean"&&(S=i.show),_&&S},ee=i=>i.colProps??F.value.baseColProps??{},ne=i=>i.slot||i.field,L=()=>{const i={},_={},S=F.value.initialValues??t.initialValues;d.value.forEach(y=>{var w;i[y.field]=y.defaultValue??(S==null?void 0:S[y.field]),(w=y.rules)!=null&&w.length&&(_[y.field]=y.rules)}),h.value={...h.value,...i},g.value=_},Z=i=>{const _={...i};return d.value.forEach(S=>{const y=S.ifShow;if(y===void 0)return;(typeof y=="boolean"?y:y({schema:S,values:i,model:i,field:S.field}))||delete _[S.field]}),_},J=i=>{const _=Z(i),S=b.value.fieldMapToTime;if(!(S!=null&&S.length))return _;const y={..._};return S.forEach(([w,[T,E]])=>{const N=y[w];Array.isArray(N)&&N.length===2&&(delete y[w],y[T]=N[0],y[E]=N[1])}),y},V=async()=>{var i;try{await((i=c.value)==null?void 0:i.validate()),F.value.submitFunc?await F.value.submitFunc():(z.value=!0,l("submit",J({...h.value})))}catch(_){console.error("Form validation failed:",_)}finally{z.value=!1}},se=async()=>{var i;F.value.resetFunc?await F.value.resetFunc():((i=c.value)==null||i.resetFields(),L(),l("reset"),F.value.submitOnReset&&await V())},Q=i=>(h.value={...h.value,...i},Promise.resolve()),W=()=>J({...h.value}),re=async()=>{var i;(i=c.value)==null||i.resetFields(),L()},ie=i=>{var _;return((_=c.value)==null?void 0:_.validate(i))??Promise.resolve()},ce=i=>c.value?i!=null&&i.length?Promise.all(i.map(_=>new Promise((S,y)=>{c.value.validateField(_,w=>w?S(void 0):y(new Error("Validation failed")))}))):c.value.validate():Promise.resolve(),de=async(i,_)=>{var y;const S=(y=C.value)==null?void 0:y.querySelector(`[data-field="${i}"]`);return S&&S.scrollIntoView({behavior:(_==null?void 0:_.behavior)??"smooth",block:(_==null?void 0:_.block)??"nearest"}),Promise.resolve()},ue=i=>{var _;(_=c.value)==null||_.clearValidate(i)},fe=async i=>{(Array.isArray(i)?i:[i]).forEach(S=>{const y=d.value.findIndex(w=>w.field===S.field);y>=0&&(d.value[y]={...d.value[y],...S})})},K=async(i,_,S)=>{if(S)d.value.unshift(i);else if(_){const y=d.value.findIndex(w=>w.field===_);d.value.splice(y+1,0,i)}else d.value.push(i);L()},pe=async i=>{const _=Array.isArray(i)?i:[i];d.value=d.value.filter(S=>!_.includes(S.field))},me=async i=>{if(b.value={...b.value,...i},i.schemas){d.value=[...i.schemas];debugger;L()}},te={getFieldsValue:W,setFieldsValue:Q,resetFields:re,validate:ie,validateFields:ce,submit:V,scrollToField:de,clearValidate:ue,updateSchema:fe,appendSchemaByField:K,removeSchemaByField:pe,setProps:me};e(te);const q=()=>{d.value=[...t.schemas??[]],L()},oe=()=>{typeof window<"u"&&(p.value=window.innerWidth)};return s.onMounted(()=>{q(),l("register",te),typeof window<"u"&&window.addEventListener("resize",oe)}),s.onUnmounted(()=>{typeof window<"u"&&window.removeEventListener("resize",oe)}),s.watch(()=>[t.schemas,t.initialValues],q,{deep:!0}),{__sfc:!0,props:t,emit:l,slots:a,formRef:c,formWrapRef:C,submitLoading:z,collapsed:r,formModel:h,formRules:g,innerSchemas:d,innerProps:b,BREAKPOINTS:k,getEffectiveSpan:m,getComponentSetting:P,effectiveProps:F,effectiveActionColOptions:R,windowWidth:p,getVisibleSchemaCount:f,hasMoreFields:O,formListeners:j,displaySchemas:M,shouldShow:H,getColProps:ee,getSlotName:ne,initForm:L,filterByIfShow:Z,processFieldMapToTime:J,handleSubmit:V,handleReset:se,setFieldsValue:Q,getFieldsValue:W,resetFields:re,validate:ie,validateFields:ce,scrollToField:de,clearValidate:ue,updateSchema:fe,appendSchemaByField:K,removeSchemaByField:pe,setProps:me,formActionRef:te,syncSchemas:q,handleResize:oe,ProFormItem:be,FormActions:we}}}),lt="";var Ge=function(){var e=this,l=e._self._c,t=e._self._setupProxy;return l("div",{ref:"formWrapRef",staticClass:"ecp-pro-form"},[l("el-form",e._g(e._b({ref:"formRef",staticClass:"ecp-pro-form",attrs:{model:t.formModel,rules:t.formRules,"label-width":t.effectiveProps.labelWidth,"label-position":t.effectiveProps.labelPosition,size:t.effectiveProps.size,disabled:t.effectiveProps.disabled}},"el-form",e.$attrs,!1),t.formListeners),[e._t("formHeader"),l("el-row",{style:t.effectiveProps.baseRowStyle,attrs:{gutter:t.effectiveProps.gutter}},[e._l(t.displaySchemas,function(a){var c,C;return[t.shouldShow(a)?l("el-col",e._b({key:a.field,attrs:{offset:((c=a.colProps)==null?void 0:c.offset)??((C=t.effectiveProps.baseColProps)==null?void 0:C.offset)??0,"data-field":a.field}},"el-col",t.getColProps(a),!1),[l(t.ProFormItem,{attrs:{schema:a,"form-model":t.formModel,"form-disabled":t.effectiveProps.disabled,"auto-placeholder":t.effectiveProps.autoSetPlaceholder,"form-action-type":t.formActionRef}},[t.slots[t.getSlotName(a)]?[e._t(t.getSlotName(a),null,{model:t.formModel,schema:a,field:a.field,values:t.formModel})]:e._e()],2)],1):e._e()]}),t.effectiveProps.showActionButtonGroup?l("el-col",e._b({staticClass:"ecp-pro-form_col"},"el-col",t.hasMoreFields?{span:24}:t.effectiveProps.actionColOptions||{span:6},!1),[l(t.FormActions,{attrs:{"show-action-button-group":t.effectiveProps.showActionButtonGroup,"show-submit-button":t.effectiveProps.showSubmitButton,"show-reset-button":t.effectiveProps.showResetButton,"submit-button-text":t.effectiveProps.submitButtonText,"reset-button-text":t.effectiveProps.resetButtonText,"submit-button-icon":t.effectiveProps.submitButtonIcon,"reset-button-icon":t.effectiveProps.resetButtonIcon,"submit-loading":t.submitLoading,"show-advanced-button":t.effectiveProps.showAdvancedButton,"has-more-fields":t.hasMoreFields,collapsed:t.collapsed,"action-col-options":t.effectiveActionColOptions},on:{submit:t.handleSubmit,reset:t.handleReset,toggle:function(a){t.collapsed=!t.collapsed}}},[l("template",{slot:"submitBefore"},[e._t("submitBefore")],2),l("template",{slot:"resetBefore"},[e._t("resetBefore")],2),l("template",{slot:"advanceBefore"},[e._t("advanceBefore")],2),l("template",{slot:"advanceAfter"},[e._t("advanceAfter")],2),l("template",{slot:"actions"},[e._t("actions")],2)],2)],1):e._e()],2),t.effectiveProps.showAdvancedButton&&t.hasMoreFields?l("el-button",{staticClass:"ecp-form-actions__advance",attrs:{type:"text"},on:{click:function(a){t.collapsed=!t.collapsed}}},[l("i",{staticClass:"el-icon-d-arrow-left",class:t.collapsed?"down":"up"}),e._v(" "+e._s(t.collapsed?"展开":"收起")+" ")]):e._e(),e._t("formFooter")],2)],1)},Ue=[],Xe=Y(He,Ge,Ue,!1,null,"140fc052",null,null);const ye=Xe.exports;function Ze(A){const e=s.ref(null),l=s.ref(A?s.unref(A):void 0),t=()=>A?s.unref(A):void 0,a=p=>{e.value=p;const f=t();debugger;f&&Object.keys(f).length>0&&p.setProps(f)};return A&&s.watch(()=>t(),p=>{l.value=p,p&&e.value&&e.value.setProps(p)},{deep:!0}),[a,{register:a,formAction:e,getFieldsValue:()=>{var p;return((p=e.value)==null?void 0:p.getFieldsValue())??{}},setFieldsValue:async p=>{var f;await((f=e.value)==null?void 0:f.setFieldsValue(p))},resetFields:async()=>{var p;await((p=e.value)==null?void 0:p.resetFields())},validate:p=>{var f;return((f=e.value)==null?void 0:f.validate(p))??Promise.resolve()},validateFields:p=>{var f;return((f=e.value)==null?void 0:f.validateFields(p))??Promise.resolve()},submit:()=>{var p;return((p=e.value)==null?void 0:p.submit())??Promise.resolve()},scrollToField:(p,f)=>{var O;return((O=e.value)==null?void 0:O.scrollToField(p,f))??Promise.resolve()},clearValidate:p=>{var f;(f=e.value)==null||f.clearValidate(p)},updateSchema:p=>{var f;return((f=e.value)==null?void 0:f.updateSchema(p))??Promise.resolve()},appendSchemaByField:(p,f,O)=>{var j;return((j=e.value)==null?void 0:j.appendSchemaByField(p,f,O))??Promise.resolve()},removeSchemaByField:p=>{var f;return((f=e.value)==null?void 0:f.removeSchemaByField(p))??Promise.resolve()},setProps:async p=>{var f;l.value={...l.value,...p},await((f=e.value)==null?void 0:f.setProps(p))}}]}const Je=[{name:"ProTable",component:ge},{name:"TableAction",component:_e},{name:"ProForm",component:ye},{name:"ProFormItem",component:be},{name:"FormActions",component:we}];function Se(A){Je.forEach(({name:e,component:l})=>{A.component(e,l)})}const Qe={install:Se,ProTable:ge,ProForm:ye,TableAction:_e};$.FormActions=we,$.ProForm=ye,$.ProFormItem=be,$.ProTable=ge,$.TableAction=_e,$.default=Qe,$.install=Se,$.useComponentSetting=he,$.useForm=Ze,$.useProTable=Ie,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
3
3
|
//# sourceMappingURL=element-component-pro.umd.js.map
|