作者 若依
提交者 Gitee

!51 优化生成vue文件的vm模板文件

Merge pull request !51 from FungLeo/master
@@ -253,7 +253,7 @@ export default { @@ -253,7 +253,7 @@ export default {
253 queryParams: { 253 queryParams: {
254 #foreach ($column in $columns) 254 #foreach ($column in $columns)
255 #if($column.query) 255 #if($column.query)
256 - $column.javaField: undefined#if($velocityCount != $columns.size()),#end 256 + $column.javaField: null#if($velocityCount != $columns.size()),#end
257 257
258 #end 258 #end
259 #end 259 #end
@@ -349,7 +349,7 @@ export default { @@ -349,7 +349,7 @@ export default {
349 $column.javaField: []#if($velocityCount != $columns.size()),#end 349 $column.javaField: []#if($velocityCount != $columns.size()),#end
350 350
351 #else 351 #else
352 - $column.javaField: undefined#if($velocityCount != $columns.size()),#end 352 + $column.javaField: null#if($velocityCount != $columns.size()),#end
353 353
354 #end 354 #end
355 #end 355 #end
@@ -376,7 +376,7 @@ export default { @@ -376,7 +376,7 @@ export default {
376 handleUpdate(row) { 376 handleUpdate(row) {
377 this.reset(); 377 this.reset();
378 this.getTreeselect(); 378 this.getTreeselect();
379 - if (row != undefined) { 379 + if (row != null) {
380 this.form.${treeParentCode} = row.${treeCode}; 380 this.form.${treeParentCode} = row.${treeCode};
381 } 381 }
382 get${BusinessName}(row.${pkColumn.javaField}).then(response => { 382 get${BusinessName}(row.${pkColumn.javaField}).then(response => {
@@ -391,7 +391,7 @@ export default { @@ -391,7 +391,7 @@ export default {
391 }); 391 });
392 }, 392 },
393 /** 提交按钮 */ 393 /** 提交按钮 */
394 - submitForm: function() { 394 + submitForm() {
395 this.#[[$]]#refs["form"].validate(valid => { 395 this.#[[$]]#refs["form"].validate(valid => {
396 if (valid) { 396 if (valid) {
397 #foreach ($column in $columns) 397 #foreach ($column in $columns)
@@ -399,7 +399,7 @@ export default { @@ -399,7 +399,7 @@ export default {
399 this.form.$column.javaField = this.form.${column.javaField}.join(","); 399 this.form.$column.javaField = this.form.${column.javaField}.join(",");
400 #end 400 #end
401 #end 401 #end
402 - if (this.form.${pkColumn.javaField} != undefined) { 402 + if (this.form.${pkColumn.javaField} != null) {
403 update${BusinessName}(this.form).then(response => { 403 update${BusinessName}(this.form).then(response => {
404 if (response.code === 200) { 404 if (response.code === 200) {
405 this.msgSuccess("修改成功"); 405 this.msgSuccess("修改成功");
@@ -286,7 +286,7 @@ export default { @@ -286,7 +286,7 @@ export default {
286 pageSize: 10, 286 pageSize: 10,
287 #foreach ($column in $columns) 287 #foreach ($column in $columns)
288 #if($column.query) 288 #if($column.query)
289 - $column.javaField: undefined#if($velocityCount != $columns.size()),#end 289 + $column.javaField: null#if($velocityCount != $columns.size()),#end
290 290
291 #end 291 #end
292 #end 292 #end
@@ -363,7 +363,7 @@ export default { @@ -363,7 +363,7 @@ export default {
363 $column.javaField: []#if($velocityCount != $columns.size()),#end 363 $column.javaField: []#if($velocityCount != $columns.size()),#end
364 364
365 #else 365 #else
366 - $column.javaField: undefined#if($velocityCount != $columns.size()),#end 366 + $column.javaField: null#if($velocityCount != $columns.size()),#end
367 367
368 #end 368 #end
369 #end 369 #end
@@ -383,7 +383,7 @@ export default { @@ -383,7 +383,7 @@ export default {
383 // 多选框选中数据 383 // 多选框选中数据
384 handleSelectionChange(selection) { 384 handleSelectionChange(selection) {
385 this.ids = selection.map(item => item.${pkColumn.javaField}) 385 this.ids = selection.map(item => item.${pkColumn.javaField})
386 - this.single = selection.length!=1 386 + this.single = selection.length!==1
387 this.multiple = !selection.length 387 this.multiple = !selection.length
388 }, 388 },
389 /** 新增按钮操作 */ 389 /** 新增按钮操作 */
@@ -408,7 +408,7 @@ export default { @@ -408,7 +408,7 @@ export default {
408 }); 408 });
409 }, 409 },
410 /** 提交按钮 */ 410 /** 提交按钮 */
411 - submitForm: function() { 411 + submitForm() {
412 this.#[[$]]#refs["form"].validate(valid => { 412 this.#[[$]]#refs["form"].validate(valid => {
413 if (valid) { 413 if (valid) {
414 #foreach ($column in $columns) 414 #foreach ($column in $columns)
@@ -416,7 +416,7 @@ export default { @@ -416,7 +416,7 @@ export default {
416 this.form.$column.javaField = this.form.${column.javaField}.join(","); 416 this.form.$column.javaField = this.form.${column.javaField}.join(",");
417 #end 417 #end
418 #end 418 #end
419 - if (this.form.${pkColumn.javaField} != undefined) { 419 + if (this.form.${pkColumn.javaField} != null) {
420 update${BusinessName}(this.form).then(response => { 420 update${BusinessName}(this.form).then(response => {
421 if (response.code === 200) { 421 if (response.code === 200) {
422 this.msgSuccess("修改成功"); 422 this.msgSuccess("修改成功");