项目管理与任务管理-关联关系
【1-项目管理】列名称 | 列类型 | 关联【任务管理】数据库字段 |
---|---|---|
相关任务 | 关联列 | 主键 |
进度汇总 | 汇总列 | 状态 |
进度汇总 | 模板列 | -- |
进度汇总-模板列-代码
···
.action{$total := 0} .action{$ok := 0} .action{if empty .相关任务} .action{"0%"} .action{else} .action{/* 获取任务值 */} .action{range $index, $value := .相关任务} .action{$total = add $total 1} .action{end} .action{/* 获取已完成个数 */} .action{range $index, $value := .进度汇总} .action{if eq $value "已完成"} .action{$ok = add $ok 1} .action{end} .action{end} .action{$ok_100:= mul $ok 100} .action{$result:= div $ok_100 $total } .action{$result} <span style="background-color: rgba(175,184,193,0.2); width: 100%; display: inline-block;height: 12px;border-radius: 6px;align-self: center;overflow: hidden;"> <span style="text-align: right; font-size: 12px; width: .action{$result}%; background-color: rgb(45,164,78); display: inline-block;height: inherit;vertical-align: top;"></span> </span> .action{end}
参考文档
- 数据库模板列简单使用指南 - 链滴
- 模板列代码分享【新】 - 链滴
- 数据库模板代码分享 - intelion 的回帖 - 链滴
- 求一个数据库模板列代码! - 链滴
- 数据库模板列进度条来啦! - 链滴
- 数据库“模板列”无法读取“汇总列”和“关联列”的值 - 88250 的回帖 - 链滴
- 模板片段
- template package - text/template - Go Packages
- Sprig Function Documentation | sprig
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于