|
|
@ -1,15 +1,24 @@ |
|
|
|
<template> |
|
|
|
<template v-if="value && typeof value === 'object' && value.componentType"> |
|
|
|
<template v-if="!Tools.isEmpty(value) && typeof value === 'object' && value.componentType && value.bindModelValue"> |
|
|
|
<component |
|
|
|
:is="value.componentType" |
|
|
|
v-bind="value.attrs" |
|
|
|
v-model="tools.dataFM.getRow(tools.table.rows, props.row[Constant.FIELD_NAMES.ROW_KEY], false)[col.name]" |
|
|
|
></component> |
|
|
|
</template> |
|
|
|
<template v-else-if="!Tools.isEmpty(value) && typeof value === 'object' && value.componentType"> |
|
|
|
<component :is="value.componentType" v-bind="value.attrs"></component> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<span v-dompurify-html="!Tools.isEmpty(value) ? value : ''"></span> |
|
|
|
<span v-dompurify-html="Tools.isUndefinedOrNull(value) ? '' : value"></span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { Tools } from '@/platform'; |
|
|
|
import { Tools, inject } from '@/platform'; |
|
|
|
import { Constant, GridTools } from './ts/index'; |
|
|
|
|
|
|
|
const tools = <GridTools>inject('tools'); |
|
|
|
const props = defineProps({ |
|
|
|
value: { |
|
|
|
type: [Object, String, Number], |
|
|
@ -17,5 +26,17 @@ const props = defineProps({ |
|
|
|
return ''; |
|
|
|
}, |
|
|
|
}, |
|
|
|
col: { |
|
|
|
type: Object, |
|
|
|
default: () => { |
|
|
|
return {}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
row: { |
|
|
|
type: Object, |
|
|
|
default: () => { |
|
|
|
return {}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
</script> |
|
|
|