| | |
| | | #foreach($column in $columns) |
| | | #set($field=$column.javaField) |
| | | #if($column.insert && !$column.pk) |
| | | #if(($column.usableColumn) || (!$column.superColumn)) |
| | | #set($parentheseIndex=$column.columnComment.indexOf("(")) |
| | | #if($parentheseIndex != -1) |
| | | #set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
| | |
| | | #end |
| | | #end |
| | | #end |
| | | #end |
| | | #if($table.sub) |
| | | <el-divider content-position="center">${subTable.functionName}信息</el-divider> |
| | | <el-row :gutter="10" class="mb8"> |
| | |
| | | #end |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | |
| | | <script> |
| | | import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}"; |
| | | #foreach($column in $columns) |
| | | #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload") |
| | | import ImageUpload from '@/components/ImageUpload'; |
| | | #break |
| | | #end |
| | | #end |
| | | #foreach($column in $columns) |
| | | #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "fileUpload") |
| | | import FileUpload from '@/components/FileUpload'; |
| | | #break |
| | | #end |
| | | #end |
| | | #foreach($column in $columns) |
| | | #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor") |
| | | import Editor from '@/components/Editor'; |
| | | #break |
| | | #end |
| | | #end |
| | | |
| | | export default { |
| | | name: "${BusinessName}", |
| | | components: { |
| | | #foreach($column in $columns) |
| | | #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload") |
| | | ImageUpload, |
| | | #break |
| | | #end |
| | | #end |
| | | #foreach($column in $columns) |
| | | #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "fileUpload") |
| | | FileUpload, |
| | | #break |
| | | #end |
| | | #end |
| | | #foreach($column in $columns) |
| | | #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "editor") |
| | | Editor, |
| | | #break |
| | | #end |
| | | #end |
| | | }, |
| | | data() { |
| | | return { |
| | | // 按钮loading |
| | | buttonLoading: false, |
| | | // 遮罩层 |
| | | loading: true, |
| | | // 导出遮罩层 |
| | |
| | | #else |
| | | #set($comment=$column.columnComment) |
| | | #end |
| | | #if(${column.dictType} != '') |
| | | #if(${column.dictType} && ${column.dictType} != '') |
| | | // $comment字典 |
| | | ${column.javaField}Options: [], |
| | | #elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
| | |
| | | created() { |
| | | this.getList(); |
| | | #foreach ($column in $columns) |
| | | #if(${column.dictType} != '') |
| | | #if(${column.dictType} && ${column.dictType} != '') |
| | | this.getDicts("${column.dictType}").then(response => { |
| | | this.${column.javaField}Options = response.data; |
| | | }); |
| | |
| | | }); |
| | | }, |
| | | #foreach ($column in $columns) |
| | | #if(${column.dictType} != '') |
| | | #if(${column.dictType} && ${column.dictType} != '') |
| | | #set($parentheseIndex=$column.columnComment.indexOf("(")) |
| | | #if($parentheseIndex != -1) |
| | | #set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
| | |
| | | submitForm() { |
| | | this.#[[$]]#refs["form"].validate(valid => { |
| | | if (valid) { |
| | | this.loading = true; |
| | | this.buttonLoading = true; |
| | | #foreach ($column in $columns) |
| | | #if($column.htmlType == "checkbox") |
| | | this.form.$column.javaField = this.form.${column.javaField}.join(","); |
| | |
| | | #end |
| | | if (this.form.${pkColumn.javaField} != null) { |
| | | update${BusinessName}(this.form).then(response => { |
| | | this.loading = false; |
| | | this.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | add${BusinessName}(this.form).then(response => { |
| | | this.loading = false; |
| | | this.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | } |
| | |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(()=> { |
| | | }).then(() => { |
| | | this.loading = true; |
| | | return del${BusinessName}(${pkColumn.javaField}s); |
| | | }).then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.msgSuccess("删除成功"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | #if($table.sub) |
| | | /** ${subTable.functionName}序号 */ |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |