Browse Source

文件修改,添加使用文档

huangyan 1 year ago
parent
commit
9b425bea66

+ 6 - 7
backend/app/controller/file.go

@@ -149,17 +149,16 @@ func GetTemplate(c *gin.Context) {
 // DeleteTemplate 删除模板
 func DeleteTemplate(c *gin.Context) {
 	name := c.Query("name")
-	uuid := c.Query("uuid")
-	if uuid == "" {
-		e2.ResponseWithMsg(c, e2.ERROR, "uuid错误")
-		return
-	}
+	//uuid := c.Query("uuid")
+	//if uuid == "" {
+	//	e2.ResponseWithMsg(c, e2.ERROR, "uuid错误")
+	//	return
+	//}
 	if name == "" {
 		e2.ResponseWithMsg(c, e2.ERROR, "参数错误")
 		return
 	}
-	one, err := global.MongoCon.DeleteOne(context.Background(), bson.M{"name": name, "uuid": uuid})
-	//err := global.Rdb.Del(context.Background(), name).Err()
+	one, err := global.MongoCon.DeleteOne(context.Background(), bson.M{"name": name})
 	if err != nil {
 		simple_zap.WithCtx(context.Background()).Sugar().Warn(err, "删除文件失败")
 		e2.ResponseWithMsg(c, e2.ERROR, "删除文件失败")

+ 3 - 2
backend/app/router.go

@@ -1,9 +1,9 @@
 package app
 
 import (
-	"file_upload/backend"
 	"file_upload/backend/app/controller"
 	"file_upload/backend/app/middlewares"
+	"file_upload/backend/app/router"
 	"file_upload/backend/global"
 	"github.com/gin-contrib/static"
 	"github.com/gin-gonic/gin"
@@ -18,11 +18,12 @@ func InitRouter() error {
 	//配置前端静态资源目录
 	engine.StaticFile("/", "./frontend/dist/index.html")
 	engine.Static("/assets", "./frontend/dist/assets")
+	engine.Static("/libs", "./frontend/dist/libs")
 	engine.StaticFile("/favicon.ico", "./frontend/dist/favicon.ico")
 	engine.Use(static.Serve("/download", static.LocalFile(global.DownloadSetting.Path, true)))
 	engine.GET("/CAD/download", controller.GetImage)
 	gin.SetMode(global.ServerSetting.Mode)
-	backend.FileInitRouter(engine)
+	router.FileInitRouter(engine)
 	//group := engine.Group("/api")
 	//group.Use(middleware.Cors())
 	//group.DELETE("/template", controller.DeleteTemplate)

+ 1 - 1
backend/router.go → backend/app/router/router.go

@@ -1,4 +1,4 @@
-package backend
+package router
 
 import (
 	"file_upload/backend/app/controller"

+ 1 - 1
backend/configs/config.yaml

@@ -42,7 +42,7 @@ nats:
   NatsServer_Url: "nats://127.0.0.0:4222"
 mongo:
     url: "mongodb://bzd_file:X7EeS6Yja5tGfXBR@116.204.6.184:27017/bzd_file"
-    password: "123456"
+    password: ""
     db: 0
 download:
   # 存储路径

+ 48 - 0
宝智达在线CAD画图使用文档.md

@@ -0,0 +1,48 @@
+首页画板处可以直接画图![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713837243323-b547ef6a-aa24-4375-8d40-8f4c72edd234.png#averageHue=%23fefefe&clientId=ue6b29804-a6e2-4&from=paste&height=716&id=uf50b78e6&originHeight=895&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=56625&status=done&style=none&taskId=u084767e1-aa66-4ca1-a2d3-b74ab4c0a7b&title=&width=1536)
+## 上方功能区
+根据上方功能选区可以直接画出下面的图形
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713837375489-6504b5aa-3ba9-487a-82d1-016acfed5baa.png#averageHue=%23fdfcfc&clientId=ue6b29804-a6e2-4&from=paste&height=715&id=u8d3a4f3e&originHeight=894&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=139052&status=done&style=none&taskId=u3effc25e-25a2-42fe-943d-aea8adbe3ff&title=&width=1536)
+当功能区为‘选择’可以按住鼠标右键选中图片,这时旁边会出现功能区可以做相应选择
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713837453513-42f31862-63cc-4004-b49a-47a972decf0d.png#averageHue=%23fdfbfb&clientId=ue6b29804-a6e2-4&from=paste&height=720&id=uef70b449&originHeight=900&originWidth=1916&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=166814&status=done&style=none&taskId=u5b2fc980-a99f-4383-b852-397fa09aded&title=&width=1532.8)
+## 下方功能区
+### 放大回退
+下方功能区可以选择放大缩小图片,以及回退操作
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713837644298-584be1af-f9ef-465d-8a11-b30ba553b647.png#averageHue=%23fdfafa&clientId=ue6b29804-a6e2-4&from=paste&height=717&id=u1592c8db&originHeight=896&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=155680&status=done&style=none&taskId=ue77952f9-5311-4b34-9adf-3ccb633caaf&title=&width=1536)
+### 回滚至中心
+点击回滚至中心按钮可以直接把画板移到中心位置
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713837703351-3a8a20ac-a9c2-4365-bb8d-8acad0ee082e.png#averageHue=%23fdfcfc&clientId=ue6b29804-a6e2-4&from=paste&height=720&id=u98bdbcbc&originHeight=900&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=167160&status=done&style=none&taskId=u57251946-cf65-4331-b1be-63fc89f1fb4&title=&width=1536)
+### 更改背景
+点击可以更改背景颜色
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713837783038-20ee69ec-7e1e-498f-acff-b8f9d5ea99d1.png#averageHue=%23e8f9eb&clientId=ue6b29804-a6e2-4&from=paste&height=720&id=ue205984c&originHeight=900&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=185446&status=done&style=none&taskId=u0a407520-a037-47a6-950f-4f3b393eda1&title=&width=1536)
+### 橡皮擦
+橡皮擦可以直接删除某一个图形
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713837877606-586a6002-bae5-4fbc-af1d-b875af5380e1.png#averageHue=%23fdfcfc&clientId=ue6b29804-a6e2-4&from=paste&height=718&id=u217ff2b0&originHeight=897&originWidth=1916&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=147146&status=done&style=none&taskId=uc1293b89-d2ce-42da-8b65-1454f3729c5&title=&width=1532.8)
+### 显示网格
+点击显示网格之后如果使用自由画笔功能会根据网格进行画图
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838055703-f1b1e786-96e8-4ac2-a24d-e037bb0501a4.png#averageHue=%23fcfcfc&clientId=ue6b29804-a6e2-4&from=paste&height=714&id=ufecf5e03&originHeight=892&originWidth=1917&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=155557&status=done&style=none&taskId=uf9d9dfe2-efbe-42e5-bf65-7392ea4627e&title=&width=1533.6)
+### 只读模式
+在只读模式中不可以编辑画板,只能查看
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838146999-fb1e413b-5329-4915-adc9-deff121d5c50.png#averageHue=%23fcfbfb&clientId=ue6b29804-a6e2-4&from=paste&height=708&id=u47e1f3ae&originHeight=885&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=156375&status=done&style=none&taskId=u06f173c9-bf19-459a-b81b-d656b429d6a&title=&width=1536)
+### 清空
+直接清空画板所有图形
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838204357-c2806fc8-6e72-4078-8f16-12b27e09c60c.png#averageHue=%23fefefe&clientId=ue6b29804-a6e2-4&from=paste&height=727&id=u05918e44&originHeight=909&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=101635&status=done&style=none&taskId=u85af6738-1e4d-418a-88d2-1ff6bfb5ae4&title=&width=1536)
+### 导入json文件
+可以把导出的json文件再次导入到画板中进行显示
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838297174-17dad906-8b7f-443e-81b8-7461e201e77f.png#averageHue=%23fefefe&clientId=ue6b29804-a6e2-4&from=paste&height=715&id=u0377d47f&originHeight=894&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=65362&status=done&style=none&taskId=ub51003a8-c2ef-451f-9068-d4ac77e9cf7&title=&width=1536)
+### 保存为模板
+点击保存模板按钮,出现弹窗输入模板名后出现成功提示则代表保存成功
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838417382-cd249897-00b2-41ad-975f-b5287ede3652.png#averageHue=%238d8d8d&clientId=ue6b29804-a6e2-4&from=paste&height=711&id=u80c5c596&originHeight=889&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=145016&status=done&style=none&taskId=u64d30022-9084-4192-8c60-6501338f485&title=&width=1536)
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838509738-9fd16f6f-279c-49fd-99ec-a8614605ac81.png#averageHue=%23fdfdfd&clientId=ue6b29804-a6e2-4&from=paste&height=720&id=uee6efa7a&originHeight=900&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=148036&status=done&style=none&taskId=ua659e7b8-f61a-44dd-bfcb-dd30e7855ce&title=&width=1536)
+### 模板列表
+模板列表功能会出现成功提示和已保存的模板信息。当点击图片时会把模板信息再次导入到画板中
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838551588-8d061acd-cb90-4250-aea6-62c4a0624f94.png#averageHue=%23a7a5a5&clientId=ue6b29804-a6e2-4&from=paste&height=709&id=u406dfe6f&originHeight=886&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=155292&status=done&style=none&taskId=ue8688259-3700-4494-af77-0c549f17958&title=&width=1536)
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838650329-9710474f-732d-45c1-a2fe-fc392ca6b03d.png#averageHue=%23fcfcfc&clientId=ue6b29804-a6e2-4&from=paste&height=714&id=u94ae0f9c&originHeight=892&originWidth=1907&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=194503&status=done&style=none&taskId=uc380ae07-34c9-45ed-8711-035a1a15711&title=&width=1525.6)
+### 保存
+点击保存按钮会直接保存当前画板
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838679895-54d9dd61-f674-4322-b207-ce874a9382f6.png#averageHue=%23fcfbfb&clientId=ue6b29804-a6e2-4&from=paste&height=720&id=ua24e6e57&originHeight=900&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=207593&status=done&style=none&taskId=u58a94af6-4006-407b-bac0-3cf6b566e63&title=&width=1536)
+### 导出
+点击导出按钮时会出现相应功能实现导出图片和json文件。
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838727808-02b8fa23-c810-4cc9-94ff-79d6df4abaca.png#averageHue=%23fcfbfb&clientId=ue6b29804-a6e2-4&from=paste&height=723&id=u0a89d93f&originHeight=904&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=215959&status=done&style=none&taskId=ue96c4fc7-342f-4914-9438-d5e5e19f1cb&title=&width=1536)
+### 帮助
+帮助按钮会显示快捷键提示
+![image.png](https://cdn.nlark.com/yuque/0/2024/png/35884699/1713838812760-162dd545-7ea1-4759-a34c-f9aaf53cadbf.png#averageHue=%23a4a4a4&clientId=ue6b29804-a6e2-4&from=paste&height=696&id=u76d3cab1&originHeight=870&originWidth=1920&originalType=binary&ratio=1.25&rotation=0&showTitle=false&size=180361&status=done&style=none&taskId=ufc56fa19-a8cc-4ec1-9b53-ee4fa038ec8&title=&width=1536)