feat: 档口入库码支持软删除与重导恢复 (#238)

This commit is contained in:
chengma
2026-08-15 10:49:28 +08:00
parent 4cbdc81a30
commit 2aea22b44d
13 changed files with 515 additions and 26 deletions
+9 -3
View File
@@ -29,16 +29,20 @@ func TestInnerCodeTemplate_独立导航与安全表单(t *testing.T) {
page := string(raw)
for _, want := range []string{
`action="/inner-codes/import"`, `action="/inner-codes/match"`,
`action="/inner-codes/apply"`, `action="/inner-codes/recheck"`,
`action="/inner-codes/apply"`, `action="/inner-codes/recheck"`, `action="/inner-codes/delete"`,
`name="csrf_token"`, `data-check-all`, `data-inner-code-apply-open`,
`data-need-checked="inner-code-match"`, `data-inner-code-id="{{.ID}}"`,
`inner-code-match{{end}}{{if .CanApply}} inner-code-apply`,
`{{if not .CanMatch}}disabled{{end}}`, `匹配已选`, `aria-label="档口入库码记录列表"`,
`data-need-checked="inner-code-delete"`, `data-confirm-delete-action="inner-code-delete"`,
`inner-code-delete {{if .CanMatch}}inner-code-match{{end}}{{if .CanApply}} inner-code-apply`,
`删除不会撤销顺运宝已写入的快递单号`, `匹配已选`, `aria-label="档口入库码记录列表"`,
} {
if !strings.Contains(page, want) {
t.Errorf("正式页面缺少 %s", want)
}
}
if strings.Contains(page, `{{if not .CanMatch}}disabled{{end}}`) {
t.Fatal("所有状态都应允许勾选删除,不能再按 CanMatch 禁用复选框")
}
}
func TestInnerCodeTemplate_模块状态白名单已登记(t *testing.T) {
@@ -52,6 +56,8 @@ func TestInnerCodeTemplate_模块状态白名单已登记(t *testing.T) {
for _, want := range []string{
`appendSelectedIDs(matchForm, "inner-code-match")`,
`appendSelectedIDs(applyForm, "inner-code-apply")`,
`appendSelectedIDs(deleteForm, "inner-code-delete")`,
`checkedCount(action)`,
`field.name = "ids"`,
} {
if !strings.Contains(string(raw), want) {