分享 提示詞

本帖最後由 epcsub 於 2026-8-22 23:44 編輯
  1. ## picklistgv: enhance
  2. ### current behavior
  3. - base/forms/picklistgv.py
  4. - it creates a floating picklist
  5. - user in a `gridview` -> F1 trigger at specific `trigger field` (a different field triggers a different picklist) -> collect `picklist items` -> create the picklist form -> user select an item -> feed a `specific value` to the original `gridview`
  6. - trigger field / picklist items / where to feed all controlled by `picklistgv.yaml`
  7.   - build2.$trigger_field.0 = sql to collect picklist items
  8.   - build2.$trigger_field.1.column = the picklist presented in how many columns; how-many atomic items per row
  9.   - build2.$trigger_field.1.width = the picklist window width
  10.   - build2.$trigger_field.1.list = how an atomic element is composed in picklist
  11.   - build2.$trigger_field.1.feed = how the picked item should be feed
  12. ```yaml
  13. // sample picklistgv.yaml
  14. build2:
  15.   cod:
  16.     - select cod,des from accod order by cod
  17.     - column: 3
  18.       width: 550
  19.       list: [cod, des]
  20.       feed: [cod, des]
  21. ```
  22. ### enhance
  23. - issue: it happens often the collected picklist items are overwhelmingly large
  24. - extend picklistgv to support `multi-step` selection
  25.   - collect `group` / `category` names -> user pick a `group`/`category` -> collect items of that `group`/`category` -> user pick `item` -> feed
  26. - `build2.$trigger_field` allows an arbitrary no. of collecting sql's, `build2.$trigger_field.0`, `build2.$trigger_field.1`, etc
  27. - look for the meta in `build2.$trigger_field.-1`
  28. ```yaml
  29. build2:
  30.   cod:
  31.     - select distinct grp from accod order by grp
  32.     - select cod,des from accod where grp='{grp}' order by cod
  33.     - column: 3
  34.       width: 550
  35.       list: [cod, des]
  36.       feed: [cod, des]
  37. ```
  38. ### note
  39. - if you need an additional module, do not install, ask, I will plug it for you
複製代碼