1
0
mirror of synced 2025-11-06 04:20:54 +08:00

添加图片上传组件

This commit is contained in:
qianlishi
2025-01-13 22:26:57 +08:00
parent 05eef368fa
commit 66a9983552
2 changed files with 15 additions and 1 deletions

View File

@@ -57,6 +57,13 @@
clearable
/>
</template>
<!-- BasicUpload -->
<template v-else-if="schema.component === 'BasicUpload'">
<BasicUpload
v-model:value="formModel[schema.field]"
v-bind="getSpecComponentProps(schema)"
/>
</template>
<!-- 动态渲染表单 -->
<component
v-else
@@ -78,6 +85,7 @@
import { basicModal, useModal } from '@/components/Modal'
import { DialogType, DialogTitle } from '@/enums/common'
import { JsqSelect } from '@/components/Base/Jsq-select';
import { BasicUpload } from '@/components/Upload';
import type { FormInst } from 'naive-ui'
import { useMessage } from 'naive-ui'
@@ -114,6 +122,13 @@
};
};
const getSpecComponentProps = (schema) => {
const compProps = handleComponentProps(schema);
return {
...compProps,
};
}
const handleComponentProps = (schema) => {
let { componentProps = {} } = schema ?? {};
if (isFunction(componentProps)) {

View File

@@ -32,7 +32,6 @@
* */
const getOptions = computed(() => {
const { dictCode, localOptions } = unref(getProps);
console.log('1', getDictName(dictCode))
const options = localOptions
? localOptions
: dictCode