Commit 5ebebf15792afac523df275d7653cff703db1c2d
1 parent
6d228828
代码生成:vue2 代码模拟格式调整
Showing
5 changed files
with
38 additions
and
39 deletions
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/form_sub_erp.vue.vm
| @@ -89,7 +89,7 @@ | @@ -89,7 +89,7 @@ | ||
| 89 | </template> | 89 | </template> |
| 90 | 90 | ||
| 91 | <script> | 91 | <script> |
| 92 | - import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}' | 92 | + import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}'; |
| 93 | #if ($hasImageUploadColumn) | 93 | #if ($hasImageUploadColumn) |
| 94 | import ImageUpload from '@/components/ImageUpload'; | 94 | import ImageUpload from '@/components/ImageUpload'; |
| 95 | #end | 95 | #end |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/form_sub_normal.vue.vm
| @@ -8,12 +8,12 @@ | @@ -8,12 +8,12 @@ | ||
| 8 | <div class="app-container"> | 8 | <div class="app-container"> |
| 9 | #if ( $subTable.subJoinMany )## 情况一:一对多,table + form | 9 | #if ( $subTable.subJoinMany )## 情况一:一对多,table + form |
| 10 | <el-form | 10 | <el-form |
| 11 | - ref="formRef" | ||
| 12 | - :model="formData" | ||
| 13 | - :rules="formRules" | ||
| 14 | - v-loading="formLoading" | ||
| 15 | - label-width="0px" | ||
| 16 | - :inline-message="true" | 11 | + ref="formRef" |
| 12 | + :model="formData" | ||
| 13 | + :rules="formRules" | ||
| 14 | + v-loading="formLoading" | ||
| 15 | + label-width="0px" | ||
| 16 | + :inline-message="true" | ||
| 17 | > | 17 | > |
| 18 | <el-table :data="formData" class="-mt-10px"> | 18 | <el-table :data="formData" class="-mt-10px"> |
| 19 | <el-table-column label="序号" type="index" width="100" /> | 19 | <el-table-column label="序号" type="index" width="100" /> |
| @@ -137,11 +137,11 @@ | @@ -137,11 +137,11 @@ | ||
| 137 | </el-row> | 137 | </el-row> |
| 138 | #else## 情况二:一对一,form | 138 | #else## 情况二:一对一,form |
| 139 | <el-form | 139 | <el-form |
| 140 | - ref="formRef" | ||
| 141 | - :model="formData" | ||
| 142 | - :rules="formRules" | ||
| 143 | - label-width="100px" | ||
| 144 | - v-loading="formLoading" | 140 | + ref="formRef" |
| 141 | + :model="formData" | ||
| 142 | + :rules="formRules" | ||
| 143 | + label-width="100px" | ||
| 144 | + v-loading="formLoading" | ||
| 145 | > | 145 | > |
| 146 | #foreach($column in $subColumns) | 146 | #foreach($column in $subColumns) |
| 147 | #if ($column.createOperation || $column.updateOperation) | 147 | #if ($column.createOperation || $column.updateOperation) |
| @@ -221,7 +221,7 @@ | @@ -221,7 +221,7 @@ | ||
| 221 | </template> | 221 | </template> |
| 222 | 222 | ||
| 223 | <script> | 223 | <script> |
| 224 | - import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}' | 224 | + import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}'; |
| 225 | #if ($hasImageUploadColumn) | 225 | #if ($hasImageUploadColumn) |
| 226 | import ImageUpload from '@/components/ImageUpload'; | 226 | import ImageUpload from '@/components/ImageUpload'; |
| 227 | #end | 227 | #end |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/components/list_sub_erp.vue.vm
| @@ -61,9 +61,9 @@ | @@ -61,9 +61,9 @@ | ||
| 61 | </template> | 61 | </template> |
| 62 | 62 | ||
| 63 | <script> | 63 | <script> |
| 64 | - import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}' | 64 | + import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}'; |
| 65 | #if ($table.templateType == 11) | 65 | #if ($table.templateType == 11) |
| 66 | - import ${subSimpleClassName}Form from './${subSimpleClassName}Form.vue' | 66 | + import ${subSimpleClassName}Form from './${subSimpleClassName}Form.vue'; |
| 67 | #end | 67 | #end |
| 68 | export default { | 68 | export default { |
| 69 | name: "${subSimpleClassName}List", | 69 | name: "${subSimpleClassName}List", |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/form.vue.vm
| @@ -12,10 +12,10 @@ | @@ -12,10 +12,10 @@ | ||
| 12 | #if ( $table.templateType == 2 && $column.id == $treeParentColumn.id ) | 12 | #if ( $table.templateType == 2 && $column.id == $treeParentColumn.id ) |
| 13 | <el-form-item label="${comment}" prop="${javaField}"> | 13 | <el-form-item label="${comment}" prop="${javaField}"> |
| 14 | <TreeSelect | 14 | <TreeSelect |
| 15 | - v-model="formData.${javaField}" | ||
| 16 | - :options="${classNameVar}Tree" | ||
| 17 | - :normalizer="normalizer" | ||
| 18 | - placeholder="请选择${comment}" | 15 | + v-model="formData.${javaField}" |
| 16 | + :options="${classNameVar}Tree" | ||
| 17 | + :normalizer="normalizer" | ||
| 18 | + placeholder="请选择${comment}" | ||
| 19 | /> | 19 | /> |
| 20 | </el-form-item> | 20 | </el-form-item> |
| 21 | #elseif ($column.htmlType == "input" && !$column.primaryKey)## 忽略主键,不用在表单里 | 21 | #elseif ($column.htmlType == "input" && !$column.primaryKey)## 忽略主键,不用在表单里 |
| @@ -107,7 +107,7 @@ | @@ -107,7 +107,7 @@ | ||
| 107 | </template> | 107 | </template> |
| 108 | 108 | ||
| 109 | <script> | 109 | <script> |
| 110 | - import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}' | 110 | + import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}'; |
| 111 | #if ($hasImageUploadColumn) | 111 | #if ($hasImageUploadColumn) |
| 112 | import ImageUpload from '@/components/ImageUpload'; | 112 | import ImageUpload from '@/components/ImageUpload'; |
| 113 | #end | 113 | #end |
| @@ -212,7 +212,7 @@ | @@ -212,7 +212,7 @@ | ||
| 212 | this.title = "新增${table.classComment}"; | 212 | this.title = "新增${table.classComment}"; |
| 213 | ## 特殊:树表专属逻辑 | 213 | ## 特殊:树表专属逻辑 |
| 214 | #if ( $table.templateType == 2 ) | 214 | #if ( $table.templateType == 2 ) |
| 215 | - this.get${simpleClassName}Tree(); | 215 | + await this.get${simpleClassName}Tree(); |
| 216 | #end | 216 | #end |
| 217 | }, | 217 | }, |
| 218 | /** 提交按钮 */ | 218 | /** 提交按钮 */ |
| @@ -263,7 +263,7 @@ | @@ -263,7 +263,7 @@ | ||
| 263 | this.#[[$modal]]#.msgSuccess("新增成功"); | 263 | this.#[[$modal]]#.msgSuccess("新增成功"); |
| 264 | this.dialogVisible = false; | 264 | this.dialogVisible = false; |
| 265 | this.#[[$]]#emit('success'); | 265 | this.#[[$]]#emit('success'); |
| 266 | - }finally { | 266 | + } finally { |
| 267 | this.formLoading = false; | 267 | this.formLoading = false; |
| 268 | } | 268 | } |
| 269 | }, | 269 | }, |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue/views/index.vue.vm
| 1 | <template> | 1 | <template> |
| 2 | <div class="app-container"> | 2 | <div class="app-container"> |
| 3 | - | ||
| 4 | <!-- 搜索工作栏 --> | 3 | <!-- 搜索工作栏 --> |
| 5 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | 4 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 6 | #foreach($column in $columns) | 5 | #foreach($column in $columns) |
| @@ -68,24 +67,24 @@ | @@ -68,24 +67,24 @@ | ||
| 68 | ## 特殊:主子表专属逻辑 | 67 | ## 特殊:主子表专属逻辑 |
| 69 | #if ( $table.templateType == 11 && $subTables && $subTables.size() > 0 ) | 68 | #if ( $table.templateType == 11 && $subTables && $subTables.size() > 0 ) |
| 70 | <el-table | 69 | <el-table |
| 71 | - v-loading="loading" | ||
| 72 | - :data="list" | ||
| 73 | - :stripe="true" | ||
| 74 | - :highlight-current-row="true" | ||
| 75 | - :show-overflow-tooltip="true" | ||
| 76 | - @current-change="handleCurrentChange" | 70 | + v-loading="loading" |
| 71 | + :data="list" | ||
| 72 | + :stripe="true" | ||
| 73 | + :highlight-current-row="true" | ||
| 74 | + :show-overflow-tooltip="true" | ||
| 75 | + @current-change="handleCurrentChange" | ||
| 77 | > | 76 | > |
| 78 | ## 特殊:树表专属逻辑 | 77 | ## 特殊:树表专属逻辑 |
| 79 | #elseif ( $table.templateType == 2 ) | 78 | #elseif ( $table.templateType == 2 ) |
| 80 | <el-table | 79 | <el-table |
| 81 | - v-loading="loading" | ||
| 82 | - :data="list" | ||
| 83 | - :stripe="true" | ||
| 84 | - :show-overflow-tooltip="true" | ||
| 85 | - v-if="refreshTable" | ||
| 86 | - row-key="id" | ||
| 87 | - :default-expand-all="isExpandAll" | ||
| 88 | - :tree-props="{children: 'children', hasChildren: 'hasChildren'}" | 80 | + v-loading="loading" |
| 81 | + :data="list" | ||
| 82 | + :stripe="true" | ||
| 83 | + :show-overflow-tooltip="true" | ||
| 84 | + v-if="refreshTable" | ||
| 85 | + row-key="id" | ||
| 86 | + :default-expand-all="isExpandAll" | ||
| 87 | + :tree-props="{children: 'children', hasChildren: 'hasChildren'}" | ||
| 89 | > | 88 | > |
| 90 | #else | 89 | #else |
| 91 | <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> | 90 | <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> |
| @@ -183,7 +182,7 @@ import Editor from '@/components/Editor'; | @@ -183,7 +182,7 @@ import Editor from '@/components/Editor'; | ||
| 183 | #if ( $table.templateType != 10 ) | 182 | #if ( $table.templateType != 10 ) |
| 184 | #if ( $subTables && $subTables.size() > 0 ) | 183 | #if ( $subTables && $subTables.size() > 0 ) |
| 185 | #foreach ($subSimpleClassName in $subSimpleClassNames) | 184 | #foreach ($subSimpleClassName in $subSimpleClassNames) |
| 186 | - import ${subSimpleClassName}List from './components/${subSimpleClassName}List.vue' | 185 | + import ${subSimpleClassName}List from './components/${subSimpleClassName}List.vue'; |
| 187 | #end | 186 | #end |
| 188 | #end | 187 | #end |
| 189 | #end | 188 | #end |
| @@ -298,7 +297,7 @@ export default { | @@ -298,7 +297,7 @@ export default { | ||
| 298 | await this.#[[$modal]]#.confirm('是否确认删除${table.classComment}编号为"' + ${primaryColumn.javaField} + '"的数据项?') | 297 | await this.#[[$modal]]#.confirm('是否确认删除${table.classComment}编号为"' + ${primaryColumn.javaField} + '"的数据项?') |
| 299 | try { | 298 | try { |
| 300 | await ${simpleClassName}Api.delete${simpleClassName}(${primaryColumn.javaField}); | 299 | await ${simpleClassName}Api.delete${simpleClassName}(${primaryColumn.javaField}); |
| 301 | - this.getList(); | 300 | + await this.getList(); |
| 302 | this.#[[$modal]]#.msgSuccess("删除成功"); | 301 | this.#[[$modal]]#.msgSuccess("删除成功"); |
| 303 | } catch {} | 302 | } catch {} |
| 304 | }, | 303 | }, |