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

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

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