| | |
| | | <template> |
| | | <basic-container> |
| | | <el-dialog v-if="dialogFormVisible" :title="title" :visible.sync="dialogFormVisible" @close="closeHandler" append-to-body> |
| | | <avue-form v-model="form" :option="option" @submit="submitHandler" @reset-change="changeHandler"></avue-form> |
| | | <avue-form v-model="form" :option="option" @submit="submitHandler" @reset-change="changeHandler"> |
| | | <template v-for="item in slotData" :slot="item.prop + 'Label'"> |
| | | <span> |
| | | <span>{{ item.label }} </span> |
| | | <el-tooltip |
| | | v-if="item.keyAttr" |
| | | class="item" |
| | | content="该属性为关键属性" |
| | | effect="dark" |
| | | placement="top-start" |
| | | > |
| | | <i class="el-icon-star-on" style="font-size: 17px !important; color: red;vertical-align: baseline;"></i> |
| | | </el-tooltip> |
| | | </span> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | |
| | | column: this.formColumn(this.formList) |
| | | } |
| | | }, |
| | | slotData(){ |
| | | return this.formColumn(this.formList) |
| | | } |
| | | }, |
| | | methods:{ |
| | | //表单提交 |
| | | submitHandler(form,done){ |
| | | console.log(form) |
| | | console.log(this.slotData) |
| | | done() |
| | | }, |
| | | changeHandler(){ |
| | |
| | | suffixIcon: item.prefix, |
| | | placeholder:item.placeholder, |
| | | clearable:item.clearable, |
| | | tip: item.tooltips, |
| | | keyAttr: item.keyAttr, |
| | | rules: [{ |
| | | required: item.required, |
| | | message: `请输入${item.text}!`, |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |