Commit c1d1ace36dc537109538777fef510573a609a137

Authored by fungleo
1 parent 6e7d7aba

优化index.vue.vm模板,!=1修改为严格不等;undefined修改为null

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>
... ...