config_tools: add custom CAT widget

add custom CAT widget

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
This commit is contained in:
Weiyi Feng
2022-05-22 17:15:34 +08:00
committed by acrnsi-robot
parent 8ffbcc22ce
commit 84550004dd
10 changed files with 632 additions and 34 deletions

View File

@@ -6,10 +6,10 @@ import {
computed, h, ref, watch, inject
} from 'vue';
import { IconInfo } from '@lljj/vjsf-utils/icons';
import {IconInfo} from '@lljj/vjsf-utils/icons';
import { validateFormDataAndTransformMsg } from '@lljj/vjsf-utils/schema/validate';
import { fallbackLabel } from '@lljj/vjsf-utils/formUtils';
import {validateFormDataAndTransformMsg} from '@lljj/vjsf-utils/schema/validate';
import {fallbackLabel} from '@lljj/vjsf-utils/formUtils';
import {
isRootNodePath, path2prop, getPathVal, setPathVal, resolveComponent
@@ -131,7 +131,7 @@ export default {
},
emits: ['otherDataChange'],
inheritAttrs: true,
setup(props, { emit }) {
setup(props, {emit}) {
const genFormProvide = inject('genFormProvide');
const widgetValue = computed({
get() {
@@ -191,7 +191,7 @@ export default {
},
) : null;
const { COMPONENT_MAP } = props.globalOptions;
const {COMPONENT_MAP} = props.globalOptions;
const miniDescriptionVNode = (miniDesModel && descriptionVNode) ? h(resolveComponent(COMPONENT_MAP.popover), {
style: {
margin: '0 2px',
@@ -227,7 +227,7 @@ export default {
style: formItemStyle,
...props.fieldAttrs,
...props.labelWidth ? { labelWidth: props.labelWidth } : {},
...props.labelWidth ? {labelWidth: props.labelWidth} : {},
...props.isFormData ? {
// 这里对根节点打特殊标志绕过elementUi无prop属性不校验
prop: isRootNode ? '__$$root' : path2prop(props.curNodePath),
@@ -295,6 +295,13 @@ export default {
},
}, [
...miniDescriptionVNode ? [miniDescriptionVNode] : [],
(window.isDev ?
h('div', {style: {position: 'relative'}}, [
h('div', {style: {position: 'absolute'}},
`${props.curNodePath}`)
]) :
''
),
`${label}`,
`${(props.formProps && props.formProps.labelSuffix) || ''}`
])