From bd30f3d53a6d858fcf39b57c3f94ab2c3fa69bf2 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Mon, 24 Jan 2022 10:09:41 +0800
Subject: [PATCH] 若依 3.4.0
---
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm | 43 ++++++++++++++++++++++++-------------------
1 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
index 0c57d50..e7687b7 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
+++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
@@ -133,10 +133,20 @@
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
+#elseif($column.list && $column.htmlType == "imageUpload")
+ <el-table-column label="${comment}" align="center" prop="${javaField}" width="100">
+ <template slot-scope="scope">
+ <image-preview :src="scope.row.${javaField}" :width="50" :height="50"/>
+ </template>
+ </el-table-column>
#elseif($column.list && "" != $column.dictType)
<el-table-column label="${comment}" align="center" prop="${javaField}">
<template slot-scope="scope">
+#if($column.htmlType == "checkbox")
+ <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
+#else
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField}"/>
+#end
</template>
</el-table-column>
#elseif($column.list && "" != $javaField)
@@ -191,11 +201,11 @@
</el-form-item>
#elseif($column.htmlType == "imageUpload")
<el-form-item label="${comment}">
- <imageUpload v-model="form.${field}"/>
+ <image-upload v-model="form.${field}"/>
</el-form-item>
#elseif($column.htmlType == "fileUpload")
<el-form-item label="${comment}">
- <fileUpload v-model="form.${field}"/>
+ <file-upload v-model="form.${field}"/>
</el-form-item>
#elseif($column.htmlType == "editor")
<el-form-item label="${comment}">
@@ -360,8 +370,7 @@
pageSize: 10,
#foreach ($column in $columns)
#if($column.query)
- $column.javaField: null#if($velocityCount != $columns.size()),#end
-
+ $column.javaField: null#if($foreach.count != $columns.size()),#end
#end
#end
},
@@ -379,8 +388,7 @@
#end
$column.javaField: [
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select")"change"#else"blur"#end }
- ]#if($velocityCount != $columns.size()),#end
-
+ ]#if($foreach.count != $columns.size()),#end
#end
#end
}
@@ -424,14 +432,11 @@
this.form = {
#foreach ($column in $columns)
#if($column.htmlType == "radio")
- $column.javaField: #if($column.javaType == "Integer" || $column.javaType == "Long")0#else"0"#end#if($velocityCount != $columns.size()),#end
-
+ $column.javaField: #if($column.javaType == "Integer" || $column.javaType == "Long")0#else"0"#end#if($foreach.count != $columns.size()),#end
#elseif($column.htmlType == "checkbox")
- $column.javaField: []#if($velocityCount != $columns.size()),#end
-
+ $column.javaField: []#if($foreach.count != $columns.size()),#end
#else
- $column.javaField: null#if($velocityCount != $columns.size()),#end
-
+ $column.javaField: null#if($foreach.count != $columns.size()),#end
#end
#end
};
@@ -500,13 +505,13 @@
#end
if (this.form.${pkColumn.javaField} != null) {
update${BusinessName}(this.form).then(response => {
- this.$modal.msgSuccess("修改成功");
+ this.#[[$modal]]#.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
add${BusinessName}(this.form).then(response => {
- this.$modal.msgSuccess("新增成功");
+ this.#[[$modal]]#.msgSuccess("新增成功");
this.open = false;
this.getList();
});
@@ -517,11 +522,11 @@
/** 删除按钮操作 */
handleDelete(row) {
const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids;
- this.$modal.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
+ this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
return del${BusinessName}(${pkColumn.javaField}s);
}).then(() => {
this.getList();
- this.$modal.msgSuccess("删除成功");
+ this.#[[$modal]]#.msgSuccess("删除成功");
}).catch(() => {});
},
#if($table.sub)
@@ -543,7 +548,7 @@
/** ${subTable.functionName}删除按钮操作 */
handleDelete${subClassName}() {
if (this.checked${subClassName}.length == 0) {
- this.msgError("请先选择要删除的${subTable.functionName}数据");
+ this.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
} else {
const ${subclassName}List = this.${subclassName}List;
const checked${subClassName} = this.checked${subClassName};
@@ -561,8 +566,8 @@
handleExport() {
this.download('${moduleName}/${businessName}/export', {
...this.queryParams
- }, `${moduleName}_${businessName}.xlsx`)
+ }, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
}
}
};
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.9.3