odant-work 1.0.62 → 1.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/#system/package-manifest.json +138 -105
- package/$server/$folder/$class/$structure/handlers/pages/form/gantt/$handler/class.js +27 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/gantt/$handler/gantt.js +293 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/scheduler/$handler/class.js +27 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/scheduler/$handler/scheduler.js +234 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/staff/$handler/staff.js +119 -0
- package/$server/$folder/lib/explorer/explorer.js +29 -0
- package/MODULES/Geo/$module/readme.md +6 -4
- package/MODULES/Geo//320/223/320/265/320/276/321/202/320/276/321/207/320/272/320/270/$catalog/class.js +9 -3
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/class.js +10 -0
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/class.js +21 -0
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/map.js +623 -0
- package/MODULES/Geo//320/232/320/276/320/276/321/200/320/264/320/270/320/275/320/260/321/202/321/213/$struct/class.js +1 -0
- package/MODULES/Geo//320/250/320/265/320/271/320/277/$struct/class.js +17 -0
- package/MODULES/KLADR/$module/$folder/$class/$catalog/class.js +9 -0
- package/MODULES/KLADR/$module/class.js +4 -0
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/class.js +7 -0
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/kladr.js +134 -0
- package/MODULES/KLADR/$module/readme.md +10 -0
- package/MODULES/KLADR//320/235/320/260/321/201/320/265/320/273/321/221/320/275/320/275/321/213/320/265 /320/277/321/203/320/275/320/272/321/202/321/213/$catalog/class.js" +14 -0
- package/MODULES/KLADR//320/237/320/276/320/264/321/200/320/260/320/267/320/264/320/265/320/273/320/265/320/275/320/270/321/217 /320/234/320/222/320/224/$catalog/class.js" +13 -0
- package/MODULES/KLADR//320/240/320/265/320/263/320/270/320/276/320/275/321/213/$catalog/class.js +14 -0
- package/MODULES/KLADR//320/243/320/273/320/270/321/206/321/213/$catalog/class.js +13 -0
- package/MODULES/Process/$module/$folder/$class/$catalog/class.js +4 -0
- package/MODULES/Process/$module/class.js +4 -0
- package/MODULES/Process/$module/readme.md +7 -0
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/class.js" +29 -0
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/class.js" +7 -0
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/gantt.js" +1 -0
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/class.js" +7 -0
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/scheduler.js" +1 -0
- package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/class.js" +18 -0
- package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/bpmn.js" +406 -0
- package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/class.js" +19 -0
- package/MODULES/Register/$module/readme.md +3 -3
- package/MODULES/Register/CATALOGS/$catalog/class.js +1 -6
- package/MODULES/Register/CATALOGS/$catalog/readme.md +1 -1
- package/MODULES/Register/CATALOGS//320/222/320/270/320/264/321/213 /320/275/320/276/321/200/320/274/320/260/321/202/320/270/320/262/320/276/320/262/$catalog/class.js" +11 -4
- package/MODULES/Register/CATALOGS//320/224/320/276/320/263/320/276/320/262/320/276/321/200/321/213/$catalog/class.js +21 -19
- package/MODULES/Register/CATALOGS//320/224/320/276/320/273/320/266/320/275/320/276/321/201/321/202/320/270/$catalog/class.js +1 -1
- package/MODULES/Register/CATALOGS//320/232/320/273/320/270/320/265/320/275/321/202/321/213/$virtual/class.js +11 -10
- package/MODULES/Register/CATALOGS//320/235/320/276/320/274/320/265/320/275/320/272/320/273/320/260/321/202/321/203/321/200/320/260/$catalog/class.js +24 -13
- package/MODULES/Register/CATALOGS//320/237/320/260/321/200/321/202/320/270/320/270/$catalog/class.js +13 -13
- package/MODULES/Register/CATALOGS//320/237/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/320/270/$virtual/class.js +9 -8
- package/MODULES/Register/CATALOGS//320/241/320/272/320/273/320/260/320/264/321/213/$catalog/class.js +17 -0
- package/MODULES/Register/CATALOGS//320/241/320/276/321/202/321/200/321/203/320/264/320/275/320/270/320/272/320/270/$virtual/class.js +11 -9
- package/MODULES/Register/CATALOGS//320/241/320/276/321/202/321/200/321/203/320/264/320/275/320/270/320/272/320/270//320/222 /320/276/321/202/320/277/321/203/321/201/320/272/320/265/$virtual/class.js" +1 -1
- package/MODULES/Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213/$catalog/class.js +13 -11
- package/MODULES/Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213//320/230/320/237/$catalog/class.js +4 -6
- package/MODULES/Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213//320/244/320/270/320/267. /320/273/320/270/321/206/320/260/$catalog/class.js" +12 -11
- package/MODULES/Register/CATALOGS//320/241/321/203/320/261/321/212/320/265/320/272/321/202/321/213//320/256/321/200. /320/273/320/270/321/206/320/260/$catalog/class.js" +15 -14
- package/MODULES/Register/CATALOGS//320/242/321/200/320/260/320/275/321/201/320/277/320/276/321/200/321/202/$catalog/class.js +19 -18
- package/MODULES/Register/OPERATIONS/$operation/class.js +1 -1
- package/MODULES/Register/OPERATIONS/$operation/readme.md +1 -1
- package/MODULES/Register/OPERATIONS//320/224/320/276/321/201/321/202/320/260/320/262/320/272/320/260/$operation/class.js +22 -21
- package/MODULES/Register/OPERATIONS//320/227/320/260/321/200/320/277/320/273/320/260/321/202/320/260/$operation/class.js +48 -47
- package/MODULES/Register/OPERATIONS//320/230/320/275/320/262/320/265/320/275/321/202/320/260/321/200/320/270/320/267/320/260/321/206/320/270/321/217/$operation/class.js +46 -45
- package/MODULES/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213/$operation/class.js +1 -1
- package/MODULES/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213//320/236/321/202/320/277/321/200/320/260/320/262/320/270/321/202/321/214 /320/262 /320/276/321/202/320/277/321/203/321/201/320/272/$operation/class.js" +1 -1
- package/MODULES/Register/OPERATIONS//320/232/320/260/320/264/321/200/321/213//320/237/321/200/320/270/321/221/320/274 /320/275/320/260 /321/200/320/260/320/261/320/276/321/202/321/203/$operation/class.js" +18 -14
- package/MODULES/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260/$operation/class.js +1 -1
- package/MODULES/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260//320/220/320/262/320/260/320/275/321/201/320/276/320/262/321/213/320/271 /320/276/321/202/321/207/321/221/321/202/$operation/class.js" +1 -1
- package/MODULES/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260//320/237/320/232/320/236/$operation/class.js +3 -3
- package/MODULES/Register/OPERATIONS//320/232/320/260/321/201/321/201/320/260//320/240/320/232/320/236/$operation/class.js +1 -1
- package/MODULES/Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270/$operation/class.js +1 -1
- package/MODULES/Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270//320/227/320/262/320/276/320/275/320/276/320/272/$operation/class.js +2 -2
- package/MODULES/Register/OPERATIONS//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270//320/237/320/270/321/201/321/214/320/274/320/276/$operation/class.js +1 -1
- package/MODULES/Register/OPERATIONS//320/{244/320/260/321/201/320/276/320/262/320/272/320/260 → 232/320/276/320/274/320/277/320/273/320/265/320/272/321/202/320/260/321/206/320/270/321/217}/$operation/class.js +52 -57
- package/MODULES/Register/OPERATIONS//320/236/321/201/320/275/320/276/320/262/320/275/321/213/320/265 /321/201/321/200/320/265/320/264/321/201/321/202/320/262/320/260//320/235/320/260/321/207/320/270/321/201/320/273/320/265/320/275/320/270/320/265 /320/260/320/274/320/276/321/200/321/202/320/270/320/267/320/260/321/206/320/270/320/270/$operation/class.js" +2 -2
- package/MODULES/Register/OPERATIONS//320/236/321/201/320/275/320/276/320/262/320/275/321/213/320/265 /321/201/321/200/320/265/320/264/321/201/321/202/320/262/320/260//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/320/265 /320/236/320/241/$operation/class.js" +7 -6
- package/MODULES/Register/OPERATIONS//320/236/321/201/320/275/320/276/320/262/320/275/321/213/320/265 /321/201/321/200/320/265/320/264/321/201/321/202/320/262/320/260//320/237/321/200/320/270/320/275/321/217/321/202/320/270/320/265 /320/272 /321/203/321/207/321/221/321/202/321/203 /320/236/320/241/$operation/class.js" +2 -2
- package/MODULES/Register/OPERATIONS//320/237/320/265/321/200/320/265/320/274/320/265/321/211/320/265/320/275/320/270/320/265/$operation/class.js +41 -40
- package/MODULES/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260/$operation/class.js" +1 -1
- package/MODULES/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260//320/227/320/260/321/200/320/277/320/273/320/260/321/202/320/260/$operation/class.js" +1 -1
- package/MODULES/Register/OPERATIONS//320/237/320/273/320/260/321/202/320/265/320/266/320/270 /321/201 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/320/276/320/263/320/276 /321/201/321/207/321/221/321/202/320/260//320/237/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/321/203/$operation/class.js" +11 -10
- package/MODULES/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/320/265 /321/202/320/276/320/262/320/260/321/200/320/260/$operation/class.js" +45 -46
- package/MODULES/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202/$operation/class.js" +1 -1
- package/MODULES/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202//320/222/320/276/320/267/320/262/321/200/320/260/321/202 /320/276/321/202 /320/277/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/320/260/$operation/class.js" +11 -10
- package/MODULES/Register/OPERATIONS//320/237/320/276/321/201/321/202/321/203/320/277/320/273/320/265/320/275/320/270/321/217 /320/275/320/260 /321/200/320/260/321/201/321/207/321/221/321/202/320/275/321/213/320/271 /321/201/321/207/321/221/321/202//320/236/321/202 /320/277/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/217/$operation/class.js" +11 -10
- package/MODULES/Register/OPERATIONS//320/237/321/200/320/276/320/270/320/267/320/262/320/276/320/264/321/201/321/202/320/262/320/276//320/222/321/213/320/277/321/203/321/201/320/272 /320/263/320/276/321/202/320/276/320/262/320/276/320/271 /320/277/321/200/320/276/320/264/321/203/320/272/321/206/320/270/320/270/$operation/class.js" +4 -4
- package/MODULES/Register/OPERATIONS//320/237/321/200/320/276/320/270/320/267/320/262/320/276/320/264/321/201/321/202/320/262/320/276//320/237/320/265/321/200/320/265/320/264/320/260/321/207/320/260 /320/274/320/260/321/202/320/265/321/200/320/270/320/260/320/273/320/276/320/262 /320/262 /320/277/321/200/320/276/320/270/320/267/320/262/320/276/320/264/321/201/321/202/320/262/320/276/$operation/class.js" +5 -4
- package/MODULES/Register/OPERATIONS//320/237/321/200/320/276/320/270/320/267/320/262/320/276/320/264/321/201/321/202/320/262/320/276//320/241/320/277/320/270/321/201/320/260/320/275/320/270/320/265 /320/276/320/261/321/211/320/265/321/205/320/276/320/267/321/217/320/271/321/201/321/202/320/262/320/265/320/275/320/275/321/213/321/205 /320/267/320/260/321/202/321/200/320/260/321/202/$operation/class.js" +6 -6
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217/$operation/class.js +26 -25
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/222/320/276/320/267/320/262/321/200/320/260/321/202 /320/276/321/202 /320/277/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/217/$operation/class.js" +32 -31
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/class.js +32 -31
- package/MODULES/Register/OPERATIONS//320/241/320/277/320/270/321/201/320/260/320/275/320/270/320/265 /320/242/320/234/320/246/$operation/class.js" +28 -0
- package/MODULES/Register/OPERATIONS//320/243/321/201/321/202/320/260/320/275/320/276/320/262/320/272/320/260 /320/275/320/276/321/200/320/274/320/260/321/202/320/270/320/262/320/260/$operation/class.js" +3 -3
- package/MODULES/Register/OPERATIONS//320/244/320/270/320/275/320/260/320/275/321/201/320/276/320/262/321/213/320/271 /321/200/320/265/320/267/321/203/320/273/321/214/321/202/320/260/321/202//320/227/320/260/320/272/321/200/321/213/321/202/320/270/320/265 /320/274/320/265/321/201/321/217/321/206/320/260/$operation/class.js" +1 -1
- package/MODULES/Register/REGISTER/$register/$folder/$class/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/$register/$folder/$class/$account/readme.md +1 -1
- package/MODULES/Register/REGISTER/$register/readme.md +1 -1
- package/MODULES/Register/REGISTER/01/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/02/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/04/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/08/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/10/$account/class.js +23 -1
- package/MODULES/Register/REGISTER/10/01/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/10/05/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/41/$account/class.js +25 -24
- package/MODULES/Register/REGISTER/43/$account/class.js +2 -2
- package/MODULES/Register/REGISTER/44/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/60/$account/class.js +24 -15
- package/MODULES/Register/REGISTER/62/$account/class.js +24 -15
- package/MODULES/Register/REGISTER/67/$account/class.js +1 -0
- package/MODULES/Register/REGISTER/70/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/71/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/73/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/76/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/90/01/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/90/02/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/90/03/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/91/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/94/$account/class.js +24 -23
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213/$account/class.js +1 -1
- package/MODULES/Register/REGISTER//320/232/320/276/320/274/320/274/321/203/320/275/320/270/320/272/320/260/321/206/320/270/320/270/$account/class.js +1 -1
- package/MODULES/Register/REGISTER//320/235/320/276/321/200/320/274/320/260/321/202/320/270/320/262/321/213/$account/class.js +2 -2
- package/MODULES/Register/STRUCTS//320/220/320/264/321/200/320/265/321/201/$struct/class.js +14 -11
- package/MODULES/Register/STRUCTS//320/225/320/264/320/270/320/275/320/270/321/206/320/260 /320/270/320/267/320/274/320/265/321/200/320/265/320/275/320/270/321/217/$struct/class.js" +11 -11
- package/MODULES/Register/STRUCTS//320/237/320/260/321/201/320/277/320/276/321/200/321/202/$struct/class.js +14 -11
- package/MODULES/Register/STRUCTS//320/244/320/230/320/236/$struct/class.js +16 -0
- package/package.json +1 -1
- package/scripts/check-ignored-code.mjs +1 -1
- package/scripts/demo-seed.mjs +7 -5
- package/sources/client.js +6 -1
- package/sources/data/fio.js +355 -0
- package/sources/data/objects.js +11 -1
- package/sources/data/print.js +29 -3
- package/sources/data/schema.js +15 -4
- package/sources/host/auth-methods.js +34 -2
- package/sources/modules/kladr/index.js +336 -0
- package/sources/modules/user-profile/user-profile.js +40 -2
- package/sources/server/access/gateway.js +6 -0
- package/sources/server/access/invites.js +416 -0
- package/sources/server/class/base-template.js +94 -61
- package/sources/server/class.js +22 -0
- package/sources/server/folder.js +72 -6
- package/$server/$folder/$class/ai/progress.md +0 -33
- package/$server/$folder/$file/$task/progress.md +0 -20
- package/$server/$folder/handlers/methods/create/progress.md +0 -15
- package/$server/$folder/lib/dot/progress.md +0 -15
- package/$server/$folder/lib/menu/progress.md +0 -13
- package/$server/$folder/lib/node/progress.md +0 -13
- package/$server/$folder/lib/prompt-bar/progress.md +0 -13
- package/$server/$folder/lib/tree/progress.md +0 -16
- package/.cursor/rules/work.mdc +0 -8
- package/.cursorrules +0 -2
- package/MODULES/Register/CATALOGS//320/241/320/272/320/273/320/260/320/264/321/213 /320/270 /321/200/320/265/320/267/320/265/321/200/320/262/321/203/320/260/321/200/321/213/$catalog/class.js" +0 -17
- package/MODULES/Register/OPERATIONS//320/225/321/201/321/202/320/265/321/201/321/202/320/262/320/265/320/275/320/275/320/260/321/217 /321/203/320/261/321/213/320/273/321/214/$operation/class.js" +0 -21
- package/NODES/teewtew/$node/class.js +0 -3
- package/NODES/work.odant.org/$node/class.js +0 -4
- package/config.json +0 -1
- package/eslint.config.js +0 -51
- package/jsconfig.json +0 -37
- package/oda/components/packets/progress.md +0 -29
- package/oda/progress.md +0 -29
- package/opencode.json +0 -9
- package/progress.md +0 -13
- package/publish.cmd +0 -2
- package/sources/data/progress.md +0 -792
- package/sources/host/progress.md +0 -14
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Визуальный BPMN 2.0 редактор и запускатель процессов (form/bpmn) для /MODULES/Process/Схемы процессов.
|
|
3
|
+
*/
|
|
4
|
+
const DEFAULT_DIAGRAM = () => ({
|
|
5
|
+
nodes: [
|
|
6
|
+
{ id: 'n_start', kind: 'start', label: 'Старт', x: 70, y: 150, role: '', days: 0 },
|
|
7
|
+
{ id: 'n_task1', kind: 'task', label: 'Согласование заявки', x: 240, y: 150, role: 'Руководитель', days: 2 },
|
|
8
|
+
{ id: 'n_gw1', kind: 'gateway', label: 'Одобрено?', x: 440, y: 150, role: '', days: 0 },
|
|
9
|
+
{ id: 'n_task2', kind: 'task', label: 'Исполнение', x: 630, y: 150, role: 'Исполнитель', days: 3 },
|
|
10
|
+
{ id: 'n_end', kind: 'end', label: 'Завершение', x: 810, y: 150, role: '', days: 0 },
|
|
11
|
+
],
|
|
12
|
+
edges: [
|
|
13
|
+
{ id: 'e1', from: 'n_start', to: 'n_task1', label: '' },
|
|
14
|
+
{ id: 'e2', from: 'n_task1', to: 'n_gw1', label: '' },
|
|
15
|
+
{ id: 'e3', from: 'n_gw1', to: 'n_task2', label: 'Да' },
|
|
16
|
+
{ id: 'e4', from: 'n_task2', to: 'n_end', label: '' },
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
function parseDiagram(raw) {
|
|
21
|
+
if (!raw || typeof raw !== 'string')
|
|
22
|
+
return DEFAULT_DIAGRAM();
|
|
23
|
+
try {
|
|
24
|
+
const parsed = JSON.parse(raw);
|
|
25
|
+
if (Array.isArray(parsed?.nodes) && Array.isArray(parsed?.edges))
|
|
26
|
+
return parsed;
|
|
27
|
+
}
|
|
28
|
+
catch { /* ignore */ }
|
|
29
|
+
return DEFAULT_DIAGRAM();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
imports: 'oda//button, oda//icon',
|
|
34
|
+
template: /* html */`
|
|
35
|
+
<style>
|
|
36
|
+
:host {
|
|
37
|
+
@apply --vertical;
|
|
38
|
+
@apply --flex;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
background: var(--content-background);
|
|
41
|
+
color: var(--content-color);
|
|
42
|
+
font-size: 13px;
|
|
43
|
+
}
|
|
44
|
+
.toolbar {
|
|
45
|
+
@apply --horizontal;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: 8px;
|
|
48
|
+
padding: 8px 12px;
|
|
49
|
+
border-bottom: 1px solid var(--subtle-border);
|
|
50
|
+
background: var(--subtle-background);
|
|
51
|
+
flex-wrap: wrap;
|
|
52
|
+
}
|
|
53
|
+
.main {
|
|
54
|
+
@apply --horizontal;
|
|
55
|
+
@apply --flex;
|
|
56
|
+
min-height: 0;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
}
|
|
59
|
+
.sidebar {
|
|
60
|
+
width: 260px;
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
border-right: 1px solid var(--subtle-border);
|
|
63
|
+
@apply --vertical;
|
|
64
|
+
overflow-y: auto;
|
|
65
|
+
padding: 8px;
|
|
66
|
+
gap: 6px;
|
|
67
|
+
}
|
|
68
|
+
.proc-item {
|
|
69
|
+
padding: 8px 10px;
|
|
70
|
+
border-radius: 8px;
|
|
71
|
+
border: 1px solid transparent;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
}
|
|
74
|
+
.proc-item:hover { background: var(--subtle-background); }
|
|
75
|
+
.proc-item.active {
|
|
76
|
+
border-color: var(--accent-color, #1d63dc);
|
|
77
|
+
background: var(--accent-soft, rgba(29,99,220,0.1));
|
|
78
|
+
}
|
|
79
|
+
.canvas-wrap {
|
|
80
|
+
@apply --flex;
|
|
81
|
+
position: relative;
|
|
82
|
+
overflow: auto;
|
|
83
|
+
background: radial-gradient(circle, rgba(148,163,184,0.22) 1px, transparent 1px);
|
|
84
|
+
background-size: 20px 20px;
|
|
85
|
+
}
|
|
86
|
+
svg.bpmn-svg {
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
min-width: 960px;
|
|
90
|
+
min-height: 460px;
|
|
91
|
+
user-select: none;
|
|
92
|
+
}
|
|
93
|
+
.node-group { cursor: move; }
|
|
94
|
+
.prop-panel {
|
|
95
|
+
width: 250px;
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
border-left: 1px solid var(--subtle-border);
|
|
98
|
+
padding: 12px;
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
gap: 10px;
|
|
102
|
+
background: var(--subtle-background);
|
|
103
|
+
}
|
|
104
|
+
.prop-panel input, .prop-panel select {
|
|
105
|
+
width: 100%;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
padding: 5px 8px;
|
|
108
|
+
border: 1px solid var(--control-border-color);
|
|
109
|
+
border-radius: 6px;
|
|
110
|
+
background: var(--control-background);
|
|
111
|
+
color: var(--control-color);
|
|
112
|
+
font: inherit;
|
|
113
|
+
}
|
|
114
|
+
.status-msg { font-size: 12.5px; color: #15803d; font-weight: 600; }
|
|
115
|
+
</style>
|
|
116
|
+
|
|
117
|
+
<div class="toolbar">
|
|
118
|
+
<select :value="selectedProcId" @change="selectProcess($event.target.value)" style="padding:5px 8px;border-radius:6px;border:1px solid var(--control-border-color);background:var(--control-background);color:var(--control-color);">
|
|
119
|
+
<option ~for="processes" :value="$for.item.id">{{$for.item.title || $for.item.id}}</option>
|
|
120
|
+
</select>
|
|
121
|
+
<oda-button icon="icons:add" @tap="addNode('task')">+ Задача</oda-button>
|
|
122
|
+
<oda-button icon="icons:call-split" @tap="addNode('gateway')">+ Шлюз</oda-button>
|
|
123
|
+
<oda-button icon="icons:play-arrow" @tap="addNode('start')">+ Старт</oda-button>
|
|
124
|
+
<oda-button icon="icons:stop" @tap="addNode('end')">+ Финал</oda-button>
|
|
125
|
+
<oda-button icon="icons:trending-flat" :light="Boolean(connectFromId)" @tap="toggleConnectMode()">
|
|
126
|
+
{{connectFromId ? 'Выберите целевой узел…' : 'Связать узлы'}}
|
|
127
|
+
</oda-button>
|
|
128
|
+
<div class="horizontal" style="margin-left:auto;gap:8px;align-items:center;">
|
|
129
|
+
<span ~if="statusMsg" class="status-msg">{{statusMsg}}</span>
|
|
130
|
+
<oda-button icon="icons:play-circle-filled" @tap="launchProcess()">Запустить процесс</oda-button>
|
|
131
|
+
<oda-button icon="icons:save" :disabled="!changed || busy" @tap="save()">Сохранить схему</oda-button>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<div class="main">
|
|
136
|
+
<div class="sidebar">
|
|
137
|
+
<div style="font-weight:700;padding:4px 6px;">Процессы ({{processes.length}})</div>
|
|
138
|
+
<div ~for="processes" class="proc-item" ~class="{active: selectedProcId === $for.item.id}" @tap="selectProcess($for.item.id)">
|
|
139
|
+
<div style="font-weight:600;">{{$for.item.title || $for.item.id}}</div>
|
|
140
|
+
<div style="font-size:11.5px;color:var(--muted-color);">{{$for.item.body?.status || 'Черновик'}} · {{$for.item.body?.owner_role || 'без роли'}}</div>
|
|
141
|
+
</div>
|
|
142
|
+
<oda-button icon="icons:add" @tap="createProcess()">+ Новый процесс</oda-button>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<div class="canvas-wrap">
|
|
146
|
+
<svg class="bpmn-svg" @pointermove="onSvgMove" @pointerup="onSvgUp">
|
|
147
|
+
<defs>
|
|
148
|
+
<marker id="bpmnArrow" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
|
149
|
+
<polygon points="0 0, 10 3.5, 0 7" fill="#475569"></polygon>
|
|
150
|
+
</marker>
|
|
151
|
+
</defs>
|
|
152
|
+
|
|
153
|
+
<g ~for="renderedEdges">
|
|
154
|
+
<line :x1="$for.item.x1" :y1="$for.item.y1" :x2="$for.item.x2" :y2="$for.item.y2"
|
|
155
|
+
stroke="#475569" stroke-width="2" marker-end="url(#bpmnArrow)" style="cursor:pointer;"
|
|
156
|
+
@dblclick="removeEdge($for.item.id)"></line>
|
|
157
|
+
<text ~if="$for.item.label" :x="$for.item.mx" :y="$for.item.my - 6" text-anchor="middle" fill="#1e293b" font-size="11" font-weight="600">{{$for.item.label}}</text>
|
|
158
|
+
</g>
|
|
159
|
+
|
|
160
|
+
<g ~for="diagram.nodes" class="node-group"
|
|
161
|
+
@pointerdown="onNodeDown($event, $for.item)" @tap.stop="onNodeTap($for.item)">
|
|
162
|
+
<circle ~if="$for.item.kind === 'start'" :cx="$for.item.x" :cy="$for.item.y" r="22"
|
|
163
|
+
fill="#dcfce7" :stroke="selectedNodeId === $for.item.id ? '#1d63dc' : '#16a34a'" stroke-width="3"></circle>
|
|
164
|
+
<circle ~if="$for.item.kind === 'end'" :cx="$for.item.x" :cy="$for.item.y" r="22"
|
|
165
|
+
fill="#fee2e2" :stroke="selectedNodeId === $for.item.id ? '#1d63dc' : '#dc2626'" stroke-width="5"></circle>
|
|
166
|
+
<polygon ~if="$for.item.kind === 'gateway'"
|
|
167
|
+
:points="($for.item.x) + ',' + ($for.item.y - 26) + ' ' + ($for.item.x + 26) + ',' + ($for.item.y) + ' ' + ($for.item.x) + ',' + ($for.item.y + 26) + ' ' + ($for.item.x - 26) + ',' + ($for.item.y)"
|
|
168
|
+
fill="#fef3c7" :stroke="selectedNodeId === $for.item.id ? '#1d63dc' : '#d97706'" stroke-width="2.5"></polygon>
|
|
169
|
+
<rect ~if="$for.item.kind === 'task'"
|
|
170
|
+
:x="$for.item.x - 72" :y="$for.item.y - 30" width="144" height="60" rx="10"
|
|
171
|
+
fill="#eff6ff" :stroke="selectedNodeId === $for.item.id ? '#1d63dc' : '#3b82f6'" stroke-width="2.5"></rect>
|
|
172
|
+
|
|
173
|
+
<text :x="$for.item.x" :y="$for.item.kind === 'task' ? $for.item.y - 4 : $for.item.y + 42"
|
|
174
|
+
text-anchor="middle" fill="#0f172a" font-size="12" font-weight="600">{{$for.item.label}}</text>
|
|
175
|
+
<text ~if="$for.item.kind === 'task' && ($for.item.role || $for.item.days)"
|
|
176
|
+
:x="$for.item.x" :y="$for.item.y + 15" text-anchor="middle" fill="#475569" font-size="10.5">
|
|
177
|
+
{{$for.item.role || 'Исполнитель'}} · {{$for.item.days || 1}} дн.
|
|
178
|
+
</text>
|
|
179
|
+
</g>
|
|
180
|
+
</svg>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div class="prop-panel" ~if="selectedNode">
|
|
184
|
+
<div style="font-weight:700;">Свойства узла</div>
|
|
185
|
+
<label>Название
|
|
186
|
+
<input type="text" :value="selectedNode.label" @input="updateSelectedNode('label', $event.target.value)">
|
|
187
|
+
</label>
|
|
188
|
+
<label ~if="selectedNode.kind === 'task'">Роль / Исполнитель
|
|
189
|
+
<input type="text" :value="selectedNode.role || ''" @input="updateSelectedNode('role', $event.target.value)">
|
|
190
|
+
</label>
|
|
191
|
+
<label ~if="selectedNode.kind === 'task'">Длительность (дней)
|
|
192
|
+
<input type="number" min="1" :value="selectedNode.days || 1" @input="updateSelectedNode('days', Number($event.target.value) || 1)">
|
|
193
|
+
</label>
|
|
194
|
+
<oda-button icon="icons:delete" @tap="removeSelectedNode()">Удалить узел</oda-button>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
`,
|
|
198
|
+
processes: [],
|
|
199
|
+
selectedProcId: '',
|
|
200
|
+
diagram: DEFAULT_DIAGRAM(),
|
|
201
|
+
selectedNodeId: '',
|
|
202
|
+
connectFromId: '',
|
|
203
|
+
changed: false,
|
|
204
|
+
busy: false,
|
|
205
|
+
statusMsg: '',
|
|
206
|
+
_drag: null,
|
|
207
|
+
get isViewChanged() {
|
|
208
|
+
return Boolean(this.changed);
|
|
209
|
+
},
|
|
210
|
+
get selectedProc() {
|
|
211
|
+
return (this.processes || []).find(p => p.id === this.selectedProcId) || null;
|
|
212
|
+
},
|
|
213
|
+
get selectedNode() {
|
|
214
|
+
return (this.diagram?.nodes || []).find(n => n.id === this.selectedNodeId) || null;
|
|
215
|
+
},
|
|
216
|
+
get renderedEdges() {
|
|
217
|
+
const byId = new Map((this.diagram?.nodes || []).map(n => [n.id, n]));
|
|
218
|
+
const out = [];
|
|
219
|
+
for (const e of this.diagram?.edges || []) {
|
|
220
|
+
const a = byId.get(e.from);
|
|
221
|
+
const b = byId.get(e.to);
|
|
222
|
+
if (!a || !b)
|
|
223
|
+
continue;
|
|
224
|
+
const dx = b.x - a.x;
|
|
225
|
+
const dy = b.y - a.y;
|
|
226
|
+
const len = Math.hypot(dx, dy) || 1;
|
|
227
|
+
const padA = a.kind === 'task' ? 72 : 24;
|
|
228
|
+
const padB = b.kind === 'task' ? 72 : 26;
|
|
229
|
+
const x1 = Math.round(a.x + (dx / len) * Math.min(padA, len / 2));
|
|
230
|
+
const y1 = Math.round(a.y + (dy / len) * Math.min(padA, len / 2));
|
|
231
|
+
const x2 = Math.round(b.x - (dx / len) * Math.min(padB, len / 2));
|
|
232
|
+
const y2 = Math.round(b.y - (dy / len) * Math.min(padB, len / 2));
|
|
233
|
+
out.push({ id: e.id, x1, y1, x2, y2, mx: Math.round((x1 + x2) / 2), my: Math.round((y1 + y2) / 2), label: e.label || '' });
|
|
234
|
+
}
|
|
235
|
+
return out;
|
|
236
|
+
},
|
|
237
|
+
attached() {
|
|
238
|
+
this.reload();
|
|
239
|
+
},
|
|
240
|
+
async reload() {
|
|
241
|
+
if (!this.$item?.fetch)
|
|
242
|
+
return;
|
|
243
|
+
const res = await this.$item.fetch('db_query', { limit: 200 }).catch(() => null);
|
|
244
|
+
this.processes = Array.isArray(res?.items) ? res.items : [];
|
|
245
|
+
if (this.processes.length && !this.selectedProc) {
|
|
246
|
+
this.selectProcess(this.processes[0].id);
|
|
247
|
+
}
|
|
248
|
+
else if (this.selectedProc) {
|
|
249
|
+
this.diagram = parseDiagram(this.selectedProc.body?.bpmn_xml);
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
selectProcess(id) {
|
|
253
|
+
this.selectedProcId = id;
|
|
254
|
+
const proc = this.selectedProc;
|
|
255
|
+
this.diagram = parseDiagram(proc?.body?.bpmn_xml);
|
|
256
|
+
this.selectedNodeId = '';
|
|
257
|
+
this.connectFromId = '';
|
|
258
|
+
this.changed = false;
|
|
259
|
+
this.statusMsg = '';
|
|
260
|
+
},
|
|
261
|
+
async createProcess() {
|
|
262
|
+
const name = window.prompt?.('Название нового бизнес-процесса:', 'Новый процесс');
|
|
263
|
+
if (!name || !name.trim())
|
|
264
|
+
return;
|
|
265
|
+
const created = await this.$item.fetch('db_create', {}, {
|
|
266
|
+
body: { name: name.trim(), status: 'Черновик', bpmn_xml: JSON.stringify(DEFAULT_DIAGRAM()) },
|
|
267
|
+
});
|
|
268
|
+
await this.reload();
|
|
269
|
+
if (created?.id)
|
|
270
|
+
this.selectProcess(created.id);
|
|
271
|
+
},
|
|
272
|
+
addNode(kind) {
|
|
273
|
+
const idx = (this.diagram.nodes || []).length + 1;
|
|
274
|
+
const labels = { start: 'Старт', end: 'Финал', gateway: 'Условие', task: `Шаг ${idx}` };
|
|
275
|
+
const id = `n_${Date.now().toString(36)}_${idx}`;
|
|
276
|
+
const node = { id, kind, label: labels[kind] || 'Узел', x: 140 + (idx * 65) % 620, y: 120 + (idx * 45) % 220, role: 'Исполнитель', days: 1 };
|
|
277
|
+
this.diagram = { ...this.diagram, nodes: [...this.diagram.nodes, node] };
|
|
278
|
+
this.selectedNodeId = id;
|
|
279
|
+
this.changed = true;
|
|
280
|
+
},
|
|
281
|
+
toggleConnectMode() {
|
|
282
|
+
this.connectFromId = this.connectFromId ? '' : (this.selectedNodeId || '__pick__');
|
|
283
|
+
},
|
|
284
|
+
onNodeTap(node) {
|
|
285
|
+
if (!node)
|
|
286
|
+
return;
|
|
287
|
+
if (this.connectFromId) {
|
|
288
|
+
if (this.connectFromId === '__pick__') {
|
|
289
|
+
this.connectFromId = node.id;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (this.connectFromId !== node.id) {
|
|
293
|
+
const exists = (this.diagram.edges || []).some(e => e.from === this.connectFromId && e.to === node.id);
|
|
294
|
+
if (!exists) {
|
|
295
|
+
const edge = { id: 'e_' + Date.now().toString(36), from: this.connectFromId, to: node.id, label: '' };
|
|
296
|
+
this.diagram = { ...this.diagram, edges: [...this.diagram.edges, edge] };
|
|
297
|
+
this.changed = true;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
this.connectFromId = '';
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
this.selectedNodeId = node.id;
|
|
304
|
+
},
|
|
305
|
+
onNodeDown(e, node) {
|
|
306
|
+
this.selectedNodeId = node.id;
|
|
307
|
+
this._drag = { id: node.id, startX: e.clientX, startY: e.clientY, ox: node.x, oy: node.y };
|
|
308
|
+
},
|
|
309
|
+
onSvgMove(e) {
|
|
310
|
+
if (!this._drag)
|
|
311
|
+
return;
|
|
312
|
+
const nx = Math.max(40, Math.round(this._drag.ox + (e.clientX - this._drag.startX)));
|
|
313
|
+
const ny = Math.max(40, Math.round(this._drag.oy + (e.clientY - this._drag.startY)));
|
|
314
|
+
this.diagram = {
|
|
315
|
+
...this.diagram,
|
|
316
|
+
nodes: this.diagram.nodes.map(n => n.id === this._drag.id ? { ...n, x: nx, y: ny } : n),
|
|
317
|
+
};
|
|
318
|
+
this.changed = true;
|
|
319
|
+
},
|
|
320
|
+
onSvgUp() {
|
|
321
|
+
this._drag = null;
|
|
322
|
+
},
|
|
323
|
+
updateSelectedNode(key, val) {
|
|
324
|
+
if (!this.selectedNodeId)
|
|
325
|
+
return;
|
|
326
|
+
this.diagram = {
|
|
327
|
+
...this.diagram,
|
|
328
|
+
nodes: this.diagram.nodes.map(n => n.id === this.selectedNodeId ? { ...n, [key]: val } : n),
|
|
329
|
+
};
|
|
330
|
+
this.changed = true;
|
|
331
|
+
},
|
|
332
|
+
removeSelectedNode() {
|
|
333
|
+
if (!this.selectedNodeId)
|
|
334
|
+
return;
|
|
335
|
+
const id = this.selectedNodeId;
|
|
336
|
+
this.diagram = {
|
|
337
|
+
nodes: this.diagram.nodes.filter(n => n.id !== id),
|
|
338
|
+
edges: this.diagram.edges.filter(e => e.from !== id && e.to !== id),
|
|
339
|
+
};
|
|
340
|
+
this.selectedNodeId = '';
|
|
341
|
+
this.changed = true;
|
|
342
|
+
},
|
|
343
|
+
removeEdge(edgeId) {
|
|
344
|
+
this.diagram = { ...this.diagram, edges: this.diagram.edges.filter(e => e.id !== edgeId) };
|
|
345
|
+
this.changed = true;
|
|
346
|
+
},
|
|
347
|
+
async save() {
|
|
348
|
+
const proc = this.selectedProc;
|
|
349
|
+
if (!proc || this.busy)
|
|
350
|
+
return;
|
|
351
|
+
this.busy = true;
|
|
352
|
+
try {
|
|
353
|
+
const nextBody = { ...(proc.body || {}), bpmn_xml: JSON.stringify(this.diagram) };
|
|
354
|
+
await this.$item.fetch('db_update', {}, { id: proc.id, version: proc.version, body: nextBody });
|
|
355
|
+
this.changed = false;
|
|
356
|
+
this.statusMsg = '✓ Схема сохранена';
|
|
357
|
+
await this.reload();
|
|
358
|
+
}
|
|
359
|
+
finally {
|
|
360
|
+
this.busy = false;
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
async launchProcess() {
|
|
364
|
+
const proc = this.selectedProc;
|
|
365
|
+
if (!proc)
|
|
366
|
+
return;
|
|
367
|
+
const tasksPath = String(this.$item?.short || '').replace(/\/Схемы процессов.*$/, '/Задачи и этапы');
|
|
368
|
+
const tasksItem = await WORK.get_item(tasksPath).catch(() => null);
|
|
369
|
+
if (!tasksItem?.fetch) {
|
|
370
|
+
this.statusMsg = 'Класс «Задачи и этапы» не найден рядом со схемами';
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const taskNodes = (this.diagram?.nodes || []).filter(n => n.kind === 'task');
|
|
374
|
+
if (!taskNodes.length)
|
|
375
|
+
return;
|
|
376
|
+
let curDay = new Date();
|
|
377
|
+
let prevTaskId = '';
|
|
378
|
+
let createdCount = 0;
|
|
379
|
+
for (const tn of taskNodes) {
|
|
380
|
+
const startStr = curDay.toISOString().slice(0, 10);
|
|
381
|
+
const durDays = Math.max(1, Number(tn.days) || 1);
|
|
382
|
+
const endDay = new Date(curDay.getTime() + durDays * 86400_000);
|
|
383
|
+
const dueStr = endDay.toISOString().slice(0, 10);
|
|
384
|
+
const created = await tasksItem.fetch('db_create', {}, {
|
|
385
|
+
body: {
|
|
386
|
+
name: `${proc.title}: ${tn.label}`,
|
|
387
|
+
process_ref: proc.id,
|
|
388
|
+
...(prevTaskId ? { depends_on: prevTaskId } : {}),
|
|
389
|
+
start_at: startStr,
|
|
390
|
+
due_at: dueStr,
|
|
391
|
+
duration_hours: durDays * 8,
|
|
392
|
+
progress: 0,
|
|
393
|
+
assignee: tn.role || '',
|
|
394
|
+
status: 'К выполнению',
|
|
395
|
+
priority: 'Обычный',
|
|
396
|
+
},
|
|
397
|
+
});
|
|
398
|
+
if (created?.id) {
|
|
399
|
+
prevTaskId = created.id;
|
|
400
|
+
createdCount++;
|
|
401
|
+
}
|
|
402
|
+
curDay = endDay;
|
|
403
|
+
}
|
|
404
|
+
this.statusMsg = `✓ Процесс запущен: создано этапов — ${createdCount}`;
|
|
405
|
+
},
|
|
406
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
label: 'BPMN-схема',
|
|
3
|
+
icon: 'carbon:flow',
|
|
4
|
+
order: 12,
|
|
5
|
+
allowSave: true,
|
|
6
|
+
roles: ['BOSS', 'USER'],
|
|
7
|
+
async allowUse($context, params) {
|
|
8
|
+
const t = $context?.type;
|
|
9
|
+
if (t && t !== '$catalog' && t !== '$class')
|
|
10
|
+
return false;
|
|
11
|
+
try {
|
|
12
|
+
const s = (await $context?.db_schema?.({ session: params?.session }))?.schema;
|
|
13
|
+
if (s)
|
|
14
|
+
return (s.fields || []).some(f => f.id === 'bpmn_xml');
|
|
15
|
+
}
|
|
16
|
+
catch { /* ignore */ }
|
|
17
|
+
return true;
|
|
18
|
+
},
|
|
19
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Эталонная учётная конфигурация WORK по модели ODANT:
|
|
4
4
|
|
|
5
|
-
- **`STRUCTS` (`$struct`)** — составные структуры реквизитов (`Адрес`, `Паспорт`, `Единица измерения`), поддерживающие вложенность и признак табличной части `table: true`.
|
|
6
|
-
- **`CATALOGS` (`$catalog`, `$virtual`)** — реальные справочники (
|
|
5
|
+
- **`STRUCTS` (`$struct`)** — составные структуры реквизитов (`ФИО` со склонением по падежам, `Адрес`, `Паспорт`, `Банковский счёт`, `Единица измерения`), поддерживающие вложенность и признак табличной части `table: true`.
|
|
6
|
+
- **`CATALOGS` (`$catalog`, `$virtual`)** — реальные справочники (`Субъекты` → `Юр. лица`, `ИП`, `Физ. лица`; `Номенклатура`, `Склады`, `Партии`, `Договоры`, `Транспорт`, `Должности`, `Виды нормативов`) и виртуальные справочники (`Клиенты`, `Поставщики`, `Сотрудники` → `В отпуске`).
|
|
7
7
|
- **`OPERATIONS` (`$operation`)** — дерево хозяйственных, кадровых и складских операций с правилами двойной записи `POSTINGS` и печатными формами `print/*.html`.
|
|
8
|
-
- **`REGISTER` (`$register`, `$account`)** — единый журнал проводок и иерархический план счетов с аналитиками и 4-шаговым интерфейсом отчётности ODANT (`sheet`, `analysis`, `turnovers`, `entry`).
|
|
8
|
+
- **`REGISTER` (`$register`, `$account`)** — единый журнал проводок и иерархический план счетов (`01`–`99`, включая `67` + служебные счета) с аналитиками и 4-шаговым интерфейсом отчётности ODANT (`sheet`, `analysis`, `turnovers`, `entry`).
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
1. **Реальный справочник (`$catalog`):**
|
|
10
10
|
- **Группа справочников** (у класса есть дочерние классы `$catalog`, например `Адресаты` → `Юридические лица`, `Физические лица`, `ИП`): собственных объектов не создаёт, но агрегирует объекты всех дочерних справочников и служит полиморфным типом ссылки.
|
|
11
|
-
- **Лист справочника** (дочерних `$catalog` нет, например `Номенклатура`,
|
|
11
|
+
- **Лист справочника** (дочерних `$catalog` нет, например `Номенклатура`, `Склады`, `Транспорт`): хранит объекты справочника с историей версий (`valid_from`).
|
|
12
12
|
- Отдельный тип `$registry` не используется — везде применяется единый `$catalog`.
|
|
13
13
|
|
|
14
14
|
2. **Виртуальный справочник (`$virtual`, например `Клиенты`, `Поставщики`, `Сотрудники`, `Сотрудники/В отпуске`):**
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export default {
|
|
2
1
|
label: 'Виды нормативов',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export default {
|
|
3
|
+
label: 'Виды нормативов',
|
|
4
|
+
icon: 'carbon:calculator',
|
|
5
|
+
METADATA: {
|
|
6
|
+
FIELDS: [
|
|
7
|
+
{ id: 'unit', label: 'Единица измерения', type: 'string' },
|
|
8
|
+
{ id: 'default_value', label: 'Значение по умолчанию', type: 'number' },
|
|
9
|
+
{ id: 'comment', label: 'Комментарий', type: 'text' },
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
export default {
|
|
2
1
|
label: 'Договоры',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{ id: '
|
|
17
|
-
{ id: '
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
2
|
+
export default {
|
|
3
|
+
label: 'Договоры',
|
|
4
|
+
icon: 'carbon:document',
|
|
5
|
+
METADATA: {
|
|
6
|
+
FIELDS: [
|
|
7
|
+
{ id: 'counterparty', label: 'Контрагент', type: 'link', target: '/MODULES/Register/CATALOGS/Субъекты', required: true },
|
|
8
|
+
{
|
|
9
|
+
id: 'kind',
|
|
10
|
+
label: 'Вид',
|
|
11
|
+
type: 'enum',
|
|
12
|
+
values: ['Поставка', 'Покупка', 'Перевозка', 'Услуги', 'Аренда', 'Подряд'],
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
{ id: 'number', label: 'Номер договора', type: 'string' },
|
|
16
|
+
{ id: 'date', label: 'Дата', type: 'date', required: true },
|
|
17
|
+
{ id: 'valid_to', label: 'Действует до', type: 'date' },
|
|
18
|
+
{ id: 'payment_days', label: 'Отсрочка платежа, дней', type: 'integer' },
|
|
19
|
+
{ id: 'amount', label: 'Сумма', type: 'money' },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
}
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
FIELDS: [
|
|
6
6
|
{ id: 'code', label: 'Код должности', type: 'string' },
|
|
7
7
|
{ id: 'department', label: 'Подразделение', type: 'string' },
|
|
8
|
-
{ id: 'base_salary', label: 'Оклад по штату', type: '
|
|
8
|
+
{ id: 'base_salary', label: 'Оклад по штату', type: 'money' },
|
|
9
9
|
],
|
|
10
10
|
},
|
|
11
11
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export default {
|
|
2
1
|
label: 'Клиенты',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{ id: '
|
|
9
|
-
{ id: '
|
|
10
|
-
|
|
11
|
-
}
|
|
2
|
+
export default {
|
|
3
|
+
label: 'Клиенты',
|
|
4
|
+
icon: 'carbon:customer',
|
|
5
|
+
SOURCE: { registry: '/MODULES/Register/CATALOGS/Субъекты', account: '/MODULES/Register/REGISTER/62', slot: 'counterparty' },
|
|
6
|
+
OVERLAY: [
|
|
7
|
+
{ id: 'manager', label: 'Менеджер', type: 'link', target: '/MODULES/Register/CATALOGS/Сотрудники' },
|
|
8
|
+
{ id: 'credit_limit', label: 'Кредитный лимит', type: 'money' },
|
|
9
|
+
{ id: 'payment_days', label: 'Отсрочка платежа, дней', type: 'integer' },
|
|
10
|
+
{ id: 'discount', label: 'Скидка, %', type: 'number' },
|
|
11
|
+
],
|
|
12
|
+
}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
label: 'Номенклатура',
|
|
3
|
-
icon: 'carbon:box',
|
|
4
|
-
METADATA: {
|
|
5
|
-
FIELDS: [
|
|
6
|
-
{ id: 'sku', label: 'Артикул' },
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
label: 'Номенклатура',
|
|
3
|
+
icon: 'carbon:box',
|
|
4
|
+
METADATA: {
|
|
5
|
+
FIELDS: [
|
|
6
|
+
{ id: 'sku', label: 'Артикул', type: 'string' },
|
|
7
|
+
{
|
|
8
|
+
id: 'kind',
|
|
9
|
+
label: 'Вид',
|
|
10
|
+
type: 'enum',
|
|
11
|
+
values: ['Товар', 'Продукция', 'Материал', 'Тара', 'Услуга', 'Работа', 'ОС'],
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
{ id: 'base_unit', label: 'Базовая единица', type: 'string', required: true },
|
|
15
|
+
{
|
|
16
|
+
id: 'vat_rate',
|
|
17
|
+
label: 'Ставка НДС',
|
|
18
|
+
type: 'enum',
|
|
19
|
+
values: ['20%', '10%', '0%', 'Без НДС'],
|
|
20
|
+
},
|
|
21
|
+
{ id: 'units', label: 'Единицы измерения', type: '/MODULES/Register/STRUCTS/Единица измерения', table: true },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
}
|
package/MODULES/Register/CATALOGS//320/237/320/260/321/200/321/202/320/270/320/270/$catalog/class.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export default {
|
|
2
1
|
label: 'Партии',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{ id: '
|
|
9
|
-
{ id: '
|
|
10
|
-
{ id: '
|
|
11
|
-
{ id: '
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
2
|
+
export default {
|
|
3
|
+
label: 'Партии',
|
|
4
|
+
icon: 'carbon:batch-job',
|
|
5
|
+
METADATA: {
|
|
6
|
+
FIELDS: [
|
|
7
|
+
{ id: 'item', label: 'Номенклатура', type: 'link', target: '/MODULES/Register/CATALOGS/Номенклатура', required: true },
|
|
8
|
+
{ id: 'supplier', label: 'Поставщик', type: 'link', target: '/MODULES/Register/CATALOGS/Субъекты' },
|
|
9
|
+
{ id: 'received', label: 'Дата поступления', type: 'date' },
|
|
10
|
+
{ id: 'certificate', label: 'Сертификат / ГТД', type: 'string' },
|
|
11
|
+
{ id: 'expires', label: 'Годен до', type: 'date' },
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
}
|