From 0b29e4e85601e209d0dd34761292e688d2aeabd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wyle=2EGong-=E5=B7=A9=E6=96=87=E6=98=95?= Date: Wed, 23 Apr 2025 11:22:46 +0800 Subject: [PATCH] ui --- vyes-ui | 1 - vyes-ui/LICENSE | 21 +++ vyes-ui/Makefile | 9 + vyes-ui/README.md | 1 + vyes-ui/go.mod | 24 +++ vyes-ui/go.sum | 34 ++++ vyes-ui/init.go | 25 +++ vyes-ui/ui/btn.html | 136 +++++++++++++++ vyes-ui/ui/dialog.html | 58 +++++++ vyes-ui/ui/dropdown.html | 81 +++++++++ vyes-ui/ui/form.html | 46 +++++ vyes-ui/ui/icon.html | 55 ++++++ vyes-ui/ui/input.html | 134 ++++++++++++++ vyes-ui/ui/input/select.html | 119 +++++++++++++ vyes-ui/ui/preview.html | 11 ++ vyes-ui/ui/root.html | 65 +++++++ vyes-ui/ui/table.html | 317 ++++++++++++++++++++++++++++++++++ vyes-ui/ui/table/setting.html | 96 ++++++++++ vyes-ui/ui/tailwind.config.js | 28 +++ vyes-ui/ui/tree.html | 41 +++++ 20 files changed, 1301 insertions(+), 1 deletion(-) delete mode 160000 vyes-ui create mode 100644 vyes-ui/LICENSE create mode 100644 vyes-ui/Makefile create mode 100644 vyes-ui/README.md create mode 100644 vyes-ui/go.mod create mode 100644 vyes-ui/go.sum create mode 100644 vyes-ui/init.go create mode 100644 vyes-ui/ui/btn.html create mode 100644 vyes-ui/ui/dialog.html create mode 100644 vyes-ui/ui/dropdown.html create mode 100644 vyes-ui/ui/form.html create mode 100644 vyes-ui/ui/icon.html create mode 100644 vyes-ui/ui/input.html create mode 100644 vyes-ui/ui/input/select.html create mode 100644 vyes-ui/ui/preview.html create mode 100644 vyes-ui/ui/root.html create mode 100644 vyes-ui/ui/table.html create mode 100644 vyes-ui/ui/table/setting.html create mode 100644 vyes-ui/ui/tailwind.config.js create mode 100644 vyes-ui/ui/tree.html diff --git a/vyes-ui b/vyes-ui deleted file mode 160000 index f1c7ded..0000000 --- a/vyes-ui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f1c7dedc1e6c2bceec011c4da59caa35e104f10f diff --git a/vyes-ui/LICENSE b/vyes-ui/LICENSE new file mode 100644 index 0000000..4ee8cdc --- /dev/null +++ b/vyes-ui/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 veypi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vyes-ui/Makefile b/vyes-ui/Makefile new file mode 100644 index 0000000..bb4473c --- /dev/null +++ b/vyes-ui/Makefile @@ -0,0 +1,9 @@ +# +# Makefile +# Copyright (C) 2024 veypi +# 2025-03-04 14:03:56 +# Distributed under terms of the GPL license. +# + +run: + @go run ./cli/*.go -f ./cfg/dev.yaml diff --git a/vyes-ui/README.md b/vyes-ui/README.md new file mode 100644 index 0000000..42c8d68 --- /dev/null +++ b/vyes-ui/README.md @@ -0,0 +1 @@ +# vyes-ui \ No newline at end of file diff --git a/vyes-ui/go.mod b/vyes-ui/go.mod new file mode 100644 index 0000000..f5f5f8f --- /dev/null +++ b/vyes-ui/go.mod @@ -0,0 +1,24 @@ +module vyesui + +go 1.23.2 + +replace github.com/veypi/OneBD => ../../../OneBD/ + +replace github.com/veypi/utils => ../../../utils/ + +require ( + github.com/google/uuid v1.6.0 + github.com/veypi/OneBD v0.0.0-00010101000000-000000000000 + github.com/veypi/utils v0.3.7 + gorm.io/gorm v1.25.12 +) + +require ( + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/rs/zerolog v1.17.2 // indirect + golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect + golang.org/x/text v0.14.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/vyes-ui/go.sum b/vyes-ui/go.sum new file mode 100644 index 0000000..ec0500a --- /dev/null +++ b/vyes-ui/go.sum @@ -0,0 +1,34 @@ +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.17.2 h1:RMRHFw2+wF7LO0QqtELQwo8hqSmqISyCJeFeAAuWcRo= +github.com/rs/zerolog v1.17.2/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= +gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= diff --git a/vyes-ui/init.go b/vyes-ui/init.go new file mode 100644 index 0000000..5695e57 --- /dev/null +++ b/vyes-ui/init.go @@ -0,0 +1,25 @@ +// +// Copyright (C) 2025 veypi +// 2025-03-04 14:03:56 +// Distributed under terms of the MIT license. +// + +package vyesui + +import ( + "embed" + "github.com/veypi/OneBD/rest" + "github.com/veypi/OneBD/rest/middlewares/vyes" +) + +var Router = rest.NewRouter() + +//go:embed ui/* +var uifs embed.FS + +//go:embed ui/root.html +var rootFile []byte + +func init() { + vyes.WrapUI(Router, uifs) +} diff --git a/vyes-ui/ui/btn.html b/vyes-ui/ui/btn.html new file mode 100644 index 0000000..d164858 --- /dev/null +++ b/vyes-ui/ui/btn.html @@ -0,0 +1,136 @@ + + + + + + ok +
+ + + + diff --git a/vyes-ui/ui/dialog.html b/vyes-ui/ui/dialog.html new file mode 100644 index 0000000..acefbe0 --- /dev/null +++ b/vyes-ui/ui/dialog.html @@ -0,0 +1,58 @@ + + + + + +
+ blank dialog +
+
+ + + + + diff --git a/vyes-ui/ui/dropdown.html b/vyes-ui/ui/dropdown.html new file mode 100644 index 0000000..d7cbea6 --- /dev/null +++ b/vyes-ui/ui/dropdown.html @@ -0,0 +1,81 @@ + + + + + Dropdown Menu + + + + + + + + + diff --git a/vyes-ui/ui/form.html b/vyes-ui/ui/form.html new file mode 100644 index 0000000..2df505f --- /dev/null +++ b/vyes-ui/ui/form.html @@ -0,0 +1,46 @@ + + + + + + +
+
+
+
{{key.label || key.name}}
+
+
+
+
+
+
{{errmsg}}
+
+
Ok
+
+
+ + + + diff --git a/vyes-ui/ui/icon.html b/vyes-ui/ui/icon.html new file mode 100644 index 0000000..557bd19 --- /dev/null +++ b/vyes-ui/ui/icon.html @@ -0,0 +1,55 @@ + + + + + + diff --git a/vyes-ui/ui/input.html b/vyes-ui/ui/input.html new file mode 100644 index 0000000..737003e --- /dev/null +++ b/vyes-ui/ui/input.html @@ -0,0 +1,134 @@ + + + + + + +
+
{{label}}
+ +
+
{{value?'true':'false'}}
+
+ + + +
+
+ + + + + diff --git a/vyes-ui/ui/input/select.html b/vyes-ui/ui/input/select.html new file mode 100644 index 0000000..0fa1f4e --- /dev/null +++ b/vyes-ui/ui/input/select.html @@ -0,0 +1,119 @@ + + + + + + +
+ {{selectLabel()||placeholder||'请选择'}} +
+
🔻
+
+ +
+ Not Found Options +
+
+ {{v.label || v }} +
+
+ + + + + diff --git a/vyes-ui/ui/preview.html b/vyes-ui/ui/preview.html new file mode 100644 index 0000000..fe2ceb3 --- /dev/null +++ b/vyes-ui/ui/preview.html @@ -0,0 +1,11 @@ + + + + +
value
+ + + + diff --git a/vyes-ui/ui/root.html b/vyes-ui/ui/root.html new file mode 100644 index 0000000..92e4dd1 --- /dev/null +++ b/vyes-ui/ui/root.html @@ -0,0 +1,65 @@ + + + + + + VyesUI - 高效前端组件库 + + + +
+
+

欢迎使用 VyesUI

+

一个基于 Vyes 框架构建的高效前端组件库

+
+
+
+

简洁易用

+

遵循 HTML5 规范,提供直观的 API 设计,让开发者快速上手。

+
+
+

响应式设计

+

内置移动端优先的设计理念,确保在各种设备上都能获得良好的用户体验。

+
+
+

灵活定制

+

支持 Tailwind CSS 样式系统,方便开发者根据需求定制样式。

+
+
+

丰富的组件

+

包含多种常用组件,满足不同场景下的开发需求。

+
+
+
+ + diff --git a/vyes-ui/ui/table.html b/vyes-ui/ui/table.html new file mode 100644 index 0000000..256a265 --- /dev/null +++ b/vyes-ui/ui/table.html @@ -0,0 +1,317 @@ + + + + + +
+
+
{{key.label||key.name}}
+
+ +
+
+
+ {{ (key.field?key.field(row):row[key.name]) || ' '}} +
+
+
+
+
+ +
+
+
+ + + +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
{{listOpts.page}}
+
+
总计{{total}}条数据
+
+
+
+
+
+ + +
+ +
智能识别
+
+
+
+ + + + + diff --git a/vyes-ui/ui/table/setting.html b/vyes-ui/ui/table/setting.html new file mode 100644 index 0000000..e50fa55 --- /dev/null +++ b/vyes-ui/ui/table/setting.html @@ -0,0 +1,96 @@ + + + + + + + +

高级检索设置

+ +
+ + +
+ +
+ + + + +
+
+

选择显示字段:

+
+ + {{ field.label || field.name }} + +
+
+ +
+

字段筛选:

+
+
+
+
+
+
+
+ + + + + diff --git a/vyes-ui/ui/tailwind.config.js b/vyes-ui/ui/tailwind.config.js new file mode 100644 index 0000000..16b1323 --- /dev/null +++ b/vyes-ui/ui/tailwind.config.js @@ -0,0 +1,28 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: [ + "./components/**/*.{js,vue,ts}", + "./layouts/**/*.vue", + "./pages/**/*.vue", + "./plugins/**/*.{js,ts}", + "./app.vue", + "./error.vue", + "*.html", + ], + theme: { + extend: { + colors: { + vprimary: '#2196f3', + vsecondary: '#ecc94b', + vaccents: '#ff9800', + verror: '#f44336', + vwaring: '#ff5722', + vinfo: '#ffc107', + vsuccess: '#53de58', + vignore: '#d1d5db', + } + }, + }, + plugins: [], +} + diff --git a/vyes-ui/ui/tree.html b/vyes-ui/ui/tree.html new file mode 100644 index 0000000..7fe5225 --- /dev/null +++ b/vyes-ui/ui/tree.html @@ -0,0 +1,41 @@ + + + + +
+
+
+ + {{row.name}} + +
+
+ +
+ {{row.name}} +
+
+
+
+
+ + + +