Commit 5be8d46d055807d3f614c657c391ee5ea046254c

Authored by 若依
Committed by Gitee
2 parents cbf4795f ca657b04

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

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