| | |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | :loading="exportLoading" |
| | | :loading="exportLoading" |
| | | @click="handleExport" |
| | | v-hasPermi="['${moduleName}:${businessName}:export']" |
| | | >导出</el-button> |
| | |
| | | <span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | #elseif($column.list && "" != $column.dictType) |
| | | #elseif($column.list && $column.dictType && "" != $column.dictType) |
| | | <el-table-column label="${comment}" align="center" prop="${javaField}" :formatter="${javaField}Format" /> |
| | | #elseif($column.list && "" != $javaField) |
| | | <el-table-column label="${comment}" align="center" prop="${javaField}" /> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}"; |
| | | import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"; |
| | | import { downLoadExcel } from "@/utils/download"; |
| | | |
| | | export default { |
| | | name: "${BusinessName}", |
| | |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | #if($table.sub) |
| | | /** ${subTable.functionName}序号 */ |
| | |
| | | /** ${subTable.functionName}删除按钮操作 */ |
| | | handleDelete${subClassName}() { |
| | | if (this.checked${subClassName}.length == 0) { |
| | | this.$alert("请先选择要删除的${subTable.functionName}数据", "提示", { confirmButtonText: "确定", }); |
| | | this.msgError("请先选择要删除的${subTable.functionName}数据"); |
| | | } else { |
| | | this.${subclassName}List.splice(this.checked${subClassName}[0].index - 1, 1); |
| | | const ${subclassName}List = this.${subclassName}List; |
| | | const checked${subClassName} = this.checked${subClassName}; |
| | | this.${subclassName}List = ${subclassName}List.filter(function(item) { |
| | | return checked${subClassName}.indexOf(item.index) == -1 |
| | | }); |
| | | } |
| | | }, |
| | | /** 单选框选中数据 */ |
| | | /** 复选框选中数据 */ |
| | | handle${subClassName}SelectionChange(selection) { |
| | | if (selection.length > 1) { |
| | | this.$refs.${subclassName}.clearSelection(); |
| | | this.$refs.${subclassName}.toggleRowSelection(selection.pop()); |
| | | } else { |
| | | this.checked${subClassName} = selection; |
| | | } |
| | | this.checked${subClassName} = selection.map(item => item.index) |
| | | }, |
| | | #end |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | const queryParams = this.queryParams; |
| | | this.$confirm('是否确认导出所有${functionName}数据项?', "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.exportLoading = true; |
| | | return export${BusinessName}(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }).catch(() => {}); |
| | | downLoadExcel('/${moduleName}/${businessName}/export', this.queryParams); |
| | | } |
| | | } |
| | | }; |