提交 779e7312 编写于 作者: jlj05024111@163.com's avatar jlj05024111@163.com

feat: 更新md-view-base支持搜索表单插件,修复下拉编辑器props报错,修复文本框类型报错

上级 7282d3d1
......@@ -32,21 +32,25 @@ export const IBizDropdown = defineComponent({
});
// 当前值
const curValue: Ref<Array<string> | string | undefined> = computed({
get() {
if (props.value) {
return c!.multiple ? props.value?.split(',') : props.value;
}
return props.value;
},
set(select: string | Array<string> | undefined) {
if (Array.isArray(select)) {
emit('change', select.length === 0 ? null : select.join(','));
} else {
emit('change', select);
}
const curValue: Ref<Array<string> | string | Number | undefined> = computed(
{
get() {
if (props.value) {
return c!.multiple
? (props.value as String)?.split(',')
: props.value;
}
return props.value;
},
set(select: string | Number | Array<string> | undefined) {
if (Array.isArray(select)) {
emit('change', select.length === 0 ? null : select.join(','));
} else {
emit('change', select);
}
},
},
});
);
const valueText = computed(() => {
const valueArr = Array.isArray(curValue.value)
......
......@@ -73,7 +73,7 @@ export const IBizInput = defineComponent({
}
}
}
const currentVal = ref<string>('');
const currentVal = ref<string | number>('');
const getInputValue = (value: string | number) => {
if (type.value === 'number' || !ibiz.config.enableXSS) {
......
......@@ -11,7 +11,7 @@ export const MDViewBase = defineComponent({
setup() {
return {};
},
render() {
render(h) {
const c = this.controller;
// 外面的插槽同样传给view-layout
......@@ -38,8 +38,22 @@ export const MDViewBase = defineComponent({
},
};
if (c.showSearchForm) {
const { searchForm } = this.controller.model;
slots.searchForm = () => {
if (c.complete && c.model.searchForm) {
if (c.complete && searchForm) {
if (c.providers[searchForm.name]) {
return h(c.providers[searchForm.name].component, {
props: {
controller: c,
context: c.context,
params: c.params,
modelData: searchForm,
},
on: {
neuronInit: c.nerve.onNeuronInit(searchForm.source.name),
},
});
}
return (
<search-form-control
v-show={c.showSearchForm}
......@@ -47,9 +61,7 @@ export const MDViewBase = defineComponent({
context={c.context}
params={c.params}
controller={c}
on-neuronInit={c.nerve.onNeuronInit(
c.model.searchForm.source.name,
)}
on-neuronInit={c.nerve.onNeuronInit(searchForm.source.name)}
></search-form-control>
);
}
......
......@@ -59,6 +59,9 @@ export const TreeControl = defineComponent({
*/
const onCurrentChange = (nodeData: ITreeNodeData) => {
c.onTreeNodeClick(nodeData);
if (props.singleSelect) {
c.setSelectData([nodeData]);
}
};
// 默认展开回显
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册