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 | 89 | </template> |
| 90 | 90 | |
| 91 | 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 | 93 | #if ($hasImageUploadColumn) |
| 94 | 94 | import ImageUpload from '@/components/ImageUpload'; |
| 95 | 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 | 8 | <div class="app-container"> |
| 9 | 9 | #if ( $subTable.subJoinMany )## 情况一:一对多,table + form |
| 10 | 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 | 18 | <el-table :data="formData" class="-mt-10px"> |
| 19 | 19 | <el-table-column label="序号" type="index" width="100" /> |
| ... | ... | @@ -137,11 +137,11 @@ |
| 137 | 137 | </el-row> |
| 138 | 138 | #else## 情况二:一对一,form |
| 139 | 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 | 146 | #foreach($column in $subColumns) |
| 147 | 147 | #if ($column.createOperation || $column.updateOperation) |
| ... | ... | @@ -221,7 +221,7 @@ |
| 221 | 221 | </template> |
| 222 | 222 | |
| 223 | 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 | 225 | #if ($hasImageUploadColumn) |
| 226 | 226 | import ImageUpload from '@/components/ImageUpload'; |
| 227 | 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 | 61 | </template> |
| 62 | 62 | |
| 63 | 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 | 65 | #if ($table.templateType == 11) |
| 66 | - import ${subSimpleClassName}Form from './${subSimpleClassName}Form.vue' | |
| 66 | + import ${subSimpleClassName}Form from './${subSimpleClassName}Form.vue'; | |
| 67 | 67 | #end |
| 68 | 68 | export default { |
| 69 | 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 | 12 | #if ( $table.templateType == 2 && $column.id == $treeParentColumn.id ) |
| 13 | 13 | <el-form-item label="${comment}" prop="${javaField}"> |
| 14 | 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 | 20 | </el-form-item> |
| 21 | 21 | #elseif ($column.htmlType == "input" && !$column.primaryKey)## 忽略主键,不用在表单里 |
| ... | ... | @@ -107,7 +107,7 @@ |
| 107 | 107 | </template> |
| 108 | 108 | |
| 109 | 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 | 111 | #if ($hasImageUploadColumn) |
| 112 | 112 | import ImageUpload from '@/components/ImageUpload'; |
| 113 | 113 | #end |
| ... | ... | @@ -212,7 +212,7 @@ |
| 212 | 212 | this.title = "新增${table.classComment}"; |
| 213 | 213 | ## 特殊:树表专属逻辑 |
| 214 | 214 | #if ( $table.templateType == 2 ) |
| 215 | - this.get${simpleClassName}Tree(); | |
| 215 | + await this.get${simpleClassName}Tree(); | |
| 216 | 216 | #end |
| 217 | 217 | }, |
| 218 | 218 | /** 提交按钮 */ |
| ... | ... | @@ -263,7 +263,7 @@ |
| 263 | 263 | this.#[[$modal]]#.msgSuccess("新增成功"); |
| 264 | 264 | this.dialogVisible = false; |
| 265 | 265 | this.#[[$]]#emit('success'); |
| 266 | - }finally { | |
| 266 | + } finally { | |
| 267 | 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 | 1 | <template> |
| 2 | 2 | <div class="app-container"> |
| 3 | - | |
| 4 | 3 | <!-- 搜索工作栏 --> |
| 5 | 4 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 6 | 5 | #foreach($column in $columns) |
| ... | ... | @@ -68,24 +67,24 @@ |
| 68 | 67 | ## 特殊:主子表专属逻辑 |
| 69 | 68 | #if ( $table.templateType == 11 && $subTables && $subTables.size() > 0 ) |
| 70 | 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 | 78 | #elseif ( $table.templateType == 2 ) |
| 80 | 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 | 89 | #else |
| 91 | 90 | <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> |
| ... | ... | @@ -183,7 +182,7 @@ import Editor from '@/components/Editor'; |
| 183 | 182 | #if ( $table.templateType != 10 ) |
| 184 | 183 | #if ( $subTables && $subTables.size() > 0 ) |
| 185 | 184 | #foreach ($subSimpleClassName in $subSimpleClassNames) |
| 186 | - import ${subSimpleClassName}List from './components/${subSimpleClassName}List.vue' | |
| 185 | + import ${subSimpleClassName}List from './components/${subSimpleClassName}List.vue'; | |
| 187 | 186 | #end |
| 188 | 187 | #end |
| 189 | 188 | #end |
| ... | ... | @@ -298,7 +297,7 @@ export default { |
| 298 | 297 | await this.#[[$modal]]#.confirm('是否确认删除${table.classComment}编号为"' + ${primaryColumn.javaField} + '"的数据项?') |
| 299 | 298 | try { |
| 300 | 299 | await ${simpleClassName}Api.delete${simpleClassName}(${primaryColumn.javaField}); |
| 301 | - this.getList(); | |
| 300 | + await this.getList(); | |
| 302 | 301 | this.#[[$modal]]#.msgSuccess("删除成功"); |
| 303 | 302 | } catch {} |
| 304 | 303 | }, | ... | ... |