hys-ui 0.1.0 → 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.
- package/CHANGELOG.md +137 -1
- package/README.md +18 -6
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAlert/HysAlert.vue.js +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -26
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -84
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +1 -1
- package/dist/components/HysCard/HysCard2.vue.js +177 -44
- package/dist/components/HysCascader/HysCascader.vue.js +5 -182
- package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +200 -2
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +397 -390
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
- package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
- package/dist/components/HysFileManager/HysFileManager2.vue.js +86 -2
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +580 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -69
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +1399 -2
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +468 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +35 -35
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -70
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +41 -36
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +93 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +101 -2
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +205 -2
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +87 -67
- package/dist/components/HysSearch/HysSearch.vue.js +50 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -58
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +859 -164
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
- package/dist/components/HysSteps/HysSteps.vue.js +2 -2
- package/dist/components/HysSteps/HysSteps2.vue.js +111 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +235 -42
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1471 -82
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -66
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +137 -66
- package/dist/components/HysToast/HysToast.vue.js +2 -2
- package/dist/components/HysToast/HysToast2.vue.js +121 -38
- package/dist/components/HysTour/HysTour.vue.js +47 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -207
- package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +641 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -129
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +97 -78
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/formContext.js +94 -3
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/toastEscape.js +16 -0
- package/dist/composables/transfer.js +63 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +16 -16
- package/dist/composables/useFloating.js +98 -52
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysToast.js +148 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/config.js +18 -15
- package/dist/index.js +149 -136
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -29
- package/dist/types/components/HysCard/HysCard.vue.d.ts +57 -5
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +55 -27
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +8 -4
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +88 -4
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -33
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +4 -1
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +62 -17
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -14
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +65 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +5 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -30
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/composables/autocomplete.d.ts +106 -0
- package/dist/types/composables/avatar.d.ts +70 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +192 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/datePicker.d.ts +247 -0
- package/dist/types/composables/formContext.d.ts +138 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +44 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +309 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/toastEscape.d.ts +1 -0
- package/dist/types/composables/transfer.d.ts +180 -0
- package/dist/types/composables/tree.d.ts +237 -0
- package/dist/types/composables/treeSelect.d.ts +167 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useFloating.d.ts +8 -5
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useHysToast.d.ts +50 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/index.d.ts +38 -7
- package/package.json +47 -11
|
@@ -1,4 +1,1401 @@
|
|
|
1
|
-
import
|
|
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 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "hys-ui-pg-empty"
|
|
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({
|
|
57
|
+
__name: "HysGantt",
|
|
58
|
+
props: {
|
|
59
|
+
items: {},
|
|
60
|
+
modelValue: {},
|
|
61
|
+
scale: { default: "day" },
|
|
62
|
+
editable: { type: Boolean, default: !1 },
|
|
63
|
+
rowHeight: { default: 46 },
|
|
64
|
+
labelWidth: { default: 270 },
|
|
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 }
|
|
80
|
+
},
|
|
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) {
|
|
106
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(e)) return null;
|
|
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();
|
|
238
|
+
});
|
|
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));
|
|
241
|
+
}
|
|
242
|
+
const He = h(
|
|
243
|
+
() => Array.from({ length: We.value }, (e, t) => O.value.start + t)
|
|
244
|
+
), Ht = h(() => {
|
|
245
|
+
const e = [];
|
|
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
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return e;
|
|
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", {
|
|
754
|
+
ref_key: "scroller",
|
|
755
|
+
ref: x,
|
|
756
|
+
class: "hys-ui-pg-body hys-ui-pg-scroll",
|
|
757
|
+
style: H(Lt.value),
|
|
758
|
+
role: "region",
|
|
759
|
+
tabindex: "0",
|
|
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))
|
|
770
|
+
}, [
|
|
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
|
+
})
|
|
779
|
+
}, [
|
|
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)
|
|
815
|
+
]),
|
|
816
|
+
u("div", {
|
|
817
|
+
class: "hys-ui-pg-task-list",
|
|
818
|
+
style: H({ height: E.value.length * I.value + "px" })
|
|
819
|
+
}, [
|
|
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
|
+
]
|
|
842
|
+
}, [
|
|
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
|
+
`)
|
|
853
|
+
}, [
|
|
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" })
|
|
891
|
+
}, [
|
|
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)
|
|
1139
|
+
], 4)
|
|
1140
|
+
], 4)
|
|
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
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
});
|
|
2
1399
|
export {
|
|
3
|
-
|
|
1400
|
+
Kl as default
|
|
4
1401
|
};
|