@done-coding/admin-core 0.20.1-alpha.0 → 0.21.1-alpha.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 (136) hide show
  1. package/es/components/app-layout/AppLayout.vue.mjs +1 -1
  2. package/es/components/app-layout/AppLayout.vue2.mjs +51 -6
  3. package/es/components/app-layout/AppPage.vue.mjs +1 -1
  4. package/es/components/app-layout/AppPage.vue2.mjs +16 -9
  5. package/es/components/display/ShadowClone.vue.mjs +32 -0
  6. package/es/components/display/ShadowClone.vue2.mjs +4 -0
  7. package/es/components/display/use-shadow-target.mjs +76 -0
  8. package/es/components/form/FormActiveFilter.vue.mjs +7 -0
  9. package/es/components/form/FormActiveFilter.vue2.mjs +62 -0
  10. package/es/components/form/FormInput.vue.mjs +27 -0
  11. package/es/components/form/FormInput.vue2.mjs +4 -0
  12. package/es/components/form/FormInputShadowClone.vue.mjs +47 -0
  13. package/es/components/form/FormInputShadowClone.vue2.mjs +4 -0
  14. package/es/components/form/FormMain.vue.mjs +1 -1
  15. package/es/components/form/FormMain.vue2.mjs +5 -25
  16. package/es/components/form/FormSelectShadowClone.vue.mjs +57 -0
  17. package/es/components/form/FormSelectShadowClone.vue2.mjs +4 -0
  18. package/es/components/form/FormShadowCloneDispatch.vue.mjs +7 -0
  19. package/es/components/form/FormShadowCloneDispatch.vue2.mjs +74 -0
  20. package/es/components/form/FormSortSwitch.vue.mjs +7 -0
  21. package/es/components/form/FormSortSwitch.vue2.mjs +188 -0
  22. package/es/components/form/FormSortSwitchGroup.vue.mjs +7 -0
  23. package/es/components/form/FormSortSwitchGroup.vue2.mjs +68 -0
  24. package/es/components/form/FormUpload.vue.mjs +8 -0
  25. package/es/components/form/FormUpload.vue2.mjs +112 -0
  26. package/es/components/form/FormUploadAudio.vue.mjs +7 -0
  27. package/es/components/form/FormUploadAudio.vue2.mjs +88 -0
  28. package/es/components/form/FormUploadCard.vue.mjs +7 -0
  29. package/es/components/form/FormUploadCard.vue2.mjs +56 -0
  30. package/es/components/form/FormUploadFileInfo.vue.mjs +7 -0
  31. package/es/components/form/FormUploadFileInfo.vue2.mjs +36 -0
  32. package/es/components/form/FormUploadImage.vue.mjs +7 -0
  33. package/es/components/form/FormUploadImage.vue2.mjs +77 -0
  34. package/es/components/form/FormUploadTrigger.vue.mjs +7 -0
  35. package/es/components/form/FormUploadTrigger.vue2.mjs +34 -0
  36. package/es/components/form/FormUploadVideo.vue.mjs +7 -0
  37. package/es/components/form/FormUploadVideo.vue2.mjs +74 -0
  38. package/es/components/form/use-password-autofill.mjs +34 -0
  39. package/es/components/form/use-upload-state.mjs +98 -0
  40. package/es/components/list-layout/ListLayout.vue.mjs +1 -1
  41. package/es/components/list-layout/ListLayout.vue2.mjs +36 -9
  42. package/es/components/list-layout/use-active-filter.mjs +133 -0
  43. package/es/components/modal/ImagePreviewTrigger.vue.mjs +34 -0
  44. package/es/components/modal/ImagePreviewTrigger.vue2.mjs +4 -0
  45. package/es/components/modal/ModalImagePreview.vue.mjs +52 -0
  46. package/es/components/modal/ModalImagePreview.vue2.mjs +4 -0
  47. package/es/components/modal/ModalPorter.vue.mjs +49 -2
  48. package/es/components/modal/ModalShelf.vue.mjs +13 -4
  49. package/es/components/modal/ModalVideoPreview.vue.mjs +8 -0
  50. package/es/components/modal/ModalVideoPreview.vue2.mjs +93 -0
  51. package/es/components/modal/VideoPreviewTrigger.vue.mjs +7 -0
  52. package/es/components/modal/VideoPreviewTrigger.vue2.mjs +96 -0
  53. package/es/components/modal/modal-global-keys.mjs +11 -0
  54. package/es/components/modal/modal-global-symbol.mjs +6 -0
  55. package/es/components/modal/modal-shelf-core.mjs +53 -4
  56. package/es/components/table/TableEmpty.vue.mjs +36 -0
  57. package/es/components/table/TableEmpty.vue2.mjs +4 -0
  58. package/es/components/table/TableMain.vue.mjs +1 -1
  59. package/es/components/table/TableMain.vue2.mjs +21 -8
  60. package/es/components/view-layout/ViewLayout.vue.mjs +1 -1
  61. package/es/components/view-layout/ViewLayout.vue2.mjs +1 -1
  62. package/es/hooks/menus-dispatch.mjs +8 -3
  63. package/es/index.mjs +127 -91
  64. package/es/style.css +412 -33
  65. package/package.json +2 -2
  66. package/src/components/app-layout/docs/README-AppLayout.md +48 -0
  67. package/src/components/app-layout/docs/README-AppPage.md +40 -2
  68. package/src/components/display/README.md +9 -3
  69. package/src/components/display/docs/README-ShadowClone.md +75 -0
  70. package/src/components/form/README.md +15 -2
  71. package/src/components/form/docs/README-FormActiveFilter.md +57 -0
  72. package/src/components/form/docs/README-FormInput.md +66 -0
  73. package/src/components/form/docs/README-FormSelect.md +77 -0
  74. package/src/components/form/docs/README-FormShadowCloneDispatch.md +65 -0
  75. package/src/components/form/docs/README-FormSortSwitchGroup.md +131 -0
  76. package/src/components/form/docs/README-FormUpload.md +108 -0
  77. package/src/components/form/docs/README-FormUploadAudio.md +80 -0
  78. package/src/components/form/docs/README-FormUploadImage.md +83 -0
  79. package/src/components/form/docs/README-FormUploadVideo.md +82 -0
  80. package/src/components/list-layout/README.md +6 -2
  81. package/src/components/list-layout/docs/README-ListLayout.md +1 -0
  82. package/src/components/modal/README.md +7 -2
  83. package/src/components/modal/docs/README-ImagePreviewTrigger.md +78 -0
  84. package/src/components/modal/docs/README-ModalImagePreview.md +78 -0
  85. package/src/components/modal/docs/README-ModalPorter.md +10 -0
  86. package/src/components/modal/docs/README-ModalShelf.md +11 -2
  87. package/src/components/modal/docs/README-ModalVideoPreview.md +89 -0
  88. package/src/components/modal/docs/README-VideoPreviewTrigger.md +91 -0
  89. package/src/components/table/docs/README-TableMain.md +3 -0
  90. package/types/components/app-layout/AppLayout.vue.d.ts +31 -1
  91. package/types/components/app-layout/AppPage.vue.d.ts +7 -2
  92. package/types/components/app-layout/types.d.ts +25 -0
  93. package/types/components/display/ShadowClone.vue.d.ts +20 -0
  94. package/types/components/display/TabsTile.vue.d.ts +2 -2
  95. package/types/components/display/index.d.ts +8 -1
  96. package/types/components/display/types.d.ts +7 -0
  97. package/types/components/display/use-shadow-target.d.ts +9 -0
  98. package/types/components/form/FormActiveFilter.vue.d.ts +9 -0
  99. package/types/components/form/FormInput.vue.d.ts +3 -0
  100. package/types/components/form/FormInputShadowClone.vue.d.ts +7 -0
  101. package/types/components/form/FormSearch.vue.d.ts +1 -1
  102. package/types/components/form/FormSelectShadowClone.vue.d.ts +39 -0
  103. package/types/components/form/FormShadowCloneDispatch.vue.d.ts +44 -0
  104. package/types/components/form/FormSortSwitch.vue.d.ts +17 -0
  105. package/types/components/form/FormSortSwitchGroup.vue.d.ts +15 -0
  106. package/types/components/form/FormUpload.vue.d.ts +57 -0
  107. package/types/components/form/FormUploadAudio.vue.d.ts +30 -0
  108. package/types/components/form/FormUploadCard.vue.d.ts +24 -0
  109. package/types/components/form/FormUploadFileInfo.vue.d.ts +10 -0
  110. package/types/components/form/FormUploadImage.vue.d.ts +34 -0
  111. package/types/components/form/FormUploadTrigger.vue.d.ts +11 -0
  112. package/types/components/form/FormUploadVideo.vue.d.ts +34 -0
  113. package/types/components/form/index.d.ts +12 -1
  114. package/types/components/form/types.d.ts +158 -0
  115. package/types/components/form/use-password-autofill.d.ts +11 -0
  116. package/types/components/form/use-upload-state.d.ts +29 -0
  117. package/types/components/list-layout/ListLayout.vue.d.ts +3 -0
  118. package/types/components/list-layout/types.d.ts +16 -0
  119. package/types/components/list-layout/use-active-filter.d.ts +27 -0
  120. package/types/components/modal/ImagePreviewTrigger.vue.d.ts +41 -0
  121. package/types/components/modal/ModalConfirm.vue.d.ts +1 -1
  122. package/types/components/modal/ModalImagePreview.vue.d.ts +31 -0
  123. package/types/components/modal/ModalPorter.vue.d.ts +7 -0
  124. package/types/components/modal/ModalShelf.vue.d.ts +12 -3
  125. package/types/components/modal/ModalVideoPreview.vue.d.ts +40 -0
  126. package/types/components/modal/VideoPreviewTrigger.vue.d.ts +43 -0
  127. package/types/components/modal/index.d.ts +6 -1
  128. package/types/components/modal/modal-global-keys.d.ts +25 -0
  129. package/types/components/modal/modal-global-symbol.d.ts +8 -0
  130. package/types/components/modal/modal-shelf-core.d.ts +11 -3
  131. package/types/components/modal/modal-shelf-types.d.ts +50 -0
  132. package/types/components/table/TableEmpty.vue.d.ts +11 -0
  133. package/types/components/table/types.d.ts +11 -0
  134. package/types/components/view-layout/types.d.ts +1 -1
  135. package/types/injectInfo.json.d.ts +1 -1
  136. package/types/store/app.d.ts +1 -1
@@ -0,0 +1,52 @@
1
+ import { defineComponent, useModel, computed, useAttrs, openBlock, createElementBlock, createVNode, unref, mergeProps, createCommentVNode, mergeModels } from "vue";
2
+ import { ElImageViewer } from "element-plus";
3
+ const _hoisted_1 = {
4
+ key: 0,
5
+ class: "dc-modal-image-preview modal-image-preview"
6
+ };
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ ...{ inheritAttrs: false },
9
+ __name: "ModalImagePreview",
10
+ props: /* @__PURE__ */ mergeModels({
11
+ src: {},
12
+ payload: {},
13
+ closeFn: {},
14
+ removeFn: {},
15
+ onClose: {}
16
+ }, {
17
+ "show": { type: Boolean, ...{ required: true } },
18
+ "showModifiers": {}
19
+ }),
20
+ emits: ["update:show"],
21
+ setup(__props) {
22
+ const props = __props;
23
+ const show = useModel(__props, "show");
24
+ const srcValue = computed(() => {
25
+ var _a;
26
+ return props.src ?? ((_a = props.payload) == null ? void 0 : _a.src) ?? "";
27
+ });
28
+ const attrs = useAttrs();
29
+ const urlList = computed(() => {
30
+ const explicit = attrs.urlList;
31
+ return explicit && explicit.length ? explicit : [srcValue.value];
32
+ });
33
+ const restAttrs = computed(() => {
34
+ const rest = { ...attrs };
35
+ delete rest.urlList;
36
+ return rest;
37
+ });
38
+ const onViewerClose = () => {
39
+ var _a;
40
+ show.value = false;
41
+ (_a = props.onClose) == null ? void 0 : _a.call(props, false);
42
+ };
43
+ return (_ctx, _cache) => {
44
+ return show.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
45
+ createVNode(unref(ElImageViewer), mergeProps({ "url-list": urlList.value }, restAttrs.value, { onClose: onViewerClose }), null, 16, ["url-list"])
46
+ ])) : createCommentVNode("", true);
47
+ };
48
+ }
49
+ });
50
+ export {
51
+ _sfc_main as default
52
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./ModalImagePreview.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -1,10 +1,12 @@
1
- import { defineComponent, getCurrentInstance, inject, renderSlot } from "vue";
1
+ import { defineComponent, getCurrentInstance, inject, watch, renderSlot } from "vue";
2
+ import { APP_GLOBAL_MODAL_PORTER_SYMBOL } from "./modal-global-symbol.mjs";
2
3
  import { getModalShelfInjectionKey } from "../../inject/key.mjs";
3
4
  import { useActivated } from "../../hooks/activated.mjs";
4
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
6
  __name: "ModalPorter",
6
7
  props: {
7
- modalList: {}
8
+ modalList: {},
9
+ globalOnly: {}
8
10
  },
9
11
  setup(__props, { expose: __expose }) {
10
12
  var _a;
@@ -14,6 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
16
  app: inject(getModalShelfInjectionKey("app"), null),
15
17
  page: inject(getModalShelfInjectionKey("page"), null)
16
18
  };
19
+ const isGlobalOnly = props.globalOnly === APP_GLOBAL_MODAL_PORTER_SYMBOL;
17
20
  function nsOf(key) {
18
21
  return `p${uid}:${key}`;
19
22
  }
@@ -28,6 +31,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
31
  }
29
32
  return shelf;
30
33
  }
34
+ function globalOnlyEntries() {
35
+ const bad = props.modalList.filter((e) => e.shelf !== "app");
36
+ bad.forEach((e) => {
37
+ console.error(
38
+ `[ModalPorter] globalOnly 专用模式只接受 shelf:"app" 条目,忽略: ${String(
39
+ e.key
40
+ )}(shelf=${String(e.shelf)})——page 级弹窗注册不得逃逸到全局面`
41
+ );
42
+ });
43
+ return props.modalList.filter((e) => e.shelf === "app");
44
+ }
45
+ function pushGlobalConfig(entries) {
46
+ const shelf = namedShelves.app;
47
+ if (!shelf) {
48
+ console.error(
49
+ "[ModalPorter] globalOnly 专用模式需要 app 级 ModalShelf(未找到)"
50
+ );
51
+ return;
52
+ }
53
+ const config = entries.map((e) => ({
54
+ key: String(e.key),
55
+ component: e.component,
56
+ sameKeyStrategy: e.sameKeyStrategy
57
+ }));
58
+ shelf.registerConfig(config);
59
+ }
60
+ if (isGlobalOnly) {
61
+ pushGlobalConfig(globalOnlyEntries());
62
+ watch(
63
+ () => props.modalList,
64
+ (_newList, oldList) => {
65
+ const shelf = namedShelves.app;
66
+ if (!shelf) return;
67
+ shelf.unregisterConfig(oldList.map((e) => String(e.key)));
68
+ pushGlobalConfig(globalOnlyEntries());
69
+ }
70
+ );
71
+ }
31
72
  function evoke(key, payload) {
32
73
  const entry = props.modalList.find((e) => e.key === key);
33
74
  if (!entry) {
@@ -43,6 +84,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
43
84
  }
44
85
  useActivated((info) => {
45
86
  if (info.isActivated) return;
87
+ if (isGlobalOnly) {
88
+ const shelf = namedShelves.app;
89
+ if (shelf)
90
+ shelf.unregisterConfig(props.modalList.map((e) => String(e.key)));
91
+ return;
92
+ }
46
93
  const byShelf = /* @__PURE__ */ new Map();
47
94
  props.modalList.forEach((e) => {
48
95
  const s = resolveShelf(e.shelf);
@@ -1,16 +1,25 @@
1
- import { defineComponent, provide, onMounted, inject, openBlock, createElementBlock, Fragment, renderSlot, renderList, unref, createBlock, resolveDynamicComponent, defineAsyncComponent } from "vue";
1
+ import { defineComponent, useModel, provide, onMounted, inject, openBlock, createElementBlock, Fragment, renderSlot, renderList, unref, createBlock, resolveDynamicComponent, mergeModels, defineAsyncComponent } from "vue";
2
2
  import { createShelfController } from "./modal-shelf-core.mjs";
3
3
  import { assertLevelHierarchy } from "./modal-shelf-hierarchy.mjs";
4
4
  import { getModalShelfInjectionKey } from "../../inject/key.mjs";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "ModalShelf",
7
- props: {
7
+ props: /* @__PURE__ */ mergeModels({
8
8
  level: {}
9
- },
9
+ }, {
10
+ "remote": {
11
+ // 初始空壳即带 modalKey 清单(挂载前 remote.modalKey 恒存在,消费方零判空)。
12
+ // 字面量直注 GlobalModalRemote 被 Record 索引签名拒绝,断言只作用于类型。
13
+ default: () => ({ modalKey: [] })
14
+ },
15
+ "remoteModifiers": {}
16
+ }),
17
+ emits: ["update:remote"],
10
18
  setup(__props, { expose: __expose }) {
11
19
  const props = __props;
12
20
  const level = props.level;
13
- const controller = createShelfController(level);
21
+ const remote = useModel(__props, "remote");
22
+ const controller = createShelfController(level, remote);
14
23
  __expose(controller);
15
24
  provide(getModalShelfInjectionKey(level), controller);
16
25
  function resolveComp(c) {
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./ModalVideoPreview.vue2.mjs";
2
+ /* empty css */
3
+ /* empty css */
4
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
5
+ const ModalVideoPreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d4b84c07"]]);
6
+ export {
7
+ ModalVideoPreview as default
8
+ };
@@ -0,0 +1,93 @@
1
+ import { defineComponent, useModel, computed, useAttrs, ref, openBlock, createBlock, unref, withCtx, createElementVNode, mergeProps, mergeModels } from "vue";
2
+ import { ElDialog } from "element-plus";
3
+ const _hoisted_1 = { class: "modal-video-preview__stage" };
4
+ const _hoisted_2 = { class: "modal-video-preview__shim" };
5
+ const _hoisted_3 = ["src", "poster"];
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ ...{ inheritAttrs: false },
8
+ __name: "ModalVideoPreview",
9
+ props: /* @__PURE__ */ mergeModels({
10
+ url: {},
11
+ coverUrl: {},
12
+ autoPlay: { type: Boolean, default: true },
13
+ payload: {},
14
+ closeFn: {},
15
+ removeFn: {},
16
+ onClose: {}
17
+ }, {
18
+ "show": { type: Boolean, ...{ required: true } },
19
+ "showModifiers": {}
20
+ }),
21
+ emits: ["update:show"],
22
+ setup(__props) {
23
+ const props = __props;
24
+ const show = useModel(__props, "show");
25
+ const videoUrl = computed(() => {
26
+ var _a;
27
+ return props.url ?? ((_a = props.payload) == null ? void 0 : _a.url) ?? "";
28
+ });
29
+ const coverUrlValue = computed(
30
+ () => {
31
+ var _a;
32
+ return props.coverUrl ?? ((_a = props.payload) == null ? void 0 : _a.coverUrl) ?? "";
33
+ }
34
+ );
35
+ const hasCover = computed(() => !!coverUrlValue.value);
36
+ const videoSrc = computed(
37
+ () => hasCover.value ? videoUrl.value : `${videoUrl.value}#t=0.01`
38
+ );
39
+ const attrs = useAttrs();
40
+ const videoAttrs = computed(
41
+ () => hasCover.value ? attrs : { ...attrs, preload: "metadata" }
42
+ );
43
+ const videoEl = ref();
44
+ const onOpened = () => {
45
+ var _a;
46
+ if (!props.autoPlay) return;
47
+ (_a = videoEl.value) == null ? void 0 : _a.play().catch(() => {
48
+ });
49
+ };
50
+ const onClosed = () => {
51
+ var _a;
52
+ (_a = videoEl.value) == null ? void 0 : _a.pause();
53
+ };
54
+ const onDialogClose = () => {
55
+ var _a;
56
+ (_a = props.onClose) == null ? void 0 : _a.call(props, false);
57
+ };
58
+ return (_ctx, _cache) => {
59
+ return openBlock(), createBlock(unref(ElDialog), {
60
+ modelValue: show.value,
61
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => show.value = $event),
62
+ class: "dc-modal-video-preview modal-video-preview",
63
+ "modal-class": "dc-modal-video-preview__overlay",
64
+ width: "100vw",
65
+ "align-center": "",
66
+ "append-to-body": "",
67
+ onOpened,
68
+ onClosed,
69
+ onClose: onDialogClose
70
+ }, {
71
+ default: withCtx(() => [
72
+ createElementVNode("div", _hoisted_1, [
73
+ createElementVNode("div", _hoisted_2, [
74
+ createElementVNode("video", mergeProps({
75
+ ref_key: "videoEl",
76
+ ref: videoEl
77
+ }, videoAttrs.value, {
78
+ src: videoSrc.value,
79
+ poster: coverUrlValue.value || void 0,
80
+ controls: "",
81
+ class: "modal-video-preview__video"
82
+ }), null, 16, _hoisted_3)
83
+ ])
84
+ ])
85
+ ]),
86
+ _: 1
87
+ }, 8, ["modelValue"]);
88
+ };
89
+ }
90
+ });
91
+ export {
92
+ _sfc_main as default
93
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./VideoPreviewTrigger.vue2.mjs";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const VideoPreviewTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-49e0acc8"]]);
5
+ export {
6
+ VideoPreviewTrigger as default
7
+ };
@@ -0,0 +1,96 @@
1
+ import { defineComponent, inject, ref, openBlock, createElementBlock, Fragment, renderSlot, createVNode, unref, mergeProps, withCtx, createElementVNode, withKeys, createBlock, createCommentVNode } from "vue";
2
+ import { ElImage, ElIcon } from "element-plus";
3
+ import { VideoPlay } from "@element-plus/icons-vue";
4
+ import { GLOBAL_MODAL_REMOTE_KEY, APP_GLOBAL_VIDEO_PREVIEW_KEY } from "./modal-global-keys.mjs";
5
+ import ModalVideoPreview from "./ModalVideoPreview.vue.mjs";
6
+ const _hoisted_1 = {
7
+ class: "video-preview-trigger__play-badge",
8
+ "aria-hidden": "true"
9
+ };
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
11
+ ...{ inheritAttrs: false },
12
+ __name: "VideoPreviewTrigger",
13
+ props: {
14
+ url: {},
15
+ coverUrl: {},
16
+ lazy: { type: Boolean, default: true },
17
+ preview: { type: Boolean, default: true }
18
+ },
19
+ setup(__props) {
20
+ const props = __props;
21
+ const remote = inject(GLOBAL_MODAL_REMOTE_KEY);
22
+ const localShow = ref(false);
23
+ const openPreview = () => {
24
+ var _a, _b;
25
+ if (!props.preview) return;
26
+ if ((_b = (_a = remote == null ? void 0 : remote.value) == null ? void 0 : _a.modalKey) == null ? void 0 : _b.includes(APP_GLOBAL_VIDEO_PREVIEW_KEY)) {
27
+ remote.value[APP_GLOBAL_VIDEO_PREVIEW_KEY].evoke({
28
+ url: props.url,
29
+ coverUrl: props.coverUrl
30
+ });
31
+ } else {
32
+ localShow.value = true;
33
+ }
34
+ };
35
+ return (_ctx, _cache) => {
36
+ return openBlock(), createElementBlock(Fragment, null, [
37
+ renderSlot(_ctx.$slots, "default", { open: openPreview }, () => [
38
+ __props.coverUrl ? (openBlock(), createElementBlock("div", {
39
+ key: 0,
40
+ class: "dc-video-preview-trigger video-preview-trigger video-preview-trigger_cover",
41
+ onClick: openPreview
42
+ }, [
43
+ createVNode(unref(ElImage), mergeProps({
44
+ class: "video-preview-trigger__cover",
45
+ src: __props.coverUrl,
46
+ lazy: __props.lazy
47
+ }, _ctx.$attrs), {
48
+ placeholder: withCtx(() => [
49
+ renderSlot(_ctx.$slots, "placeholder", {}, void 0, true)
50
+ ]),
51
+ error: withCtx(() => [
52
+ renderSlot(_ctx.$slots, "error", {}, void 0, true)
53
+ ]),
54
+ _: 3
55
+ }, 16, ["src", "lazy"]),
56
+ createElementVNode("span", _hoisted_1, [
57
+ createVNode(unref(ElIcon), { size: 20 }, {
58
+ default: withCtx(() => [
59
+ createVNode(unref(VideoPlay))
60
+ ]),
61
+ _: 1
62
+ })
63
+ ])
64
+ ])) : (openBlock(), createElementBlock("div", {
65
+ key: 1,
66
+ class: "dc-video-preview-trigger video-preview-trigger video-preview-trigger_placeholder",
67
+ role: "button",
68
+ tabindex: "0",
69
+ onClick: openPreview,
70
+ onKeydown: withKeys(openPreview, ["enter"])
71
+ }, [
72
+ createVNode(unref(ElIcon), {
73
+ class: "video-preview-trigger__play-icon",
74
+ size: 32
75
+ }, {
76
+ default: withCtx(() => [
77
+ createVNode(unref(VideoPlay))
78
+ ]),
79
+ _: 1
80
+ })
81
+ ], 32))
82
+ ], true),
83
+ localShow.value ? (openBlock(), createBlock(ModalVideoPreview, {
84
+ key: 0,
85
+ show: localShow.value,
86
+ "onUpdate:show": _cache[0] || (_cache[0] = ($event) => localShow.value = $event),
87
+ url: __props.url,
88
+ coverUrl: __props.coverUrl
89
+ }, null, 8, ["show", "url", "coverUrl"])) : createCommentVNode("", true)
90
+ ], 64);
91
+ };
92
+ }
93
+ });
94
+ export {
95
+ _sfc_main as default
96
+ };
@@ -0,0 +1,11 @@
1
+ import injectInfo from "../../injectInfo.json.mjs";
2
+ const APP_GLOBAL_IMAGE_PREVIEW_KEY = "appGlobalImagePreview";
3
+ const APP_GLOBAL_VIDEO_PREVIEW_KEY = "appGlobalVideoPreview";
4
+ const GLOBAL_MODAL_REMOTE_KEY = Symbol.for(
5
+ `${injectInfo.name}:GLOBAL_MODAL_REMOTE`
6
+ );
7
+ export {
8
+ APP_GLOBAL_IMAGE_PREVIEW_KEY,
9
+ APP_GLOBAL_VIDEO_PREVIEW_KEY,
10
+ GLOBAL_MODAL_REMOTE_KEY
11
+ };
@@ -0,0 +1,6 @@
1
+ const APP_GLOBAL_MODAL_PORTER_SYMBOL = Symbol(
2
+ "admin-core:global-modal-porter"
3
+ );
4
+ export {
5
+ APP_GLOBAL_MODAL_PORTER_SYMBOL
6
+ };
@@ -1,8 +1,9 @@
1
- import { ref } from "vue";
1
+ import { ref, markRaw } from "vue";
2
2
  const CLOSE_ANIM_MS = 300;
3
- function createShelfController(level) {
3
+ function createShelfController(level, remoteRef) {
4
4
  let seq = 0;
5
5
  const items = ref([]);
6
+ const configs = /* @__PURE__ */ new Map();
6
7
  function indexByNsKey(nsKey) {
7
8
  return items.value.findIndex((it) => it.nsKey === nsKey);
8
9
  }
@@ -57,11 +58,59 @@ function createShelfController(level) {
57
58
  }
58
59
  remove(nsKey);
59
60
  const id = ++seq;
60
- const item = { id, nsKey, component, payload, show: true };
61
+ const item = {
62
+ id,
63
+ nsKey,
64
+ component: markRaw(component),
65
+ payload,
66
+ show: true
67
+ };
61
68
  items.value.push(item);
62
69
  return handleFor(nsKey);
63
70
  }
64
- return { level, items, evoke, remove, close };
71
+ function syncRemote() {
72
+ if (!remoteRef) return;
73
+ const handles = {};
74
+ configs.forEach((cfg, key) => {
75
+ handles[key] = {
76
+ evoke: (payload) => evoke(key, cfg.component, {
77
+ payload: payload ?? {},
78
+ sameKeyStrategy: cfg.sameKeyStrategy
79
+ }),
80
+ close: () => {
81
+ const cur = items.value.find((it) => it.nsKey === key);
82
+ if (cur) close(cur);
83
+ },
84
+ update: (payload) => {
85
+ const cur = items.value.find((it) => it.nsKey === key);
86
+ if (cur) cur.payload = { ...cur.payload, ...payload };
87
+ }
88
+ };
89
+ });
90
+ remoteRef.value = Object.assign(handles, {
91
+ modalKey: [...configs.keys()]
92
+ });
93
+ }
94
+ function registerConfig(entries) {
95
+ entries.forEach((e) => configs.set(e.key, e));
96
+ syncRemote();
97
+ }
98
+ function unregisterConfig(keys) {
99
+ keys.forEach((k) => {
100
+ configs.delete(k);
101
+ remove(k);
102
+ });
103
+ syncRemote();
104
+ }
105
+ return {
106
+ level,
107
+ items,
108
+ evoke,
109
+ remove,
110
+ close,
111
+ registerConfig,
112
+ unregisterConfig
113
+ };
65
114
  }
66
115
  export {
67
116
  createShelfController
@@ -0,0 +1,36 @@
1
+ import { defineComponent, openBlock, createElementBlock, Fragment, createTextVNode, createBlock, unref, withCtx, createVNode } from "vue";
2
+ import { ElEmpty, ElIcon } from "element-plus";
3
+ import { Search } from "@element-plus/icons-vue";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "TableEmpty",
6
+ props: {
7
+ loading: { type: Boolean, default: false },
8
+ hasRequested: { type: Boolean, default: false }
9
+ },
10
+ setup(__props) {
11
+ return (_ctx, _cache) => {
12
+ return __props.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
13
+ createTextVNode("加载中...")
14
+ ], 64)) : !__props.hasRequested ? (openBlock(), createBlock(unref(ElEmpty), {
15
+ key: 1,
16
+ description: "欢迎触发查询"
17
+ }, {
18
+ image: withCtx(() => [
19
+ createVNode(unref(ElIcon), {
20
+ size: 64,
21
+ color: "var(--el-text-color-placeholder)"
22
+ }, {
23
+ default: withCtx(() => [
24
+ createVNode(unref(Search))
25
+ ]),
26
+ _: 1
27
+ })
28
+ ]),
29
+ _: 1
30
+ })) : (openBlock(), createBlock(unref(ElEmpty), { key: 2 }));
31
+ };
32
+ }
33
+ });
34
+ export {
35
+ _sfc_main as default
36
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./TableEmpty.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./TableMain.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const TableMain = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-54ab0e8e"]]);
4
+ const TableMain = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6a8d4637"]]);
5
5
  export {
6
6
  TableMain as default
7
7
  };
@@ -9,7 +9,8 @@ import { useTableSkeleton } from "./use-table-skeleton.mjs";
9
9
  import { useFillHeight } from "./use-fill-height.mjs";
10
10
  import _sfc_main$1 from "../display/WatchSize.vue.mjs";
11
11
  import DataListView from "../data-view/DataListView.vue.mjs";
12
- import { ElTable, ElTableColumn, ElEmpty, ElPagination } from "element-plus";
12
+ import { ElTable, ElTableColumn, ElPagination } from "element-plus";
13
+ import _sfc_main$2 from "./TableEmpty.vue.mjs";
13
14
  import { pickExportColumns } from "../../utils/export.mjs";
14
15
  import { useChannelViewportHeight } from "../../hooks/use-channel-viewport-height.mjs";
15
16
  import { APP_API_LIST_MODEL_KEY_CONFIG } from "../../config/list-model.mjs";
@@ -18,6 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18
19
  __name: "TableMain",
19
20
  props: /* @__PURE__ */ mergeModels({
20
21
  showPager: { type: Boolean, default: true },
22
+ initialSearch: { type: Boolean, default: true },
21
23
  showSwitchView: { type: Boolean },
22
24
  showToolbar: { type: Boolean, default: true },
23
25
  toolbar: {},
@@ -25,6 +27,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
27
  pageSizeInit: { default: 20 },
26
28
  pageSizeOptions: { default: () => [10, 20, 30, 40] },
27
29
  pageLayout: { default: "total, sizes, prev, pager, next, jumper" },
30
+ paginationBackground: { type: Boolean, default: true },
28
31
  rowKey: {},
29
32
  api: {},
30
33
  tableProps: {},
@@ -51,7 +54,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
51
54
  emits: /* @__PURE__ */ mergeModels(["pageChange", "pageSizeChange", "dataChange", "loadingChange", "pageInfoChange"], ["update:isAutoRefresh", "update:refreshInterval", "update:customView"]),
52
55
  setup(__props, { expose: __expose, emit: __emit }) {
53
56
  useCssVars((_ctx) => ({
54
- "v6df3e765": unref(fillMinHeightCss)
57
+ "ed56f300": unref(fillMinHeightCss)
55
58
  }));
56
59
  const props = __props;
57
60
  const emits = __emit;
@@ -176,9 +179,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
176
179
  }
177
180
  return res;
178
181
  };
182
+ const hasRequested = ref(false);
183
+ let suppressAutoParams = !props.initialSearch;
179
184
  const getList = (silent = false) => {
180
185
  var _a;
181
186
  if (!pageSize.value) return;
187
+ hasRequested.value = true;
182
188
  if (loading.value) {
183
189
  console.warn(`请求并发`);
184
190
  } else {
@@ -262,7 +268,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
262
268
  onMounted(() => {
263
269
  pageSize.value = props.pageSizeInit;
264
270
  onActivated(() => {
265
- expose.refresh();
271
+ if (hasRequested.value) {
272
+ expose.refresh();
273
+ }
266
274
  });
267
275
  });
268
276
  watch(list, (n) => {
@@ -272,6 +280,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
272
280
  () => props.query,
273
281
  (n, o) => {
274
282
  if (JSON.stringify(n) === JSON.stringify(o)) return;
283
+ suppressAutoParams = false;
275
284
  currentPage.value = 1;
276
285
  }
277
286
  );
@@ -279,6 +288,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
279
288
  params,
280
289
  (n, o) => {
281
290
  if (JSON.stringify(n) === JSON.stringify(o)) return;
291
+ if (suppressAutoParams) {
292
+ return;
293
+ }
282
294
  getList();
283
295
  },
284
296
  {
@@ -347,9 +359,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
347
359
  renderSlot(_ctx.$slots, "custom-view-item", normalizeProps(guardReactiveProps(assertDataViewItemScope(scopeData))), void 0, true)
348
360
  ]),
349
361
  empty: withCtx(() => [
350
- loading.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
351
- createTextVNode("加载中...")
352
- ], 64)) : (openBlock(), createBlock(unref(ElEmpty), { key: 1 }))
362
+ createVNode(_sfc_main$2, {
363
+ loading: loading.value,
364
+ "has-requested": hasRequested.value
365
+ }, null, 8, ["loading", "has-requested"])
353
366
  ]),
354
367
  default: withCtx(() => [
355
368
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
@@ -399,11 +412,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
399
412
  "onUpdate:pageSize": _cache[4] || (_cache[4] = ($event) => pageSize.value = $event),
400
413
  "page-sizes": __props.pageSizeOptions,
401
414
  size: "small",
402
- background: "",
415
+ background: __props.paginationBackground,
403
416
  layout: __props.pageLayout,
404
417
  total: total.value,
405
418
  onSizeChange
406
- }, null, 8, ["current-page", "page-size", "page-sizes", "layout", "total"])
419
+ }, null, 8, ["current-page", "page-size", "page-sizes", "background", "layout", "total"])
407
420
  ], 512), [
408
421
  [vShow, __props.showPager]
409
422
  ])
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./ViewLayout.vue2.mjs";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const ViewLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e6c42f0b"]]);
4
+ const ViewLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-773e43bd"]]);
5
5
  export {
6
6
  ViewLayout as default
7
7
  };
@@ -13,7 +13,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  props: {
14
14
  api: {},
15
15
  params: {},
16
- refine: { type: Boolean, default: true },
16
+ refine: { type: Boolean, default: false },
17
17
  viewportHeight: {},
18
18
  channel: {},
19
19
  parentChannel: {},
@@ -19,10 +19,15 @@ const useMenusDataDispatch = ({
19
19
  () => activeMenu.value && getCanRedirectFirstChildMenu(activeMenu.value, true)
20
20
  );
21
21
  const activeModulePath = computed(() => {
22
+ var _a;
22
23
  if (!activeMenu.value) {
23
- console.warn(
24
- `当前 ${route.path} 未找到聚焦的菜单 可能路由配置不展示菜单`
25
- );
24
+ const menuMeta = (_a = route.meta) == null ? void 0 : _a.menu;
25
+ const hasMenuIntent = !!menuMeta && menuMeta.show !== false;
26
+ if (hasMenuIntent) {
27
+ console.warn(
28
+ `当前 ${route.path} 未找到聚焦的菜单 可能路由配置不展示菜单`
29
+ );
30
+ }
26
31
  return;
27
32
  }
28
33
  if (activeMenu.value.routeLevel === ROUTE_MODULE_LEVEL) {