| | |
| | | <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px"> |
| | | #foreach($column in $columns) |
| | | <zt-form-item label="${column.comments}" prop="${column.attrName}" rules="required"> |
| | | <el-input v-model="dataForm.${column.attrName}"></el-input> |
| | | #if($column.dictType != 'null' && $column.dictType != '') |
| | | <zt-dict v-model="dataForm.${column.attrName}" dict="$column.dictType"></zt-dict> |
| | | #else |
| | | <el-input v-model="dataForm.${column.attrName}"></el-input> |
| | | #end |
| | | </zt-form-item> |
| | | #end |
| | | </el-form> |
| | |
| | | methods: { |
| | | // 获取信息 |
| | | async getInfo() { |
| | | let res = await #[[this.$http.get(]]#`/${moduleName}/${pathName}/#[[${]]#this.dataForm.${pk.attrName}}`) |
| | | let res = await #[[this.$http.get(]]#`/${moduleName}/${className}/#[[${]]#this.dataForm.id}`) |
| | | this.dataForm = { |
| | | ...this.dataForm, |
| | | ...res.data |
| | |
| | | }, |
| | | // 表单提交 |
| | | async formSubmit() { |
| | | let res = await #[[this.$http]]#[!this.dataForm.${pk.attrName} ? 'post' : 'put']('/${moduleName}/${pathName}/', this.dataForm) |
| | | let res = await #[[this.$http]]#[!this.dataForm.id ? 'post' : 'put']('/${moduleName}/${className}/', this.dataForm) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |