现象:
数据库的模板列结果包含了很多空行,请问有啥办法去除结果的空行吗?或者能在别的模板列里面能去除换行和空格也可以的。
数据库模板的代码在下方,请各位大佬帮忙看看,谢谢
数据库的样式:
模板代码:
.action{$today := (now | date "2006-01-02")}
.action{$this_year := (now | date "2006")}
.action{$this_month := (now | date "2006-01")}
.action{$item := .事项}
.action{/*年初年末*/}
.action{$this_year_fir := toDate "2006-01-02" ( nospace (cat $this_year "-01-01")) | date "2006-01-02"}
.action{$this_year_end := toDate "2006-01-02" ( nospace (cat $this_year "-12-31")) | date "2006-01-02"}
.action{/*月初月末, 月末需完善*/}
.action{$this_month_fir := toDate "2006-01-02" ( nospace (cat $this_month "-01")) | date "2006-01-02"}
.action{$this_month_end := (toDate "2006-01-02" $this_month_fir).AddDate 0 1 -1 | date "2006-01-02"}
.action{/*周一周末*/}
.action{$weekday_num := (now | Weekday)}
.action{$this_monday := (toDate "2006-01-02" $today) | dateModify (nospace (cat (mul (sub 1 $weekday_num) 24) "h")) | date "2006-01-02" }
.action{$this_sunday := (toDate "2006-01-02" $this_monday) | dateModify "+144h" | date "2006-01-02"}
.action{if eq $item "本年"}
.action{(trimAll "\r \n" $this_year_fir)}
.action{else if eq $item "本月"}
.action{$this_month_fir}
.action{else if eq $item "本周"}
.action{$this_monday}
.action{else}
.action{$today}
.action{end}
结果截图: