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

feat: 更新表单多数据删除,添加按钮支持权限配置控制

上级 f7439068
...@@ -59,9 +59,8 @@ export const FormMDCtrl = defineComponent({ ...@@ -59,9 +59,8 @@ export const FormMDCtrl = defineComponent({
}; };
if (this.modelData.mdCtrlType === 'REPEATER') { if (this.modelData.mdCtrlType === 'REPEATER') {
formProps.simpleDataIndex = index; formProps.simpleDataIndex = index;
} else {
formProps.enableAutoSave = true;
} }
formProps.enableAutoSave = this.c.enableUpdate;
const formEmits: IData = { const formEmits: IData = {
neuronInit: this.c.onNeuronInit(data.srfkey), neuronInit: this.c.onNeuronInit(data.srfkey),
}; };
...@@ -73,6 +72,7 @@ export const FormMDCtrl = defineComponent({ ...@@ -73,6 +72,7 @@ export const FormMDCtrl = defineComponent({
return ( return (
<div class={this.ns.b('form-content')} key={data.srfkey}> <div class={this.ns.b('form-content')} key={data.srfkey}>
{formComponent} {formComponent}
{this.c.enableDelete && (
<div class={this.ns.b('btn')}> <div class={this.ns.b('btn')}>
<i-button <i-button
class={this.ns.b('remove-btn')} class={this.ns.b('remove-btn')}
...@@ -82,6 +82,7 @@ export const FormMDCtrl = defineComponent({ ...@@ -82,6 +82,7 @@ export const FormMDCtrl = defineComponent({
删除 删除
</i-button> </i-button>
</div> </div>
)}
</div> </div>
); );
}) })
...@@ -96,6 +97,7 @@ export const FormMDCtrl = defineComponent({ ...@@ -96,6 +97,7 @@ export const FormMDCtrl = defineComponent({
<span class={this.ns.b('caption')}> <span class={this.ns.b('caption')}>
{this.modelData.source.caption} {this.modelData.source.caption}
</span> </span>
{this.c.enableCreate && (
<i-button <i-button
class={this.ns.b('add-btn')} class={this.ns.b('add-btn')}
type='text' type='text'
...@@ -103,6 +105,7 @@ export const FormMDCtrl = defineComponent({ ...@@ -103,6 +105,7 @@ export const FormMDCtrl = defineComponent({
> >
添加 添加
</i-button> </i-button>
)}
</div>, </div>,
renderFormContent(), renderFormContent(),
]} ]}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册