fix: readonly支持组件数组不从外部引入
This commit is contained in:
@ -142,16 +142,6 @@ componentMap.set('ErpApply', ErpApply);
|
||||
componentMap.set('ErpUpload', ErpUpload);
|
||||
componentMap.set('ErpCheck', ErpCheck);
|
||||
componentMap.set('AutoComplete', AutoComplete);
|
||||
const readonlySupportList = [
|
||||
"Input",
|
||||
"AutoCodeRule",
|
||||
"DatePicker",
|
||||
"TimePicker",
|
||||
"Info",
|
||||
"Text",
|
||||
'InputTextArea',
|
||||
'InputNumber'
|
||||
]
|
||||
|
||||
export function add(compName: ComponentType, component: Component) {
|
||||
componentMap.set(compName, component);
|
||||
@ -161,10 +151,4 @@ export function del(compName: ComponentType) {
|
||||
componentMap.delete(compName);
|
||||
}
|
||||
|
||||
export function isreadComponent() {
|
||||
let str = readonlySupportList.join('|')
|
||||
const reg = new RegExp(str);
|
||||
return reg
|
||||
}
|
||||
|
||||
export { componentMap, readonlySupportList };
|
||||
export { componentMap };
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { readonlySupportList } from '/@/components/Form/src/componentMap';
|
||||
|
||||
const props = defineProps({
|
||||
value: String,
|
||||
@ -20,7 +19,15 @@ function genFieldValue(val) {
|
||||
const schema = props.schema;
|
||||
const { componentProps, component } = schema;
|
||||
|
||||
if (readonlySupportList.includes(component)) {
|
||||
if ([
|
||||
"Input",
|
||||
"AutoCodeRule",
|
||||
"DatePicker",
|
||||
"TimePicker",
|
||||
"Info",
|
||||
"Text",
|
||||
'InputTextArea',
|
||||
'InputNumber'].includes(component)) {
|
||||
return `${componentProps?.addonBefore || ''}${val}${componentProps?.addonAfter || ''}`;
|
||||
}
|
||||
if (component === 'Switch') {
|
||||
|
||||
Reference in New Issue
Block a user