From c169ec18cd40833e4f6cd570fd03f8c0d4d9696d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com>
Date: Tue, 7 Dec 2021 22:41:49 +0800
Subject: [PATCH 01/19] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E7=94=9F=E6=88=90=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ZR.CodeGenerator/CodeGenerateTemplate.cs | 4 +-
ZR.Vue/src/components/UploadImage/index.vue | 62 ++++++++++++---------
2 files changed, 37 insertions(+), 29 deletions(-)
diff --git a/ZR.CodeGenerator/CodeGenerateTemplate.cs b/ZR.CodeGenerator/CodeGenerateTemplate.cs
index 1a4a511..8c0cd4e 100644
--- a/ZR.CodeGenerator/CodeGenerateTemplate.cs
+++ b/ZR.CodeGenerator/CodeGenerateTemplate.cs
@@ -105,7 +105,7 @@ namespace ZR.CodeGenerator
//图片
sb.AppendLine(" ");
sb.AppendLine($" ");
- sb.AppendLine($@" ");
+ sb.AppendLine($@" ");
sb.AppendLine(" ");
sb.AppendLine(" ");
}
@@ -160,7 +160,7 @@ namespace ZR.CodeGenerator
sb.AppendLine(" ");
sb.AppendLine($" ");
sb.AppendLine($" ");
- sb.AppendLine($" ");
+ sb.AppendLine($" ");
sb.AppendLine(" ");
sb.AppendLine(" ");
sb.AppendLine(" ");
diff --git a/ZR.Vue/src/components/UploadImage/index.vue b/ZR.Vue/src/components/UploadImage/index.vue
index 9b41c19..a397ab0 100644
--- a/ZR.Vue/src/components/UploadImage/index.vue
+++ b/ZR.Vue/src/components/UploadImage/index.vue
@@ -12,7 +12,27 @@
import { getToken } from "@/utils/auth";
export default {
- name: "UploadImage",
+ props: {
+ value: [String],
+ column: [String],
+ // 上传地址
+ uploadUrl: {
+ type: String,
+ default: "/Common/UploadFile",
+ },
+ // 文件类型, 例如['png', 'jpg', 'jpeg']
+ fileType: {
+ type: Array,
+ default: () => ["png", "jpg", "jpeg", "webp"],
+ },
+ // 大小限制(MB)
+ fileSize: {
+ type: Number,
+ default: 5,
+ },
+ //显示手动输入地址
+ showInput: false,
+ },
data() {
return {
uploadImgUrl: process.env.VUE_APP_BASE_API + this.uploadUrl, // 上传的图片服务器地址
@@ -22,40 +42,29 @@ export default {
imageUrl: "",
};
},
- props: {
- icon: {
- type: String,
+ watch: {
+ //监听 v-model 的值
+ value: {
+ immediate: true,
+ deep: true,
+ handler: function (val) {
+ if (val) {
+ this.imageUrl = val;
+ } else {
+ this.imageUrl = "";
+ }
+ },
},
- // 当前form 列名
- column: { type: String },
- // 上传地址
- uploadUrl: {
- type: String,
- default: "Common/UploadFile",
- },
- // 文件类型, 例如['png', 'jpg', 'jpeg']
- fileType: {
- type: Array,
- default: () => ["png", "jpg", "jpeg"],
- },
- // 大小限制(MB)
- fileSize: {
- type: Number,
- default: 5,
- },
- },
- mounted() {
- this.imageUrl = this.icon;
},
methods: {
handleUploadSuccess(res) {
- this.$emit(`handleUploadSuccess`, res, this.column);
+ this.$emit(`input`, res, this.column);
this.imageUrl = res.data;
this.loading.close();
},
// 上传前loading加载
handleBeforeUpload(file) {
- console.log(file)
+ console.log(file);
let isImg = false;
if (this.fileType.length) {
let fileExtension = "";
@@ -98,7 +107,6 @@ export default {
this.loading.close();
},
},
- watch: {},
};
From ca9fadaef6d1fcbe6c5dc2a7051ab9ad1247577e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com>
Date: Wed, 8 Dec 2021 13:31:31 +0800
Subject: [PATCH 02/19] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E7=94=9F=E6=88=90=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ZR.Admin.WebApi/ZR.Admin.WebApi.csproj | 1 -
ZR.Admin.WebApi/appsettings.json | 8 ++--
.../wwwroot/CodeGenTemplate/TplVue.txt | 41 +++++++++++--------
ZR.CodeGenerator/CodeGenerateTemplate.cs | 40 +++++++++---------
ZR.CodeGenerator/CodeGeneratorTool.cs | 2 +-
ZR.Vue/src/views/tool/gen/editTable.vue | 4 +-
6 files changed, 52 insertions(+), 44 deletions(-)
diff --git a/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj b/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj
index 0b71c00..cbd8d09 100644
--- a/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj
+++ b/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj
@@ -67,7 +67,6 @@
-
diff --git a/ZR.Admin.WebApi/appsettings.json b/ZR.Admin.WebApi/appsettings.json
index bd00d8f..84d5bda 100644
--- a/ZR.Admin.WebApi/appsettings.json
+++ b/ZR.Admin.WebApi/appsettings.json
@@ -18,10 +18,10 @@
"cors": "http://localhost:8887" //ַǰĿ","
},
"JwtSettings": {
- "Issuer": "https://localhost:8888",
- "Audience": "https://localhost:8888",
- "SecretKey": "Hello-key-ZRADMIN.NET-20210101",
- "Expire": 5
+ "Issuer": "ZRAdmin.NET",
+ "Audience": "ZRAdmin.NET",
+ "SecretKey": "SecretKey-ZRADMIN.NET-20210101",
+ "Expire": 30
},
"DemoMode": false, //Ƿʾģʽ
"DbKey": "", //ݿkey
diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt
index 8f42fec..2606a9c 100644
--- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt
+++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt
@@ -38,9 +38,7 @@ ${VueViewListContent}
编辑
-
- 删除
-
+ 删除
@@ -50,7 +48,7 @@ ${VueViewListContent}
- ${VueViewFormContent}
+${VueViewFormContent}