| | |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | :loading="exportLoading" |
| | | @click="handleExport" |
| | | v-hasPermi="['${moduleName}:${businessName}:export']" |
| | | >导出</el-button> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | |
| | | #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)) |
| | |
| | | <el-form-item label="${comment}" prop="${field}"> |
| | | <el-date-picker clearable size="small" |
| | | v-model="form.${field}" |
| | | type="date" |
| | | value-format="yyyy-MM-dd" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="选择${comment}"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="${comment}" prop="${field}"> |
| | | <el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" /> |
| | | </el-form-item> |
| | | #end |
| | | #end |
| | | #end |
| | | #end |
| | |
| | | #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, |
| | | // 导出遮罩层 |
| | | exportLoading: false, |
| | | // 选中数组 |
| | | ids: [], |
| | | #if($table.sub) |
| | |
| | | #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)) |
| | |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | this.loading = true; |
| | | this.reset(); |
| | | const ${pkColumn.javaField} = row.${pkColumn.javaField} || this.ids |
| | | get${BusinessName}(${pkColumn.javaField}).then(response => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | #foreach ($column in $columns) |
| | | #if($column.htmlType == "checkbox") |
| | |
| | | submitForm() { |
| | | this.#[[$]]#refs["form"].validate(valid => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | #foreach ($column in $columns) |
| | | #if($column.htmlType == "checkbox") |
| | | this.form.$column.javaField = this.form.${column.javaField}.join(","); |
| | |
| | | this.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | add${BusinessName}(this.form).then(response => { |
| | | this.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | } |
| | |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(function() { |
| | | }).then(() => { |
| | | this.loading = true; |
| | | return del${BusinessName}(${pkColumn.javaField}s); |
| | | }).then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.msgSuccess("删除成功"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | #if($table.sub) |
| | | /** ${subTable.functionName}序号 */ |
| | |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(function() { |
| | | }).then(() => { |
| | | this.exportLoading = true; |
| | | return export${BusinessName}(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | }) |
| | | this.exportLoading = false; |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |