hys-ui 0.1.1 → 0.2.0

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.
Files changed (225) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +3 -1
  3. package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
  4. package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
  5. package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
  6. package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
  7. package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
  8. package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
  9. package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
  10. package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
  11. package/dist/components/HysBadge/HysBadge.vue.js +2 -2
  12. package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
  13. package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
  14. package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
  15. package/dist/components/HysButton/HysButton.vue.js +2 -2
  16. package/dist/components/HysButton/HysButton2.vue.js +29 -28
  17. package/dist/components/HysCalendar/HysCalendar.vue.js +5 -92
  18. package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
  19. package/dist/components/HysCard/HysCard.vue.js +2 -2
  20. package/dist/components/HysCard/HysCard2.vue.js +175 -42
  21. package/dist/components/HysCascader/HysCascader.vue.js +5 -194
  22. package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
  23. package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
  24. package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
  25. package/dist/components/HysCheckbox/HysCheckbox.vue.js +3 -3
  26. package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
  27. package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
  28. package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
  29. package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
  30. package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
  31. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  32. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +399 -392
  33. package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
  34. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
  35. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
  36. package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
  37. package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
  38. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
  39. package/dist/components/HysDivider/HysDivider.vue.js +2 -2
  40. package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
  41. package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
  42. package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
  43. package/dist/components/HysForm/HysForm.vue.js +3 -3
  44. package/dist/components/HysForm/HysForm2.vue.js +578 -92
  45. package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
  46. package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
  47. package/dist/components/HysGantt/HysGantt.vue.js +1 -1
  48. package/dist/components/HysGantt/HysGantt2.vue.js +1369 -272
  49. package/dist/components/HysInput/HysInput.vue.js +2 -2
  50. package/dist/components/HysInput/HysInput2.vue.js +467 -120
  51. package/dist/components/HysMention/HysMention.vue.js +2 -2
  52. package/dist/components/HysMention/HysMention2.vue.js +89 -88
  53. package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
  54. package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
  55. package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
  56. package/dist/components/HysPagination/HysPagination.vue.js +1 -1
  57. package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
  58. package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
  59. package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
  60. package/dist/components/HysRadio/HysRadio.vue.js +7 -0
  61. package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
  62. package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +2 -2
  63. package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
  64. package/dist/components/HysRating/HysRating.vue.js +1 -1
  65. package/dist/components/HysRating/HysRating2.vue.js +288 -68
  66. package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
  67. package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
  68. package/dist/components/HysSearch/HysSearch.vue.js +37 -36
  69. package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
  70. package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
  71. package/dist/components/HysSelect/HysSelect.vue.js +3 -2
  72. package/dist/components/HysSelect/HysSelect2.vue.js +859 -185
  73. package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
  74. package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
  75. package/dist/components/HysSlider/HysSlider.vue.js +2 -2
  76. package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
  77. package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
  78. package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
  79. package/dist/components/HysSteps/HysSteps.vue.js +1 -1
  80. package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
  81. package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
  82. package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
  83. package/dist/components/HysTable/HysTable.vue.js +2 -2
  84. package/dist/components/HysTable/HysTable2.vue.js +1473 -88
  85. package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
  86. package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
  87. package/dist/components/HysTabs/HysTabs.vue.js +2 -2
  88. package/dist/components/HysTabs/HysTabs2.vue.js +262 -68
  89. package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
  90. package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
  91. package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
  92. package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
  93. package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
  94. package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
  95. package/dist/components/HysTree/HysTree.vue.js +2 -3
  96. package/dist/components/HysTree/HysTree2.vue.js +641 -302
  97. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
  98. package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
  99. package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
  100. package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
  101. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  102. package/dist/components/HysUpload/HysUpload2.vue.js +77 -76
  103. package/dist/composables/autocomplete.js +50 -0
  104. package/dist/composables/avatar.js +57 -0
  105. package/dist/composables/calendar.js +96 -0
  106. package/dist/composables/cascader.js +79 -0
  107. package/dist/composables/choice.js +38 -0
  108. package/dist/composables/choiceModel.js +67 -0
  109. package/dist/composables/datePicker.js +227 -0
  110. package/dist/composables/formContext.js +92 -7
  111. package/dist/composables/formLayout.js +57 -0
  112. package/dist/composables/formValidation.js +240 -0
  113. package/dist/composables/ganttConflicts.js +143 -0
  114. package/dist/composables/numberInput.js +91 -0
  115. package/dist/composables/rating.js +16 -0
  116. package/dist/composables/selectOptions.js +54 -0
  117. package/dist/composables/table.js +150 -0
  118. package/dist/composables/textInput.js +34 -0
  119. package/dist/composables/transfer.js +63 -0
  120. package/dist/composables/tree.js +118 -0
  121. package/dist/composables/treeSelect.js +71 -0
  122. package/dist/composables/useCascader.js +438 -0
  123. package/dist/composables/useDatePicker.js +425 -0
  124. package/dist/composables/useFloating.js +97 -51
  125. package/dist/composables/useGanttDependencies.js +306 -0
  126. package/dist/composables/useGanttHistory.js +157 -0
  127. package/dist/composables/useGanttLabelResize.js +100 -0
  128. package/dist/composables/useTable.js +474 -0
  129. package/dist/composables/useTextareaSize.js +72 -0
  130. package/dist/composables/useTransfer.js +257 -0
  131. package/dist/composables/useTree.js +439 -0
  132. package/dist/composables/useTreeSelect.js +361 -0
  133. package/dist/index.js +149 -139
  134. package/dist/style.css +1 -1
  135. package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
  136. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
  137. package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
  138. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
  139. package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
  140. package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
  141. package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
  142. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -31
  143. package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
  144. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
  145. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
  146. package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +50 -39
  147. package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
  148. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
  149. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
  150. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
  151. package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
  152. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
  153. package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
  154. package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
  155. package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
  156. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
  157. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +82 -4
  158. package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
  159. package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
  160. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
  161. package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
  162. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
  163. package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
  164. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
  165. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
  166. package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
  167. package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
  168. package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
  169. package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
  170. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
  171. package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
  172. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -20
  173. package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
  174. package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
  175. package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
  176. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +1 -1
  177. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -9
  178. package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
  179. package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
  180. package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
  181. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
  182. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
  183. package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
  184. package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
  185. package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -2
  186. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
  187. package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
  188. package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
  189. package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
  190. package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
  191. package/dist/types/composables/autocomplete.d.ts +106 -0
  192. package/dist/types/composables/avatar.d.ts +70 -0
  193. package/dist/types/composables/calendar.d.ts +66 -0
  194. package/dist/types/composables/cascader.d.ts +192 -0
  195. package/dist/types/composables/choice.d.ts +110 -0
  196. package/dist/types/composables/choiceModel.d.ts +11 -0
  197. package/dist/types/composables/datePicker.d.ts +247 -0
  198. package/dist/types/composables/formContext.d.ts +133 -8
  199. package/dist/types/composables/formLayout.d.ts +11 -0
  200. package/dist/types/composables/formValidation.d.ts +13 -0
  201. package/dist/types/composables/gantt.d.ts +68 -0
  202. package/dist/types/composables/ganttConflicts.d.ts +30 -0
  203. package/dist/types/composables/numberInput.d.ts +45 -0
  204. package/dist/types/composables/rating.d.ts +18 -0
  205. package/dist/types/composables/segmented.d.ts +15 -0
  206. package/dist/types/composables/selectOptions.d.ts +44 -0
  207. package/dist/types/composables/slider.d.ts +21 -0
  208. package/dist/types/composables/table.d.ts +309 -0
  209. package/dist/types/composables/textInput.d.ts +76 -0
  210. package/dist/types/composables/transfer.d.ts +180 -0
  211. package/dist/types/composables/tree.d.ts +237 -0
  212. package/dist/types/composables/treeSelect.d.ts +167 -0
  213. package/dist/types/composables/useCascader.d.ts +162 -0
  214. package/dist/types/composables/useDatePicker.d.ts +79 -0
  215. package/dist/types/composables/useFloating.d.ts +8 -5
  216. package/dist/types/composables/useGanttDependencies.d.ts +83 -0
  217. package/dist/types/composables/useGanttHistory.d.ts +42 -0
  218. package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
  219. package/dist/types/composables/useTable.d.ts +60 -0
  220. package/dist/types/composables/useTextareaSize.d.ts +3 -0
  221. package/dist/types/composables/useTransfer.d.ts +58 -0
  222. package/dist/types/composables/useTree.d.ts +77 -0
  223. package/dist/types/composables/useTreeSelect.d.ts +117 -0
  224. package/dist/types/index.d.ts +33 -7
  225. package/package.json +2 -1
@@ -1,11 +1,59 @@
1
- import { defineComponent as ge, ref as W, watch as j, computed as y, onMounted as ye, onActivated as fe, nextTick as le, onDeactivated as me, onBeforeUnmount as we, openBlock as i, createElementBlock as o, mergeProps as be, unref as q, createElementVNode as r, createVNode as se, withCtx as xe, createTextVNode as ie, toDisplayString as f, normalizeStyle as p, Fragment as P, renderList as S, withKeys as _, withModifiers as x, normalizeClass as K, createCommentVNode as z } from "vue";
2
- import { useHysRootAttrs as ke } from "../../config.js";
3
- import $e from "../HysSegmented/HysSegmented.vue.js";
4
- import Ce from "../HysButton/HysButton.vue.js";
5
- const Me = { class: "hys-ui-pg-toolbar" }, De = { class: "hys-ui-pg-hint" }, Pe = { class: "hys-ui-pg-body" }, Se = ["onClick", "onKeydown"], _e = ["title"], Te = {
1
+ import { defineComponent as Jt, ref as S, watch as G, computed as h, onMounted as Qt, onActivated as Zt, nextTick as ae, onDeactivated as jt, onBeforeUnmount as ea, useId as ta, shallowRef as aa, openBlock as o, createElementBlock as c, mergeProps as xt, unref as l, createElementVNode as u, createVNode as y, withCtx as U, createTextVNode as j, createCommentVNode as g, toDisplayString as p, normalizeStyle as H, withModifiers as m, Fragment as q, renderList as ee, withKeys as V, normalizeClass as X, createBlock as De, Teleport as la } from "vue";
2
+ import { useHysRootAttrs as sa } from "../../config.js";
3
+ import ia from "../HysSegmented/HysSegmented.vue.js";
4
+ import W from "../HysButton/HysButton.vue.js";
5
+ import It from "../HysInput/HysInput.vue.js";
6
+ import na from "../HysPagination/HysPagination.vue.js";
7
+ import { ganttDependencyPickPath as oa, ganttDependencyPath as ra, useGanttDependencies as ua } from "../../composables/useGanttDependencies.js";
8
+ import { Undo2 as da, Redo2 as ca, TriangleAlert as Ct, X as Tt, Trash2 as Pt, ChevronDown as va, Search as Mt, LocateFixed as Qe, GitBranch as pa, Check as ha, CornerDownRight as ga } from "lucide-vue-next";
9
+ import { useGanttLabelResize as fa } from "../../composables/useGanttLabelResize.js";
10
+ import { useFloating as ya } from "../../composables/useFloating.js";
11
+ import { useGanttHistory as ma } from "../../composables/useGanttHistory.js";
12
+ import { analyzeGanttSchedule as ka, previewGanttConflicts as ba, ganttEdgeKey as wa } from "../../composables/ganttConflicts.js";
13
+ const xa = { class: "hys-ui-pg-toolbar" }, Ia = {
14
+ key: 0,
15
+ class: "hys-ui-pg-history-controls",
16
+ role: "group",
17
+ "aria-label": "排期历史操作"
18
+ }, Ca = { class: "hys-ui-pg-hint" }, Ta = { class: "hys-ui-pg-label-head" }, Pa = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], Ma = ["aria-pressed", "data-row-index", "onClick", "onKeydown"], za = ["title"], Sa = ["title"], Da = {
6
19
  key: 0,
7
20
  class: "hys-ui-pg-empty"
8
- }, He = { class: "hys-ui-pg-months" }, Ue = ["title"], Ve = { class: "hys-ui-pg-days" }, We = ["aria-label", "title", "onClick", "onKeydown", "onPointerdown"], ze = { class: "hys-ui-pg-bar-title" }, Le = ["onPointerdown"], Ae = ["onPointerdown"], Be = ["width", "height"], Fe = ["d"], Ee = { class: "hys-ui-pg-footer" }, Ke = { key: 0 }, oe = 864e5, Oe = /* @__PURE__ */ ge({
21
+ }, La = { class: "hys-ui-pg-months" }, $a = ["title"], Ea = { class: "hys-ui-pg-days" }, _a = ["data-row-index"], Ka = ["aria-pressed", "aria-label", "title", "onClick", "onKeydown", "onPointerdown"], Ha = { class: "hys-ui-pg-bar-title" }, Fa = ["onPointerdown"], Ra = ["onPointerdown"], Aa = ["aria-label", "onPointerdown", "onClick", "onKeydown"], Ua = ["width", "height", "aria-hidden"], Va = ["data-edge-key"], Wa = ["d"], Ba = ["d", "aria-label", "onClick", "onFocus", "onKeydown"], Na = ["cx", "cy"], qa = ["cx", "cy", "aria-label", "onFocus", "onPointerdown", "onClick", "onKeydown"], Ga = ["d"], Oa = ["cx", "cy"], Ya = ["transform", "aria-expanded", "aria-label", "onClick", "onKeydown"], Xa = {
22
+ key: 0,
23
+ cx: "29",
24
+ r: "13",
25
+ fill: "transparent",
26
+ class: "hys-ui-pg-incoming-hit"
27
+ }, Ja = {
28
+ "text-anchor": "middle",
29
+ dy: ".35em"
30
+ }, Qa = ["d"], Za = { class: "hys-ui-pg-footer" }, ja = { key: 0 }, el = {
31
+ key: 1,
32
+ class: "hys-ui-pg-link-feedback"
33
+ }, tl = {
34
+ role: "status",
35
+ "aria-live": "polite"
36
+ }, al = {
37
+ key: 2,
38
+ class: "hys-ui-pg-history-message",
39
+ "aria-live": "polite"
40
+ }, ll = {
41
+ key: 3,
42
+ class: "hys-ui-pg-conflict-area"
43
+ }, sl = { class: "hys-ui-pg-conflict-summary" }, il = { "aria-live": "polite" }, nl = {
44
+ key: 0,
45
+ class: "hys-ui-pg-conflict-preview"
46
+ }, ol = { class: "hys-ui-pg-conflict-list" }, rl = { class: "hys-ui-pg-conflict-tag" }, ul = {
47
+ key: 0,
48
+ class: "hys-ui-pg-conflict-empty"
49
+ }, dl = ["aria-label"], cl = { class: "hys-ui-pg-picker-heading" }, vl = { class: "hys-ui-pg-picker-target" }, pl = { class: "hys-ui-pg-picker-target-main" }, hl = ["title"], gl = { class: "hys-ui-pg-picker-options" }, fl = ["data-current"], yl = { class: "hys-ui-pg-picker-names" }, ml = ["title"], kl = { class: "hys-ui-pg-picker-check" }, bl = { class: "hys-ui-pg-picker-actions" }, wl = {
50
+ key: 0,
51
+ class: "hys-ui-pg-picker-empty"
52
+ }, xl = {
53
+ key: 0,
54
+ class: "hys-ui-pg-picker-notice",
55
+ role: "status"
56
+ }, zt = 864e5, Kl = /* @__PURE__ */ Jt({
9
57
  __name: "HysGantt",
10
58
  props: {
11
59
  items: {},
@@ -14,291 +62,1340 @@ const Me = { class: "hys-ui-pg-toolbar" }, De = { class: "hys-ui-pg-hint" }, Pe
14
62
  editable: { type: Boolean, default: !1 },
15
63
  rowHeight: { default: 46 },
16
64
  labelWidth: { default: 270 },
17
- fitContainer: { type: Boolean, default: !0 }
65
+ labelResizable: { type: Boolean, default: !0 },
66
+ minLabelWidth: { default: 120 },
67
+ maxLabelWidth: { default: 600 },
68
+ fitContainer: { type: Boolean, default: !0 },
69
+ height: {},
70
+ maxHeight: { type: [Number, String, Boolean], default: void 0 },
71
+ virtual: { type: Boolean, default: !1 },
72
+ overscan: { default: 6 },
73
+ dependencyEditable: { type: Boolean, default: void 0 },
74
+ showDependencies: { type: Boolean, default: !0 },
75
+ history: { type: Boolean, default: !0 },
76
+ historyLimit: { default: 50 },
77
+ historyKeyboard: { type: Boolean, default: !0 },
78
+ showHistoryControls: { type: Boolean, default: !0 },
79
+ showConflicts: { type: Boolean, default: !0 }
18
80
  },
19
- emits: ["update:modelValue", "update:scale", "scaleChange", "update:items", "change", "open"],
20
- setup(d, { emit: re }) {
21
- const ue = ke(), c = d, m = re, w = W(c.scale);
22
- j(() => c.scale, (e) => w.value = e);
23
- const T = W(c.modelValue ?? null);
24
- j(() => c.modelValue, (e) => T.value = e ?? null);
25
- const k = W(null), H = /* @__PURE__ */ new Date();
26
- H.setHours(0, 0, 0, 0);
27
- function $(e) {
81
+ emits: ["update:modelValue", "update:scale", "scaleChange", "update:items", "change", "open", "dependencyAdd", "dependencyRemove", "dependencyInvalid", "dependencyMove", "update:labelWidth", "labelResize", "historyChange", "undo", "redo", "historyInvalid", "conflictChange"],
82
+ setup($, { expose: St, emit: Dt }) {
83
+ const Ze = sa(), r = $, w = Dt, J = S(r.scale);
84
+ G(
85
+ () => r.scale,
86
+ (e) => J.value = e
87
+ );
88
+ const F = S(r.modelValue ?? null);
89
+ G(
90
+ () => r.modelValue,
91
+ (e) => F.value = e ?? null
92
+ );
93
+ const Le = S(), x = S(null), $e = S(null), Ee = S(0), je = S(null), be = /* @__PURE__ */ new Date();
94
+ be.setHours(0, 0, 0, 0);
95
+ function et(e) {
96
+ return typeof e == "number" ? Number.isFinite(e) && e >= 0 ? e + "px" : void 0 : typeof e == "string" && e.trim() ? e : void 0;
97
+ }
98
+ const Lt = h(() => ({
99
+ height: et(r.height),
100
+ maxHeight: r.maxHeight === !1 || r.height !== void 0 && r.maxHeight === void 0 ? "none" : et(
101
+ r.maxHeight ?? (r.height === void 0 ? 620 : void 0)
102
+ ),
103
+ scrollPaddingInlineStart: Ee.value + "px"
104
+ }));
105
+ function we(e) {
28
106
  if (!/^\d{4}-\d{2}-\d{2}$/.test(e)) return null;
29
- const [n, t, l] = e.split("-").map(Number), a = new Date(n, t - 1, l);
30
- return a.getFullYear() === n && a.getMonth() === t - 1 && a.getDate() === l ? a : null;
31
- }
32
- function h(e) {
33
- return Math.round((Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()) - Date.UTC(1970, 0, 1)) / oe);
34
- }
35
- function U(e) {
36
- return new Date(e * oe);
37
- }
38
- function L(e) {
39
- return U(e).toISOString().slice(0, 10);
40
- }
41
- const v = y(() => c.items.map((e) => {
42
- const n = $(e.start), t = $(e.end);
43
- return !n || !t || h(t) < h(n) ? null : { ...e, s: h(n), e: h(t), progress: Math.min(100, Math.max(0, e.progress ?? 0)) };
44
- }).filter((e) => e !== null)), de = y(() => w.value === "day" ? 36 : w.value === "week" ? 17 : w.value === "month" ? 7 : 36), b = y(() => {
45
- const e = v.value.flatMap((t) => [t.s, t.e]), n = h(H);
46
- return { start: Math.min(n - 7, ...e) - 7, end: Math.max(n + 21, ...e) + 14 };
47
- }), N = y(() => b.value.end - b.value.start + 1), Y = W(0), u = y(() => Math.max(de.value, c.fitContainer ? Y.value / N.value : 0)), J = y(() => Math.max(N.value * u.value, c.fitContainer ? Y.value : 0));
48
- let C, M = !0;
49
- function A() {
50
- var e;
51
- M && (Y.value = ((e = k.value) == null ? void 0 : e.clientWidth) || 0);
52
- }
53
- function R() {
54
- C == null || C.disconnect(), C = void 0, window.removeEventListener("resize", A);
55
- }
56
- function Q() {
57
- R(), !(!M || !k.value) && (A(), k.value && typeof ResizeObserver < "u" ? (C = new ResizeObserver(A), C.observe(k.value)) : window.addEventListener("resize", A));
58
- }
59
- ye(Q), fe(() => {
60
- M = !0, le(() => M && Q());
61
- }), me(() => {
62
- M = !1, R(), V();
63
- }), we(() => {
64
- M = !1, R(), V();
107
+ const [t, s, n] = e.split("-").map(Number), d = new Date(t, s - 1, n);
108
+ return d.getFullYear() === t && d.getMonth() === s - 1 && d.getDate() === n ? d : null;
109
+ }
110
+ function Q(e) {
111
+ return Math.round(
112
+ (Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()) - Date.UTC(1970, 0, 1)) / zt
113
+ );
114
+ }
115
+ function xe(e) {
116
+ return new Date(e * zt);
117
+ }
118
+ function _e(e) {
119
+ return xe(e).toISOString().slice(0, 10);
120
+ }
121
+ const I = h(
122
+ () => Number.isFinite(r.rowHeight) && r.rowHeight > 0 ? r.rowHeight : 46
123
+ ), E = h(() => {
124
+ const e = /* @__PURE__ */ new Map(), t = (s) => {
125
+ if (!e.has(s)) {
126
+ const n = we(s);
127
+ e.set(s, n ? Q(n) : null);
128
+ }
129
+ return e.get(s);
130
+ };
131
+ return r.items.map((s) => {
132
+ const n = t(s.start), d = t(s.end);
133
+ return n === null || d === null || d < n ? null : {
134
+ ...s,
135
+ s: n,
136
+ e: d,
137
+ progress: Math.min(100, Math.max(0, s.progress ?? 0))
138
+ };
139
+ }).filter((s) => s !== null);
140
+ }), $t = h(
141
+ () => E.value.filter((e) => e.status === "已完成").length
142
+ ), Ve = S(620), ve = S(0), le = h(() => {
143
+ const e = E.value.length;
144
+ if (!r.virtual) return { start: 0, end: e };
145
+ const t = Number.isFinite(r.overscan) ? Math.max(0, Math.min(100, Math.floor(r.overscan))) : 6, s = Math.min(
146
+ Math.max(0, e - 1),
147
+ Math.max(0, Math.floor(ve.value / I.value))
148
+ );
149
+ return {
150
+ start: Math.max(0, s - t),
151
+ end: Math.min(
152
+ e,
153
+ s + Math.ceil(
154
+ Math.max(I.value, Ve.value - 66) / I.value
155
+ ) + t + 1
156
+ )
157
+ };
158
+ }), tt = h(
159
+ () => E.value.slice(le.value.start, le.value.end).map((e, t) => ({ task: e, index: t + le.value.start }))
160
+ ), Et = h(
161
+ () => J.value === "day" ? 36 : J.value === "week" ? 17 : J.value === "month" ? 7 : 36
162
+ ), O = h(() => {
163
+ const e = Q(be);
164
+ let t = e - 7, s = e + 21;
165
+ for (const n of E.value)
166
+ t = Math.min(t, n.s), s = Math.max(s, n.e);
167
+ return { start: t - 7, end: s + 14 };
168
+ }), We = h(() => O.value.end - O.value.start + 1), se = S(0), D = h(
169
+ () => Math.max(
170
+ Et.value,
171
+ r.fitContainer ? se.value / We.value : 0
172
+ )
173
+ ), Be = h(
174
+ () => Math.max(
175
+ We.value * D.value,
176
+ r.fitContainer ? se.value : 0
177
+ )
178
+ );
179
+ let ie, C = !0;
180
+ const at = S(0), T = fa({
181
+ width: () => r.labelWidth,
182
+ min: () => r.minLabelWidth,
183
+ max: () => r.maxLabelWidth,
184
+ enabled: () => r.labelResizable,
185
+ available: at,
186
+ live: () => C,
187
+ start: () => {
188
+ B(), i.cancel();
189
+ },
190
+ update: (e) => w("update:labelWidth", e),
191
+ commit: (e) => w("labelResize", e)
192
+ });
193
+ let Ke = !1, pe = 0, he, Ie, Z = { top: 0, left: 0 };
194
+ function _t() {
195
+ he = void 0, C && r.virtual && (ve.value = Math.floor(Z.top / I.value) * I.value);
196
+ }
197
+ G(
198
+ [() => r.virtual, I],
199
+ () => {
200
+ var e;
201
+ ve.value = Math.floor(
202
+ (((e = x.value) == null ? void 0 : e.scrollTop) ?? Z.top) / I.value
203
+ ) * I.value;
204
+ },
205
+ { flush: "sync" }
206
+ );
207
+ function lt() {
208
+ const e = x.value;
209
+ if (!C || Ke || !(e != null && e.isConnected)) return;
210
+ const t = Z.top !== e.scrollTop, s = Z.left !== e.scrollLeft;
211
+ Z = { top: e.scrollTop, left: e.scrollLeft }, (t || s) && M.close(), r.virtual && t && he === void 0 && (he = requestAnimationFrame(_t));
212
+ }
213
+ function st() {
214
+ he !== void 0 && cancelAnimationFrame(he), Ie !== void 0 && cancelAnimationFrame(Ie), he = Ie = void 0;
215
+ }
216
+ function Ce() {
217
+ var e, t, s, n;
218
+ C && (at.value = ((e = x.value) == null ? void 0 : e.clientWidth) || 0, Ee.value = ((t = $e.value) == null ? void 0 : t.offsetWidth) || T.width.value, Ve.value = ((s = x.value) == null ? void 0 : s.clientHeight) || 620, se.value = Math.max(
219
+ 0,
220
+ (((n = x.value) == null ? void 0 : n.clientWidth) || 0) - Ee.value
221
+ ));
222
+ }
223
+ function Ne() {
224
+ ie == null || ie.disconnect(), ie = void 0, window.removeEventListener("resize", Ce);
225
+ }
226
+ function it() {
227
+ Ne(), !(!C || !x.value) && (Ce(), typeof ResizeObserver < "u" ? (ie = new ResizeObserver(Ce), ie.observe(x.value), $e.value && ie.observe($e.value)) : window.addEventListener("resize", Ce));
228
+ }
229
+ Qt(it), Zt(async () => {
230
+ const e = ++pe;
231
+ C = !0, Ke = !0, await ae(), !(!C || e !== pe) && (it(), await ae(), !(!C || e !== pe || !x.value) && (x.value.scrollTop = Z.top, x.value.scrollLeft = Z.left, ve.value = x.value.scrollTop, Ie = requestAnimationFrame(() => {
232
+ Ie = void 0, C && e === pe && (Ke = !1, lt());
233
+ })));
234
+ }), jt(() => {
235
+ C = !1, Ke = !0, pe++, st(), Ne(), B();
236
+ }), ea(() => {
237
+ C = !1, pe++, st(), Ne(), B();
65
238
  });
66
- function ce(e) {
67
- !["day", "week", "month"].includes(e) || e === w.value || (w.value = e, m("update:scale", e), m("scaleChange", e));
239
+ function Kt(e) {
240
+ !["day", "week", "month"].includes(e) || e === J.value || (i.cancel(), B(), J.value = e, w("update:scale", e), w("scaleChange", e));
68
241
  }
69
- const B = y(() => Array.from({ length: N.value }, (e, n) => b.value.start + n)), he = y(() => {
242
+ const He = h(
243
+ () => Array.from({ length: We.value }, (e, t) => O.value.start + t)
244
+ ), Ht = h(() => {
70
245
  const e = [];
71
- for (let n = 0; n < B.value.length; n++) {
72
- const t = U(B.value[n]), l = `${t.getUTCFullYear()}-${t.getUTCMonth()}`, a = e[e.length - 1];
73
- (a == null ? void 0 : a.key) === l ? a.width += u.value : e.push({ key: l, label: `${t.getUTCFullYear()}年${t.getUTCMonth() + 1}月`, left: n * u.value, width: u.value });
246
+ for (let t = 0; t < He.value.length; t++) {
247
+ const s = xe(He.value[t]), n = `${s.getUTCFullYear()}-${s.getUTCMonth()}`, d = e[e.length - 1];
248
+ (d == null ? void 0 : d.key) === n ? d.width += D.value : e.push({
249
+ key: n,
250
+ label: `${s.getUTCFullYear()}年${s.getUTCMonth() + 1}月`,
251
+ left: t * D.value,
252
+ width: D.value
253
+ });
74
254
  }
75
255
  return e;
76
- }), Z = y(() => new Map(v.value.map((e, n) => [String(e.id), { x: (e.s - b.value.start) * u.value, w: (e.e - e.s + 1) * u.value, y: n * c.rowHeight + c.rowHeight / 2 }]))), ee = y(() => v.value.flatMap((e) => (e.dependencies ?? []).flatMap((n) => {
77
- const t = Z.value.get(String(n)), l = Z.value.get(String(e.id));
78
- return !t || !l || String(n) === String(e.id) ? [] : [{ id: `${n}-${e.id}`, path: `M ${t.x + t.w} ${t.y} H ${t.x + t.w + 9} V ${l.y} H ${l.x}` }];
79
- })));
80
- function F(e) {
81
- T.value = e.id, m("update:modelValue", e.id), m("open", e);
82
- }
83
- function te() {
84
- const e = k.value;
85
- e && (e.scrollLeft = Math.max(0, (h(H) - b.value.start) * u.value - e.clientWidth / 3));
86
- }
87
- j(w, () => le(te));
88
- const g = W(null);
89
- let I;
90
- function ne() {
91
- var n, t;
92
- const e = I;
93
- I = void 0, (t = e == null ? void 0 : (n = e.element).hasPointerCapture) != null && t.call(n, e.id) && e.element.releasePointerCapture(e.id);
94
- }
95
- function V() {
96
- g.value = null, ne();
97
- }
98
- function O(e, n, t) {
99
- !c.editable || n.disabled || e.button !== 0 || (e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), I = { element: e.currentTarget, id: e.pointerId }, g.value = { id: n.id, type: t, x: e.clientX, original: { ...n }, days: 0, unitWidth: u.value }, T.value = n.id, m("update:modelValue", n.id));
100
- }
101
- function X(e) {
102
- g.value && (g.value.days = Math.round((e.clientX - g.value.x) / g.value.unitWidth));
103
- }
104
- function D(e) {
105
- const n = g.value;
106
- if (!n || (g.value = null, ne(), e.type === "pointercancel" || !n.days)) return;
107
- const t = $(n.original.start), l = $(n.original.end);
108
- if (!t || !l) return;
109
- let a = h(t), s = h(l);
110
- n.type === "move" ? (a += n.days, s += n.days) : n.type === "start" ? a = Math.min(s, a + n.days) : s = Math.max(a, s + n.days);
111
- const G = { ...n.original, start: L(a), end: L(s) };
112
- m("update:items", c.items.map((ae) => String(ae.id) === String(G.id) ? G : ae)), m("change", G);
113
- }
114
- function ve(e) {
115
- const n = g.value;
116
- if (!n || String(n.id) !== String(e.id)) return { s: e.s, e: e.e };
117
- const t = n.days;
118
- return n.type === "move" ? { s: e.s + t, e: e.e + t } : n.type === "start" ? { s: Math.min(e.e, e.s + t), e: e.e } : { s: e.s, e: Math.max(e.s, e.e + t) };
119
- }
120
- function pe(e) {
121
- const n = ve(e);
122
- return { left: `${(n.s - b.value.start) * u.value}px`, width: `${Math.max(u.value, (n.e - n.s + 1) * u.value)}px`, background: e.color || "var(--hys-ui-primary,var(--hys-ui-theme-primary, #4776ed))" };
123
- }
124
- function E(e, n) {
125
- if (!c.editable || e.disabled) return;
126
- const t = $(e.start), l = $(e.end);
127
- if (!t || !l) return;
128
- const a = { ...e, start: L(h(t) + n), end: L(h(l) + n) };
129
- m("update:items", c.items.map((s) => String(s.id) === String(e.id) ? a : s)), m("change", a);
130
- }
131
- return (e, n) => (i(), o("section", be(q(ue), {
132
- class: "hys-ui-pg-gantt",
133
- "aria-label": "项目甘特图"
134
- }), [
135
- r("div", Me, [
136
- se($e, {
137
- class: "hys-ui-pg-scale",
138
- "model-value": w.value,
139
- options: [{ label: "日", value: "day" }, { label: "周", value: "week" }, { label: "月", value: "month" }],
140
- "aria-label": "时间刻度",
141
- "onUpdate:modelValue": ce
142
- }, null, 8, ["model-value"]),
143
- se(Ce, {
144
- variant: "secondary",
145
- size: "sm",
146
- class: "hys-ui-pg-today",
147
- onClick: te
148
- }, {
149
- default: xe(() => [...n[0] || (n[0] = [
150
- ie("定位今天", -1)
151
- ])]),
152
- _: 1
153
- }),
154
- r("span", De, f(d.editable ? "拖动任务条调整排期 · Alt + 左/右方向键微调日期" : "点击任务查看详情"), 1)
155
- ]),
156
- r("div", Pe, [
157
- r("div", {
158
- class: "hys-ui-pg-labels",
159
- style: p({ width: d.labelWidth + "px", minWidth: d.labelWidth + "px" })
160
- }, [
161
- n[1] || (n[1] = r("div", { class: "hys-ui-pg-label-head" }, "任务 / 负责人", -1)),
162
- (i(!0), o(P, null, S(v.value, (t) => (i(), o("button", {
163
- type: "button",
164
- key: t.id,
165
- class: K(["hys-ui-pg-task-label", { "hys-ui-selected": T.value === t.id }]),
166
- style: p({ height: d.rowHeight + "px" }),
167
- onClick: (l) => F(t),
168
- onKeydown: [
169
- _(x((l) => E(t, -1), ["alt", "prevent"]), ["left"]),
170
- _(x((l) => E(t, 1), ["alt", "prevent"]), ["right"])
171
- ]
172
- }, [
173
- r("strong", {
174
- title: t.title
175
- }, f(t.title), 9, _e),
176
- r("small", null, f(t.owner || "未分配") + " · " + f(t.status || "待办"), 1)
177
- ], 46, Se))), 128)),
178
- v.value.length ? z("", !0) : (i(), o("div", Te, "暂无有效排期任务"))
179
- ], 4),
180
- r("div", {
256
+ }), ge = h(
257
+ () => new Map(
258
+ E.value.map((e, t) => [
259
+ e.id,
260
+ {
261
+ x: (e.s - O.value.start) * D.value,
262
+ w: (e.e - e.s + 1) * D.value,
263
+ y: t * I.value + I.value / 2,
264
+ index: t
265
+ }
266
+ ])
267
+ )
268
+ ), qe = h(
269
+ () => E.value.flatMap(
270
+ (e) => [...new Set(e.dependencies ?? [])].flatMap((t) => {
271
+ var d;
272
+ const s = ge.value.get(t), n = ge.value.get(e.id);
273
+ return !s || !n || t === e.id ? [] : [
274
+ {
275
+ id: JSON.stringify([t, e.id]),
276
+ sourceId: t,
277
+ sourceTitle: E.value[s.index].title,
278
+ targetId: e.id,
279
+ targetTitle: e.title,
280
+ first: Math.min(s.index, n.index),
281
+ last: Math.max(s.index, n.index),
282
+ endpoint: { x: n.x - 9, y: n.y },
283
+ editable: !e.disabled && !((d = E.value[s.index]) != null && d.disabled),
284
+ removable: !e.disabled,
285
+ path: ra(s, n, I.value),
286
+ pickPath: oa(s, n, I.value)
287
+ }
288
+ ];
289
+ })
290
+ )
291
+ ), nt = h(
292
+ () => r.virtual ? qe.value.filter(
293
+ (e) => e.last >= le.value.start && e.first < le.value.end
294
+ ) : qe.value
295
+ ), Te = h(() => {
296
+ const e = /* @__PURE__ */ new Map();
297
+ for (const t of qe.value) {
298
+ const s = e.get(t.targetId);
299
+ s ? s.push(t) : e.set(t.targetId, [t]);
300
+ }
301
+ return e;
302
+ }), Ft = h(
303
+ () => [...Te.value].flatMap(([e, t]) => {
304
+ const s = ge.value.get(e);
305
+ return t.length > 1 && s && s.index >= le.value.start && s.index < le.value.end ? [
306
+ {
307
+ id: e,
308
+ title: t[0].targetTitle,
309
+ count: t.length,
310
+ x: s.x - 38,
311
+ y: s.y
312
+ }
313
+ ] : [];
314
+ })
315
+ ), R = h(
316
+ () => r.dependencyEditable ?? r.editable
317
+ ), f = ma({
318
+ items: () => r.items,
319
+ enabled: () => r.history,
320
+ limit: () => r.historyLimit,
321
+ live: () => C,
322
+ allowed: (e, t) => !e.disabled && t.every(
323
+ (s) => s === "dependencies" ? R.value : r.editable
324
+ ),
325
+ send: (e) => w("update:items", e),
326
+ change: (e) => w("change", e),
327
+ beforeReplay: () => {
328
+ B(), i.cancel(), i.clearSelected(), M.close();
329
+ },
330
+ external: () => {
331
+ B(), i.cancel(), i.clearSelected(), M.close();
332
+ },
333
+ state: (e) => w("historyChange", e),
334
+ invalid: (e) => w("historyInvalid", e),
335
+ replay: (e, t) => {
336
+ var s;
337
+ w(e === "undo" ? "undo" : "redo", t), (s = x.value) == null || s.focus({ preventScroll: !0 });
338
+ }
339
+ }), Ge = h(
340
+ () => new Map(r.items.map((e) => [e.id, e]))
341
+ ), ne = h(() => ka(r.items)), oe = h(() => ne.value.conflicts), Rt = h(
342
+ () => oe.value.map((e) => ({ ...e }))
343
+ ), te = S(!1), fe = S(""), re = S(1), ot = "hys-gantt-conflicts-" + ta(), ye = h(() => {
344
+ const e = fe.value.trim().toLocaleLowerCase();
345
+ return e ? oe.value.filter(
346
+ (t) => (t.taskTitle + " " + t.taskId + " " + (t.sourceTitle ?? "") + " " + (t.sourceId ?? "") + " " + t.message).toLocaleLowerCase().includes(e)
347
+ ) : oe.value;
348
+ }), At = h(
349
+ () => ye.value.slice(
350
+ (re.value - 1) * 10,
351
+ re.value * 10
352
+ )
353
+ );
354
+ G([ye, fe], () => {
355
+ re.value = Math.min(
356
+ re.value,
357
+ Math.max(1, Math.ceil(ye.value.length / 10))
358
+ );
359
+ }), G(fe, () => re.value = 1), G(
360
+ () => r.showConflicts,
361
+ (e) => {
362
+ e || (te.value = !1);
363
+ }
364
+ );
365
+ let rt = "";
366
+ G(
367
+ oe,
368
+ (e) => {
369
+ const t = JSON.stringify(e);
370
+ t !== rt && (rt = t, w(
371
+ "conflictChange",
372
+ e.map((s) => ({ ...s }))
373
+ ));
374
+ },
375
+ { immediate: !0 }
376
+ );
377
+ const i = ua({
378
+ items: () => r.items,
379
+ rows: () => E.value,
380
+ enabled: R,
381
+ live: () => C,
382
+ root: Le,
383
+ viewport: x,
384
+ grid: je,
385
+ labelWidth: () => Ee.value,
386
+ rowHeight: () => I.value,
387
+ position: (e) => ge.value.get(e),
388
+ locate: ze,
389
+ cancelTask: B,
390
+ update: (e, t) => {
391
+ var s, n;
392
+ return f.capture(e, {
393
+ type: t.type === "add" ? "dependency-add" : t.type === "remove" ? "dependency-remove" : "dependency-move",
394
+ label: (t.type === "add" ? "添加依赖:" : t.type === "remove" ? "删除依赖:" : "改接依赖:") + (((s = Ge.value.get(t.sourceId)) == null ? void 0 : s.title) ?? t.sourceId) + " → " + (((n = Ge.value.get(t.targetId)) == null ? void 0 : n.title) ?? t.targetId)
395
+ });
396
+ },
397
+ change: (e) => w("change", e),
398
+ added: (e, t) => w("dependencyAdd", e, t),
399
+ removed: (e, t) => w("dependencyRemove", e, t),
400
+ moved: (e, t, s) => w("dependencyMove", e, t, s),
401
+ invalid: (e) => w("dependencyInvalid", e)
402
+ }), ue = h(() => {
403
+ var t;
404
+ const e = i.selected.value;
405
+ return e ? (t = Te.value.get(e.targetId)) == null ? void 0 : t.find((s) => s.sourceId === e.sourceId) : void 0;
406
+ }), ut = aa(), me = S(), de = S(), Fe = S(""), Pe = S(), Me = S(""), M = ya(ut, me, {
407
+ placement: "bottom-start",
408
+ gap: 8,
409
+ width: () => 380
410
+ }), ce = h(
411
+ () => de.value === void 0 ? [] : Te.value.get(de.value) ?? []
412
+ ), dt = h(() => {
413
+ const e = Fe.value.trim().toLocaleLowerCase();
414
+ return e ? ce.value.filter(
415
+ (t) => (t.sourceTitle + " " + t.sourceId).toLocaleLowerCase().includes(e)
416
+ ) : ce.value;
417
+ });
418
+ async function Oe(e, t) {
419
+ var s, n, d;
420
+ if (!(!C || !R.value)) {
421
+ if (M.open.value && de.value === t) {
422
+ M.close(!0);
423
+ return;
424
+ }
425
+ i.cancel(!i.selected.value), M.close(), de.value = t, Fe.value = "", Me.value = "", ut.value = e.currentTarget, await M.show(), C && M.open.value && ((d = ((s = me.value) == null ? void 0 : s.querySelector(
426
+ '[data-pg-choice][aria-pressed="true"]'
427
+ )) ?? ((n = me.value) == null ? void 0 : n.querySelector("[data-pg-choice]"))) == null || d.focus());
428
+ }
429
+ }
430
+ async function Ut(e, t) {
431
+ var n, d;
432
+ if (M.close(), i.selectEdge(e, t.sourceId, t.targetId), await ae(), !C) return;
433
+ const s = [
434
+ ...((n = Le.value) == null ? void 0 : n.querySelectorAll(".hys-ui-pg-edge-group")) ?? []
435
+ ].find((b) => b.dataset.edgeKey === t.id);
436
+ (d = (s == null ? void 0 : s.querySelector(".hys-ui-pg-edge-endpoint-hit")) ?? (s == null ? void 0 : s.querySelector(".hys-ui-pg-edge-hit"))) == null || d.focus({ preventScroll: !0 });
437
+ }
438
+ async function ct(e, t, s) {
439
+ var n;
440
+ M.close(), t && s && i.selectEdge(t, s.sourceId, s.targetId), await ze(e) && (F.value = e, w("update:modelValue", e), (n = x.value) == null || n.focus({ preventScroll: !0 }));
441
+ }
442
+ async function Vt(e) {
443
+ M.close(), await ze(e.targetId, { block: "nearest" }), i.beginKeyboard(e.sourceId, e.targetId);
444
+ }
445
+ async function Wt(e) {
446
+ var t, s, n;
447
+ if (!Pe.value) {
448
+ Pe.value = e.id, Me.value = "";
449
+ try {
450
+ await i.remove(e.sourceId, e.targetId) || (Me.value = i.message.value);
451
+ } finally {
452
+ Pe.value = void 0;
453
+ }
454
+ await ae(), C && M.open.value ? (s = (t = me.value) == null ? void 0 : t.querySelector("[data-pg-choice]")) == null || s.focus() : C && ((n = x.value) == null || n.focus({ preventScroll: !0 }));
455
+ }
456
+ }
457
+ function Bt(e) {
458
+ var d, b;
459
+ if (pt(e) || !["ArrowUp", "ArrowDown", "Home", "End"].includes(e.key) || e.target instanceof HTMLInputElement && ["Home", "End"].includes(e.key))
460
+ return;
461
+ e.preventDefault(), e.stopPropagation();
462
+ const t = [
463
+ ...((d = me.value) == null ? void 0 : d.querySelectorAll(
464
+ "[data-pg-choice]"
465
+ )) ?? []
466
+ ], s = t.indexOf(document.activeElement), n = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : s < 0 ? e.key === "ArrowUp" ? t.length - 1 : 0 : (s + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length;
467
+ (b = t[n]) == null || b.focus();
468
+ }
469
+ G(ce, () => {
470
+ M.open.value && (ce.value.length < 2 ? M.close() : ae(M.update));
471
+ }), G(
472
+ [R, () => r.showDependencies, () => !!i.draft.value],
473
+ () => {
474
+ (!R.value || !r.showDependencies || i.draft.value) && M.close();
475
+ }
476
+ ), G(
477
+ () => r.showDependencies,
478
+ (e) => {
479
+ e || i.cancel();
480
+ }
481
+ );
482
+ async function ze(e, t = {}) {
483
+ if (!C) return !1;
484
+ const s = E.value.findIndex((z) => z.id === e);
485
+ if (s < 0 || (await ae(), !C || !x.value)) return !1;
486
+ Ce();
487
+ const n = x.value, d = E.value[s];
488
+ if (!d || d.id !== e) return !1;
489
+ const b = Math.max(I.value, n.clientHeight - 66), a = s * I.value, k = a + I.value;
490
+ let v = t.block === "start" ? a : t.block === "end" ? k - b : t.block === "nearest" ? a < n.scrollTop ? a : k > n.scrollTop + b ? k - b : n.scrollTop : a - (b - I.value) / 2, P = n.scrollLeft;
491
+ if (t.horizontal !== !1) {
492
+ const z = (d.s - O.value.start) * D.value, N = (d.e - d.s + 1) * D.value;
493
+ z < P || N > se.value ? P = z : z + N > P + se.value && (P = z + N - se.value);
494
+ }
495
+ const K = {
496
+ top: Math.max(0, v),
497
+ left: Math.max(0, P),
498
+ behavior: t.behavior ?? "auto"
499
+ };
500
+ return n.scrollTo ? n.scrollTo(K) : (n.scrollTop = K.top, n.scrollLeft = K.left), Z = { top: n.scrollTop, left: n.scrollLeft }, ve.value = n.scrollTop, await ae(), C;
501
+ }
502
+ function Nt(e = {}) {
503
+ if (!C || !x.value) return;
504
+ const t = x.value;
505
+ t.scrollTo ? t.scrollTo({
506
+ top: 0,
507
+ left: t.scrollLeft,
508
+ behavior: e.behavior ?? "auto"
509
+ }) : t.scrollTop = 0, Z = { top: t.scrollTop, left: t.scrollLeft }, ve.value = t.scrollTop;
510
+ }
511
+ function Re(e) {
512
+ var t;
513
+ if (((t = i.draft.value) == null ? void 0 : t.mode) === "keyboard") {
514
+ i.submit(e.id);
515
+ return;
516
+ }
517
+ performance.now() < ft || (i.clearSelected(), F.value = e.id, w("update:modelValue", e.id), w("open", e));
518
+ }
519
+ function vt() {
520
+ F.value !== null && (F.value = null, w("update:modelValue", null));
521
+ }
522
+ function qt(e) {
523
+ pt(e) || (i.key(e), !(e.defaultPrevented || e.key !== "Escape") && (!_.value && F.value === null || (_.value ? B() : vt(), e.preventDefault(), e.stopPropagation())));
524
+ }
525
+ function pt(e) {
526
+ if (!f.enabled.value || !r.historyKeyboard || e.defaultPrevented || e.isComposing || e.altKey || !(e.ctrlKey || e.metaKey))
527
+ return !1;
528
+ const t = e.key.toLowerCase(), s = t === "y" || t === "z" && e.shiftKey;
529
+ return t !== "z" && t !== "y" || e.target instanceof Element && e.target.closest(
530
+ 'input,textarea,select,[contenteditable="true"],[role="textbox"]'
531
+ ) ? !1 : (e.preventDefault(), e.stopPropagation(), _.value || i.draft.value || T.resizing.value ? (B(), i.cancel(), T.cancel(), !0) : (f.pending.value || (s ? f.redo() : f.undo()), !0));
532
+ }
533
+ function ht(e) {
534
+ if (e.type === "click" && e.detail > 0 || e.target instanceof Element && e.target.closest(
535
+ ".hys-ui-pg-edge-hit, .hys-ui-pg-edge-endpoint-hit, .hys-ui-pg-incoming-trigger, .hys-ui-pg-link-feedback button"
536
+ ))
537
+ return;
538
+ i.clearSelected(), M.close();
539
+ const t = e.target;
540
+ !i.draft.value && !_.value && t instanceof Element && !t.closest(
541
+ ".hys-ui-pg-bar, .hys-ui-pg-task-label, .hys-ui-pg-link-port"
542
+ ) && (t === x.value || t.closest(".hys-ui-pg-grid, .hys-ui-pg-task-list")) && vt();
543
+ }
544
+ function gt() {
545
+ if (!C) return;
546
+ const e = x.value;
547
+ e && (e.scrollLeft = Math.max(
548
+ 0,
549
+ (Q(be) - O.value.start) * D.value - se.value / 3
550
+ ));
551
+ }
552
+ G(J, () => ae(gt));
553
+ const _ = S(null);
554
+ let Ye, ft = 0;
555
+ function yt() {
556
+ var t, s;
557
+ const e = Ye;
558
+ Ye = void 0, (s = e == null ? void 0 : (t = e.element).hasPointerCapture) != null && s.call(t, e.id) && e.element.releasePointerCapture(e.id);
559
+ }
560
+ function B() {
561
+ _.value && (ft = performance.now() + 350), _.value = null, yt();
562
+ }
563
+ function Xe(e, t, s) {
564
+ var n;
565
+ !r.editable || t.disabled || e.button !== 0 || f.pending.value || (e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), Ye = { element: e.currentTarget, id: e.pointerId }, (n = e.currentTarget.closest(".hys-ui-pg-bar")) == null || n.focus({ preventScroll: !0 }), _.value = {
566
+ id: t.id,
567
+ type: s,
568
+ x: e.clientX,
569
+ original: { ...t },
570
+ days: 0,
571
+ unitWidth: D.value
572
+ }, F.value = t.id, w("update:modelValue", t.id));
573
+ }
574
+ function Je(e) {
575
+ _.value && (_.value.days = Math.round(
576
+ (e.clientX - _.value.x) / _.value.unitWidth
577
+ ));
578
+ }
579
+ function ke(e) {
580
+ const t = _.value;
581
+ if (!t || (_.value = null, yt(), e.type === "pointercancel" || !t.days)) return;
582
+ const s = Ge.value.get(t.id);
583
+ if (!r.editable || !s || s.disabled) return;
584
+ const n = we(t.original.start), d = we(t.original.end);
585
+ if (!n || !d) return;
586
+ let b = Q(n), a = Q(d);
587
+ t.type === "move" ? (b += t.days, a += t.days) : t.type === "start" ? b = Math.min(a, b + t.days) : a = Math.max(b, a + t.days);
588
+ const k = {
589
+ ...s,
590
+ start: _e(b),
591
+ end: _e(a)
592
+ };
593
+ f.capture(
594
+ r.items.map((v) => v.id === k.id ? k : v),
595
+ {
596
+ type: t.type === "move" ? "move" : t.type === "start" ? "resize-start" : "resize-end",
597
+ label: (t.type === "move" ? "移动任务:" : t.type === "start" ? "调整开始日期:" : "调整结束日期:") + k.title
598
+ }
599
+ ) && w("change", k);
600
+ }
601
+ function mt(e) {
602
+ const t = _.value;
603
+ if (!t || t.id !== e.id) return { s: e.s, e: e.e };
604
+ const s = t.days;
605
+ return t.type === "move" ? { s: e.s + s, e: e.e + s } : t.type === "start" ? { s: Math.min(e.e, e.s + s), e: e.e } : { s: e.s, e: Math.max(e.s, e.e + s) };
606
+ }
607
+ function Gt(e) {
608
+ const t = mt(e);
609
+ return {
610
+ left: `${(t.s - O.value.start) * D.value}px`,
611
+ width: `${Math.max(D.value, (t.e - t.s + 1) * D.value)}px`,
612
+ background: e.color || "var(--hys-ui-primary,var(--hys-ui-theme-primary, #4776ed))"
613
+ };
614
+ }
615
+ function Ot(e) {
616
+ return {
617
+ left: (mt(e).e - O.value.start + 1) * D.value + 5 + "px"
618
+ };
619
+ }
620
+ function Ae(e, t) {
621
+ if (!r.editable || e.disabled || f.pending.value) return;
622
+ const s = we(e.start), n = we(e.end);
623
+ if (!s || !n) return;
624
+ const d = {
625
+ ...e,
626
+ start: _e(Q(s) + t),
627
+ end: _e(Q(n) + t)
628
+ };
629
+ f.capture(
630
+ r.items.map((b) => b.id === e.id ? d : b),
631
+ { type: "nudge", label: "微调排期:" + d.title }
632
+ ) && w("change", d);
633
+ }
634
+ const Y = h(() => {
635
+ const e = _.value;
636
+ if (!e || !e.days) return;
637
+ const t = ne.value.tasks.get(e.id);
638
+ if (!t || t.s === null || t.e === null) return;
639
+ const s = e.type === "end" ? t.s : e.type === "start" ? Math.min(t.e, t.s + e.days) : t.s + e.days, n = e.type === "start" ? t.e : e.type === "end" ? Math.max(t.s, t.e + e.days) : t.e + e.days, d = (ne.value.incident.get(e.id) ?? []).flatMap(
640
+ (v) => {
641
+ const P = ne.value.byEdge.get(v.id);
642
+ return (P == null ? void 0 : P.type) === "dependency-order" ? [P] : [];
643
+ }
644
+ ), b = ba(ne.value, e.id, s, n), a = new Set(d.map((v) => v.id)), k = new Set(b.map((v) => v.id));
645
+ return {
646
+ conflicts: b,
647
+ added: b.filter((v) => !a.has(v.id)).length,
648
+ resolved: d.filter((v) => !k.has(v.id)).length,
649
+ before: d.length
650
+ };
651
+ });
652
+ function Ue(e) {
653
+ return ne.value.byTask.get(e) ?? [];
654
+ }
655
+ function kt(e, t) {
656
+ return ne.value.byEdge.get(wa(e, t));
657
+ }
658
+ function Yt(e) {
659
+ return {
660
+ "dependency-order": "前后置日期冲突",
661
+ "invalid-date": "日期无效",
662
+ "missing-dependency": "前置引用失效",
663
+ "dependency-cycle": "循环依赖"
664
+ }[e];
665
+ }
666
+ async function Xt(e) {
667
+ var t;
668
+ await ze(e.taskId) && (F.value = e.taskId, w("update:modelValue", e.taskId), e.sourceId !== void 0 && ge.value.has(e.sourceId) && i.selectEdge(new Event("select"), e.sourceId, e.taskId), (t = x.value) == null || t.focus({ preventScroll: !0 }));
669
+ }
670
+ return St({
671
+ element: Le,
672
+ viewport: x,
673
+ scrollToTask: ze,
674
+ scrollToTop: Nt,
675
+ addDependency: i.add,
676
+ removeDependency: i.remove,
677
+ moveDependency: i.moveTarget,
678
+ cancelDependency: () => i.cancel(),
679
+ undo: f.undo,
680
+ redo: f.redo,
681
+ clearHistory: f.clear,
682
+ canUndo: f.canUndo,
683
+ canRedo: f.canRedo,
684
+ historyState: f.state,
685
+ conflicts: Rt
686
+ }), (e, t) => {
687
+ var s, n, d, b;
688
+ return o(), c("section", xt({
689
+ ref_key: "root",
690
+ ref: Le
691
+ }, l(Ze), {
692
+ class: ["hys-ui-pg-gantt", { "hys-ui-pg-resizing-label": l(T).resizing.value }],
693
+ "aria-label": "项目甘特图",
694
+ onKeydown: qt,
695
+ onPointerdownCapture: ht,
696
+ onClickCapture: ht
697
+ }), [
698
+ u("div", xa, [
699
+ y(ia, {
700
+ class: "hys-ui-pg-scale",
701
+ "model-value": J.value,
702
+ options: [
703
+ { label: "日", value: "day" },
704
+ { label: "周", value: "week" },
705
+ { label: "月", value: "month" }
706
+ ],
707
+ "aria-label": "时间刻度",
708
+ "onUpdate:modelValue": Kt
709
+ }, null, 8, ["model-value"]),
710
+ y(W, {
711
+ variant: "secondary",
712
+ size: "sm",
713
+ class: "hys-ui-pg-today",
714
+ onClick: gt
715
+ }, {
716
+ default: U(() => [...t[23] || (t[23] = [
717
+ j("定位今天", -1)
718
+ ])]),
719
+ _: 1
720
+ }),
721
+ l(f).enabled.value && $.showHistoryControls && ($.editable || R.value || l(f).state.value.undoCount || l(f).state.value.redoCount) ? (o(), c("div", Ia, [
722
+ y(W, {
723
+ variant: "secondary",
724
+ size: "sm",
725
+ disabled: !l(f).canUndo.value,
726
+ "aria-label": "撤销",
727
+ title: (l(f).state.value.undoLabel ? "撤销:" + l(f).state.value.undoLabel : "没有可撤销的操作") + "(Ctrl/⌘ + Z)",
728
+ onClick: t[0] || (t[0] = (a) => l(f).undo())
729
+ }, {
730
+ default: U(() => [
731
+ y(l(da), { size: 15 }),
732
+ t[24] || (t[24] = j("撤销", -1))
733
+ ]),
734
+ _: 1
735
+ }, 8, ["disabled", "title"]),
736
+ y(W, {
737
+ variant: "secondary",
738
+ size: "sm",
739
+ disabled: !l(f).canRedo.value,
740
+ "aria-label": "重做",
741
+ title: (l(f).state.value.redoLabel ? "重做:" + l(f).state.value.redoLabel : "没有可重做的操作") + "(Ctrl/⌘ + Shift + Z)",
742
+ onClick: t[1] || (t[1] = (a) => l(f).redo())
743
+ }, {
744
+ default: U(() => [
745
+ y(l(ca), { size: 15 }),
746
+ t[25] || (t[25] = j("重做", -1))
747
+ ]),
748
+ _: 1
749
+ }, 8, ["disabled", "title"])
750
+ ])) : g("", !0),
751
+ u("span", Ca, p($.editable ? "拖动任务条调整排期 · Alt + 左/右方向键微调日期 · Esc / 点击空白取消选中" : "点击任务查看详情 · Esc / 点击空白取消选中"), 1)
752
+ ]),
753
+ u("div", {
181
754
  ref_key: "scroller",
182
- ref: k,
183
- class: "hys-ui-pg-scroll",
755
+ ref: x,
756
+ class: "hys-ui-pg-body hys-ui-pg-scroll",
757
+ style: H(Lt.value),
758
+ role: "region",
184
759
  tabindex: "0",
185
- "aria-label": "可横向滚动的甘特图时间轴"
760
+ "aria-label": "可滚动的甘特图任务与时间轴",
761
+ onScrollPassive: lt,
762
+ onPointermove: t[11] || (t[11] = //@ts-ignore
763
+ (...a) => l(i).move && l(i).move(...a)),
764
+ onPointerup: t[12] || (t[12] = //@ts-ignore
765
+ (...a) => l(i).end && l(i).end(...a)),
766
+ onPointercancel: t[13] || (t[13] = //@ts-ignore
767
+ (...a) => l(i).lost && l(i).lost(...a)),
768
+ onLostpointercapture: t[14] || (t[14] = //@ts-ignore
769
+ (...a) => l(i).lost && l(i).lost(...a))
186
770
  }, [
187
- r("div", {
188
- class: "hys-ui-pg-canvas",
189
- style: p({ width: J.value + "px" })
771
+ u("div", {
772
+ ref_key: "labels",
773
+ ref: $e,
774
+ class: "hys-ui-pg-labels",
775
+ style: H({
776
+ width: l(T).width.value + "px",
777
+ minWidth: l(T).width.value + "px"
778
+ })
190
779
  }, [
191
- r("div", He, [
192
- (i(!0), o(P, null, S(he.value, (t) => (i(), o("span", {
193
- key: t.key,
194
- title: t.label,
195
- style: p({ left: t.left + "px", width: t.width + "px" })
196
- }, f(t.label), 13, Ue))), 128))
197
- ]),
198
- r("div", Ve, [
199
- (i(!0), o(P, null, S(B.value, (t) => (i(), o("span", {
200
- key: t,
201
- class: K({ "hys-ui-weekend": [0, 6].includes(U(t).getUTCDay()), "hys-ui-today": t === h(q(H)) }),
202
- style: p({ width: u.value + "px" })
203
- }, f(w.value === "month" ? "" : U(t).getUTCDate()), 7))), 128))
780
+ u("div", Ta, [
781
+ t[26] || (t[26] = j(" 任务 / 负责人 ", -1)),
782
+ $.labelResizable ? (o(), c("div", {
783
+ key: 0,
784
+ class: "hys-ui-pg-label-resizer",
785
+ role: "separator",
786
+ tabindex: "0",
787
+ "aria-label": "任务名称列宽",
788
+ "aria-orientation": "vertical",
789
+ "aria-valuenow": l(T).width.value,
790
+ "aria-valuemin": l(T).minimum.value,
791
+ "aria-valuemax": l(T).maximum.value,
792
+ style: H({ height: Ve.value + "px" }),
793
+ title: "拖动调整任务列宽;左右键微调,Shift 加速,双击还原",
794
+ onPointerdown: t[2] || (t[2] = m(
795
+ //@ts-ignore
796
+ (...a) => l(T).down && l(T).down(...a),
797
+ ["stop", "prevent"]
798
+ )),
799
+ onPointermove: t[3] || (t[3] = //@ts-ignore
800
+ (...a) => l(T).move && l(T).move(...a)),
801
+ onPointerup: t[4] || (t[4] = //@ts-ignore
802
+ (...a) => l(T).up && l(T).up(...a)),
803
+ onPointercancel: t[5] || (t[5] = //@ts-ignore
804
+ (...a) => l(T).up && l(T).up(...a)),
805
+ onLostpointercapture: t[6] || (t[6] = //@ts-ignore
806
+ (...a) => l(T).cancel && l(T).cancel(...a)),
807
+ onKeydown: t[7] || (t[7] = //@ts-ignore
808
+ (...a) => l(T).key && l(T).key(...a)),
809
+ onDblclick: t[8] || (t[8] = m(
810
+ //@ts-ignore
811
+ (...a) => l(T).reset && l(T).reset(...a),
812
+ ["stop"]
813
+ ))
814
+ }, null, 44, Pa)) : g("", !0)
204
815
  ]),
205
- r("div", {
206
- class: "hys-ui-pg-grid",
207
- style: p({ height: v.value.length * d.rowHeight + "px" })
816
+ u("div", {
817
+ class: "hys-ui-pg-task-list",
818
+ style: H({ height: E.value.length * I.value + "px" })
208
819
  }, [
209
- (i(!0), o(P, null, S(B.value, (t) => (i(), o("div", {
210
- key: t,
211
- class: K(["hys-ui-pg-day-column", { "hys-ui-weekend": [0, 6].includes(U(t).getUTCDay()) }]),
212
- style: p({ left: (t - b.value.start) * u.value + "px", width: u.value + "px" })
213
- }, null, 6))), 128)),
214
- r("div", {
215
- class: "hys-ui-pg-today-line",
216
- style: p({ left: (h(q(H)) - b.value.start) * u.value + u.value / 2 + "px" })
217
- }, null, 4),
218
- (i(!0), o(P, null, S(v.value, (t, l) => {
219
- var a;
220
- return i(), o("div", {
221
- key: t.id,
222
- class: "hys-ui-pg-row",
223
- style: p({ top: l * d.rowHeight + "px", height: d.rowHeight + "px" })
820
+ (o(!0), c(q, null, ee(tt.value, (a) => {
821
+ var k, v, P;
822
+ return o(), c("button", {
823
+ type: "button",
824
+ key: a.task.id,
825
+ class: X(["hys-ui-pg-task-label", {
826
+ "hys-ui-selected": F.value === a.task.id,
827
+ "hys-ui-pg-task-has-conflict": $.showConflicts && Ue(a.task.id).length > 0,
828
+ "hys-ui-pg-link-target": ((k = l(i).draft.value) == null ? void 0 : k.targetId) === a.task.id,
829
+ "hys-ui-pg-link-invalid": ((v = l(i).draft.value) == null ? void 0 : v.targetId) === a.task.id && !!((P = l(i).draft.value) != null && P.reason)
830
+ }]),
831
+ "aria-pressed": F.value === a.task.id,
832
+ "data-row-index": a.index,
833
+ style: H({
834
+ height: I.value + "px",
835
+ top: a.index * I.value + "px"
836
+ }),
837
+ onClick: (K) => Re(a.task),
838
+ onKeydown: [
839
+ V(m((K) => Ae(a.task, -1), ["alt", "prevent"]), ["left"]),
840
+ V(m((K) => Ae(a.task, 1), ["alt", "prevent"]), ["right"])
841
+ ]
224
842
  }, [
225
- r("div", {
226
- class: K(["hys-ui-pg-bar", { "hys-ui-selected": T.value === t.id, "hys-ui-dragging": ((a = g.value) == null ? void 0 : a.id) === t.id, "hys-ui-disabled": t.disabled }]),
227
- style: p(pe(t)),
228
- role: "button",
229
- tabindex: "0",
230
- "aria-label": `${t.title},${t.start} 至 ${t.end},完成 ${t.progress}%`,
231
- title: `${t.title}
232
- ${t.start} → ${t.end}
233
- 完成 ${t.progress}%`,
234
- onClick: (s) => F(t),
235
- onKeydown: [
236
- _((s) => F(t), ["enter"]),
237
- _(x((s) => F(t), ["prevent"]), ["space"]),
238
- _(x((s) => E(t, -1), ["alt", "prevent"]), ["left"]),
239
- _(x((s) => E(t, 1), ["alt", "prevent"]), ["right"])
240
- ],
241
- onPointerdown: (s) => O(s, t, "move"),
242
- onPointermove: X,
243
- onPointerup: D,
244
- onPointercancel: D,
245
- onLostpointercapture: V
843
+ u("strong", {
844
+ title: a.task.title
845
+ }, p(a.task.title), 9, za),
846
+ u("small", null, p(a.task.owner || "未分配") + " · " + p(a.task.status || "待办"), 1),
847
+ $.showConflicts && Ue(a.task.id).length ? (o(), c("span", {
848
+ key: 0,
849
+ class: "hys-ui-pg-task-warning",
850
+ "aria-hidden": "true",
851
+ title: Ue(a.task.id).map((K) => K.message).join(`
852
+ `)
246
853
  }, [
247
- r("div", {
248
- class: "hys-ui-pg-progress",
249
- style: p({ width: t.progress + "%" })
250
- }, null, 4),
251
- r("span", ze, f(t.progress) + "%", 1),
252
- d.editable && !t.disabled ? (i(), o("span", {
253
- key: 0,
254
- class: "hys-ui-pg-handle hys-ui-start",
255
- title: "调整开始日期",
256
- onPointerdown: x((s) => O(s, t, "start"), ["stop"]),
257
- onPointermove: X,
258
- onPointerup: D,
259
- onPointercancel: D,
260
- onLostpointercapture: V
261
- }, null, 40, Le)) : z("", !0),
262
- d.editable && !t.disabled ? (i(), o("span", {
263
- key: 1,
264
- class: "hys-ui-pg-handle hys-ui-end",
265
- title: "调整结束日期",
266
- onPointerdown: x((s) => O(s, t, "end"), ["stop"]),
267
- onPointermove: X,
268
- onPointerup: D,
269
- onPointercancel: D,
270
- onLostpointercapture: V
271
- }, null, 40, Ae)) : z("", !0)
272
- ], 46, We)
273
- ], 4);
274
- }), 128)),
275
- ee.value.length ? (i(), o("svg", {
276
- key: 0,
277
- class: "hys-ui-pg-dependencies",
278
- width: J.value,
279
- height: v.value.length * d.rowHeight,
280
- "aria-hidden": "true"
854
+ y(l(Ct), { size: 14 })
855
+ ], 8, Sa)) : g("", !0)
856
+ ], 46, Ma);
857
+ }), 128))
858
+ ], 4),
859
+ E.value.length ? g("", !0) : (o(), c("div", Da, " 暂无有效排期任务 "))
860
+ ], 4),
861
+ u("div", {
862
+ class: "hys-ui-pg-timeline",
863
+ style: H({ width: Be.value + "px" })
864
+ }, [
865
+ u("div", {
866
+ class: "hys-ui-pg-canvas",
867
+ style: H({ width: Be.value + "px" })
868
+ }, [
869
+ u("div", La, [
870
+ (o(!0), c(q, null, ee(Ht.value, (a) => (o(), c("span", {
871
+ key: a.key,
872
+ title: a.label,
873
+ style: H({ left: a.left + "px", width: a.width + "px" })
874
+ }, p(a.label), 13, $a))), 128))
875
+ ]),
876
+ u("div", Ea, [
877
+ (o(!0), c(q, null, ee(He.value, (a) => (o(), c("span", {
878
+ key: a,
879
+ class: X({
880
+ "hys-ui-weekend": [0, 6].includes(xe(a).getUTCDay()),
881
+ "hys-ui-today": a === Q(l(be))
882
+ }),
883
+ style: H({ width: D.value + "px" })
884
+ }, p(J.value === "month" ? "" : xe(a).getUTCDate()), 7))), 128))
885
+ ]),
886
+ u("div", {
887
+ ref_key: "grid",
888
+ ref: je,
889
+ class: "hys-ui-pg-grid",
890
+ style: H({ height: E.value.length * I.value + "px" })
281
891
  }, [
282
- (i(!0), o(P, null, S(ee.value, (t) => (i(), o("path", {
283
- key: t.id,
284
- d: t.path,
285
- fill: "none",
286
- stroke: "currentColor",
287
- "stroke-width": "1.5",
288
- "stroke-dasharray": "4 3"
289
- }, null, 8, Fe))), 128))
290
- ], 8, Be)) : z("", !0)
892
+ (o(!0), c(q, null, ee(He.value, (a) => (o(), c("div", {
893
+ key: a,
894
+ class: X(["hys-ui-pg-day-column", {
895
+ "hys-ui-weekend": [0, 6].includes(xe(a).getUTCDay())
896
+ }]),
897
+ style: H({
898
+ left: (a - O.value.start) * D.value + "px",
899
+ width: D.value + "px"
900
+ })
901
+ }, null, 6))), 128)),
902
+ u("div", {
903
+ class: "hys-ui-pg-today-line",
904
+ style: H({
905
+ left: (Q(l(be)) - O.value.start) * D.value + D.value / 2 + "px"
906
+ })
907
+ }, null, 4),
908
+ (o(!0), c(q, null, ee(tt.value, (a) => {
909
+ var k, v, P, K, z, N, Se;
910
+ return o(), c("div", {
911
+ key: a.task.id,
912
+ class: "hys-ui-pg-row",
913
+ "data-row-index": a.index,
914
+ style: H({
915
+ top: a.index * I.value + "px",
916
+ height: I.value + "px"
917
+ })
918
+ }, [
919
+ u("div", {
920
+ class: X(["hys-ui-pg-bar", {
921
+ "hys-ui-selected": F.value === a.task.id,
922
+ "hys-ui-dragging": ((k = _.value) == null ? void 0 : k.id) === a.task.id,
923
+ "hys-ui-disabled": a.task.disabled,
924
+ "hys-ui-pg-bar-has-conflict": $.showConflicts && (((v = _.value) == null ? void 0 : v.id) === a.task.id && Y.value ? Y.value.conflicts.length > 0 : Ue(a.task.id).length > 0),
925
+ "hys-ui-pg-link-source": ((P = l(i).draft.value) == null ? void 0 : P.sourceId) === a.task.id,
926
+ "hys-ui-pg-link-target": ((K = l(i).draft.value) == null ? void 0 : K.targetId) === a.task.id,
927
+ "hys-ui-pg-link-invalid": ((z = l(i).draft.value) == null ? void 0 : z.targetId) === a.task.id && !!((N = l(i).draft.value) != null && N.reason)
928
+ }]),
929
+ style: H(Gt(a.task)),
930
+ role: "button",
931
+ "aria-pressed": F.value === a.task.id,
932
+ tabindex: "0",
933
+ "aria-label": `${a.task.title},${a.task.start} 至 ${a.task.end},完成 ${a.task.progress}%`,
934
+ title: `${a.task.title}
935
+ ${a.task.start} → ${a.task.end}
936
+ 完成 ${a.task.progress}%`,
937
+ onClick: (L) => Re(a.task),
938
+ onKeydown: [
939
+ V((L) => Re(a.task), ["enter"]),
940
+ V(m((L) => Re(a.task), ["prevent"]), ["space"]),
941
+ V(m((L) => Ae(a.task, -1), ["alt", "prevent"]), ["left"]),
942
+ V(m((L) => Ae(a.task, 1), ["alt", "prevent"]), ["right"])
943
+ ],
944
+ onPointerdown: (L) => Xe(L, a.task, "move"),
945
+ onPointermove: Je,
946
+ onPointerup: ke,
947
+ onPointercancel: ke,
948
+ onLostpointercapture: B
949
+ }, [
950
+ u("div", {
951
+ class: "hys-ui-pg-progress",
952
+ style: H({ width: a.task.progress + "%" })
953
+ }, null, 4),
954
+ u("span", Ha, p(a.task.progress) + "%", 1),
955
+ $.editable && !a.task.disabled ? (o(), c("span", {
956
+ key: 0,
957
+ class: "hys-ui-pg-handle hys-ui-start",
958
+ title: "调整开始日期",
959
+ onPointerdown: m((L) => Xe(L, a.task, "start"), ["stop"]),
960
+ onPointermove: Je,
961
+ onPointerup: ke,
962
+ onPointercancel: ke,
963
+ onLostpointercapture: B
964
+ }, null, 40, Fa)) : g("", !0),
965
+ $.editable && !a.task.disabled ? (o(), c("span", {
966
+ key: 1,
967
+ class: "hys-ui-pg-handle hys-ui-end",
968
+ title: "调整结束日期",
969
+ onPointerdown: m((L) => Xe(L, a.task, "end"), ["stop"]),
970
+ onPointermove: Je,
971
+ onPointerup: ke,
972
+ onPointercancel: ke,
973
+ onLostpointercapture: B
974
+ }, null, 40, Ra)) : g("", !0)
975
+ ], 46, Ka),
976
+ R.value && $.showDependencies && !a.task.disabled ? (o(), c("button", {
977
+ key: 0,
978
+ type: "button",
979
+ class: X(["hys-ui-pg-link-port", {
980
+ "hys-ui-pg-link-port-visible": F.value === a.task.id || ((Se = l(i).draft.value) == null ? void 0 : Se.sourceId) === a.task.id
981
+ }]),
982
+ style: H(Ot(a.task)),
983
+ "aria-label": "连接后续任务:" + a.task.title,
984
+ title: "拖动到后置任务,或点击后选择任务;也支持 Enter 和上下键",
985
+ onPointerdown: m((L) => l(i).beginPointer(L, a.task.id), ["stop", "prevent"]),
986
+ onClick: m((L) => l(i).clickSource(L, a.task.id), ["stop"]),
987
+ onKeydown: [
988
+ V(m((L) => l(i).beginKeyboard(a.task.id), ["stop", "prevent"]), ["enter"]),
989
+ V(m((L) => l(i).beginKeyboard(a.task.id), ["stop", "prevent"]), ["space"])
990
+ ]
991
+ }, null, 46, Aa)) : g("", !0)
992
+ ], 12, _a);
993
+ }), 128)),
994
+ $.showDependencies && nt.value.length || l(i).draft.value ? (o(), c("svg", {
995
+ key: 0,
996
+ class: X(["hys-ui-pg-dependencies", {
997
+ "hys-ui-pg-has-edge-selection": !!l(i).selected.value
998
+ }]),
999
+ width: Be.value,
1000
+ height: E.value.length * I.value,
1001
+ "aria-hidden": !R.value || void 0
1002
+ }, [
1003
+ $.showDependencies ? (o(), c(q, { key: 0 }, [
1004
+ (o(!0), c(q, null, ee(nt.value, (a) => {
1005
+ var k, v, P, K, z, N, Se, L, bt, wt;
1006
+ return o(), c("g", {
1007
+ key: a.id,
1008
+ class: X(["hys-ui-pg-edge-group", {
1009
+ "hys-ui-pg-edge-shared": (((k = Te.value.get(a.targetId)) == null ? void 0 : k.length) ?? 0) > 1,
1010
+ "hys-ui-pg-edge-current": ((v = l(i).selected.value) == null ? void 0 : v.sourceId) === a.sourceId && ((P = l(i).selected.value) == null ? void 0 : P.targetId) === a.targetId,
1011
+ "hys-ui-pg-edge-rewiring": ((K = l(i).draft.value) == null ? void 0 : K.sourceId) === a.sourceId && ((z = l(i).draft.value) == null ? void 0 : z.previousTargetId) === a.targetId
1012
+ }]),
1013
+ "data-edge-key": a.id
1014
+ }, [
1015
+ u("path", {
1016
+ class: X(["hys-ui-pg-edge-line", {
1017
+ "hys-ui-pg-edge-selected": ((N = l(i).selected.value) == null ? void 0 : N.sourceId) === a.sourceId && ((Se = l(i).selected.value) == null ? void 0 : Se.targetId) === a.targetId,
1018
+ "hys-ui-pg-edge-conflict": $.showConflicts && !!kt(a.sourceId, a.targetId),
1019
+ "hys-ui-pg-edge-related": F.value === a.sourceId || F.value === a.targetId
1020
+ }]),
1021
+ d: a.path,
1022
+ fill: "none",
1023
+ stroke: "currentColor",
1024
+ "stroke-width": "1.5"
1025
+ }, null, 10, Wa),
1026
+ R.value ? (o(), c("path", {
1027
+ key: 0,
1028
+ class: "hys-ui-pg-edge-hit",
1029
+ d: (((L = Te.value.get(a.targetId)) == null ? void 0 : L.length) ?? 0) > 1 && !(((bt = l(i).selected.value) == null ? void 0 : bt.sourceId) === a.sourceId && ((wt = l(i).selected.value) == null ? void 0 : wt.targetId) === a.targetId) ? a.pickPath : a.path,
1030
+ fill: "none",
1031
+ stroke: "transparent",
1032
+ "stroke-width": "12",
1033
+ role: "button",
1034
+ tabindex: "0",
1035
+ "aria-label": "依赖 " + a.sourceId + " → " + a.targetId + ",选中后按 Delete 移除",
1036
+ onPointerdown: t[9] || (t[9] = m(() => {
1037
+ }, ["stop"])),
1038
+ onClick: m((A) => l(i).selectEdge(A, a.sourceId, a.targetId), ["stop"]),
1039
+ onFocus: (A) => l(i).selectEdge(A, a.sourceId, a.targetId),
1040
+ onKeydown: V(m((A) => l(i).selectEdge(A, a.sourceId, a.targetId), ["prevent", "stop"]), ["enter"])
1041
+ }, null, 40, Ba)) : g("", !0),
1042
+ R.value && a.editable ? (o(), c(q, { key: 1 }, [
1043
+ u("circle", {
1044
+ class: "hys-ui-pg-edge-endpoint",
1045
+ cx: a.endpoint.x,
1046
+ cy: a.endpoint.y,
1047
+ r: "5",
1048
+ "aria-hidden": "true"
1049
+ }, null, 8, Na),
1050
+ u("circle", {
1051
+ class: "hys-ui-pg-edge-endpoint-hit",
1052
+ cx: a.endpoint.x,
1053
+ cy: a.endpoint.y,
1054
+ r: "12",
1055
+ fill: "transparent",
1056
+ role: "button",
1057
+ tabindex: "0",
1058
+ "aria-label": "改接依赖终点:" + a.sourceId + " → " + a.targetId,
1059
+ onFocus: (A) => l(i).selectEdge(A, a.sourceId, a.targetId),
1060
+ onPointerdown: m((A) => l(i).beginPointer(A, a.sourceId, a.targetId), ["stop", "prevent"]),
1061
+ onClick: m((A) => l(i).clickSource(A, a.sourceId, a.targetId), ["stop"]),
1062
+ onKeydown: [
1063
+ V(m((A) => l(i).beginKeyboard(a.sourceId, a.targetId), ["stop", "prevent"]), ["enter"]),
1064
+ V(m((A) => l(i).beginKeyboard(a.sourceId, a.targetId), ["stop", "prevent"]), ["space"])
1065
+ ]
1066
+ }, [
1067
+ u("title", null, p(a.sourceTitle) + " → " + p(a.targetTitle) + ":拖动修改连接终点,或按 Enter 后用上下键选择新任务 ", 1)
1068
+ ], 40, qa)
1069
+ ], 64)) : g("", !0)
1070
+ ], 10, Va);
1071
+ }), 128)),
1072
+ ue.value ? (o(), c(q, { key: 0 }, [
1073
+ u("path", {
1074
+ class: X(["hys-ui-pg-active-edge-line", {
1075
+ "hys-ui-pg-edge-conflict": $.showConflicts && !!kt(
1076
+ ue.value.sourceId,
1077
+ ue.value.targetId
1078
+ )
1079
+ }]),
1080
+ d: ue.value.path,
1081
+ fill: "none",
1082
+ "stroke-width": "2.5"
1083
+ }, null, 10, Ga),
1084
+ ue.value.editable && R.value ? (o(), c("circle", {
1085
+ key: 0,
1086
+ class: "hys-ui-pg-active-endpoint",
1087
+ cx: ue.value.endpoint.x,
1088
+ cy: ue.value.endpoint.y,
1089
+ r: "5"
1090
+ }, null, 8, Oa)) : g("", !0)
1091
+ ], 64)) : g("", !0),
1092
+ R.value ? (o(!0), c(q, { key: 1 }, ee(Ft.value, (a) => {
1093
+ var k;
1094
+ return o(), c("g", {
1095
+ key: a.id,
1096
+ class: "hys-ui-pg-incoming-trigger",
1097
+ transform: `translate(${a.x} ${a.y})`,
1098
+ role: "button",
1099
+ tabindex: "0",
1100
+ "aria-haspopup": "dialog",
1101
+ "aria-expanded": l(M).open.value && de.value === a.id,
1102
+ "aria-label": "选择前置依赖:" + a.title + "," + a.count + " 条",
1103
+ onPointerdown: t[10] || (t[10] = m(() => {
1104
+ }, ["stop"])),
1105
+ onClick: m((v) => Oe(v, a.id), ["stop"]),
1106
+ onKeydown: [
1107
+ V(m((v) => Oe(v, a.id), ["stop", "prevent"]), ["enter"]),
1108
+ V(m((v) => Oe(v, a.id), ["stop", "prevent"]), ["space"])
1109
+ ]
1110
+ }, [
1111
+ t[27] || (t[27] = u("circle", {
1112
+ r: "13",
1113
+ fill: "transparent",
1114
+ class: "hys-ui-pg-incoming-hit"
1115
+ }, null, -1)),
1116
+ ((k = l(i).selected.value) == null ? void 0 : k.targetId) !== a.id ? (o(), c("circle", Xa)) : g("", !0),
1117
+ t[28] || (t[28] = u("circle", {
1118
+ r: "9",
1119
+ class: "hys-ui-pg-incoming-badge"
1120
+ }, null, -1)),
1121
+ u("text", Ja, p(a.count > 99 ? "99+" : a.count), 1),
1122
+ u("title", null, p(a.title) + " 有 " + p(a.count) + " 条前置关系,点击选择要编辑的连线 ", 1)
1123
+ ], 40, Ya);
1124
+ }), 128)) : g("", !0)
1125
+ ], 64)) : g("", !0),
1126
+ l(i).draft.value ? (o(), c("path", {
1127
+ key: 1,
1128
+ class: X(["hys-ui-pg-link-preview", {
1129
+ "hys-ui-pg-link-preview-invalid": !!l(i).draft.value.reason
1130
+ }]),
1131
+ d: l(i).path.value,
1132
+ fill: "none",
1133
+ stroke: "currentColor",
1134
+ "stroke-width": "2",
1135
+ "stroke-dasharray": "5 4"
1136
+ }, null, 10, Qa)) : g("", !0)
1137
+ ], 10, Ua)) : g("", !0)
1138
+ ], 4)
291
1139
  ], 4)
292
1140
  ], 4)
293
- ], 512)
294
- ]),
295
- r("div", Ee, [
296
- ie(f(v.value.length) + " 项任务 · " + f(v.value.filter((t) => t.status === "已完成").length) + " 项已完成 ", 1),
297
- v.value.length !== d.items.length ? (i(), o("span", Ke, "· " + f(d.items.length - v.value.length) + " 项日期无效已隐藏", 1)) : z("", !0)
298
- ])
299
- ], 16));
1141
+ ], 36),
1142
+ u("div", Za, [
1143
+ j(p(E.value.length) + " 项任务 · " + p($t.value) + " 项已完成 ", 1),
1144
+ E.value.length !== $.items.length ? (o(), c("span", ja, "· " + p($.items.length - E.value.length) + " 项日期无效已隐藏", 1)) : g("", !0),
1145
+ R.value ? (o(), c("div", el, [
1146
+ u("span", tl, p(l(i).message.value || "拖动圆点连接依赖;选中连线可拖动终点改接或移除。"), 1),
1147
+ l(i).draft.value ? (o(), De(W, {
1148
+ key: 0,
1149
+ variant: "ghost",
1150
+ size: "sm",
1151
+ onClick: t[15] || (t[15] = (a) => l(i).cancel())
1152
+ }, {
1153
+ default: U(() => [
1154
+ y(l(Tt), { size: 14 }),
1155
+ t[29] || (t[29] = j("取消连接", -1))
1156
+ ]),
1157
+ _: 1
1158
+ })) : l(i).selected.value ? (o(), De(W, {
1159
+ key: 1,
1160
+ variant: "ghost",
1161
+ size: "sm",
1162
+ onClick: t[16] || (t[16] = (a) => l(i).remove(
1163
+ l(i).selected.value.sourceId,
1164
+ l(i).selected.value.targetId
1165
+ ))
1166
+ }, {
1167
+ default: U(() => [
1168
+ y(l(Pt), { size: 14 }),
1169
+ t[30] || (t[30] = j("移除依赖", -1))
1170
+ ]),
1171
+ _: 1
1172
+ })) : g("", !0)
1173
+ ])) : g("", !0),
1174
+ l(f).message.value ? (o(), c("p", al, p(l(f).message.value), 1)) : g("", !0),
1175
+ $.showConflicts && (oe.value.length || te.value || Y.value && (Y.value.before || Y.value.conflicts.length)) ? (o(), c("div", ll, [
1176
+ u("div", sl, [
1177
+ y(l(Ct), { size: 14 }),
1178
+ u("span", il, p(oe.value.length ? oe.value.length + " 项排期冲突" : "当前排期检查正常"), 1),
1179
+ y(W, {
1180
+ variant: "ghost",
1181
+ size: "sm",
1182
+ "aria-expanded": te.value,
1183
+ "aria-controls": ot,
1184
+ onClick: t[17] || (t[17] = (a) => te.value = !te.value)
1185
+ }, {
1186
+ default: U(() => [
1187
+ j(p(te.value ? "收起详情" : "查看详情"), 1),
1188
+ y(l(va), {
1189
+ size: 13,
1190
+ style: H({
1191
+ transform: te.value ? "rotate(180deg)" : void 0
1192
+ })
1193
+ }, null, 8, ["style"])
1194
+ ]),
1195
+ _: 1
1196
+ }, 8, ["aria-expanded"])
1197
+ ]),
1198
+ Y.value ? (o(), c("p", nl, " 调整预览:相关依赖有 " + p(Y.value.conflicts.length) + " 项冲突,新增 " + p(Y.value.added) + " 项、消除 " + p(Y.value.resolved) + " 项。" + p(((s = Y.value.conflicts[0]) == null ? void 0 : s.message) ?? ""), 1)) : g("", !0),
1199
+ te.value ? (o(), c("section", {
1200
+ key: 1,
1201
+ id: ot,
1202
+ class: "hys-ui-pg-conflict-panel",
1203
+ "aria-label": "排期冲突详情"
1204
+ }, [
1205
+ y(It, {
1206
+ modelValue: fe.value,
1207
+ "onUpdate:modelValue": t[18] || (t[18] = (a) => fe.value = a),
1208
+ size: "sm",
1209
+ "prefix-icon": l(Mt),
1210
+ clearable: "",
1211
+ placeholder: "搜索任务、编号或冲突说明",
1212
+ "aria-label": "搜索排期冲突"
1213
+ }, null, 8, ["modelValue", "prefix-icon"]),
1214
+ u("ul", ol, [
1215
+ (o(!0), c(q, null, ee(At.value, (a) => (o(), c("li", {
1216
+ key: a.id
1217
+ }, [
1218
+ u("div", null, [
1219
+ u("span", rl, p(Yt(a.type)), 1),
1220
+ u("strong", null, p(a.sourceTitle ? a.sourceTitle + " → " : "") + p(a.taskTitle), 1),
1221
+ u("p", null, p(a.message), 1)
1222
+ ]),
1223
+ y(W, {
1224
+ variant: "ghost",
1225
+ size: "sm",
1226
+ disabled: !ge.value.has(a.taskId),
1227
+ "aria-label": "定位冲突任务:" + a.taskTitle,
1228
+ onClick: (k) => Xt(a)
1229
+ }, {
1230
+ default: U(() => [
1231
+ y(l(Qe), { size: 14 }),
1232
+ t[31] || (t[31] = j("定位", -1))
1233
+ ]),
1234
+ _: 1
1235
+ }, 8, ["disabled", "aria-label", "onClick"])
1236
+ ]))), 128)),
1237
+ ye.value.length ? g("", !0) : (o(), c("li", ul, p(fe.value ? "没有匹配的排期冲突" : "当前没有排期冲突"), 1))
1238
+ ]),
1239
+ ye.value.length > 10 ? (o(), De(na, {
1240
+ key: 0,
1241
+ page: re.value,
1242
+ "onUpdate:page": t[19] || (t[19] = (a) => re.value = a),
1243
+ total: ye.value.length,
1244
+ "page-size": 10,
1245
+ compact: ""
1246
+ }, null, 8, ["page", "total"])) : g("", !0)
1247
+ ])) : g("", !0)
1248
+ ])) : g("", !0)
1249
+ ]),
1250
+ (o(), De(la, { to: "body" }, [
1251
+ l(M).open.value ? (o(), c("div", xt({
1252
+ key: 0,
1253
+ ref_key: "pickerPanel",
1254
+ ref: me
1255
+ }, l(Ze), {
1256
+ class: "hys-ui-pg-dependency-picker hys-ui-floating-surface",
1257
+ style: l(M).style.value,
1258
+ role: "dialog",
1259
+ "aria-label": "选择前置依赖:" + (((n = ce.value[0]) == null ? void 0 : n.targetTitle) ?? ""),
1260
+ onKeydown: Bt
1261
+ }), [
1262
+ u("div", cl, [
1263
+ t[32] || (t[32] = u("strong", null, "选择前置关系", -1)),
1264
+ y(W, {
1265
+ variant: "ghost",
1266
+ size: "sm",
1267
+ class: "hys-ui-pg-picker-close",
1268
+ "aria-label": "关闭前置关系列表",
1269
+ onClick: t[20] || (t[20] = (a) => l(M).close(!0))
1270
+ }, {
1271
+ default: U(() => [
1272
+ y(l(Tt), { size: 15 })
1273
+ ]),
1274
+ _: 1
1275
+ })
1276
+ ]),
1277
+ u("div", vl, [
1278
+ u("div", pl, [
1279
+ t[33] || (t[33] = u("span", null, "后置", -1)),
1280
+ u("strong", {
1281
+ title: (d = ce.value[0]) == null ? void 0 : d.targetTitle
1282
+ }, p((b = ce.value[0]) == null ? void 0 : b.targetTitle), 9, hl)
1283
+ ]),
1284
+ y(W, {
1285
+ variant: "ghost",
1286
+ size: "sm",
1287
+ class: "hys-ui-pg-picker-action",
1288
+ "aria-label": "定位后置任务",
1289
+ title: "定位后置任务",
1290
+ onClick: t[21] || (t[21] = (a) => de.value !== void 0 && ct(de.value))
1291
+ }, {
1292
+ default: U(() => [
1293
+ y(l(Qe), { size: 15 })
1294
+ ]),
1295
+ _: 1
1296
+ })
1297
+ ]),
1298
+ y(It, {
1299
+ modelValue: Fe.value,
1300
+ "onUpdate:modelValue": t[22] || (t[22] = (a) => Fe.value = a),
1301
+ size: "sm",
1302
+ "prefix-icon": l(Mt),
1303
+ clearable: "",
1304
+ placeholder: "搜索前置任务或编号",
1305
+ "aria-label": "搜索前置关系",
1306
+ class: "hys-ui-pg-picker-search"
1307
+ }, null, 8, ["modelValue", "prefix-icon"]),
1308
+ u("div", gl, [
1309
+ (o(!0), c(q, null, ee(dt.value, (a) => {
1310
+ var k, v, P, K;
1311
+ return o(), c("div", {
1312
+ key: a.id,
1313
+ class: "hys-ui-pg-picker-option",
1314
+ "data-current": ((k = l(i).selected.value) == null ? void 0 : k.sourceId) === a.sourceId && ((v = l(i).selected.value) == null ? void 0 : v.targetId) === a.targetId
1315
+ }, [
1316
+ y(W, {
1317
+ variant: "ghost",
1318
+ "data-pg-choice": "",
1319
+ "aria-label": a.sourceTitle + " → " + a.targetTitle,
1320
+ "aria-pressed": ((P = l(i).selected.value) == null ? void 0 : P.sourceId) === a.sourceId && ((K = l(i).selected.value) == null ? void 0 : K.targetId) === a.targetId,
1321
+ onClick: (z) => Ut(z, a)
1322
+ }, {
1323
+ default: U(() => {
1324
+ var z, N;
1325
+ return [
1326
+ y(l(pa), {
1327
+ size: 15,
1328
+ class: "hys-ui-pg-picker-icon"
1329
+ }),
1330
+ u("span", yl, [
1331
+ u("span", {
1332
+ title: a.sourceTitle
1333
+ }, p(a.sourceTitle), 9, ml)
1334
+ ]),
1335
+ u("span", kl, [
1336
+ ((z = l(i).selected.value) == null ? void 0 : z.sourceId) === a.sourceId && ((N = l(i).selected.value) == null ? void 0 : N.targetId) === a.targetId ? (o(), De(l(ha), {
1337
+ key: 0,
1338
+ size: 14
1339
+ })) : g("", !0)
1340
+ ])
1341
+ ];
1342
+ }),
1343
+ _: 2
1344
+ }, 1032, ["aria-label", "aria-pressed", "onClick"]),
1345
+ u("div", bl, [
1346
+ y(W, {
1347
+ variant: "ghost",
1348
+ size: "sm",
1349
+ class: "hys-ui-pg-picker-action",
1350
+ "aria-label": "定位前置任务:" + a.sourceTitle,
1351
+ title: "定位前置任务",
1352
+ onClick: m((z) => ct(a.sourceId, z, a), ["stop"])
1353
+ }, {
1354
+ default: U(() => [
1355
+ y(l(Qe), { size: 14 })
1356
+ ]),
1357
+ _: 1
1358
+ }, 8, ["aria-label", "onClick"]),
1359
+ y(W, {
1360
+ variant: "ghost",
1361
+ size: "sm",
1362
+ class: "hys-ui-pg-picker-action",
1363
+ disabled: !a.editable || !!Pe.value,
1364
+ "aria-label": "修改终点:" + a.sourceTitle + " → " + a.targetTitle,
1365
+ title: "修改连接终点",
1366
+ onClick: m((z) => Vt(a), ["stop"])
1367
+ }, {
1368
+ default: U(() => [
1369
+ y(l(ga), { size: 14 })
1370
+ ]),
1371
+ _: 1
1372
+ }, 8, ["disabled", "aria-label", "onClick"]),
1373
+ y(W, {
1374
+ variant: "ghost",
1375
+ size: "sm",
1376
+ class: "hys-ui-pg-picker-action hys-ui-pg-picker-delete",
1377
+ disabled: !a.removable || !!Pe.value,
1378
+ "aria-label": "删除依赖:" + a.sourceTitle + " → " + a.targetTitle,
1379
+ title: "删除这条依赖",
1380
+ onClick: m((z) => Wt(a), ["stop"])
1381
+ }, {
1382
+ default: U(() => [
1383
+ y(l(Pt), { size: 14 })
1384
+ ]),
1385
+ _: 1
1386
+ }, 8, ["disabled", "aria-label", "onClick"])
1387
+ ])
1388
+ ], 8, fl);
1389
+ }), 128)),
1390
+ dt.value.length ? g("", !0) : (o(), c("p", wl, " 没有匹配的前置关系 "))
1391
+ ]),
1392
+ Me.value ? (o(), c("p", xl, p(Me.value), 1)) : g("", !0)
1393
+ ], 16, dl)) : g("", !0)
1394
+ ]))
1395
+ ], 16);
1396
+ };
300
1397
  }
301
1398
  });
302
1399
  export {
303
- Oe as default
1400
+ Kl as default
304
1401
  };