v2
This commit is contained in:
13
internal/erpserver/templ/component/content.templ
Normal file
13
internal/erpserver/templ/component/content.templ
Normal file
@@ -0,0 +1,13 @@
|
||||
package component
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
templ Content(str string) {
|
||||
trimSpace(str)
|
||||
}
|
||||
|
||||
func trimSpace(str string) string {
|
||||
return strings.TrimSpace(str)
|
||||
}
|
||||
48
internal/erpserver/templ/component/content_templ.go
Normal file
48
internal/erpserver/templ/component/content_templ.go
Normal file
@@ -0,0 +1,48 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.3.898
|
||||
package component
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Content(str string) templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||
return templ_7745c5c3_CtxErr
|
||||
}
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
defer func() {
|
||||
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err == nil {
|
||||
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||||
}
|
||||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "trimSpace(str)")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func trimSpace(str string) string {
|
||||
return strings.TrimSpace(str)
|
||||
}
|
||||
|
||||
var _ = templruntime.GeneratedTemplate
|
||||
25
internal/erpserver/templ/component/time.go
Normal file
25
internal/erpserver/templ/component/time.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package component
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
)
|
||||
|
||||
func YearBegin() templ.Component {
|
||||
dt := time.Now()
|
||||
t := dt.AddDate(0, -int(dt.Month())+1, -dt.Day()+1)
|
||||
return templ.Raw(t.Format("2006-01-02") + " 00:00:00")
|
||||
}
|
||||
|
||||
func MonthBegin() string {
|
||||
dt := time.Now()
|
||||
t := dt.AddDate(0, 0, -dt.Day()+1)
|
||||
return t.Format("2006-01-02") + " 00:00:00"
|
||||
}
|
||||
|
||||
func MonthEnd() string {
|
||||
dt := time.Now()
|
||||
t := dt.AddDate(0, 0, -dt.Day()+1).AddDate(0, 1, -1)
|
||||
return t.Format("2006-01-02") + " 23:59:59"
|
||||
}
|
||||
47
internal/erpserver/templ/component/upload.templ
Normal file
47
internal/erpserver/templ/component/upload.templ
Normal file
@@ -0,0 +1,47 @@
|
||||
package component
|
||||
|
||||
templ Upload(avatar string) {
|
||||
<button type="button" class="layui-btn pear-btn-primary" id="upload_img_btn_logo">
|
||||
<i class="layui-icon layui-icon-upload"></i> 上传
|
||||
</button>
|
||||
<div style="width: 132px;">
|
||||
<div class="layui-upload-list">
|
||||
<i class="btn-remove layui-icon layui-icon-clear" id="upload_img_remove_logo" title="删除"></i>
|
||||
<img class="layui-upload-img" id="upload_img_preview_logo">
|
||||
<input type="hidden" id="upload_img_input_logo" name="File" value={ avatar } />
|
||||
<div id="upload_img_tips_logo"></div>
|
||||
</div>
|
||||
|
||||
<div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="upload_img_progress_logo">
|
||||
<div class="layui-progress-bar" lay-percent=""></div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.layui-upload-list {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.layui-upload-img {
|
||||
display: none;
|
||||
width: 100%;
|
||||
height: 92px;
|
||||
}
|
||||
|
||||
.layui-upload-list:hover .btn-remove {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.layui-upload-list .btn-remove {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: -11px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 24px;
|
||||
color: red;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
53
internal/erpserver/templ/component/upload_templ.go
Normal file
53
internal/erpserver/templ/component/upload_templ.go
Normal file
@@ -0,0 +1,53 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.3.898
|
||||
package component
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
func Upload(avatar string) templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||
return templ_7745c5c3_CtxErr
|
||||
}
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
defer func() {
|
||||
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err == nil {
|
||||
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||||
}
|
||||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<button type=\"button\" class=\"layui-btn pear-btn-primary\" id=\"upload_img_btn_logo\"><i class=\"layui-icon layui-icon-upload\"></i> 上传</button><div style=\"width: 132px;\"><div class=\"layui-upload-list\"><i class=\"btn-remove layui-icon layui-icon-clear\" id=\"upload_img_remove_logo\" title=\"删除\"></i> <img class=\"layui-upload-img\" id=\"upload_img_preview_logo\"> <input type=\"hidden\" id=\"upload_img_input_logo\" name=\"File\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(avatar)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/erpserver/templ/component/upload.templ`, Line: 11, Col: 86}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\"><div id=\"upload_img_tips_logo\"></div></div><div class=\"layui-progress layui-progress-big\" lay-showPercent=\"yes\" lay-filter=\"upload_img_progress_logo\"><div class=\"layui-progress-bar\" lay-percent=\"\"></div></div></div><style>\n .layui-upload-list {\n position: relative;\n cursor: pointer;\n }\n\n .layui-upload-img {\n display: none;\n width: 100%;\n height: 92px;\n }\n\n .layui-upload-list:hover .btn-remove {\n display: inline-block;\n }\n\n .layui-upload-list .btn-remove {\n display: none;\n position: absolute;\n top: -12px;\n right: -11px;\n width: 20px;\n height: 20px;\n font-size: 24px;\n color: red;\n cursor: pointer;\n }\n </style>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
var _ = templruntime.GeneratedTemplate
|
||||
Reference in New Issue
Block a user