zzz-pc-view 0.0.39 → 0.0.41

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 (37) hide show
  1. package/package.json +3 -1
  2. package/src/api/own +4 -4
  3. package/src/decorators/CurdKey/CurdApi.d.ts +2 -2
  4. package/src/decorators/CurdKey/index.d.ts +65 -25
  5. package/src/decorators/DeclareType.d.ts +1 -1
  6. package/src/decorators/FilterKey/index.d.ts +8 -8
  7. package/src/index.d.ts +4 -0
  8. package/src/index.es.js +1518 -150
  9. package/src/index.umd.js +2 -2
  10. package/src/pcViews/components/curd/CreateBtnView.vue.d.ts +16 -0
  11. package/src/pcViews/components/curd/CurdFormOperatorView.vue.d.ts +20 -0
  12. package/src/pcViews/components/curd/CurdFormView.vue.d.ts +16 -0
  13. package/src/pcViews/components/curd/CurdTableOperatorView.vue.d.ts +21 -0
  14. package/src/pcViews/components/curd/CurdView.vue.d.ts +3 -1
  15. package/src/pcViews/components/curd/CurdViewHandler.d.ts +171 -6
  16. package/src/pcViews/components/curd/CurdViewType.d.ts +4 -0
  17. package/src/pcViews/components/curd/DialogEditorView.vue.d.ts +21 -0
  18. package/src/pcViews/components/curd/DrawerEditorView.vue.d.ts +16 -0
  19. package/src/pcViews/components/curd/SearchBtnView.vue.d.ts +9 -0
  20. package/src/pcViews/components/curd/index.d.ts +6 -0
  21. package/src/pcViews/components/forms/MyInputView.vue.d.ts +21 -0
  22. package/src/pcViews/components/forms/index.d.ts +1 -0
  23. package/src/pcViews/components/layout/DataWrapperView.vue.d.ts +4 -0
  24. package/src/pcViews/components/layout/LayoutHeaderView.vue.d.ts +3 -0
  25. package/src/pcViews/components/layout/LayoutMainView.vue.d.ts +14 -1
  26. package/src/pcViews/components/layout/LayoutNavView.vue.d.ts +10 -0
  27. package/src/pcViews/components/layout/LayoutProfileView.vue.d.ts +15 -0
  28. package/src/pcViews/components/layout/LayoutViewDeclare.d.ts +53 -0
  29. package/src/pcViews/components/layout/index.d.ts +1 -0
  30. package/src/pcViews/components/utils.d.ts +10 -6
  31. package/src/webUtils/icons/index.d.ts +1 -0
  32. package/src/webUtils/index.d.ts +2 -0
  33. package/src/webUtils/useNavStore.d.ts +137 -32
  34. package/src/webUtils/useSkeletonRow.d.ts +4 -0
  35. package/src/webUtils/utils.d.ts +39 -0
  36. package/src/zzz-frame.css +1 -1
  37. /package/src/pcViews/components/layout/{LayoutHeader.vue.d.ts → LayoutTabView.vue.d.ts} +0 -0
package/src/index.es.js CHANGED
@@ -5,15 +5,16 @@ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
5
5
  import CryptoJS from "crypto-js";
6
6
  import qs from "qs";
7
7
  import axios, { CanceledError } from "axios";
8
- import "vue-router";
9
- import { shallowRef, computed, reactive, onBeforeUnmount, defineComponent, openBlock, createElementBlock, createElementVNode, h, resolveComponent, renderSlot, createVNode, withCtx, createBlock, resolveDynamicComponent, unref, createTextVNode, toDisplayString, Fragment, watch, mergeProps, toHandlers, createCommentVNode, renderList, resolveDirective, withDirectives, isRef } from "vue";
8
+ import { openBlock, createElementBlock, createElementVNode, ref, computed, shallowRef, nextTick, watch, onBeforeUnmount, onDeactivated, onActivated, reactive, defineComponent, h, resolveComponent, renderSlot, createVNode, withCtx, createBlock, createCommentVNode, resolveDynamicComponent, unref, createTextVNode, toDisplayString, Fragment, mergeProps, toHandlers, renderList, resolveDirective, withDirectives, withModifiers, isRef, createSlots, withKeys, normalizeStyle, normalizeClass, normalizeProps, guardReactiveProps, Transition, KeepAlive } from "vue";
9
+ import { useRoute, useRouter } from "vue-router";
10
10
  import Mock from "mockjs";
11
- import ElementPlus, { ElNotification, ElMessageBox, ElInput } from "element-plus";
11
+ import ElementPlus, { ElNotification, ElMessageBox } from "element-plus";
12
+ import Sortable from "sortablejs";
12
13
  const fn = () => {
13
14
  };
14
15
  const object = {};
15
16
  const list$1 = [];
16
- const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
17
+ const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
17
18
  __proto__: null,
18
19
  fn,
19
20
  list: list$1,
@@ -1458,7 +1459,7 @@ const create$1 = (option) => {
1458
1459
  formatParams.push(parentTreeNode);
1459
1460
  formatParams.push(parentTreeNode == null ? void 0 : parentTreeNode.data);
1460
1461
  }
1461
- formatter == null ? void 0 : formatter(...formatParams);
1462
+ formatter(...formatParams);
1462
1463
  }
1463
1464
  const { children } = node;
1464
1465
  if (!Array.isArray(children) || children.length === 0) {
@@ -1572,7 +1573,7 @@ const tree = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
1572
1573
  sortTree,
1573
1574
  toFlat
1574
1575
  }, Symbol.toStringTag, { value: "Module" }));
1575
- const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1576
+ const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1576
1577
  __proto__: null,
1577
1578
  completeByDate,
1578
1579
  formatValue,
@@ -1654,7 +1655,7 @@ const createDataTimesByLength = (beginTime, length, interval, dateUnit, repeat)
1654
1655
  endDate[setMethodName](endDate[getMethodName]() + length - 1);
1655
1656
  return createDataTimesByRange([new ZDate(beginTime), endDate], interval, dateUnit, repeat);
1656
1657
  };
1657
- const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1658
+ const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1658
1659
  __proto__: null,
1659
1660
  HttpResponse,
1660
1661
  createDataTimesByLength,
@@ -1740,7 +1741,7 @@ const create = (option) => {
1740
1741
  return request;
1741
1742
  };
1742
1743
  };
1743
- const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1744
+ const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1744
1745
  __proto__: null,
1745
1746
  ABORTED_CODE,
1746
1747
  HttpRequestError,
@@ -1817,7 +1818,7 @@ const useHttpRequestInterval = (request, ms) => {
1817
1818
  abort
1818
1819
  };
1819
1820
  };
1820
- const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1821
+ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1821
1822
  __proto__: null,
1822
1823
  useHttpRequestInterval,
1823
1824
  useInterval
@@ -1829,17 +1830,85 @@ const ZUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
1829
1830
  ZDate,
1830
1831
  combine,
1831
1832
  decrypt,
1832
- empty: index$g,
1833
+ empty: index$f,
1833
1834
  encrypt,
1834
- httpRequest: index$d,
1835
- interval: index$c,
1836
- mock: index$e,
1835
+ httpRequest: index$c,
1836
+ interval: index$b,
1837
+ mock: index$d,
1837
1838
  parse,
1838
- reduce: index$f,
1839
+ reduce: index$e,
1839
1840
  stringify,
1840
1841
  toFixed,
1841
1842
  unitConvertor
1842
1843
  }, Symbol.toStringTag, { value: "Module" }));
1844
+ const _export_sfc = (sfc, props) => {
1845
+ const target = sfc.__vccOpts || sfc;
1846
+ for (const [key2, val] of props) {
1847
+ target[key2] = val;
1848
+ }
1849
+ return target;
1850
+ };
1851
+ const _sfc_main$p = {};
1852
+ const _hoisted_1$e = {
1853
+ viewBox: "0 0 1024 1024",
1854
+ version: "1.1",
1855
+ xmlns: "http://www.w3.org/2000/svg"
1856
+ };
1857
+ function _sfc_render$2(_ctx, _cache) {
1858
+ return openBlock(), createElementBlock("svg", _hoisted_1$e, _cache[0] || (_cache[0] = [
1859
+ createElementVNode("path", { d: "M930.3 899.5h-836c-16.6 0-30 13.4-30 30s13.4 30 30 30h836c16.6 0 30-13.4 30-30s-13.4-30-30-30zM157.3 844.8c1 0 2.1 0 3.1-0.1l212.8-18.9c8.2-0.7 15.8-4.3 21.6-10.1l500.1-500.1c13.7-13.7 13.7-35.8 0-49.5L701 72.1c-6.6-6.6-15.5-10.3-24.8-10.3s-18.2 3.7-24.7 10.3L151.7 571.9l-0.4 0.4c-5.8 5.8-9.4 13.5-10.1 21.7l-18.8 212.8c-0.9 10.3 2.8 20.5 10.1 27.8 6.6 6.5 15.6 10.2 24.8 10.2z m519-698.5l144.4 144.5-83.5 83.5-144.5-144.5 83.6-83.5zM209.8 612.8l333.4-333.4 144.5 144.5-333.4 333.3-158.5 14.1 14-158.5z" }, null, -1)
1860
+ ]));
1861
+ }
1862
+ const __vite_glob_0_0 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$2]]);
1863
+ const _sfc_main$o = {};
1864
+ const _hoisted_1$d = {
1865
+ viewBox: "0 0 1024 1024",
1866
+ version: "1.1",
1867
+ xmlns: "http://www.w3.org/2000/svg"
1868
+ };
1869
+ function _sfc_render$1(_ctx, _cache) {
1870
+ return openBlock(), createElementBlock("svg", _hoisted_1$d, _cache[0] || (_cache[0] = [
1871
+ createElementVNode("path", { d: "M619.264 278.016A33.216 33.216 0 0 0 650.24 243.2v-35.2a31.168 31.168 0 1 0-61.888 0v35.136a33.536 33.536 0 0 0 30.912 35.2m185.6 307.2a31.232 31.232 0 0 1 23.04 10.624l122.304 138.496a40.256 40.256 0 0 1 0 52.288l-122.56 137.344a29.888 29.888 0 0 1-46.016-0.384 40.576 40.576 0 0 1 0.32-52.224l99.2-110.848-99.2-112a40.768 40.768 0 0 1 0-52.224 29.376 29.376 0 0 1 22.976-11.008z" }, null, -1),
1872
+ createElementVNode("path", { d: "M598.4 730.304h309.056a32.448 32.448 0 0 1 0 64.832H598.4a32.448 32.448 0 0 1 0-64.832" }, null, -1),
1873
+ createElementVNode("path", { d: "M305.28 891.008H194.176a61.376 61.376 0 0 1-61.248-61.248V194.304a61.376 61.376 0 0 1 61.248-61.248H261.12a26.752 26.752 0 0 1 26.88 26.944v130.688a118.464 118.464 0 0 0 118.016 118.144h211.712A118.464 118.464 0 0 0 736 290.688V160a26.816 26.816 0 0 1 45.824-18.816L883.2 242.368a27.264 27.264 0 0 1 7.936 19.2v300.8a26.752 26.752 0 0 0 26.752 26.752h14.912a26.752 26.752 0 0 0 26.752-26.752v-326.4a32.896 32.896 0 0 0-10.24-24.064L811.776 74.368A33.856 33.856 0 0 0 787.712 64H194.176A130.624 130.624 0 0 0 64 194.304v635.52A130.624 130.624 0 0 0 194.176 960h291.136A26.752 26.752 0 0 0 512 933.248v-15.296a26.752 26.752 0 0 0-26.752-26.752H305.472zM383.68 132.992H640a26.752 26.752 0 0 1 26.752 26.752v157.632a22.784 22.784 0 0 1-22.4 22.4H379.584a22.784 22.784 0 0 1-22.4-22.4V160A26.752 26.752 0 0 1 384 133.056z" }, null, -1)
1874
+ ]));
1875
+ }
1876
+ const __vite_glob_0_1 = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$1]]);
1877
+ const _sfc_main$n = {};
1878
+ const _hoisted_1$c = {
1879
+ viewBox: "0 0 1024 1024",
1880
+ version: "1.1",
1881
+ xmlns: "http://www.w3.org/2000/svg"
1882
+ };
1883
+ function _sfc_render(_ctx, _cache) {
1884
+ return openBlock(), createElementBlock("svg", _hoisted_1$c, _cache[0] || (_cache[0] = [
1885
+ createElementVNode("path", { d: "M579.7 291.4c18.8 0 34.1-15.3 34.1-34.1v-34.1c0-18.8-15.4-34.1-34.1-34.1-18.8 0-34.1 15.3-34.1 34.1v34.1c0 18.7 15.4 34.1 34.1 34.1z" }, null, -1),
1886
+ createElementVNode("path", { d: "M944.7 216.3L808.2 79.9c-6.8-6.8-15.3-10.2-23.9-10.2H170.4c-56.3 0-102.3 46-102.3 102.3v682.1c0 56.3 46 102.3 102.3 102.3h682.1c56.3 0 102.3-46 102.3-102.3V240.2c0.1-8.5-3.3-17-10.1-23.9zM358 137.9h307v182.5c0 11.9-10.2 22.2-22.2 22.2H380.2c-11.9 0-22.2-10.2-22.2-22.2V137.9z m358.1 750.3H306.9V652.9c0-20.5 17.1-37.5 37.5-37.5h334.2c20.5 0 37.5 17 37.5 37.5v235.3z m170.6-34.1c0 18.8-15.3 34.1-34.1 34.1h-66.5V652.9c0-58-47.7-105.7-105.7-105.7h-336c-58 0-105.7 47.7-105.7 105.7v235.3h-68.2c-18.8 0-34.1-15.3-34.1-34.1V172c0-18.8 15.3-34.1 34.1-34.1h119.4v182.5c0 49.5 40.9 90.4 90.4 90.4h262.6c49.5 0 90.4-40.9 90.4-90.4V137.9h37.5l116 116v600.2z" }, null, -1)
1887
+ ]));
1888
+ }
1889
+ const __vite_glob_0_2 = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render]]);
1890
+ const getPageViewMap = (pageViewMap, pageViewPathIgnore) => Object.entries(pageViewMap).reduce((map2, [key2, pageCreator]) => {
1891
+ if (pageViewPathIgnore) {
1892
+ key2 = key2.replace(pageViewPathIgnore, "");
1893
+ }
1894
+ const pageViewName = key2.replace(/^\//, "").substring(0, key2.lastIndexOf("/") - 1);
1895
+ map2[pageViewName] = pageCreator;
1896
+ return map2;
1897
+ }, {});
1898
+ const getComponentViewMap = (componentViewMap) => (
1899
+ // 将对象转换为键值对数组,并使用 reduce 方法遍历数组
1900
+ Object.entries(componentViewMap).reduce((map2, [key2, pageCreator]) => {
1901
+ map2[key2.replace(/\.[^\.]+$/, "").substring(key2.lastIndexOf("/") + 1)] = pageCreator;
1902
+ return map2;
1903
+ }, {})
1904
+ );
1905
+ const webUtilsIconMap = getComponentViewMap(
1906
+ /* @__PURE__ */ Object.assign({
1907
+ "./EditorSvg.vue": __vite_glob_0_0,
1908
+ "./SaveContinueSvg.vue": __vite_glob_0_1,
1909
+ "./SaveSvg.vue": __vite_glob_0_2
1910
+ })
1911
+ );
1843
1912
  function mitt(n) {
1844
1913
  return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
1845
1914
  var i = n.get(t);
@@ -1861,7 +1930,7 @@ const WS_MSG_OPTION_SYMBOL = Symbol("WS_MSG_OPTION_SYMBOL");
1861
1930
  const WS_PARAMS = Symbol("WS_PARAMS");
1862
1931
  const WS_EVENTS = Symbol("WS_EVENTS");
1863
1932
  const WS_CREATE = Symbol("WS_CREATE");
1864
- const WS_REMOVE = Symbol("REMOVE_WS");
1933
+ const WS_REMOVE = Symbol("WS_REMOVE");
1865
1934
  const WS_ON_OPEN = Symbol("WS_ON_OPEN");
1866
1935
  const WS_ON_MESSAGE = Symbol("WS_ON_MESSAGE");
1867
1936
  const WS_ON_CLOSE = Symbol("WS_ON_CLOSE");
@@ -2134,14 +2203,6 @@ class ZNavButton extends ZBaseNav {
2134
2203
  __publicField(this, "type", 3);
2135
2204
  }
2136
2205
  }
2137
- const getPageViewMap = (pageViewMap, pageViewPathIgnore) => Object.entries(pageViewMap).reduce((map2, [key2, pageCreator]) => {
2138
- if (pageViewPathIgnore) {
2139
- key2 = key2.replace(pageViewPathIgnore, "");
2140
- }
2141
- const pageViewName = key2.replace(/^\//, "").substring(0, key2.lastIndexOf("/") - 1);
2142
- map2[pageViewName] = pageCreator;
2143
- return map2;
2144
- }, {});
2145
2206
  const getNavsCategory = (navs, pageViewMap) => {
2146
2207
  const navDirs = [];
2147
2208
  const navMenus = [];
@@ -2171,7 +2232,7 @@ const getNavsCategory = (navs, pageViewMap) => {
2171
2232
  }
2172
2233
  return {
2173
2234
  navDirs,
2174
- navMenus,
2235
+ navMenus: sort(navMenus, "orderNo"),
2175
2236
  navLinks,
2176
2237
  navButtons
2177
2238
  };
@@ -2189,7 +2250,93 @@ const getNavMenuButtonMap = (navButtons) => navButtons.reduce(
2189
2250
  {}
2190
2251
  );
2191
2252
  const ROOT_ROUTE_NAME = "ROOT_ROUTE";
2253
+ const NOT_FOUND_ROUTE_NAME = "NOT_FOUND";
2254
+ let router;
2255
+ const setRouter = (_router) => {
2256
+ if (router === _router) return;
2257
+ router = _router;
2258
+ watchRoute(_router);
2259
+ };
2260
+ let stopRouteWatch;
2261
+ const tabsRef = ref([]);
2262
+ const tabMapComputed = computed(
2263
+ () => (
2264
+ // 使用 ZUtils.reduce.toKeyValue 函数将 tabsRef 中的路由对象数组转换为键值对映射
2265
+ toKeyValue(
2266
+ // 从 tabsRef 中获取当前的路由标签页数组
2267
+ tabsRef.value,
2268
+ // 指定使用路由对象的 'name' 属性作为键
2269
+ "id"
2270
+ )
2271
+ )
2272
+ );
2273
+ const getTab = (route) => {
2274
+ const meta = route.meta;
2275
+ const raw = meta.raw;
2276
+ return {
2277
+ // 使用路由名称作为标签页的 ID
2278
+ id: route.name,
2279
+ // 从原始导航菜单对象中获取图标
2280
+ icon: raw.icon,
2281
+ // 从原始导航菜单对象中获取标题
2282
+ title: raw.title,
2283
+ // 从原始导航菜单对象中获取是否固定的标志
2284
+ isAffix: raw.isAffix,
2285
+ // 从原始导航菜单对象中获取是否保持激活状态的标志
2286
+ keepAliveView: raw.isKeepAlive,
2287
+ // 初始化保持激活状态的计数为 0
2288
+ count: 0
2289
+ };
2290
+ };
2291
+ const setTabs = (routes) => {
2292
+ tabsRef.value = routes.reduce((tabs, route) => {
2293
+ const meta = route.meta;
2294
+ if (meta) {
2295
+ const { raw } = meta;
2296
+ if (raw == null ? void 0 : raw.isAffix) {
2297
+ tabs.push(getTab(route));
2298
+ }
2299
+ }
2300
+ return tabs;
2301
+ }, []);
2302
+ };
2303
+ const watchRoute = (router2) => {
2304
+ stopRouteWatch == null ? void 0 : stopRouteWatch();
2305
+ const routeRef = router2.currentRoute;
2306
+ stopRouteWatch = watch(routeRef, (newRoute, oldRoute) => {
2307
+ const routeName = newRoute.name;
2308
+ if (routeName === NOT_FOUND_ROUTE_NAME || routeName === ROOT_ROUTE_NAME) {
2309
+ return;
2310
+ }
2311
+ const meta = newRoute.meta;
2312
+ if (!meta) {
2313
+ return;
2314
+ }
2315
+ const { raw } = meta;
2316
+ if (!raw) {
2317
+ return;
2318
+ }
2319
+ if (raw.type !== 2) {
2320
+ return;
2321
+ }
2322
+ if (tabMapComputed.value[newRoute.name]) {
2323
+ return;
2324
+ }
2325
+ const tabs = tabsRef.value;
2326
+ if (oldRoute) {
2327
+ const oldRouteName = oldRoute.name;
2328
+ const oldRouteTabIndex = tabs.findIndex((tab) => tab.id === oldRouteName);
2329
+ if (oldRouteTabIndex > -1) {
2330
+ console.log(oldRouteName, oldRouteTabIndex + 1);
2331
+ tabs.splice(oldRouteTabIndex + 1, 0, getTab(newRoute));
2332
+ return;
2333
+ }
2334
+ }
2335
+ tabs.push(getTab(newRoute));
2336
+ });
2337
+ };
2192
2338
  const setRoutes = (option) => {
2339
+ tabsRef.value = [];
2193
2340
  const navMenuButtonMap = getNavMenuButtonMap(option.navButtons);
2194
2341
  const routes = [];
2195
2342
  const { navMenus, pageViewMap } = option;
@@ -2210,12 +2357,12 @@ const setRoutes = (option) => {
2210
2357
  const { NotFoundPageView } = option;
2211
2358
  if (NotFoundPageView) {
2212
2359
  routes.push({
2213
- name: "NotFound",
2360
+ name: NOT_FOUND_ROUTE_NAME,
2214
2361
  path: "*",
2215
2362
  component: NotFoundPageView
2216
2363
  });
2217
2364
  }
2218
- const { router } = option;
2365
+ setTabs(routes);
2219
2366
  router.addRoute({
2220
2367
  name: ROOT_ROUTE_NAME,
2221
2368
  path: "/",
@@ -2274,11 +2421,10 @@ const setNavTree = (navDirs, navMenus, navLinks) => {
2274
2421
  navChildrenMapRef.value = childrenMap;
2275
2422
  };
2276
2423
  const setNavs = (option) => {
2277
- const pageViewMap = getPageViewMap(option.pageViewMap, option.pageViewPathIgnore);
2424
+ const pageViewMap = getComponentViewMap(option.pageViewMap);
2278
2425
  const navsCategory = getNavsCategory(option.navs, pageViewMap);
2279
2426
  const { navMenus } = navsCategory;
2280
2427
  setRoutes({
2281
- router: option.router,
2282
2428
  RootPageView: option.RootPageView,
2283
2429
  navMenus,
2284
2430
  pageViewMap,
@@ -2291,29 +2437,178 @@ const clear = (option) => {
2291
2437
  navTreeRef.value = list$1;
2292
2438
  navChildrenMapRef.value = object;
2293
2439
  if (option) {
2294
- const { router, path } = option;
2295
- option.router.addRoute({
2440
+ const { path } = option;
2441
+ router.addRoute({
2296
2442
  name: ROOT_ROUTE_NAME,
2297
2443
  path,
2298
2444
  component: option.PageView
2299
2445
  });
2300
2446
  router.replace(path).then(() => {
2447
+ tabsRef.value = [];
2301
2448
  });
2302
2449
  }
2303
2450
  };
2304
2451
  const response = {
2452
+ /**
2453
+ * 根路由名称常量,用于标识根路由。
2454
+ * @type {'ROOT_ROUTE'}
2455
+ */
2305
2456
  ROOT_ROUTE_NAME,
2457
+ /**
2458
+ * 设置 Vue Router 实例的方法。
2459
+ * @type {Function}
2460
+ * @param {Router} _router - 要设置的 Vue Router 实例。
2461
+ */
2462
+ setRouter,
2463
+ /**
2464
+ * 根据传入的选项对象,设置导航项和路由配置的方法。
2465
+ * @type {Function}
2466
+ * @param {Object} option - 包含导航项和路由配置选项的对象。
2467
+ */
2306
2468
  setNavs,
2469
+ /**
2470
+ * 清除导航树和导航子项映射,并根据传入的选项重置路由配置的方法。
2471
+ * @type {Function}
2472
+ * @param {Object} [option] - 可选的选项对象,包含路由实例、路径和页面视图组件。
2473
+ */
2307
2474
  clear,
2475
+ /**
2476
+ * 获取导航树的 getter 方法。
2477
+ * @type {Function}
2478
+ * @returns {ZNavWithoutButton[]} - 导航树的根节点数组。
2479
+ */
2308
2480
  get navTree() {
2309
2481
  return navTreeRef.value;
2310
2482
  },
2483
+ /**
2484
+ * 获取导航目录的子导航项映射的 getter 方法。
2485
+ * @type {Function}
2486
+ * @returns {Record<ZNavDir['id'], ZNavWithoutButton[]>} - 导航目录的子导航项映射。
2487
+ */
2311
2488
  get navChildrenMap() {
2312
2489
  return navChildrenMapRef.value;
2490
+ },
2491
+ /**
2492
+ * 获取当前打开的路由标签页列表的 getter 方法。
2493
+ * @type {Function}
2494
+ * @returns {NavTab[]} - 当前打开的路由标签页列表。
2495
+ */
2496
+ get tabs() {
2497
+ return tabsRef.value;
2498
+ },
2499
+ /**
2500
+ * 获取路由名称到路由标签页对象的映射的 getter 方法。
2501
+ * @type {Function}
2502
+ * @returns {Record<string, NavTab>} - 路由名称到路由标签页对象的映射。
2503
+ */
2504
+ get tabMap() {
2505
+ return tabMapComputed.value;
2506
+ },
2507
+ /**
2508
+ * 移除指定标签页的方法。
2509
+ * 如果移除的是当前激活的标签页,会自动切换到下一个标签页。
2510
+ * @type {Function}
2511
+ * @param {NavTab} tab - 要移除的标签页对象。
2512
+ * @returns {Promise<void>} - 一个 Promise,当标签页移除操作完成时 resolve。
2513
+ */
2514
+ removeTab: async (tab) => {
2515
+ const tabIndex = tabsRef.value.indexOf(tab);
2516
+ if (tabIndex === -1) return;
2517
+ const tabs = tabsRef.value;
2518
+ const tabsLen = tabs.length;
2519
+ if (tab.id === router.currentRoute.value.name) {
2520
+ if (tabsLen > 1) {
2521
+ const nextTabIndex = tabIndex === 0 ? 1 : tabIndex - 1;
2522
+ const nextTab = tabs[nextTabIndex];
2523
+ await router.push({
2524
+ name: nextTab.id
2525
+ });
2526
+ }
2527
+ }
2528
+ tabs.splice(tabIndex, 1);
2529
+ },
2530
+ /**
2531
+ * 刷新指定标签页的方法。
2532
+ * 如果标签页设置了保持激活状态,则会先禁用再启用该状态以实现刷新。
2533
+ * @type {Function}
2534
+ * @param {NavTab} tab - 要刷新的标签页对象。
2535
+ */
2536
+ refreshTab: (tab) => {
2537
+ if (tab.keepAliveView) {
2538
+ tab.keepAliveView = false;
2539
+ nextTick(() => {
2540
+ tab.keepAliveView = true;
2541
+ });
2542
+ }
2543
+ tab.count++;
2544
+ },
2545
+ /**
2546
+ * 根据 DOM 元素的顺序对标签页列表进行排序的方法。
2547
+ * @type {Function}
2548
+ * @param {HTMLElement} sortElContainer - 包含排序元素的容器元素。
2549
+ * @param {string} datasetProp - 用于获取元素数据集中的属性名。
2550
+ */
2551
+ sortTabs: (sortElContainer, datasetProp) => {
2552
+ const { children } = sortElContainer;
2553
+ const childrenLen = children.length;
2554
+ const indexMap = {};
2555
+ for (let i = 0; i < childrenLen; i++) {
2556
+ indexMap[children[i].dataset[datasetProp]] = i;
2557
+ }
2558
+ tabsRef.value.sort((a, b) => indexMap[a.id] - indexMap[b.id]);
2313
2559
  }
2314
2560
  };
2315
2561
  const useNavStore = () => response;
2316
- const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2562
+ const useSkeletonRow = (skeletonHeight, gap) => {
2563
+ let skeletonContainer = void 0;
2564
+ const rowsRef = shallowRef(0);
2565
+ let setRowTimer = void 0;
2566
+ const setRows = () => {
2567
+ clearTimeout(setRowTimer);
2568
+ setRowTimer = setTimeout(() => {
2569
+ if (skeletonContainer) {
2570
+ const { clientHeight } = skeletonContainer;
2571
+ const height = clientHeight - clientHeight % skeletonHeight;
2572
+ rowsRef.value = Math.floor((height - skeletonHeight) / (skeletonHeight + gap));
2573
+ }
2574
+ }, 0);
2575
+ };
2576
+ const onWindowResize = () => {
2577
+ setRows();
2578
+ };
2579
+ const setSkeletonContainer = (container) => {
2580
+ skeletonContainer = container;
2581
+ if (container) {
2582
+ setRows();
2583
+ window.addEventListener("resize", onWindowResize);
2584
+ } else {
2585
+ window.removeEventListener("resize", onWindowResize);
2586
+ }
2587
+ };
2588
+ const removeWindowResizeEvent = () => {
2589
+ if (skeletonContainer) {
2590
+ window.removeEventListener("resize", onWindowResize);
2591
+ }
2592
+ };
2593
+ onBeforeUnmount(() => {
2594
+ removeWindowResizeEvent();
2595
+ });
2596
+ onDeactivated(() => {
2597
+ removeWindowResizeEvent();
2598
+ });
2599
+ onActivated(() => {
2600
+ if (skeletonContainer) {
2601
+ window.addEventListener("resize", onWindowResize);
2602
+ }
2603
+ });
2604
+ return {
2605
+ setSkeletonContainer,
2606
+ get rows() {
2607
+ return rowsRef.value;
2608
+ }
2609
+ };
2610
+ };
2611
+ const ZWebUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2317
2612
  __proto__: null,
2318
2613
  HttpRequestMethodEnum,
2319
2614
  WebSocketManager,
@@ -2324,8 +2619,10 @@ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
2324
2619
  ZNavLink,
2325
2620
  ZNavMenu,
2326
2621
  ZNavTypeEnum,
2622
+ getComponentViewMap,
2327
2623
  getPageViewMap,
2328
- useNavStore
2624
+ useNavStore,
2625
+ useSkeletonRow
2329
2626
  }, Symbol.toStringTag, { value: "Module" }));
2330
2627
  const useLoadUtil = () => {
2331
2628
  const loadingCount = shallowRef(0);
@@ -2889,10 +3186,10 @@ class FilterHandler extends ConfigsCreator {
2889
3186
  }
2890
3187
  }
2891
3188
  /**
2892
- * 定义一个受保护的方法 `search`,用于执行搜索操作。
2893
- * 该方法首先调用 `validateQuery` 方法来验证查询。
2894
- * 如果验证成功,则调用 `onValidateQuerySuccess` 方法。
2895
- * 如果验证失败,则调用 `onValidateQueryFail` 方法,并传递错误对象。
3189
+ * 执行搜索操作,该方法会先验证查询的有效性,然后根据验证结果执行相应的回调函数。
3190
+ * 此方法是过滤器处理程序的核心逻辑之一,用于确保在进行搜索操作之前,查询数据是有效的。
3191
+ *
3192
+ * @returns {void}
2896
3193
  */
2897
3194
  search() {
2898
3195
  this.validateQuery().then(() => {
@@ -2996,7 +3293,7 @@ const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
2996
3293
  var EditTypeEnum = /* @__PURE__ */ ((EditTypeEnum2) => {
2997
3294
  EditTypeEnum2[EditTypeEnum2["CREATE"] = 1] = "CREATE";
2998
3295
  EditTypeEnum2[EditTypeEnum2["DETAIL"] = 2] = "DETAIL";
2999
- EditTypeEnum2[EditTypeEnum2["UPDATE"] = 6] = "UPDATE";
3296
+ EditTypeEnum2[EditTypeEnum2["UPDATE"] = 3] = "UPDATE";
3000
3297
  return EditTypeEnum2;
3001
3298
  })(EditTypeEnum || {});
3002
3299
  const editTypeMap = {
@@ -3038,10 +3335,10 @@ const editTypeMap = {
3038
3335
  * @property {string} method - 操作的HTTP方法,为'PUT'。
3039
3336
  */
3040
3337
  [
3041
- 6
3338
+ 3
3042
3339
  /* UPDATE */
3043
3340
  ]: {
3044
- id: 6,
3341
+ id: 3,
3045
3342
  label: "修改",
3046
3343
  method: "PUT"
3047
3344
  }
@@ -3342,7 +3639,6 @@ const useCurdMock = (option) => {
3342
3639
  if (listConfig) {
3343
3640
  const requestMethod = (listConfig.method || "get").toLowerCase();
3344
3641
  Mock.mock(new RegExp(`^/api${basePath}/list`), requestMethod, (option2) => {
3345
- console.log(new HttpResponse("data", getListParam(list2, option2, listFilter).list));
3346
3642
  return new HttpResponse("data", getListParam(list2, option2, listFilter).list);
3347
3643
  });
3348
3644
  }
@@ -3457,6 +3753,13 @@ class CurdHandler extends FilterHandler {
3457
3753
  * @description 它会在组件初始化时被设置,并且在组件的整个生命周期中保持不变。
3458
3754
  */
3459
3755
  __publicField(this, "label");
3756
+ /**
3757
+ * 定义一个只读属性,用于存储权限配置。
3758
+ * 该属性是一个记录类型,键为字符串,值为 ZNavButton 类型。
3759
+ * 它用于存储每个操作对应的导航按钮,以实现权限控制。
3760
+ * 这个属性在组件初始化时被设置,并且在组件的整个生命周期中保持不变。
3761
+ */
3762
+ __publicField(this, "permission");
3460
3763
  /**
3461
3764
  * 创建一个浅引用,用于存储 CURD 操作的配置。
3462
3765
  * 这个引用将用于在组件中存储和更新 CURD 配置。
@@ -3515,6 +3818,7 @@ class CurdHandler extends FilterHandler {
3515
3818
  if (steps.length === 0) {
3516
3819
  steps.push({});
3517
3820
  }
3821
+ const formItemGroupMap = {};
3518
3822
  return this.displayFormItemsComputed.value.reduce(
3519
3823
  (stepFormItemsGroup, formItem) => {
3520
3824
  let stepIndex = formItem.stepIndex || 0;
@@ -3530,11 +3834,18 @@ class CurdHandler extends FilterHandler {
3530
3834
  label: step.label || "",
3531
3835
  desc: step.desc || "",
3532
3836
  index: stepIndex,
3533
- formItems: []
3837
+ formItemsGroup: []
3534
3838
  }
3535
3839
  );
3536
3840
  }
3537
- stepFormItems.formItems.push(formItem);
3841
+ const formItemGroupMapKey = `${stepIndex}-${formItem.rowGroup}`;
3842
+ let formItems = formItemGroupMap[formItemGroupMapKey];
3843
+ if (!formItems) {
3844
+ stepFormItems.formItemsGroup.push(
3845
+ formItems = formItemGroupMap[formItemGroupMapKey] = []
3846
+ );
3847
+ }
3848
+ formItems.push(formItem);
3538
3849
  return stepFormItemsGroup;
3539
3850
  },
3540
3851
  /**
@@ -3708,16 +4019,18 @@ class CurdHandler extends FilterHandler {
3708
4019
  */
3709
4020
  __publicField(this, "editorDataRequestUtil");
3710
4021
  /**
3711
- * 创建一个浅引用,用于存储编辑器数据。
3712
- * 这个引用将用于在组件中存储和更新编辑器数据。
3713
- * @type {shallowRef<T>}
3714
- * @description 这个引用是浅的,意味着它不会递归地观察嵌套对象的变化。
4022
+ * 创建一个响应式引用,用于存储编辑器的数据。
4023
+ * 这个引用将用于在组件中存储和更新编辑器的数据。
4024
+ * @type {Ref<T | undefined>}
4025
+ * @description 这个引用是响应式的,意味着它会在数据发生变化时自动更新。
3715
4026
  * @description 这对于性能优化很重要,因为它避免了不必要的更新。
3716
4027
  */
3717
- __publicField(this, "editorDataRef", shallowRef());
4028
+ __publicField(this, "editorDataRef", ref());
3718
4029
  __publicField(this, "saveEditorDataRequestUtil");
3719
4030
  this.curdTargetPrototype = curdTargetPrototype;
3720
4031
  this.CurdTarget = CurdTarget;
4032
+ this.label = param.label;
4033
+ this.permission = param.permission;
3721
4034
  CurdTarget[classCurdKey] = this;
3722
4035
  this.api = param.api;
3723
4036
  const { pagination } = param;
@@ -3746,7 +4059,6 @@ class CurdHandler extends FilterHandler {
3746
4059
  if (nameKeyConfig) {
3747
4060
  this.nameKeyConfig = nameKeyConfig;
3748
4061
  }
3749
- this.label = param.label;
3750
4062
  this.listRequestUtil = useRequestUtil(true);
3751
4063
  this.editorDataRequestUtil = useRequestUtil(true);
3752
4064
  this.saveEditorDataRequestUtil = useRequestUtil(true);
@@ -4055,6 +4367,24 @@ class CurdHandler extends FilterHandler {
4055
4367
  const maxStepIndex = Math.min(minStepIndex, this.displayStepFormItemsGroup.length - 1);
4056
4368
  this.formStepIndexRef.value = maxStepIndex;
4057
4369
  }
4370
+ /**
4371
+ * 更改表单步骤索引。
4372
+ * 根据传入的方向参数(1 或 -1),决定是向前还是向后移动表单步骤。
4373
+ * 如果方向为 1(向前),则先验证编辑器数据,验证通过后将步骤索引加 1。
4374
+ * 如果方向为 -1(向后),则直接将步骤索引减 1。
4375
+ *
4376
+ * @param { -1 | 1 } direction - 方向参数,1 表示向前,-1 表示向后。
4377
+ * @returns { void }
4378
+ */
4379
+ changeFormStepIndex(direction) {
4380
+ if (direction === 1) {
4381
+ this.validEditorData().then(() => {
4382
+ this.formStepIndex++;
4383
+ });
4384
+ } else {
4385
+ this.formStepIndex--;
4386
+ }
4387
+ }
4058
4388
  /**
4059
4389
  * 获取当前编辑类型。
4060
4390
  * 这个方法返回 editTypeRef 引用的值,它表示当前的编辑类型。
@@ -4125,6 +4455,7 @@ class CurdHandler extends FilterHandler {
4125
4455
  this.editTypeRef.value = editTypeMap[editTypeId];
4126
4456
  this.editorVisibleRef.value = true;
4127
4457
  if (editTypeId & EditTypeEnum.DETAIL) {
4458
+ this.editorDataRef.value = void 0;
4128
4459
  data = await this.editorDataRequestUtil.requestData(this.api.getDetail(data));
4129
4460
  }
4130
4461
  this.setEditorData(data);
@@ -4137,6 +4468,14 @@ class CurdHandler extends FilterHandler {
4137
4468
  closeEditor() {
4138
4469
  this.editorVisible = false;
4139
4470
  }
4471
+ /**
4472
+ * 获取保存编辑器数据请求的加载状态。
4473
+ * 该方法返回 `saveEditorDataRequestUtil` 的 `loadStatus` 属性值,用于判断保存编辑器数据的请求是否正在加载。
4474
+ * @returns {boolean} - 保存编辑器数据请求的加载状态,true 表示正在加载,false 表示加载完成。
4475
+ */
4476
+ get saveEditorDataLoadStatus() {
4477
+ return this.saveEditorDataRequestUtil.loadStatus;
4478
+ }
4140
4479
  /**
4141
4480
  * 保存编辑器数据并执行回调函数。
4142
4481
  * 这个方法会验证编辑器数据的有效性,然后将数据发送到服务器进行保存。
@@ -4157,18 +4496,16 @@ class CurdHandler extends FilterHandler {
4157
4496
  });
4158
4497
  }
4159
4498
  /**
4160
- * 保存编辑器数据并继续创建。
4161
- * 这个方法会将当前步骤索引重置为0,然后调用saveEditorData方法保存编辑器数据。
4162
- * 在保存成功后,它会创建一个新的编辑器数据实例,并将其设置为编辑器的数据。
4499
+ * 保存编辑器数据并继续创建新数据。
4500
+ * 此方法会调用 `saveEditorData` 方法保存当前编辑器中的数据,
4501
+ * 当保存成功后,将表单步骤索引重置为 0,并使用新创建的实例重置编辑器数据,以便用户继续创建新数据。
4502
+ *
4163
4503
  * @returns {void}
4164
4504
  */
4165
4505
  editorDataSaveAndContinue() {
4166
- this.formStepIndex = 0;
4167
4506
  this.saveEditorData(() => {
4168
- this.setEditorData(new this.CurdTarget(
4169
- 6
4170
- /* CONTINUE_CREATE */
4171
- ));
4507
+ this.formStepIndex = 0;
4508
+ this.setEditorData(new this.CurdTarget(6, this.editorData));
4172
4509
  });
4173
4510
  }
4174
4511
  /**
@@ -9892,17 +10229,183 @@ const directiveInstaller = {
9892
10229
  }
9893
10230
  };
9894
10231
  class CurdViewHandler extends CurdHandler {
9895
- constructor(...args) {
9896
- super(...args);
10232
+ constructor() {
10233
+ super(...arguments);
10234
+ /**
10235
+ * 用于存储表格组件实例的浅响应式引用。
10236
+ * 该引用指向一个 `ElTable` 组件实例,可用于访问和操作表格的属性和方法。
10237
+ */
9897
10238
  __publicField(this, "tableElRef", shallowRef());
10239
+ /**
10240
+ * 搜索按钮点击事件处理函数。
10241
+ * 当搜索按钮被点击时,调用 `search` 方法执行搜索操作。
10242
+ */
9898
10243
  __publicField(this, "onSearchBtnClick", () => {
9899
10244
  this.search();
9900
10245
  });
10246
+ /**
10247
+ * 编辑器按钮点击事件处理函数。
10248
+ * 当编辑器按钮被点击时,调用 `openEditor` 方法打开编辑器。
10249
+ * 该方法接收与 `ZDecorators.CurdKey.CurdHandler` 类中 `openEditor` 方法相同的参数,
10250
+ * 并将这些参数传递给 `openEditor` 方法。
10251
+ *
10252
+ * @param {...Parameters<ZDecorators.CurdKey.CurdHandler<T>['openEditor']>} args - 传递给 `openEditor` 方法的参数。
10253
+ */
10254
+ __publicField(this, "onEditorBtnClick", (...args) => {
10255
+ this.openEditor(...args);
10256
+ });
10257
+ /**
10258
+ * 表格行点击事件处理函数。
10259
+ * 当表格的某一行被点击时,根据当前用户的权限决定打开编辑模式还是详情查看模式。
10260
+ *
10261
+ * @param {T} model - 当前点击行的数据对象。
10262
+ */
10263
+ __publicField(this, "onTableRowClick", (model) => {
10264
+ const { permission } = this;
10265
+ if (permission.Edit) {
10266
+ this.onEditorBtnClick(EditTypeEnum.UPDATE, model);
10267
+ } else if (permission.Detail) {
10268
+ this.onEditorBtnClick(EditTypeEnum.DETAIL, model);
10269
+ }
10270
+ });
10271
+ /**
10272
+ * 删除按钮点击事件处理函数。
10273
+ * 当删除按钮被点击时,调用 `delete` 方法执行删除操作。
10274
+ * 该方法接收与 `ZDecorators.CurdKey.CurdHandler` 类中 `delete` 方法相同的参数,
10275
+ * 并将这些参数传递给 `delete` 方法。
10276
+ *
10277
+ * @param {...Parameters<ZDecorators.CurdKey.CurdHandler<T>['delete']>} args - 传递给 `delete` 方法的参数。
10278
+ */
10279
+ __publicField(this, "onDeleteBtnClick", (...args) => {
10280
+ this.delete(...args);
10281
+ });
10282
+ /**
10283
+ * 导出按钮点击事件处理函数。
10284
+ * 当导出按钮被点击时,调用 `export` 方法执行导出操作。
10285
+ */
9901
10286
  __publicField(this, "onExportBtnClick", () => {
9902
10287
  this.export();
9903
10288
  });
10289
+ /**
10290
+ * 创建按钮点击事件处理函数。
10291
+ * 当创建按钮被点击时,调用 `openEditor` 方法打开编辑器,进入创建数据的模式。
10292
+ * 此方法会传递编辑类型为创建,并使用 `CurdTarget` 类创建一个新的创建类型实例。
10293
+ */
10294
+ __publicField(this, "onCreateBtnClick", () => {
10295
+ this.openEditor(
10296
+ EditTypeEnum.CREATE,
10297
+ new this.CurdTarget(CreateTypeEnum.CREATE)
10298
+ );
10299
+ });
10300
+ /**
10301
+ * 标记编辑器是否打开的布尔值。
10302
+ * 用于跟踪编辑器的打开状态,true 表示编辑器已打开,false 表示编辑器已关闭。
10303
+ */
10304
+ __publicField(this, "editorOpened", false);
10305
+ /**
10306
+ * 编辑器打开时的回调方法。
10307
+ * 该方法会在编辑器打开时执行,主要完成以下操作:
10308
+ * 1. 将 editorOpened 状态设置为 true
10309
+ * 2. 调用 focusInput 方法自动聚焦到输入框
10310
+ */
10311
+ __publicField(this, "onEditorOpened", () => {
10312
+ this.editorOpened = true;
10313
+ this.focusInput();
10314
+ });
10315
+ /**
10316
+ * 编辑器关闭时的回调方法。
10317
+ * 该方法会在编辑器关闭时执行,将 editorOpened 状态设置为 false,
10318
+ * 用于跟踪编辑器的关闭状态。
10319
+ */
10320
+ __publicField(this, "onEditorClosed", () => {
10321
+ this.editorOpened = false;
10322
+ });
10323
+ /**
10324
+ * 保存按钮点击事件处理函数。
10325
+ * 当保存按钮被点击时,调用 `editorDataSaveAndClose` 方法保存编辑器数据并关闭编辑器。
10326
+ */
10327
+ __publicField(this, "onSaveBtnClick", () => {
10328
+ this.editorDataSaveAndClose();
10329
+ });
10330
+ /**
10331
+ * 保存并继续按钮点击事件处理函数。
10332
+ * 当保存并继续按钮被点击时,调用 `editorDataSaveAndContinue` 方法保存编辑器数据并保持编辑器打开状态,以便继续编辑。
10333
+ */
10334
+ __publicField(this, "onSaveContinueBtnClick", () => {
10335
+ this.editorDataSaveAndContinue();
10336
+ });
10337
+ /**
10338
+ * 关闭编辑器按钮点击事件处理函数。
10339
+ * 当关闭编辑器按钮被点击时,调用 `closeEditor` 方法关闭编辑器。
10340
+ */
10341
+ __publicField(this, "onCloseEditorBtnClick", () => {
10342
+ this.closeEditor();
10343
+ });
10344
+ /**
10345
+ * 计算属性,用于确定表单是否禁用。
10346
+ * 当编辑器数据加载状态或保存编辑器数据加载状态为真时,表单将被禁用。
10347
+ * 该属性是一个只读的计算属性,它会根据 `editorDataLoadStatus` 和 `saveEditorDataLoadStatus` 的值动态更新。
10348
+ */
10349
+ __publicField(this, "formDisabledComputed", computed(
10350
+ // 当编辑器数据正在加载或者保存编辑器数据正在加载时,表单禁用
10351
+ () => this.editorDataLoadStatus || this.saveEditorDataLoadStatus
10352
+ ));
10353
+ /**
10354
+ * 表单输入框按下回车键时的处理函数。
10355
+ * 根据当前表单步骤索引和编辑类型,决定是保存并关闭编辑器,还是切换到下一个表单步骤。
10356
+ */
10357
+ __publicField(this, "onFormKeyEnter", () => {
10358
+ if (this.formStepIndex === this.displayStepFormItemsGroup.length - 1) {
10359
+ if (this.editType.id === EditTypeEnum.DETAIL) {
10360
+ return;
10361
+ }
10362
+ this.editorDataSaveAndClose();
10363
+ } else {
10364
+ this.changeFormStepIndex(1);
10365
+ }
10366
+ });
10367
+ /**
10368
+ * 用于存储表单组件实例的浅响应式引用。
10369
+ * 该引用指向一个 `ElForm` 组件实例,可用于访问和操作表单的属性和方法,
10370
+ * 例如表单验证、重置表单等操作。
10371
+ */
9904
10372
  __publicField(this, "editorFormElRef", shallowRef());
9905
10373
  }
10374
+ /**
10375
+ * 自动聚焦输入框的方法。
10376
+ * 该方法会在编辑器打开时自动聚焦到带有 'auto-focus' 类的输入框。
10377
+ * 仅在有编辑的模式下生效,且需要确保编辑器表单元素和自动聚焦元素存在。
10378
+ */
10379
+ focusInput() {
10380
+ if ((this.editType.id & EditTypeEnum.CREATE) === 0) {
10381
+ return;
10382
+ }
10383
+ const editorFormEl = this.editorFormElRef.value;
10384
+ if (!editorFormEl) {
10385
+ return;
10386
+ }
10387
+ const autoFocusEl = editorFormEl.$el.querySelector("input.auto-focus, .auto-focus input");
10388
+ if (!autoFocusEl) {
10389
+ return;
10390
+ }
10391
+ autoFocusEl.focus();
10392
+ }
10393
+ /**
10394
+ * 获取表单是否禁用的状态。
10395
+ * 该 getter 方法返回 `formDisabledComputed` 计算属性的值,用于确定表单是否应该被禁用。
10396
+ *
10397
+ * @returns {boolean} 表单是否禁用的布尔值。
10398
+ */
10399
+ get formDisabled() {
10400
+ return this.formDisabledComputed.value;
10401
+ }
10402
+ /**
10403
+ * 当查询验证失败时的处理方法。
10404
+ * 该方法会在查询验证失败时被调用,使用 `ElNotification` 组件显示一个错误通知。
10405
+ * 通知的标题为 '错误',内容为错误对象的消息,位置在右下角。
10406
+ *
10407
+ * @param {Error} error - 验证失败时抛出的错误对象。
10408
+ */
9906
10409
  onValidateQueryFail(error) {
9907
10410
  ElNotification.error({
9908
10411
  title: "错误",
@@ -9910,6 +10413,14 @@ class CurdViewHandler extends CurdHandler {
9910
10413
  position: "bottom-right"
9911
10414
  });
9912
10415
  }
10416
+ /**
10417
+ * 确认删除操作的提示框方法。
10418
+ * 该方法会弹出一个确认对话框,提示用户是否要永久删除指定的数据记录。
10419
+ * 对话框中会显示要删除的数据的名称(如果有),并提供确认和取消按钮。
10420
+ *
10421
+ * @param {T} data - 要删除的数据对象。
10422
+ * @returns {Promise<MessageBoxData>} - 返回一个 Promise,该 Promise 会在用户点击确认或取消按钮后解析,包含用户的选择信息。
10423
+ */
9913
10424
  confirmDelete(data) {
9914
10425
  const vNodes = [h("span", null, "此操作将永久删除")];
9915
10426
  const name = this.getDataName(data);
@@ -9925,6 +10436,11 @@ class CurdViewHandler extends CurdHandler {
9925
10436
  type: "warning"
9926
10437
  });
9927
10438
  }
10439
+ /**
10440
+ * 删除操作成功后的回调方法。
10441
+ * 当删除操作成功完成时,该方法会被调用,使用 `ElNotification` 组件显示一个成功通知。
10442
+ * 通知的标题为 '成功',内容为 '删除成功',位置在右下角。
10443
+ */
9928
10444
  onDeleteSuccess() {
9929
10445
  ElNotification.success({
9930
10446
  title: "成功",
@@ -9932,25 +10448,68 @@ class CurdViewHandler extends CurdHandler {
9932
10448
  position: "bottom-right"
9933
10449
  });
9934
10450
  }
10451
+ /**
10452
+ * 编辑器关闭后的回调方法。
10453
+ * 该方法会在编辑器关闭操作完成后被调用,目前为空方法,可根据具体需求在该方法中添加后续处理逻辑,
10454
+ * 例如清理临时数据、重置状态等操作。
10455
+ */
9935
10456
  afterCloseEditor() {
9936
10457
  }
10458
+ /**
10459
+ * 编辑器数据准备好之后的回调方法。
10460
+ * 该方法会在编辑器数据准备好之后被调用,在一个宏任务中执行以下操作:
10461
+ * 1. 清除表单的验证状态
10462
+ * 2. 如果编辑器处于打开状态,则自动聚焦到输入框
10463
+ * 使用 setTimeout 确保这些操作在下一个事件循环中执行,避免与当前渲染周期冲突。
10464
+ */
9937
10465
  afterEditorDataReady() {
10466
+ setTimeout(() => {
10467
+ var _a2;
10468
+ (_a2 = this.editorFormElRef.value) == null ? void 0 : _a2.clearValidate();
10469
+ if (this.editorOpened) {
10470
+ this.focusInput();
10471
+ }
10472
+ });
9938
10473
  }
10474
+ /**
10475
+ * 验证编辑器表单数据的方法。
10476
+ * 该方法调用 `editorFormElRef` 引用的表单实例的 `validate` 方法,对表单数据进行验证。
10477
+ * 并返回验证结果,验证结果的类型为 `FormValidationResult`。
10478
+ *
10479
+ * @returns {FormValidationResult} 表单数据的验证结果。
10480
+ */
9939
10481
  validEditorData() {
9940
10482
  return this.editorFormElRef.value.validate();
9941
10483
  }
10484
+ /**
10485
+ * 保存编辑器数据成功后的回调方法。
10486
+ * 当保存编辑器数据操作成功完成时,该方法会被调用,目前只是简单地将保存成功后的数据打印到控制台。
10487
+ * 可根据具体需求在该方法中添加后续处理逻辑,例如显示成功提示、更新表格数据等操作。
10488
+ *
10489
+ * @param {T} data - 保存成功后的数据对象。
10490
+ */
10491
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9942
10492
  onSaveEditorDataSuccess(data) {
9943
- console.log(data);
9944
10493
  }
10494
+ /**
10495
+ * 初始化 CURD 配置后的回调方法。
10496
+ * 该方法会在 CURD 配置初始化完成后被调用,目前为空方法,可根据具体需求在该方法中添加后续处理逻辑,
10497
+ * 例如根据配置初始化一些数据、设置默认值等操作。
10498
+ */
9945
10499
  afterInitCurdConfigs() {
9946
10500
  }
10501
+ /**
10502
+ * 组件卸载前的钩子函数。
10503
+ * 该方法会在组件实例被卸载之前调用,目前为空方法,可根据具体需求在该方法中添加后续处理逻辑,
10504
+ * 例如清理定时器、取消订阅、释放资源等操作,以避免内存泄漏。
10505
+ */
9947
10506
  onBeforeUnmount() {
9948
10507
  }
9949
10508
  }
9950
- const _hoisted_1$4 = { class: "flex column wrapper data-wrapper" };
9951
- const _hoisted_2$2 = { class: "flex flex-wrap gap-10 data-wrapper-header" };
9952
- const _hoisted_3$1 = { class: "flex gap-10 data-wrapper-footer" };
9953
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
10509
+ const _hoisted_1$b = { class: "flex column wrapper data-wrapper" };
10510
+ const _hoisted_2$5 = { class: "flex flex-wrap gap-10 data-wrapper-header" };
10511
+ const _hoisted_3$4 = { class: "flex gap-10 data-wrapper-footer" };
10512
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
9954
10513
  __name: "DataWrapperView",
9955
10514
  props: {
9956
10515
  bodyViewClass: {}
@@ -9958,8 +10517,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
9958
10517
  setup(__props) {
9959
10518
  return (_ctx, _cache) => {
9960
10519
  const _component_el_scrollbar = resolveComponent("el-scrollbar");
9961
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
9962
- createElementVNode("div", _hoisted_2$2, [
10520
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
10521
+ createElementVNode("div", _hoisted_2$5, [
9963
10522
  renderSlot(_ctx.$slots, "header")
9964
10523
  ]),
9965
10524
  createVNode(_component_el_scrollbar, {
@@ -9971,7 +10530,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
9971
10530
  ]),
9972
10531
  _: 3
9973
10532
  }, 8, ["view-class"]),
9974
- createElementVNode("div", _hoisted_3$1, [
10533
+ createElementVNode("div", _hoisted_3$4, [
9975
10534
  renderSlot(_ctx.$slots, "footer")
9976
10535
  ]),
9977
10536
  renderSlot(_ctx.$slots, "extra")
@@ -9979,6 +10538,26 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
9979
10538
  };
9980
10539
  }
9981
10540
  });
10541
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
10542
+ __name: "CreateBtnView",
10543
+ props: {
10544
+ viewHandler: {}
10545
+ },
10546
+ setup(__props) {
10547
+ return (_ctx, _cache) => {
10548
+ const _component_el_button = resolveComponent("el-button");
10549
+ return _ctx.viewHandler.permission.Add ? (openBlock(), createBlock(_component_el_button, {
10550
+ key: 0,
10551
+ title: _ctx.viewHandler.permission.Add.title,
10552
+ type: "success",
10553
+ icon: "Plus",
10554
+ circle: "",
10555
+ plain: "",
10556
+ onClick: _ctx.viewHandler.onCreateBtnClick
10557
+ }, null, 8, ["title", "onClick"])) : createCommentVNode("", true);
10558
+ };
10559
+ }
10560
+ });
9982
10561
  const emptyObject = object;
9983
10562
  const useMappingOption = (props, defaultOptionComponent, defaultInputComponent) => computed(() => {
9984
10563
  var _a2;
@@ -9999,8 +10578,8 @@ const useMappingOption = (props, defaultOptionComponent, defaultInputComponent)
9999
10578
  get options() {
10000
10579
  return listRef.value;
10001
10580
  },
10002
- primaryKeyConfig: getByClass(Target),
10003
- nameKeyConfig
10581
+ primaryKey: getByClass(Target).propertyKey,
10582
+ nameKey: nameKeyConfig.propertyKey
10004
10583
  }
10005
10584
  };
10006
10585
  } else {
@@ -10018,7 +10597,13 @@ const useModelValueBridgeComputed = (props, emit) => computed({
10018
10597
  emit("change", value);
10019
10598
  }
10020
10599
  });
10021
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
10600
+ const useModelValueBridgeWithoutChangeComputed = (props, emit) => computed({
10601
+ get: () => props.modelValue,
10602
+ set: (value) => {
10603
+ emit("update:modelValue", value);
10604
+ }
10605
+ });
10606
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
10022
10607
  __name: "VSlotView",
10023
10608
  props: {
10024
10609
  component: {},
@@ -10044,7 +10629,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
10044
10629
  };
10045
10630
  }
10046
10631
  });
10047
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
10632
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
10048
10633
  __name: "CurdTableView",
10049
10634
  props: {
10050
10635
  viewHandler: {}
@@ -10104,7 +10689,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
10104
10689
  ref_for: true
10105
10690
  }, column.colProps || unref(emptyObject2)), {
10106
10691
  default: withCtx(({ row }) => [
10107
- (openBlock(), createBlock(resolveDynamicComponent(column.component || _sfc_main$a), mergeProps({
10692
+ (openBlock(), createBlock(resolveDynamicComponent(column.component || _sfc_main$k), mergeProps({
10108
10693
  viewHandler: _ctx.viewHandler,
10109
10694
  model: row,
10110
10695
  prop: column.propertyKey,
@@ -10120,8 +10705,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
10120
10705
  };
10121
10706
  }
10122
10707
  });
10123
- const _hoisted_1$3 = { key: 0 };
10124
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
10708
+ const _hoisted_1$a = { key: 0 };
10709
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
10125
10710
  __name: "FilterView",
10126
10711
  props: {
10127
10712
  viewHandler: {},
@@ -10145,7 +10730,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
10145
10730
  class: itemClassComputed.value,
10146
10731
  ref_for: true
10147
10732
  }, config.itemProps || unref(emptyObject2)), [
10148
- config.label ? (openBlock(), createElementBlock("label", _hoisted_1$3, toDisplayString(config.label), 1)) : createCommentVNode("", true),
10733
+ config.label ? (openBlock(), createElementBlock("span", _hoisted_1$a, toDisplayString(config.label), 1)) : createCommentVNode("", true),
10149
10734
  (openBlock(), createBlock(resolveDynamicComponent(config.component), mergeProps({
10150
10735
  "view-handler": _ctx.viewHandler,
10151
10736
  model: _ctx.viewHandler.query,
@@ -10158,17 +10743,17 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
10158
10743
  };
10159
10744
  }
10160
10745
  });
10161
- const _hoisted_1$2 = { class: "flex gap-layout wrapper" };
10162
- const _hoisted_2$1 = {
10746
+ const _hoisted_1$9 = { class: "flex gap-layout wrapper" };
10747
+ const _hoisted_2$4 = {
10163
10748
  key: 0,
10164
10749
  class: "curd-list-aside"
10165
10750
  };
10166
- const _hoisted_3 = { class: "flex-1 fit-size curd-list-content" };
10167
- const _hoisted_4 = {
10751
+ const _hoisted_3$3 = { class: "flex-1 fit-size curd-list-content" };
10752
+ const _hoisted_4$2 = {
10168
10753
  key: 1,
10169
10754
  class: "curd-list-aside"
10170
10755
  };
10171
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10756
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
10172
10757
  __name: "CurdView",
10173
10758
  props: {
10174
10759
  viewHandler: {}
@@ -10180,21 +10765,22 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10180
10765
  const _component_el_card = resolveComponent("el-card");
10181
10766
  const _component_el_pagination = resolveComponent("el-pagination");
10182
10767
  const _directive_loading = resolveDirective("loading");
10183
- return openBlock(), createBlock(_sfc_main$b, null, {
10768
+ return openBlock(), createBlock(_sfc_main$m, null, {
10184
10769
  header: withCtx(() => [
10185
10770
  renderSlot(_ctx.$slots, "header-before"),
10186
- _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.TOP] ? (openBlock(), createBlock(_sfc_main$8, {
10771
+ _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.TOP] ? (openBlock(), createBlock(_sfc_main$i, {
10187
10772
  key: 0,
10188
10773
  "view-handler": _ctx.viewHandler,
10189
10774
  position: unref(ZDecorators).FilterKey.PositionEnum.TOP,
10190
10775
  disabled: _ctx.viewHandler.listLoadStatus
10191
10776
  }, null, 8, ["view-handler", "position", "disabled"])) : createCommentVNode("", true),
10192
- renderSlot(_ctx.$slots, "header-after")
10777
+ renderSlot(_ctx.$slots, "header-after"),
10778
+ createVNode(_sfc_main$l, { "view-handler": _ctx.viewHandler }, null, 8, ["view-handler"])
10193
10779
  ]),
10194
10780
  body: withCtx(() => [
10195
- createElementVNode("div", _hoisted_1$2, [
10196
- _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.LEFT] ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
10197
- createVNode(_sfc_main$8, {
10781
+ createElementVNode("div", _hoisted_1$9, [
10782
+ _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.LEFT] ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
10783
+ createVNode(_sfc_main$i, {
10198
10784
  "view-handler": _ctx.viewHandler,
10199
10785
  position: unref(ZDecorators).FilterKey.PositionEnum.LEFT,
10200
10786
  disabled: _ctx.viewHandler.listLoadStatus
@@ -10206,9 +10792,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10206
10792
  class: "flex column wrapper"
10207
10793
  }, {
10208
10794
  default: withCtx(() => [
10209
- createElementVNode("div", _hoisted_3, [
10795
+ createElementVNode("div", _hoisted_3$3, [
10210
10796
  renderSlot(_ctx.$slots, "content", {}, () => [
10211
- createVNode(_sfc_main$9, { "view-handler": _ctx.viewHandler }, null, 8, ["view-handler"])
10797
+ createVNode(_sfc_main$j, { "view-handler": _ctx.viewHandler }, null, 8, ["view-handler"])
10212
10798
  ])
10213
10799
  ])
10214
10800
  ]),
@@ -10216,8 +10802,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10216
10802
  })), [
10217
10803
  [_directive_loading, _ctx.viewHandler.listLoadStatus]
10218
10804
  ]),
10219
- _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.RIGHT] ? (openBlock(), createElementBlock("div", _hoisted_4, [
10220
- createVNode(_sfc_main$8, {
10805
+ _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.RIGHT] ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
10806
+ createVNode(_sfc_main$i, {
10221
10807
  "view-handler": _ctx.viewHandler,
10222
10808
  position: unref(ZDecorators).FilterKey.PositionEnum.RIGHT,
10223
10809
  disabled: _ctx.viewHandler.listLoadStatus
@@ -10241,22 +10827,161 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10241
10827
  onSizeChange: _ctx.viewHandler.onPageSizeChange
10242
10828
  }, null, 8, ["current-page", "page-size", "total", "disabled", "onCurrentChange", "onSizeChange"])) : createCommentVNode("", true)
10243
10829
  ]),
10830
+ extra: withCtx(() => [
10831
+ renderSlot(_ctx.$slots, "editor"),
10832
+ renderSlot(_ctx.$slots, "extra")
10833
+ ]),
10244
10834
  _: 3
10245
10835
  });
10246
10836
  };
10247
10837
  }
10248
10838
  });
10249
- const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10250
- __proto__: null,
10251
- CurdView: _sfc_main$7,
10252
- CurdViewHandler
10253
- }, Symbol.toStringTag, { value: "Module" }));
10254
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
10839
+ const _hoisted_1$8 = { class: "flex center gap-5 curd-operator" };
10840
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
10841
+ __name: "CurdTableOperatorView",
10842
+ props: {
10843
+ operatorComponents: {},
10844
+ viewHandler: {},
10845
+ model: {},
10846
+ prop: {}
10847
+ },
10848
+ setup(__props) {
10849
+ return (_ctx, _cache) => {
10850
+ const _component_el_link = resolveComponent("el-link");
10851
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
10852
+ Array.isArray(_ctx.operatorComponents) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.operatorComponents, (operatorComponent, index2) => {
10853
+ return openBlock(), createBlock(resolveDynamicComponent(operatorComponent), {
10854
+ key: index2,
10855
+ viewHandler: _ctx.viewHandler,
10856
+ model: _ctx.model,
10857
+ prop: _ctx.prop
10858
+ }, null, 8, ["viewHandler", "model", "prop"]);
10859
+ }), 128)) : createCommentVNode("", true),
10860
+ _ctx.viewHandler.permission.Edit ? (openBlock(), createBlock(_component_el_link, {
10861
+ key: 1,
10862
+ title: _ctx.viewHandler.permission.Edit.title,
10863
+ type: "primary",
10864
+ icon: "EditorSvg",
10865
+ underline: false,
10866
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.viewHandler.onEditorBtnClick(unref(ZDecorators).CurdKey.EditTypeEnum.UPDATE, _ctx.model), ["stop"]))
10867
+ }, null, 8, ["title"])) : _ctx.viewHandler.permission.Detail ? (openBlock(), createBlock(_component_el_link, {
10868
+ key: 2,
10869
+ title: _ctx.viewHandler.permission.Detail.title,
10870
+ icon: "InfoFilled",
10871
+ underline: false,
10872
+ onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.viewHandler.onEditorBtnClick(unref(ZDecorators).CurdKey.EditTypeEnum.DETAIL, _ctx.model), ["stop"]))
10873
+ }, null, 8, ["title"])) : createCommentVNode("", true),
10874
+ _ctx.viewHandler.permission.Delete ? (openBlock(), createBlock(_component_el_link, {
10875
+ key: 3,
10876
+ title: _ctx.viewHandler.permission.Delete.title,
10877
+ type: "danger",
10878
+ icon: "Delete",
10879
+ underline: false,
10880
+ onClick: _cache[2] || (_cache[2] = withModifiers(($event) => _ctx.viewHandler.onDeleteBtnClick(_ctx.model), ["stop"]))
10881
+ }, null, 8, ["title"])) : createCommentVNode("", true)
10882
+ ]);
10883
+ };
10884
+ }
10885
+ });
10886
+ const _hoisted_1$7 = { class: "flex valign-center gap-layout curd-form-operator" };
10887
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
10888
+ __name: "CurdFormOperatorView",
10889
+ props: {
10890
+ operatorComponents: {},
10891
+ viewHandler: {}
10892
+ },
10893
+ setup(__props) {
10894
+ const props = __props;
10895
+ const onStepBtnClick = (direction) => {
10896
+ props.viewHandler.changeFormStepIndex(direction);
10897
+ };
10898
+ return (_ctx, _cache) => {
10899
+ const _component_el_button = resolveComponent("el-button");
10900
+ const _component_arrow_right = resolveComponent("arrow-right");
10901
+ const _component_el_icon = resolveComponent("el-icon");
10902
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
10903
+ _ctx.viewHandler.displayStepFormItemsGroup.length > 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
10904
+ createVNode(_component_el_button, {
10905
+ disabled: _ctx.viewHandler.formDisabled || _ctx.viewHandler.formStepIndex === 0,
10906
+ type: "info",
10907
+ icon: "ArrowLeft",
10908
+ plain: "",
10909
+ onClick: _cache[0] || (_cache[0] = ($event) => onStepBtnClick(-1))
10910
+ }, {
10911
+ default: withCtx(() => _cache[2] || (_cache[2] = [
10912
+ createTextVNode("上一步")
10913
+ ])),
10914
+ _: 1
10915
+ }, 8, ["disabled"]),
10916
+ createVNode(_component_el_button, {
10917
+ disabled: _ctx.viewHandler.formDisabled || _ctx.viewHandler.formStepIndex === _ctx.viewHandler.displayStepFormItemsGroup.length - 1,
10918
+ type: "info",
10919
+ plain: "",
10920
+ onClick: _cache[1] || (_cache[1] = ($event) => onStepBtnClick(1))
10921
+ }, {
10922
+ default: withCtx(() => [
10923
+ _cache[3] || (_cache[3] = createElementVNode("span", null, "下一步", -1)),
10924
+ createVNode(_component_el_icon, null, {
10925
+ default: withCtx(() => [
10926
+ createVNode(_component_arrow_right)
10927
+ ]),
10928
+ _: 1
10929
+ })
10930
+ ]),
10931
+ _: 1
10932
+ }, 8, ["disabled"])
10933
+ ], 64)) : createCommentVNode("", true),
10934
+ Array.isArray(_ctx.operatorComponents) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.operatorComponents, (operatorComponent, index2) => {
10935
+ return openBlock(), createBlock(resolveDynamicComponent(operatorComponent), {
10936
+ key: index2,
10937
+ viewHandler: _ctx.viewHandler
10938
+ }, null, 8, ["viewHandler"]);
10939
+ }), 128)) : createCommentVNode("", true),
10940
+ (_ctx.viewHandler.editType.id & unref(ZDecorators).CurdKey.EditTypeEnum.CREATE) === unref(ZDecorators).CurdKey.EditTypeEnum.CREATE ? (openBlock(), createBlock(_component_el_button, {
10941
+ key: 2,
10942
+ disabled: _ctx.viewHandler.formDisabled || _ctx.viewHandler.formStepIndex !== _ctx.viewHandler.displayStepFormItemsGroup.length - 1,
10943
+ icon: "SaveSvg",
10944
+ type: "primary",
10945
+ onClick: _ctx.viewHandler.onSaveBtnClick
10946
+ }, {
10947
+ default: withCtx(() => _cache[4] || (_cache[4] = [
10948
+ createTextVNode("保存")
10949
+ ])),
10950
+ _: 1
10951
+ }, 8, ["disabled", "onClick"])) : createCommentVNode("", true),
10952
+ _ctx.viewHandler.editType.id === unref(ZDecorators).CurdKey.EditTypeEnum.CREATE ? (openBlock(), createBlock(_component_el_button, {
10953
+ key: 3,
10954
+ disabled: _ctx.viewHandler.formDisabled || _ctx.viewHandler.formStepIndex !== _ctx.viewHandler.displayStepFormItemsGroup.length - 1,
10955
+ icon: "SaveContinueSvg",
10956
+ type: "success",
10957
+ plain: "",
10958
+ onClick: _ctx.viewHandler.onSaveContinueBtnClick
10959
+ }, {
10960
+ default: withCtx(() => _cache[5] || (_cache[5] = [
10961
+ createTextVNode("保存并继续")
10962
+ ])),
10963
+ _: 1
10964
+ }, 8, ["disabled", "onClick"])) : createCommentVNode("", true),
10965
+ createVNode(_component_el_button, {
10966
+ disabled: _ctx.viewHandler.saveEditorDataLoadStatus,
10967
+ icon: "Close",
10968
+ onClick: _ctx.viewHandler.onCloseEditorBtnClick
10969
+ }, {
10970
+ default: withCtx(() => _cache[6] || (_cache[6] = [
10971
+ createTextVNode("关闭")
10972
+ ])),
10973
+ _: 1
10974
+ }, 8, ["disabled", "onClick"])
10975
+ ]);
10976
+ };
10977
+ }
10978
+ });
10979
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
10255
10980
  __name: "SelectView",
10256
10981
  props: {
10257
10982
  options: {},
10258
- primaryKeyConfig: {},
10259
- nameKeyConfig: {},
10983
+ primaryKey: {},
10984
+ nameKey: {},
10260
10985
  modelValue: {}
10261
10986
  },
10262
10987
  emits: ["update:modelValue", "change"],
@@ -10274,9 +10999,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
10274
10999
  default: withCtx(() => [
10275
11000
  (openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (item) => {
10276
11001
  return openBlock(), createBlock(_component_el_option, {
10277
- key: item[_ctx.primaryKeyConfig.propertyKey],
10278
- label: item[_ctx.nameKeyConfig.propertyKey],
10279
- value: item[_ctx.primaryKeyConfig.propertyKey]
11002
+ key: item[_ctx.primaryKey],
11003
+ label: item[_ctx.nameKey],
11004
+ value: item[_ctx.primaryKey]
10280
11005
  }, null, 8, ["label", "value"]);
10281
11006
  }), 128))
10282
11007
  ]),
@@ -10285,7 +11010,57 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
10285
11010
  };
10286
11011
  }
10287
11012
  });
10288
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
11013
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
11014
+ __name: "MyInputView",
11015
+ props: {
11016
+ prepend: {},
11017
+ append: {},
11018
+ modelValue: {}
11019
+ },
11020
+ emits: ["update:modelValue"],
11021
+ setup(__props, { emit: __emit }) {
11022
+ const props = __props;
11023
+ const emit = __emit;
11024
+ const prependComputed = computed(() => props.prepend);
11025
+ const appendComputed = computed(() => props.append);
11026
+ const modelValueBridgeComputed = useModelValueBridgeWithoutChangeComputed(props, emit);
11027
+ return (_ctx, _cache) => {
11028
+ const _component_el_input = resolveComponent("el-input");
11029
+ return openBlock(), createBlock(_component_el_input, {
11030
+ modelValue: unref(modelValueBridgeComputed),
11031
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(modelValueBridgeComputed) ? modelValueBridgeComputed.value = $event : null)
11032
+ }, createSlots({ _: 2 }, [
11033
+ prependComputed.value ? {
11034
+ name: "prepend",
11035
+ fn: withCtx(() => [
11036
+ typeof prependComputed.value === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
11037
+ createTextVNode(toDisplayString(prependComputed.value), 1)
11038
+ ], 64)) : (openBlock(), createBlock(_sfc_main$e, mergeProps({
11039
+ key: 1,
11040
+ modelValue: prependComputed.value.modelValue,
11041
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => prependComputed.value.modelValue = $event)
11042
+ }, prependComputed.value.props), null, 16, ["modelValue"]))
11043
+ ]),
11044
+ key: "0"
11045
+ } : void 0,
11046
+ appendComputed.value ? {
11047
+ name: "append",
11048
+ fn: withCtx(() => [
11049
+ typeof appendComputed.value === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
11050
+ createTextVNode(toDisplayString(appendComputed.value), 1)
11051
+ ], 64)) : (openBlock(), createBlock(_sfc_main$e, mergeProps({
11052
+ key: 1,
11053
+ modelValue: appendComputed.value.modelValue,
11054
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => appendComputed.value.modelValue = $event)
11055
+ }, appendComputed.value.props), null, 16, ["modelValue"]))
11056
+ ]),
11057
+ key: "1"
11058
+ } : void 0
11059
+ ]), 1032, ["modelValue"]);
11060
+ };
11061
+ }
11062
+ });
11063
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
10289
11064
  __name: "VModelView",
10290
11065
  props: {
10291
11066
  component: {},
@@ -10295,7 +11070,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
10295
11070
  },
10296
11071
  setup(__props) {
10297
11072
  const props = __props;
10298
- const mappingComputed = useMappingOption(props, _sfc_main$6, ElInput);
11073
+ const mappingComputed = useMappingOption(props, _sfc_main$e, _sfc_main$d);
10299
11074
  const modelValueBridgeComputed = computed({
10300
11075
  get: () => props.model[props.prop],
10301
11076
  set: (value) => {
@@ -10311,12 +11086,225 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
10311
11086
  };
10312
11087
  }
10313
11088
  });
10314
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
11089
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11090
+ __name: "CurdFormView",
11091
+ props: {
11092
+ viewHandler: {}
11093
+ },
11094
+ setup(__props) {
11095
+ const props = __props;
11096
+ const { editorFormElRef } = props.viewHandler;
11097
+ return (_ctx, _cache) => {
11098
+ var _a2;
11099
+ const _component_el_form_item = resolveComponent("el-form-item");
11100
+ const _component_el_col = resolveComponent("el-col");
11101
+ const _component_el_row = resolveComponent("el-row");
11102
+ const _component_el_form = resolveComponent("el-form");
11103
+ return openBlock(), createBlock(_component_el_form, mergeProps({
11104
+ ref_key: "editorFormElRef",
11105
+ ref: editorFormElRef,
11106
+ model: _ctx.viewHandler.editorData,
11107
+ disabled: (_ctx.viewHandler.editType.id & unref(ZDecorators).CurdKey.EditTypeEnum.CREATE) === 0 || _ctx.viewHandler.formDisabled
11108
+ }, ((_a2 = _ctx.viewHandler.formParam) == null ? void 0 : _a2.props) || unref(ZUtils).empty.object, {
11109
+ class: "z-form",
11110
+ onKeydown: withKeys(withModifiers(_ctx.viewHandler.onFormKeyEnter, ["prevent"]), ["enter"])
11111
+ }), {
11112
+ default: withCtx(() => [
11113
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.viewHandler.displayStepFormItemsGroup[_ctx.viewHandler.formStepIndex].formItemsGroup, (formItems, rowIndex) => {
11114
+ return openBlock(), createBlock(_component_el_row, {
11115
+ key: rowIndex,
11116
+ gutter: 20
11117
+ }, {
11118
+ default: withCtx(() => [
11119
+ (openBlock(true), createElementBlock(Fragment, null, renderList(formItems, (formItem, colIndex) => {
11120
+ return openBlock(), createBlock(_component_el_col, {
11121
+ key: `${rowIndex}-${colIndex}`,
11122
+ span: formItem.colSpan || 24
11123
+ }, {
11124
+ default: withCtx(() => [
11125
+ createVNode(_component_el_form_item, mergeProps({
11126
+ prop: formItem.propertyKey,
11127
+ label: formItem.label,
11128
+ ref_for: true
11129
+ }, formItem.formItemProps || unref(ZUtils).empty.object), {
11130
+ default: withCtx(() => [
11131
+ (openBlock(), createBlock(resolveDynamicComponent(formItem.component || _sfc_main$c), mergeProps({
11132
+ "view-handler": _ctx.viewHandler,
11133
+ model: _ctx.viewHandler.editorData,
11134
+ prop: formItem.propertyKey,
11135
+ ref_for: true
11136
+ }, formItem.componentProps, toHandlers(formItem.componentOn || unref(ZUtils).empty.object)), null, 16, ["view-handler", "model", "prop"]))
11137
+ ]),
11138
+ _: 2
11139
+ }, 1040, ["prop", "label"])
11140
+ ]),
11141
+ _: 2
11142
+ }, 1032, ["span"]);
11143
+ }), 128))
11144
+ ]),
11145
+ _: 2
11146
+ }, 1024);
11147
+ }), 128))
11148
+ ]),
11149
+ _: 1
11150
+ }, 16, ["model", "disabled", "onKeydown"]);
11151
+ };
11152
+ }
11153
+ });
11154
+ const _hoisted_1$6 = {
11155
+ key: 1,
11156
+ class: "wrapper z-form"
11157
+ };
11158
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
11159
+ __name: "DialogEditorView",
11160
+ props: {
11161
+ formHeight: {},
11162
+ viewHandler: {}
11163
+ },
11164
+ setup(__props) {
11165
+ const skeletonRow = useSkeletonRow(16, 21);
11166
+ return (_ctx, _cache) => {
11167
+ const _component_el_scrollbar = resolveComponent("el-scrollbar");
11168
+ const _component_el_skeleton = resolveComponent("el-skeleton");
11169
+ const _component_el_dialog = resolveComponent("el-dialog");
11170
+ const _directive_loading = resolveDirective("loading");
11171
+ return openBlock(), createBlock(_component_el_dialog, {
11172
+ title: `${_ctx.viewHandler.editType.label}·${_ctx.viewHandler.label}`,
11173
+ modelValue: _ctx.viewHandler.editorVisible,
11174
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.viewHandler.editorVisible = $event),
11175
+ class: "z-dialog",
11176
+ onOpened: _ctx.viewHandler.onEditorOpened,
11177
+ onClosed: _ctx.viewHandler.onEditorClosed
11178
+ }, {
11179
+ header: withCtx(() => [
11180
+ renderSlot(_ctx.$slots, "header")
11181
+ ]),
11182
+ footer: withCtx(() => [
11183
+ createVNode(_sfc_main$f, {
11184
+ "view-handler": _ctx.viewHandler,
11185
+ class: "align-right"
11186
+ }, null, 8, ["view-handler"])
11187
+ ]),
11188
+ default: withCtx(() => [
11189
+ withDirectives((openBlock(), createElementBlock("div", {
11190
+ style: normalizeStyle({ height: _ctx.formHeight })
11191
+ }, [
11192
+ _ctx.viewHandler.editorData ? (openBlock(), createBlock(_component_el_scrollbar, {
11193
+ key: 0,
11194
+ "view-class": "dialog-editor-form-scrollbar-view"
11195
+ }, {
11196
+ default: withCtx(() => [
11197
+ createVNode(_sfc_main$b, { "view-handler": _ctx.viewHandler }, null, 8, ["view-handler"])
11198
+ ]),
11199
+ _: 1
11200
+ })) : (openBlock(), createElementBlock("div", _hoisted_1$6, [
11201
+ createElementVNode("div", {
11202
+ ref: unref(skeletonRow).setSkeletonContainer,
11203
+ class: "wrapper"
11204
+ }, [
11205
+ createVNode(_component_el_skeleton, {
11206
+ rows: unref(skeletonRow).rows,
11207
+ animated: ""
11208
+ }, null, 8, ["rows"])
11209
+ ], 512)
11210
+ ]))
11211
+ ], 4)), [
11212
+ [_directive_loading, _ctx.viewHandler.saveEditorDataLoadStatus]
11213
+ ])
11214
+ ]),
11215
+ _: 3
11216
+ }, 8, ["title", "modelValue", "onOpened", "onClosed"]);
11217
+ };
11218
+ }
11219
+ });
11220
+ const _hoisted_1$5 = {
11221
+ key: 1,
11222
+ class: "wrapper z-form"
11223
+ };
11224
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
11225
+ __name: "DrawerEditorView",
11226
+ props: {
11227
+ viewHandler: {}
11228
+ },
11229
+ setup(__props) {
11230
+ const skeletonRow = useSkeletonRow(16, 21);
11231
+ return (_ctx, _cache) => {
11232
+ const _component_el_skeleton = resolveComponent("el-skeleton");
11233
+ const _component_el_drawer = resolveComponent("el-drawer");
11234
+ const _directive_loading = resolveDirective("loading");
11235
+ return openBlock(), createBlock(_component_el_drawer, {
11236
+ title: `${_ctx.viewHandler.editType.label}·${_ctx.viewHandler.label}`,
11237
+ modelValue: _ctx.viewHandler.editorVisible,
11238
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.viewHandler.editorVisible = $event),
11239
+ class: "z-drawer",
11240
+ onOpened: _ctx.viewHandler.onEditorOpened,
11241
+ onClosed: _ctx.viewHandler.onEditorClosed
11242
+ }, {
11243
+ footer: withCtx(() => [
11244
+ createVNode(_sfc_main$f, {
11245
+ "view-handler": _ctx.viewHandler,
11246
+ class: "align-left"
11247
+ }, null, 8, ["view-handler"])
11248
+ ]),
11249
+ default: withCtx(() => [
11250
+ _ctx.viewHandler.editorData ? withDirectives((openBlock(), createBlock(_sfc_main$b, {
11251
+ key: 0,
11252
+ "view-handler": _ctx.viewHandler
11253
+ }, null, 8, ["view-handler"])), [
11254
+ [_directive_loading, _ctx.viewHandler.saveEditorDataLoadStatus]
11255
+ ]) : (openBlock(), createElementBlock("div", _hoisted_1$5, [
11256
+ createElementVNode("div", {
11257
+ ref: unref(skeletonRow).setSkeletonContainer,
11258
+ class: "wrapper"
11259
+ }, [
11260
+ createVNode(_component_el_skeleton, {
11261
+ rows: unref(skeletonRow).rows,
11262
+ animated: ""
11263
+ }, null, 8, ["rows"])
11264
+ ], 512)
11265
+ ]))
11266
+ ]),
11267
+ _: 1
11268
+ }, 8, ["title", "modelValue", "onOpened", "onClosed"]);
11269
+ };
11270
+ }
11271
+ });
11272
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
11273
+ __name: "SearchBtnView",
11274
+ props: {
11275
+ viewHandler: {}
11276
+ },
11277
+ setup(__props) {
11278
+ return (_ctx, _cache) => {
11279
+ const _component_el_button = resolveComponent("el-button");
11280
+ return openBlock(), createBlock(_component_el_button, {
11281
+ title: "查询",
11282
+ disabled: _ctx.viewHandler.queryLoadStatus || _ctx.viewHandler.listLoadStatus,
11283
+ type: "primary",
11284
+ icon: "Search",
11285
+ circle: "",
11286
+ onClick: _ctx.viewHandler.onSearchBtnClick
11287
+ }, null, 8, ["disabled", "onClick"]);
11288
+ };
11289
+ }
11290
+ });
11291
+ const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11292
+ __proto__: null,
11293
+ CreateBtnView: _sfc_main$l,
11294
+ CurdView: _sfc_main$h,
11295
+ CurdViewHandler,
11296
+ DialogEditorView: _sfc_main$a,
11297
+ DrawerEditorView: _sfc_main$9,
11298
+ FormOperatorView: _sfc_main$f,
11299
+ SearchBtnView: _sfc_main$8,
11300
+ TableOperatorView: _sfc_main$g
11301
+ }, Symbol.toStringTag, { value: "Module" }));
11302
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10315
11303
  __name: "RadioButtonGroupView",
10316
11304
  props: {
10317
11305
  options: {},
10318
- primaryKeyConfig: {},
10319
- nameKeyConfig: {},
11306
+ primaryKey: {},
11307
+ nameKey: {},
10320
11308
  modelValue: {}
10321
11309
  },
10322
11310
  emits: ["update:modelValue", "change"],
@@ -10334,9 +11322,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10334
11322
  default: withCtx(() => [
10335
11323
  (openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (item) => {
10336
11324
  return openBlock(), createBlock(_component_el_radio_button, {
10337
- key: item[_ctx.primaryKeyConfig.propertyKey],
10338
- label: item[_ctx.nameKeyConfig.propertyKey],
10339
- value: item[_ctx.primaryKeyConfig.propertyKey]
11325
+ key: item[_ctx.primaryKey],
11326
+ label: item[_ctx.nameKey],
11327
+ value: item[_ctx.primaryKey]
10340
11328
  }, null, 8, ["label", "value"]);
10341
11329
  }), 128))
10342
11330
  ]),
@@ -10345,12 +11333,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10345
11333
  };
10346
11334
  }
10347
11335
  });
10348
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
11336
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
10349
11337
  __name: "RadioGroupView",
10350
11338
  props: {
10351
11339
  options: {},
10352
- primaryKeyConfig: {},
10353
- nameKeyConfig: {},
11340
+ primaryKey: {},
11341
+ nameKey: {},
10354
11342
  modelValue: {}
10355
11343
  },
10356
11344
  emits: ["update:modelValue", "change"],
@@ -10368,9 +11356,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10368
11356
  default: withCtx(() => [
10369
11357
  (openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (item) => {
10370
11358
  return openBlock(), createBlock(_component_el_radio, {
10371
- key: item[_ctx.primaryKeyConfig.propertyKey],
10372
- label: item[_ctx.nameKeyConfig.propertyKey],
10373
- value: item[_ctx.primaryKeyConfig.propertyKey]
11359
+ key: item[_ctx.primaryKey],
11360
+ label: item[_ctx.nameKey],
11361
+ value: item[_ctx.primaryKey]
10374
11362
  }, null, 8, ["label", "value"]);
10375
11363
  }), 128))
10376
11364
  ]),
@@ -10379,12 +11367,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10379
11367
  };
10380
11368
  }
10381
11369
  });
10382
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
11370
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
10383
11371
  __name: "CheckboxGroupView",
10384
11372
  props: {
10385
11373
  options: {},
10386
- primaryKeyConfig: {},
10387
- nameKeyConfig: {},
11374
+ primaryKey: {},
11375
+ nameKey: {},
10388
11376
  modelValue: {}
10389
11377
  },
10390
11378
  emits: ["update:modelValue", "change"],
@@ -10402,9 +11390,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10402
11390
  default: withCtx(() => [
10403
11391
  (openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (item) => {
10404
11392
  return openBlock(), createBlock(_component_el_checkbox, {
10405
- key: item[_ctx.primaryKeyConfig.propertyKey],
10406
- label: item[_ctx.nameKeyConfig.propertyKey],
10407
- value: item[_ctx.primaryKeyConfig.propertyKey]
11393
+ key: item[_ctx.primaryKey],
11394
+ label: item[_ctx.nameKey],
11395
+ value: item[_ctx.primaryKey]
10408
11396
  }, null, 8, ["label", "value"]);
10409
11397
  }), 128))
10410
11398
  ]),
@@ -10415,45 +11403,408 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10415
11403
  });
10416
11404
  const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10417
11405
  __proto__: null,
10418
- CheckboxGroupView: _sfc_main$2,
10419
- RadioButtonGroupView: _sfc_main$4,
10420
- RadioGroupView: _sfc_main$3,
10421
- SelectView: _sfc_main$6,
10422
- VModelView: _sfc_main$5
11406
+ CheckboxGroupView: _sfc_main$5,
11407
+ MyInputView: _sfc_main$d,
11408
+ RadioButtonGroupView: _sfc_main$7,
11409
+ RadioGroupView: _sfc_main$6,
11410
+ SelectView: _sfc_main$e,
11411
+ VModelView: _sfc_main$c
10423
11412
  }, Symbol.toStringTag, { value: "Module" }));
10424
11413
  const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10425
11414
  __proto__: null,
10426
- VSlotView: _sfc_main$a
11415
+ VSlotView: _sfc_main$k
10427
11416
  }, Symbol.toStringTag, { value: "Module" }));
10428
- const _export_sfc = (sfc, props) => {
10429
- const target = sfc.__vccOpts || sfc;
10430
- for (const [key2, val] of props) {
10431
- target[key2] = val;
11417
+ const LayoutViewDeclare = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11418
+ __proto__: null
11419
+ }, Symbol.toStringTag, { value: "Module" }));
11420
+ const _hoisted_1$4 = ["href"];
11421
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
11422
+ __name: "LayoutNavView",
11423
+ props: {
11424
+ navs: {}
11425
+ },
11426
+ setup(__props) {
11427
+ return (_ctx, _cache) => {
11428
+ const _component_LayoutNavView = resolveComponent("LayoutNavView", true);
11429
+ const _component_el_sub_menu = resolveComponent("el-sub-menu");
11430
+ const _component_el_menu_item = resolveComponent("el-menu-item");
11431
+ const _component_router_link = resolveComponent("router-link");
11432
+ return openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navs, (nav) => {
11433
+ return openBlock(), createElementBlock(Fragment, {
11434
+ key: nav.id
11435
+ }, [
11436
+ nav.type === unref(ZWebUtils).ZNavTypeEnum.DIR ? (openBlock(), createBlock(_component_el_sub_menu, {
11437
+ key: 0,
11438
+ index: nav.id,
11439
+ class: "flex center"
11440
+ }, {
11441
+ title: withCtx(() => [
11442
+ nav.icon ? (openBlock(), createBlock(resolveDynamicComponent(nav.icon), {
11443
+ key: 0,
11444
+ class: "layout-nav-icon"
11445
+ })) : createCommentVNode("", true),
11446
+ createElementVNode("span", null, toDisplayString(nav.title), 1)
11447
+ ]),
11448
+ default: withCtx(() => [
11449
+ createVNode(_component_LayoutNavView, {
11450
+ navs: nav.children
11451
+ }, null, 8, ["navs"])
11452
+ ]),
11453
+ _: 2
11454
+ }, 1032, ["index"])) : nav instanceof unref(ZWebUtils).ZNavLink ? (openBlock(), createBlock(_component_el_menu_item, {
11455
+ key: 1,
11456
+ index: nav.outLink
11457
+ }, {
11458
+ default: withCtx(() => [
11459
+ createElementVNode("a", {
11460
+ href: nav.outLink,
11461
+ target: "_blank",
11462
+ class: "flex center layout-nav-link"
11463
+ }, [
11464
+ nav.icon ? (openBlock(), createBlock(resolveDynamicComponent(nav.icon), {
11465
+ key: 0,
11466
+ class: "layout-nav-icon"
11467
+ })) : createCommentVNode("", true),
11468
+ createElementVNode("span", null, toDisplayString(nav.title), 1)
11469
+ ], 8, _hoisted_1$4)
11470
+ ]),
11471
+ _: 2
11472
+ }, 1032, ["index"])) : (openBlock(), createBlock(_component_el_menu_item, {
11473
+ key: 2,
11474
+ index: nav.path
11475
+ }, {
11476
+ default: withCtx(() => [
11477
+ createVNode(_component_router_link, {
11478
+ to: { name: nav.name },
11479
+ class: "flex center layout-nav-link"
11480
+ }, {
11481
+ default: withCtx(() => [
11482
+ nav.icon ? (openBlock(), createBlock(resolveDynamicComponent(nav.icon), {
11483
+ key: 0,
11484
+ class: "layout-nav-icon"
11485
+ })) : createCommentVNode("", true),
11486
+ createElementVNode("span", null, toDisplayString(nav.title), 1)
11487
+ ]),
11488
+ _: 2
11489
+ }, 1032, ["to"])
11490
+ ]),
11491
+ _: 2
11492
+ }, 1032, ["index"]))
11493
+ ], 64);
11494
+ }), 128);
11495
+ };
10432
11496
  }
10433
- return target;
11497
+ });
11498
+ const _hoisted_1$3 = { class: "flex valign-center gap-5 layout-profile" };
11499
+ const _hoisted_2$3 = {
11500
+ key: 1,
11501
+ class: "layout-profile-nickname"
10434
11502
  };
10435
- const _sfc_main$1 = {};
10436
- const _hoisted_1$1 = { class: "relative flex layout-header" };
10437
- function _sfc_render(_ctx, _cache) {
10438
- return openBlock(), createElementBlock("div", _hoisted_1$1, _cache[0] || (_cache[0] = [
10439
- createElementVNode("div", { class: "flex" }, null, -1),
10440
- createElementVNode("div", { class: "flex-1 fit-size" }, null, -1),
10441
- createElementVNode("div", null, null, -1),
10442
- createElementVNode("div", null, null, -1)
10443
- ]));
10444
- }
10445
- const LayoutHeader = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
10446
- const _hoisted_1 = { class: "flex column wrapper" };
10447
- const _hoisted_2 = { class: "flex flex-1 fit-size" };
11503
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
11504
+ __name: "LayoutProfileView",
11505
+ props: {
11506
+ profile: {},
11507
+ showArrow: { type: Boolean },
11508
+ arrowRotate: { type: Boolean }
11509
+ },
11510
+ setup(__props) {
11511
+ return (_ctx, _cache) => {
11512
+ const _component_arrow_down = resolveComponent("arrow-down");
11513
+ const _component_el_icon = resolveComponent("el-icon");
11514
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
11515
+ _ctx.profile.avatar ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.profile.avatar), {
11516
+ key: 0,
11517
+ class: "layout-profile-icon"
11518
+ })) : createCommentVNode("", true),
11519
+ _ctx.profile.nickname ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString(_ctx.profile.nickname), 1)) : createCommentVNode("", true),
11520
+ _ctx.showArrow ? (openBlock(), createBlock(_component_el_icon, {
11521
+ key: 2,
11522
+ class: normalizeClass(["layout-profile-arrow", {
11523
+ opened: _ctx.arrowRotate
11524
+ }])
11525
+ }, {
11526
+ default: withCtx(() => [
11527
+ createVNode(_component_arrow_down)
11528
+ ]),
11529
+ _: 1
11530
+ }, 8, ["class"])) : createCommentVNode("", true)
11531
+ ]);
11532
+ };
11533
+ }
11534
+ });
11535
+ const _hoisted_1$2 = { class: "flex valign-center gap-layout layout-header" };
11536
+ const _hoisted_2$2 = {
11537
+ key: 0,
11538
+ class: "flex valign-center gap-10 layout-header-system-info"
11539
+ };
11540
+ const _hoisted_3$2 = {
11541
+ key: 1,
11542
+ class: "layout-header-system-info-title"
11543
+ };
11544
+ const _hoisted_4$1 = { class: "flex-1 fit-size layout-nav-scrollbar-container" };
11545
+ const _hoisted_5$1 = {
11546
+ key: 1,
11547
+ class: "flex valign-center gap-8 layout-header-toolbar"
11548
+ };
11549
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
11550
+ __name: "LayoutHeaderView",
11551
+ props: {
11552
+ systemInfo: {},
11553
+ toolbarComponent: {},
11554
+ profile: {}
11555
+ },
11556
+ setup(__props) {
11557
+ const props = __props;
11558
+ const route = useRoute();
11559
+ const navStore = useNavStore();
11560
+ const profileDropdownVisibleRef = shallowRef(false);
11561
+ const onProfileDropdownVisibleChange = (visible) => {
11562
+ profileDropdownVisibleRef.value = visible;
11563
+ };
11564
+ const onProfileMenuItemClick = (index2) => {
11565
+ props.profile.menus[index2].handler();
11566
+ };
11567
+ return (_ctx, _cache) => {
11568
+ const _component_el_menu = resolveComponent("el-menu");
11569
+ const _component_el_scrollbar = resolveComponent("el-scrollbar");
11570
+ const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
11571
+ const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
11572
+ const _component_el_dropdown = resolveComponent("el-dropdown");
11573
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
11574
+ _ctx.systemInfo ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
11575
+ _ctx.systemInfo.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.systemInfo.icon), {
11576
+ key: 0,
11577
+ class: "layout-header-system-info-icon"
11578
+ })) : createCommentVNode("", true),
11579
+ _ctx.systemInfo.title ? (openBlock(), createElementBlock("div", _hoisted_3$2, toDisplayString(_ctx.systemInfo.title), 1)) : createCommentVNode("", true)
11580
+ ])) : createCommentVNode("", true),
11581
+ createElementVNode("div", _hoisted_4$1, [
11582
+ createVNode(_component_el_scrollbar, { "view-class": "flex layout-header-scrollbar-view" }, {
11583
+ default: withCtx(() => [
11584
+ createVNode(_component_el_menu, {
11585
+ "default-active": unref(route).path,
11586
+ mode: "horizontal",
11587
+ "unique-opened": "",
11588
+ class: normalizeClass({
11589
+ "layout-main-nav-center": _ctx.systemInfo
11590
+ })
11591
+ }, {
11592
+ default: withCtx(() => [
11593
+ createVNode(_sfc_main$4, {
11594
+ navs: unref(navStore).navTree
11595
+ }, null, 8, ["navs"])
11596
+ ]),
11597
+ _: 1
11598
+ }, 8, ["default-active", "class"])
11599
+ ]),
11600
+ _: 1
11601
+ })
11602
+ ]),
11603
+ _ctx.toolbarComponent ? (openBlock(), createElementBlock("div", _hoisted_5$1)) : createCommentVNode("", true),
11604
+ _ctx.profile ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
11605
+ Array.isArray(_ctx.profile.menus) && _ctx.profile.menus.length ? (openBlock(), createBlock(_component_el_dropdown, {
11606
+ key: 0,
11607
+ trigger: "click",
11608
+ class: "layout-profile-dropdown",
11609
+ onCommand: onProfileMenuItemClick,
11610
+ onVisibleChange: onProfileDropdownVisibleChange
11611
+ }, {
11612
+ dropdown: withCtx(() => [
11613
+ createVNode(_component_el_dropdown_menu, null, {
11614
+ default: withCtx(() => [
11615
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.profile.menus, (profileMenu, index2) => {
11616
+ return openBlock(), createBlock(_component_el_dropdown_item, {
11617
+ key: index2,
11618
+ icon: profileMenu.icon,
11619
+ command: index2
11620
+ }, {
11621
+ default: withCtx(() => [
11622
+ createTextVNode(toDisplayString(profileMenu.label), 1)
11623
+ ]),
11624
+ _: 2
11625
+ }, 1032, ["icon", "command"]);
11626
+ }), 128))
11627
+ ]),
11628
+ _: 1
11629
+ })
11630
+ ]),
11631
+ default: withCtx(() => [
11632
+ createVNode(_sfc_main$3, {
11633
+ profile: _ctx.profile,
11634
+ "show-arrow": "",
11635
+ "arrow-rotate": profileDropdownVisibleRef.value
11636
+ }, null, 8, ["profile", "arrow-rotate"])
11637
+ ]),
11638
+ _: 1
11639
+ })) : (openBlock(), createBlock(_sfc_main$3, {
11640
+ key: 1,
11641
+ profile: _ctx.profile
11642
+ }, null, 8, ["profile"]))
11643
+ ], 64)) : createCommentVNode("", true)
11644
+ ]);
11645
+ };
11646
+ }
11647
+ });
11648
+ const _hoisted_1$1 = { class: "relative layout-tab" };
11649
+ const _hoisted_2$1 = ["data-id", "onClick"];
11650
+ const _hoisted_3$1 = { class: "flex valign-center" };
11651
+ const _hoisted_4 = {
11652
+ key: 0,
11653
+ class: "flex center layout-tab-item-icon"
11654
+ };
11655
+ const _hoisted_5 = { class: "layout-tab-item-text" };
11656
+ const _hoisted_6 = { class: "flex valign-center" };
11657
+ const _hoisted_7 = ["onClick"];
11658
+ const _hoisted_8 = ["onClick"];
11659
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
11660
+ __name: "LayoutTabView",
11661
+ setup(__props) {
11662
+ const route = useRoute();
11663
+ const router2 = useRouter();
11664
+ const navStore = useNavStore();
11665
+ const onTabItemClick = (tab) => {
11666
+ router2.push({
11667
+ name: tab.id
11668
+ });
11669
+ };
11670
+ const onRefreshBtnClick = (tab) => {
11671
+ navStore.refreshTab(tab);
11672
+ };
11673
+ const onRemoveBtnClick = (tab) => {
11674
+ navStore.removeTab(tab);
11675
+ };
11676
+ let tabSortable = void 0;
11677
+ let sortElContainer = void 0;
11678
+ const onSortEnd = () => {
11679
+ navStore.sortTabs(sortElContainer, "id");
11680
+ };
11681
+ const setSortable = (container) => {
11682
+ if (container) {
11683
+ sortElContainer = container;
11684
+ tabSortable = new Sortable(container, {
11685
+ // 当排序结束时调用 onSortEnd 函数
11686
+ onEnd: onSortEnd
11687
+ });
11688
+ } else if (tabSortable) {
11689
+ tabSortable.destroy();
11690
+ tabSortable = sortElContainer = void 0;
11691
+ }
11692
+ };
11693
+ return (_ctx, _cache) => {
11694
+ const _component_refresh_right = resolveComponent("refresh-right");
11695
+ const _component_el_icon = resolveComponent("el-icon");
11696
+ const _component_close = resolveComponent("close");
11697
+ const _component_el_scrollbar = resolveComponent("el-scrollbar");
11698
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
11699
+ createVNode(_component_el_scrollbar, {
11700
+ "wrap-class": "layout-tab-scrollbar-wrap",
11701
+ "view-class": "layout-tab-scrollbar-view"
11702
+ }, {
11703
+ default: withCtx(() => [
11704
+ createElementVNode("div", {
11705
+ ref: setSortable,
11706
+ class: "flex valign-bottom layout-tab-list"
11707
+ }, [
11708
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(navStore).tabs, (tab, index2) => {
11709
+ return openBlock(), createElementBlock("div", {
11710
+ key: `${tab.id}|${index2}`,
11711
+ "data-id": tab.id,
11712
+ class: normalizeClass(["flex valign-center layout-tab-item", {
11713
+ affix: tab.isAffix,
11714
+ active: unref(route).name === tab.id
11715
+ }]),
11716
+ onClick: ($event) => onTabItemClick(tab)
11717
+ }, [
11718
+ createElementVNode("div", _hoisted_3$1, [
11719
+ tab.icon ? (openBlock(), createElementBlock("span", _hoisted_4, [
11720
+ (openBlock(), createBlock(resolveDynamicComponent(tab.icon)))
11721
+ ])) : createCommentVNode("", true),
11722
+ createElementVNode("span", _hoisted_5, toDisplayString(tab.title), 1)
11723
+ ]),
11724
+ createElementVNode("div", _hoisted_6, [
11725
+ unref(route).name === tab.id ? (openBlock(), createElementBlock("div", {
11726
+ key: 0,
11727
+ class: "flex center layout-tab-item-icon layout-tab-item-icon-btn",
11728
+ onClick: withModifiers(($event) => onRefreshBtnClick(tab), ["stop"])
11729
+ }, [
11730
+ createVNode(_component_el_icon, null, {
11731
+ default: withCtx(() => [
11732
+ createVNode(_component_refresh_right)
11733
+ ]),
11734
+ _: 1
11735
+ })
11736
+ ], 8, _hoisted_7)) : createCommentVNode("", true),
11737
+ !tab.isAffix && unref(navStore).tabs.length > 1 ? (openBlock(), createElementBlock("div", {
11738
+ key: 1,
11739
+ class: "flex center layout-tab-item-icon layout-tab-item-icon-btn",
11740
+ onClick: withModifiers(($event) => onRemoveBtnClick(tab), ["stop"])
11741
+ }, [
11742
+ createVNode(_component_el_icon, null, {
11743
+ default: withCtx(() => [
11744
+ createVNode(_component_close)
11745
+ ]),
11746
+ _: 1
11747
+ })
11748
+ ], 8, _hoisted_8)) : createCommentVNode("", true)
11749
+ ])
11750
+ ], 10, _hoisted_2$1);
11751
+ }), 128))
11752
+ ])
11753
+ ]),
11754
+ _: 1
11755
+ })
11756
+ ]);
11757
+ };
11758
+ }
11759
+ });
11760
+ const _hoisted_1 = { class: "flex column wrapper layout-main" };
11761
+ const _hoisted_2 = { class: "flex column flex-1 fit-size" };
11762
+ const _hoisted_3 = { class: "flex-1 fit-size" };
10448
11763
  const _sfc_main = /* @__PURE__ */ defineComponent({
10449
11764
  __name: "LayoutMainView",
11765
+ props: {
11766
+ headerProps: {},
11767
+ showTabs: { type: Boolean },
11768
+ keepAliveView: { type: Boolean }
11769
+ },
10450
11770
  setup(__props) {
11771
+ const route = useRoute();
11772
+ const navStore = useNavStore();
11773
+ const keepAlivePropsComputed = computed(() => {
11774
+ const { tabs } = navStore;
11775
+ return {
11776
+ // 计算需要缓存的组件名称数组
11777
+ include: tabs.reduce((viewNames, tab) => {
11778
+ if (tab.keepAliveView) {
11779
+ viewNames.push(tab.id);
11780
+ }
11781
+ return viewNames;
11782
+ }, [])
11783
+ };
11784
+ });
10451
11785
  return (_ctx, _cache) => {
10452
11786
  const _component_router_view = resolveComponent("router-view");
10453
11787
  return openBlock(), createElementBlock("div", _hoisted_1, [
10454
- createVNode(LayoutHeader),
11788
+ createVNode(_sfc_main$2, normalizeProps(guardReactiveProps(_ctx.headerProps)), null, 16),
10455
11789
  createElementVNode("div", _hoisted_2, [
10456
- createVNode(_component_router_view)
11790
+ _ctx.showTabs ? (openBlock(), createBlock(_sfc_main$1, { key: 0 })) : createCommentVNode("", true),
11791
+ createElementVNode("div", _hoisted_3, [
11792
+ createVNode(_component_router_view, null, {
11793
+ default: withCtx(({ Component }) => [
11794
+ createVNode(Transition, { name: "fadeLeft" }, {
11795
+ default: withCtx(() => [
11796
+ _ctx.keepAliveView ? (openBlock(), createBlock(KeepAlive, normalizeProps(mergeProps({ key: 0 }, keepAlivePropsComputed.value)), [
11797
+ (openBlock(), createBlock(resolveDynamicComponent(Component), {
11798
+ key: `${unref(route).name}-${(unref(navStore).tabMap[unref(route).name] || {}).count}`
11799
+ }))
11800
+ ], 1040)) : (openBlock(), createBlock(resolveDynamicComponent(Component), { key: 1 }))
11801
+ ]),
11802
+ _: 2
11803
+ }, 1024)
11804
+ ]),
11805
+ _: 1
11806
+ })
11807
+ ])
10457
11808
  ])
10458
11809
  ]);
10459
11810
  };
@@ -10461,7 +11812,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10461
11812
  });
10462
11813
  const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10463
11814
  __proto__: null,
10464
- DataWrapper: _sfc_main$b,
11815
+ DataWrapper: _sfc_main$m,
11816
+ LayoutViewDeclare,
10465
11817
  Main: _sfc_main
10466
11818
  }, Symbol.toStringTag, { value: "Module" }));
10467
11819
  const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -10471,7 +11823,8 @@ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
10471
11823
  forms: index$4,
10472
11824
  slots: index$3,
10473
11825
  useMappingOption,
10474
- useModelValueBridgeComputed
11826
+ useModelValueBridgeComputed,
11827
+ useModelValueBridgeWithoutChangeComputed
10475
11828
  }, Symbol.toStringTag, { value: "Module" }));
10476
11829
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10477
11830
  __proto__: null,
@@ -10479,14 +11832,29 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
10479
11832
  }, Symbol.toStringTag, { value: "Module" }));
10480
11833
  const indexPcViews = {
10481
11834
  install(app, param) {
11835
+ const navStore = useNavStore();
11836
+ navStore.setRouter(param.router);
10482
11837
  app.config.globalProperties.$ZUtils = ZUtils;
11838
+ app.config.globalProperties.$ZWebUtils = ZWebUtils;
10483
11839
  app.config.globalProperties.$ZDecorators = ZDecorators;
10484
11840
  setApi(param.api);
10485
11841
  app.use(directiveInstaller);
10486
11842
  app.use(ElementPlus, {
10487
11843
  locale: zhCn
10488
11844
  });
10489
- for (const [key2, component] of Object.entries(ElementPlusIconsVue)) {
11845
+ const elPlusIconEntries = Object.entries(ElementPlusIconsVue);
11846
+ for (const [key2, component] of elPlusIconEntries) {
11847
+ app.component(key2, component);
11848
+ }
11849
+ const { iconMap } = param;
11850
+ if (iconMap) {
11851
+ const iconEntries = Object.entries(iconMap);
11852
+ for (const [key2, component] of iconEntries) {
11853
+ app.component(key2, component);
11854
+ }
11855
+ }
11856
+ const webUtilsIconEntries = Object.entries(webUtilsIconMap);
11857
+ for (const [key2, component] of webUtilsIconEntries) {
10490
11858
  app.component(key2, component);
10491
11859
  }
10492
11860
  }
@@ -10495,6 +11863,6 @@ export {
10495
11863
  index as PcViews,
10496
11864
  ZDecorators,
10497
11865
  ZUtils,
10498
- index$b as ZWebUtils,
11866
+ ZWebUtils,
10499
11867
  indexPcViews as default
10500
11868
  };