update gojs
This commit is contained in:
parent
b1f71df331
commit
ea9fd2a6c1
8
Excel.go
8
Excel.go
@ -5,6 +5,8 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"apigo.cc/gojs"
|
||||||
|
"apigo.cc/gojs/goja"
|
||||||
"github.com/ssgo/u"
|
"github.com/ssgo/u"
|
||||||
"github.com/xuri/excelize/v2"
|
"github.com/xuri/excelize/v2"
|
||||||
)
|
)
|
||||||
@ -15,7 +17,8 @@ type Excel struct {
|
|||||||
excel *excelize.File
|
excel *excelize.File
|
||||||
}
|
}
|
||||||
|
|
||||||
func OpenExcel(filename string, password *string) (*Excel, error) {
|
func OpenExcel(filename string, password *string, vm *goja.Runtime) (*Excel, error) {
|
||||||
|
filename = gojs.FixPath(vm, filename)
|
||||||
xls := &Excel{
|
xls := &Excel{
|
||||||
filename: filename,
|
filename: filename,
|
||||||
password: u.String(password),
|
password: u.String(password),
|
||||||
@ -31,8 +34,9 @@ func OpenExcel(filename string, password *string) (*Excel, error) {
|
|||||||
return xls, err
|
return xls, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (xls *Excel) Save(filename, password *string) error {
|
func (xls *Excel) Save(filename, password *string, vm *goja.Runtime) error {
|
||||||
if filename != nil {
|
if filename != nil {
|
||||||
|
*filename = gojs.FixPath(vm, *filename)
|
||||||
xls.filename = *filename
|
xls.filename = *filename
|
||||||
}
|
}
|
||||||
if password != nil {
|
if password != nil {
|
||||||
|
|||||||
38
go.mod
38
go.mod
@ -1,32 +1,32 @@
|
|||||||
module apigo.cc/gojs/office
|
module apigo.cc/gojs/office
|
||||||
|
|
||||||
go 1.18
|
go 1.24.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
apigo.cc/gojs v0.0.8
|
apigo.cc/gojs v0.0.28
|
||||||
apigo.cc/gojs/console v0.0.2
|
apigo.cc/gojs/console v0.0.3
|
||||||
apigo.cc/gojs/file v0.0.3
|
apigo.cc/gojs/file v0.0.6
|
||||||
github.com/ssgo/u v1.7.13
|
github.com/ssgo/u v1.7.23
|
||||||
github.com/xuri/excelize/v2 v2.9.0
|
github.com/xuri/excelize/v2 v2.10.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/dlclark/regexp2 v1.11.4 // indirect
|
github.com/dlclark/regexp2 v1.11.5 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.8.0 // indirect
|
github.com/fsnotify/fsnotify v1.9.0 // indirect
|
||||||
github.com/go-sourcemap/sourcemap v2.1.4+incompatible // indirect
|
github.com/go-sourcemap/sourcemap v2.1.4+incompatible // indirect
|
||||||
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
|
github.com/google/pprof v0.0.0-20250903194437-c28834ac2320 // indirect
|
||||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
|
||||||
github.com/richardlehane/mscfb v1.0.4 // indirect
|
github.com/richardlehane/mscfb v1.0.4 // indirect
|
||||||
github.com/richardlehane/msoleps v1.0.4 // indirect
|
github.com/richardlehane/msoleps v1.0.4 // indirect
|
||||||
github.com/ssgo/config v1.7.9 // indirect
|
github.com/ssgo/config v1.7.10 // indirect
|
||||||
github.com/ssgo/log v1.7.7 // indirect
|
github.com/ssgo/log v1.7.9 // indirect
|
||||||
github.com/ssgo/standard v1.7.7 // indirect
|
github.com/ssgo/standard v1.7.7 // indirect
|
||||||
github.com/ssgo/tool v0.4.27 // indirect
|
github.com/ssgo/tool v0.4.29 // indirect
|
||||||
github.com/xuri/efp v0.0.0-20241211021726-c4e992084aa6 // indirect
|
github.com/tiendc/go-deepcopy v1.7.1 // indirect
|
||||||
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect
|
github.com/xuri/efp v0.0.1 // indirect
|
||||||
golang.org/x/crypto v0.31.0 // indirect
|
github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9 // indirect
|
||||||
golang.org/x/net v0.32.0 // indirect
|
golang.org/x/crypto v0.44.0 // indirect
|
||||||
golang.org/x/sys v0.28.0 // indirect
|
golang.org/x/net v0.47.0 // indirect
|
||||||
golang.org/x/text v0.21.0 // indirect
|
golang.org/x/sys v0.38.0 // indirect
|
||||||
|
golang.org/x/text v0.31.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user