fandypeng / excel2config Goto Github PK
View Code? Open in Web Editor NEW使用在线Excel编辑配置数据,支持多人协作,支持一键发布、回退,测试环境和正式环境一键同步。支持导出JSON数据,未来计划支持导出LUA、XML等。
License: Apache License 2.0
使用在线Excel编辑配置数据,支持多人协作,支持一键发布、回退,测试环境和正式环境一键同步。支持导出JSON数据,未来计划支持导出LUA、XML等。
License: Apache License 2.0
查看代码应该是登陆后go session写入成功,但是读取的时候始终读取到了一个空值导致
func (d *dao) UpdateGridValue(ctx context.Context, gridKey string, req *model.UpdateV) (err error) { c := d.mongo.Database(dbname).Collection(gridKey) filter := bson.M{"index": req.I, "celldata": bson.M{"$elemMatch": bson.M{"r": req.R, "c": req.C}}} formatV, err := d.format2Bson(req.V) if err != nil { log.With("err", err).With("v", req.V).Errorln("format2bson error") return } res, err := c.UpdateOne(ctx, filter, bson.D{{"$set", bson.D{{"celldata.$.v", formatV}}}}) if err != nil { log.With("err", err).With("gridKey", gridKey).With("req", req).Errorln("update error") return } if res.ModifiedCount <= 0 { formatCell, err := d.format2Bson(req.Cell) if err != nil { log.With("err", err).With("cell", req.Cell).Errorln("format2bson error") return err } _, err = c.UpdateOne(ctx, bson.M{"index": req.I}, bson.M{"$push": bson.M{"celldata": formatCell}}) } return err }
mongo.go:第171行这个地方 应该以匹配行数是否大于0来判断该sheet是否有这个单元格
现有的逻辑在批量设置格式时(rv操作)部分v值完全没有变化时,res.ModifiedCount就是0了,但matchedCount是1,
这个时候按现有代码逻辑 就会push一条新的数据到celldata中,最终导致celldata中同一个单元格有两个值
您好,我下载了这份代码,似乎您还没有实现完官方案例所提供的功能。
目前我发现了一些问题
1)插入图片,您定义的数据结构似乎有些问题。
model.Sheet.Images字段您定义为“interface{}”类型,这并不准确,并将导致luckysheet无法正确处理图片功能,我认为应该定义为map[string]*Image类型,这与luckysheet所引用的images结构才是一致的。
另外,model.Sheet结构中还有一个与Images类似命名的Image字段,目前我还没发现它的作用是什么?
2)websocket协同方面,您似乎忽略了心跳包类型?当前端发送“rub”消息时go代码将其广播给了所有协同用户,这导致前端json解析时异常。您应该捕获它并消费掉。
控制台报错:network error
Access to XMLHttpRequest at 'http://e2c.fandypeng.com:8000/user/login' from origin 'http://e2c.fandypeng.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.