zzz-pc-view 0.0.39 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.es.js CHANGED
@@ -5,15 +5,15 @@ 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 { useRoute } from "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, normalizeClass, normalizeProps, guardReactiveProps, Transition, KeepAlive } from "vue";
10
10
  import Mock from "mockjs";
11
11
  import ElementPlus, { ElNotification, ElMessageBox, ElInput } from "element-plus";
12
12
  const fn = () => {
13
13
  };
14
14
  const object = {};
15
15
  const list$1 = [];
16
- const index$g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16
+ const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
17
17
  __proto__: null,
18
18
  fn,
19
19
  list: list$1,
@@ -1572,7 +1572,7 @@ const tree = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
1572
1572
  sortTree,
1573
1573
  toFlat
1574
1574
  }, Symbol.toStringTag, { value: "Module" }));
1575
- const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1575
+ const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1576
1576
  __proto__: null,
1577
1577
  completeByDate,
1578
1578
  formatValue,
@@ -1654,7 +1654,7 @@ const createDataTimesByLength = (beginTime, length, interval, dateUnit, repeat)
1654
1654
  endDate[setMethodName](endDate[getMethodName]() + length - 1);
1655
1655
  return createDataTimesByRange([new ZDate(beginTime), endDate], interval, dateUnit, repeat);
1656
1656
  };
1657
- const index$e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1657
+ const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1658
1658
  __proto__: null,
1659
1659
  HttpResponse,
1660
1660
  createDataTimesByLength,
@@ -1740,7 +1740,7 @@ const create = (option) => {
1740
1740
  return request;
1741
1741
  };
1742
1742
  };
1743
- const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1743
+ const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1744
1744
  __proto__: null,
1745
1745
  ABORTED_CODE,
1746
1746
  HttpRequestError,
@@ -1817,7 +1817,7 @@ const useHttpRequestInterval = (request, ms) => {
1817
1817
  abort
1818
1818
  };
1819
1819
  };
1820
- const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1820
+ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1821
1821
  __proto__: null,
1822
1822
  useHttpRequestInterval,
1823
1823
  useInterval
@@ -1829,13 +1829,13 @@ const ZUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
1829
1829
  ZDate,
1830
1830
  combine,
1831
1831
  decrypt,
1832
- empty: index$g,
1832
+ empty: index$f,
1833
1833
  encrypt,
1834
- httpRequest: index$d,
1835
- interval: index$c,
1836
- mock: index$e,
1834
+ httpRequest: index$c,
1835
+ interval: index$b,
1836
+ mock: index$d,
1837
1837
  parse,
1838
- reduce: index$f,
1838
+ reduce: index$e,
1839
1839
  stringify,
1840
1840
  toFixed,
1841
1841
  unitConvertor
@@ -2082,6 +2082,21 @@ class WebSocketManager {
2082
2082
  this[WS_EVENTS].all.clear();
2083
2083
  }
2084
2084
  }
2085
+ const getPageViewMap = (pageViewMap, pageViewPathIgnore) => Object.entries(pageViewMap).reduce((map2, [key2, pageCreator]) => {
2086
+ if (pageViewPathIgnore) {
2087
+ key2 = key2.replace(pageViewPathIgnore, "");
2088
+ }
2089
+ const pageViewName = key2.replace(/^\//, "").substring(0, key2.lastIndexOf("/") - 1);
2090
+ map2[pageViewName] = pageCreator;
2091
+ return map2;
2092
+ }, {});
2093
+ const getComponentViewMap = (componentViewMap) => (
2094
+ // 将对象转换为键值对数组,并使用 reduce 方法遍历数组
2095
+ Object.entries(componentViewMap).reduce((map2, [key2, pageCreator]) => {
2096
+ map2[key2.replace(/\..+$/, "").substring(key2.lastIndexOf("/") + 1)] = pageCreator;
2097
+ return map2;
2098
+ }, {})
2099
+ );
2085
2100
  var ZNavTypeEnum = /* @__PURE__ */ ((ZNavTypeEnum2) => {
2086
2101
  ZNavTypeEnum2[ZNavTypeEnum2["DIR"] = 1] = "DIR";
2087
2102
  ZNavTypeEnum2[ZNavTypeEnum2["MENU"] = 2] = "MENU";
@@ -2134,14 +2149,6 @@ class ZNavButton extends ZBaseNav {
2134
2149
  __publicField(this, "type", 3);
2135
2150
  }
2136
2151
  }
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
2152
  const getNavsCategory = (navs, pageViewMap) => {
2146
2153
  const navDirs = [];
2147
2154
  const navMenus = [];
@@ -2189,6 +2196,7 @@ const getNavMenuButtonMap = (navButtons) => navButtons.reduce(
2189
2196
  {}
2190
2197
  );
2191
2198
  const ROOT_ROUTE_NAME = "ROOT_ROUTE";
2199
+ let router;
2192
2200
  const setRoutes = (option) => {
2193
2201
  const navMenuButtonMap = getNavMenuButtonMap(option.navButtons);
2194
2202
  const routes = [];
@@ -2215,7 +2223,6 @@ const setRoutes = (option) => {
2215
2223
  component: NotFoundPageView
2216
2224
  });
2217
2225
  }
2218
- const { router } = option;
2219
2226
  router.addRoute({
2220
2227
  name: ROOT_ROUTE_NAME,
2221
2228
  path: "/",
@@ -2278,7 +2285,6 @@ const setNavs = (option) => {
2278
2285
  const navsCategory = getNavsCategory(option.navs, pageViewMap);
2279
2286
  const { navMenus } = navsCategory;
2280
2287
  setRoutes({
2281
- router: option.router,
2282
2288
  RootPageView: option.RootPageView,
2283
2289
  navMenus,
2284
2290
  pageViewMap,
@@ -2291,8 +2297,8 @@ const clear = (option) => {
2291
2297
  navTreeRef.value = list$1;
2292
2298
  navChildrenMapRef.value = object;
2293
2299
  if (option) {
2294
- const { router, path } = option;
2295
- option.router.addRoute({
2300
+ const { path } = option;
2301
+ router.addRoute({
2296
2302
  name: ROOT_ROUTE_NAME,
2297
2303
  path,
2298
2304
  component: option.PageView
@@ -2303,6 +2309,9 @@ const clear = (option) => {
2303
2309
  };
2304
2310
  const response = {
2305
2311
  ROOT_ROUTE_NAME,
2312
+ setRouter: (_router) => {
2313
+ router = _router;
2314
+ },
2306
2315
  setNavs,
2307
2316
  clear,
2308
2317
  get navTree() {
@@ -2313,7 +2322,7 @@ const response = {
2313
2322
  }
2314
2323
  };
2315
2324
  const useNavStore = () => response;
2316
- const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2325
+ const ZWebUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2317
2326
  __proto__: null,
2318
2327
  HttpRequestMethodEnum,
2319
2328
  WebSocketManager,
@@ -2324,6 +2333,7 @@ const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
2324
2333
  ZNavLink,
2325
2334
  ZNavMenu,
2326
2335
  ZNavTypeEnum,
2336
+ getComponentViewMap,
2327
2337
  getPageViewMap,
2328
2338
  useNavStore
2329
2339
  }, Symbol.toStringTag, { value: "Module" }));
@@ -3342,7 +3352,6 @@ const useCurdMock = (option) => {
3342
3352
  if (listConfig) {
3343
3353
  const requestMethod = (listConfig.method || "get").toLowerCase();
3344
3354
  Mock.mock(new RegExp(`^/api${basePath}/list`), requestMethod, (option2) => {
3345
- console.log(new HttpResponse("data", getListParam(list2, option2, listFilter).list));
3346
3355
  return new HttpResponse("data", getListParam(list2, option2, listFilter).list);
3347
3356
  });
3348
3357
  }
@@ -9947,10 +9956,10 @@ class CurdViewHandler extends CurdHandler {
9947
9956
  onBeforeUnmount() {
9948
9957
  }
9949
9958
  }
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({
9959
+ const _hoisted_1$7 = { class: "flex column wrapper data-wrapper" };
9960
+ const _hoisted_2$4 = { class: "flex flex-wrap gap-10 data-wrapper-header" };
9961
+ const _hoisted_3$3 = { class: "flex gap-10 data-wrapper-footer" };
9962
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
9954
9963
  __name: "DataWrapperView",
9955
9964
  props: {
9956
9965
  bodyViewClass: {}
@@ -9958,8 +9967,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
9958
9967
  setup(__props) {
9959
9968
  return (_ctx, _cache) => {
9960
9969
  const _component_el_scrollbar = resolveComponent("el-scrollbar");
9961
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
9962
- createElementVNode("div", _hoisted_2$2, [
9970
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
9971
+ createElementVNode("div", _hoisted_2$4, [
9963
9972
  renderSlot(_ctx.$slots, "header")
9964
9973
  ]),
9965
9974
  createVNode(_component_el_scrollbar, {
@@ -9971,7 +9980,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
9971
9980
  ]),
9972
9981
  _: 3
9973
9982
  }, 8, ["view-class"]),
9974
- createElementVNode("div", _hoisted_3$1, [
9983
+ createElementVNode("div", _hoisted_3$3, [
9975
9984
  renderSlot(_ctx.$slots, "footer")
9976
9985
  ]),
9977
9986
  renderSlot(_ctx.$slots, "extra")
@@ -10018,7 +10027,7 @@ const useModelValueBridgeComputed = (props, emit) => computed({
10018
10027
  emit("change", value);
10019
10028
  }
10020
10029
  });
10021
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
10030
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
10022
10031
  __name: "VSlotView",
10023
10032
  props: {
10024
10033
  component: {},
@@ -10044,7 +10053,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
10044
10053
  };
10045
10054
  }
10046
10055
  });
10047
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
10056
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
10048
10057
  __name: "CurdTableView",
10049
10058
  props: {
10050
10059
  viewHandler: {}
@@ -10104,7 +10113,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
10104
10113
  ref_for: true
10105
10114
  }, column.colProps || unref(emptyObject2)), {
10106
10115
  default: withCtx(({ row }) => [
10107
- (openBlock(), createBlock(resolveDynamicComponent(column.component || _sfc_main$a), mergeProps({
10116
+ (openBlock(), createBlock(resolveDynamicComponent(column.component || _sfc_main$d), mergeProps({
10108
10117
  viewHandler: _ctx.viewHandler,
10109
10118
  model: row,
10110
10119
  prop: column.propertyKey,
@@ -10120,8 +10129,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
10120
10129
  };
10121
10130
  }
10122
10131
  });
10123
- const _hoisted_1$3 = { key: 0 };
10124
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
10132
+ const _hoisted_1$6 = { key: 0 };
10133
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
10125
10134
  __name: "FilterView",
10126
10135
  props: {
10127
10136
  viewHandler: {},
@@ -10145,7 +10154,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
10145
10154
  class: itemClassComputed.value,
10146
10155
  ref_for: true
10147
10156
  }, config.itemProps || unref(emptyObject2)), [
10148
- config.label ? (openBlock(), createElementBlock("label", _hoisted_1$3, toDisplayString(config.label), 1)) : createCommentVNode("", true),
10157
+ config.label ? (openBlock(), createElementBlock("label", _hoisted_1$6, toDisplayString(config.label), 1)) : createCommentVNode("", true),
10149
10158
  (openBlock(), createBlock(resolveDynamicComponent(config.component), mergeProps({
10150
10159
  "view-handler": _ctx.viewHandler,
10151
10160
  model: _ctx.viewHandler.query,
@@ -10158,17 +10167,17 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
10158
10167
  };
10159
10168
  }
10160
10169
  });
10161
- const _hoisted_1$2 = { class: "flex gap-layout wrapper" };
10162
- const _hoisted_2$1 = {
10170
+ const _hoisted_1$5 = { class: "flex gap-layout wrapper" };
10171
+ const _hoisted_2$3 = {
10163
10172
  key: 0,
10164
10173
  class: "curd-list-aside"
10165
10174
  };
10166
- const _hoisted_3 = { class: "flex-1 fit-size curd-list-content" };
10167
- const _hoisted_4 = {
10175
+ const _hoisted_3$2 = { class: "flex-1 fit-size curd-list-content" };
10176
+ const _hoisted_4$1 = {
10168
10177
  key: 1,
10169
10178
  class: "curd-list-aside"
10170
10179
  };
10171
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10180
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
10172
10181
  __name: "CurdView",
10173
10182
  props: {
10174
10183
  viewHandler: {}
@@ -10180,10 +10189,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10180
10189
  const _component_el_card = resolveComponent("el-card");
10181
10190
  const _component_el_pagination = resolveComponent("el-pagination");
10182
10191
  const _directive_loading = resolveDirective("loading");
10183
- return openBlock(), createBlock(_sfc_main$b, null, {
10192
+ return openBlock(), createBlock(_sfc_main$e, null, {
10184
10193
  header: withCtx(() => [
10185
10194
  renderSlot(_ctx.$slots, "header-before"),
10186
- _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.TOP] ? (openBlock(), createBlock(_sfc_main$8, {
10195
+ _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.TOP] ? (openBlock(), createBlock(_sfc_main$b, {
10187
10196
  key: 0,
10188
10197
  "view-handler": _ctx.viewHandler,
10189
10198
  position: unref(ZDecorators).FilterKey.PositionEnum.TOP,
@@ -10192,9 +10201,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10192
10201
  renderSlot(_ctx.$slots, "header-after")
10193
10202
  ]),
10194
10203
  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, {
10204
+ createElementVNode("div", _hoisted_1$5, [
10205
+ _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.LEFT] ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
10206
+ createVNode(_sfc_main$b, {
10198
10207
  "view-handler": _ctx.viewHandler,
10199
10208
  position: unref(ZDecorators).FilterKey.PositionEnum.LEFT,
10200
10209
  disabled: _ctx.viewHandler.listLoadStatus
@@ -10206,9 +10215,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10206
10215
  class: "flex column wrapper"
10207
10216
  }, {
10208
10217
  default: withCtx(() => [
10209
- createElementVNode("div", _hoisted_3, [
10218
+ createElementVNode("div", _hoisted_3$2, [
10210
10219
  renderSlot(_ctx.$slots, "content", {}, () => [
10211
- createVNode(_sfc_main$9, { "view-handler": _ctx.viewHandler }, null, 8, ["view-handler"])
10220
+ createVNode(_sfc_main$c, { "view-handler": _ctx.viewHandler }, null, 8, ["view-handler"])
10212
10221
  ])
10213
10222
  ])
10214
10223
  ]),
@@ -10216,8 +10225,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10216
10225
  })), [
10217
10226
  [_directive_loading, _ctx.viewHandler.listLoadStatus]
10218
10227
  ]),
10219
- _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.RIGHT] ? (openBlock(), createElementBlock("div", _hoisted_4, [
10220
- createVNode(_sfc_main$8, {
10228
+ _ctx.viewHandler.displayFilterConfigMap[unref(ZDecorators).FilterKey.PositionEnum.RIGHT] ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
10229
+ createVNode(_sfc_main$b, {
10221
10230
  "view-handler": _ctx.viewHandler,
10222
10231
  position: unref(ZDecorators).FilterKey.PositionEnum.RIGHT,
10223
10232
  disabled: _ctx.viewHandler.listLoadStatus
@@ -10248,10 +10257,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10248
10257
  });
10249
10258
  const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10250
10259
  __proto__: null,
10251
- CurdView: _sfc_main$7,
10260
+ CurdView: _sfc_main$a,
10252
10261
  CurdViewHandler
10253
10262
  }, Symbol.toStringTag, { value: "Module" }));
10254
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
10263
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
10255
10264
  __name: "SelectView",
10256
10265
  props: {
10257
10266
  options: {},
@@ -10285,7 +10294,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
10285
10294
  };
10286
10295
  }
10287
10296
  });
10288
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
10297
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
10289
10298
  __name: "VModelView",
10290
10299
  props: {
10291
10300
  component: {},
@@ -10295,7 +10304,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
10295
10304
  },
10296
10305
  setup(__props) {
10297
10306
  const props = __props;
10298
- const mappingComputed = useMappingOption(props, _sfc_main$6, ElInput);
10307
+ const mappingComputed = useMappingOption(props, _sfc_main$9, ElInput);
10299
10308
  const modelValueBridgeComputed = computed({
10300
10309
  get: () => props.model[props.prop],
10301
10310
  set: (value) => {
@@ -10311,7 +10320,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
10311
10320
  };
10312
10321
  }
10313
10322
  });
10314
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10323
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
10315
10324
  __name: "RadioButtonGroupView",
10316
10325
  props: {
10317
10326
  options: {},
@@ -10345,7 +10354,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10345
10354
  };
10346
10355
  }
10347
10356
  });
10348
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10357
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
10349
10358
  __name: "RadioGroupView",
10350
10359
  props: {
10351
10360
  options: {},
@@ -10379,7 +10388,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10379
10388
  };
10380
10389
  }
10381
10390
  });
10382
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10391
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
10383
10392
  __name: "CheckboxGroupView",
10384
10393
  props: {
10385
10394
  options: {},
@@ -10415,45 +10424,270 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10415
10424
  });
10416
10425
  const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10417
10426
  __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
10427
+ CheckboxGroupView: _sfc_main$5,
10428
+ RadioButtonGroupView: _sfc_main$7,
10429
+ RadioGroupView: _sfc_main$6,
10430
+ SelectView: _sfc_main$9,
10431
+ VModelView: _sfc_main$8
10423
10432
  }, Symbol.toStringTag, { value: "Module" }));
10424
10433
  const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10425
10434
  __proto__: null,
10426
- VSlotView: _sfc_main$a
10435
+ VSlotView: _sfc_main$d
10436
+ }, Symbol.toStringTag, { value: "Module" }));
10437
+ const LayoutViewDeclare = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10438
+ __proto__: null
10427
10439
  }, 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;
10440
+ const _hoisted_1$4 = ["href"];
10441
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10442
+ __name: "LayoutNavView",
10443
+ props: {
10444
+ navs: {}
10445
+ },
10446
+ setup(__props) {
10447
+ return (_ctx, _cache) => {
10448
+ const _component_LayoutNavView = resolveComponent("LayoutNavView", true);
10449
+ const _component_el_sub_menu = resolveComponent("el-sub-menu");
10450
+ const _component_el_menu_item = resolveComponent("el-menu-item");
10451
+ const _component_router_link = resolveComponent("router-link");
10452
+ return openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navs, (nav) => {
10453
+ return openBlock(), createElementBlock(Fragment, {
10454
+ key: nav.id
10455
+ }, [
10456
+ nav.type === unref(ZWebUtils).ZNavTypeEnum.DIR ? (openBlock(), createBlock(_component_el_sub_menu, {
10457
+ key: 0,
10458
+ index: nav.id,
10459
+ class: "flex center"
10460
+ }, {
10461
+ title: withCtx(() => [
10462
+ nav.icon ? (openBlock(), createBlock(resolveDynamicComponent(nav.icon), {
10463
+ key: 0,
10464
+ class: "layout-nav-icon"
10465
+ })) : createCommentVNode("", true),
10466
+ createElementVNode("span", null, toDisplayString(nav.title), 1)
10467
+ ]),
10468
+ default: withCtx(() => [
10469
+ createVNode(_component_LayoutNavView, {
10470
+ navs: nav.children
10471
+ }, null, 8, ["navs"])
10472
+ ]),
10473
+ _: 2
10474
+ }, 1032, ["index"])) : nav instanceof unref(ZWebUtils).ZNavLink ? (openBlock(), createBlock(_component_el_menu_item, {
10475
+ key: 1,
10476
+ index: nav.outLink
10477
+ }, {
10478
+ default: withCtx(() => [
10479
+ createElementVNode("a", {
10480
+ href: nav.outLink,
10481
+ target: "_blank",
10482
+ class: "flex center layout-nav-link"
10483
+ }, [
10484
+ nav.icon ? (openBlock(), createBlock(resolveDynamicComponent(nav.icon), {
10485
+ key: 0,
10486
+ class: "layout-nav-icon"
10487
+ })) : createCommentVNode("", true),
10488
+ createElementVNode("span", null, toDisplayString(nav.title), 1)
10489
+ ], 8, _hoisted_1$4)
10490
+ ]),
10491
+ _: 2
10492
+ }, 1032, ["index"])) : (openBlock(), createBlock(_component_el_menu_item, {
10493
+ key: 2,
10494
+ index: nav.path
10495
+ }, {
10496
+ default: withCtx(() => [
10497
+ createVNode(_component_router_link, {
10498
+ to: { name: nav.name },
10499
+ class: "flex center layout-nav-link"
10500
+ }, {
10501
+ default: withCtx(() => [
10502
+ nav.icon ? (openBlock(), createBlock(resolveDynamicComponent(nav.icon), {
10503
+ key: 0,
10504
+ class: "layout-nav-icon"
10505
+ })) : createCommentVNode("", true),
10506
+ createElementVNode("span", null, toDisplayString(nav.title), 1)
10507
+ ]),
10508
+ _: 2
10509
+ }, 1032, ["to"])
10510
+ ]),
10511
+ _: 2
10512
+ }, 1032, ["index"]))
10513
+ ], 64);
10514
+ }), 128);
10515
+ };
10432
10516
  }
10433
- return target;
10517
+ });
10518
+ const _hoisted_1$3 = { class: "flex valign-center gap-5 layout-profile" };
10519
+ const _hoisted_2$2 = {
10520
+ key: 1,
10521
+ class: "layout-profile-nickname"
10434
10522
  };
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" };
10523
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
10524
+ __name: "LayoutProfileView",
10525
+ props: {
10526
+ profile: {}
10527
+ },
10528
+ setup(__props) {
10529
+ return (_ctx, _cache) => {
10530
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
10531
+ _ctx.profile.avatar ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.profile.avatar), {
10532
+ key: 0,
10533
+ class: "layout-profile-icon"
10534
+ })) : createCommentVNode("", true),
10535
+ _ctx.profile.nickname ? (openBlock(), createElementBlock("span", _hoisted_2$2, toDisplayString(_ctx.profile.nickname), 1)) : createCommentVNode("", true)
10536
+ ]);
10537
+ };
10538
+ }
10539
+ });
10540
+ const _hoisted_1$2 = { class: "flex valign-center gap-layout layout-header" };
10541
+ const _hoisted_2$1 = {
10542
+ key: 0,
10543
+ class: "flex valign-center gap-10 layout-header-system-info"
10544
+ };
10545
+ const _hoisted_3$1 = {
10546
+ key: 1,
10547
+ class: "layout-header-system-info-title"
10548
+ };
10549
+ const _hoisted_4 = { class: "flex-1 fit-size layout-nav-scrollbar-container" };
10550
+ const _hoisted_5 = {
10551
+ key: 1,
10552
+ class: "flex valign-center gap-8 layout-header-toolbar"
10553
+ };
10554
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10555
+ __name: "LayoutHeaderView",
10556
+ props: {
10557
+ systemInfo: {},
10558
+ toolbarComponent: {},
10559
+ profile: {}
10560
+ },
10561
+ setup(__props) {
10562
+ const props = __props;
10563
+ const route = useRoute();
10564
+ const navStore = useNavStore();
10565
+ const onProfileMenuItemClick = (index2) => {
10566
+ props.profile.menus[index2].handler();
10567
+ };
10568
+ return (_ctx, _cache) => {
10569
+ const _component_el_menu = resolveComponent("el-menu");
10570
+ const _component_el_scrollbar = resolveComponent("el-scrollbar");
10571
+ const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
10572
+ const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
10573
+ const _component_el_dropdown = resolveComponent("el-dropdown");
10574
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
10575
+ _ctx.systemInfo ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
10576
+ _ctx.systemInfo.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.systemInfo.icon), {
10577
+ key: 0,
10578
+ class: "layout-header-system-info-icon"
10579
+ })) : createCommentVNode("", true),
10580
+ _ctx.systemInfo.title ? (openBlock(), createElementBlock("div", _hoisted_3$1, toDisplayString(_ctx.systemInfo.title), 1)) : createCommentVNode("", true)
10581
+ ])) : createCommentVNode("", true),
10582
+ createElementVNode("div", _hoisted_4, [
10583
+ createVNode(_component_el_scrollbar, { "view-class": "flex layout-header-scrollbar-view" }, {
10584
+ default: withCtx(() => [
10585
+ createVNode(_component_el_menu, {
10586
+ "default-active": unref(route).path,
10587
+ mode: "horizontal",
10588
+ "unique-opened": "",
10589
+ class: normalizeClass({
10590
+ "layout-main-nav-center": _ctx.systemInfo
10591
+ })
10592
+ }, {
10593
+ default: withCtx(() => [
10594
+ createVNode(_sfc_main$4, {
10595
+ navs: unref(navStore).navTree
10596
+ }, null, 8, ["navs"])
10597
+ ]),
10598
+ _: 1
10599
+ }, 8, ["default-active", "class"])
10600
+ ]),
10601
+ _: 1
10602
+ })
10603
+ ]),
10604
+ _ctx.toolbarComponent ? (openBlock(), createElementBlock("div", _hoisted_5)) : createCommentVNode("", true),
10605
+ _ctx.profile ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
10606
+ Array.isArray(_ctx.profile.menus) && _ctx.profile.menus.length ? (openBlock(), createBlock(_component_el_dropdown, {
10607
+ key: 0,
10608
+ trigger: "click",
10609
+ class: "layout-profile-dropdown",
10610
+ onCommand: onProfileMenuItemClick
10611
+ }, {
10612
+ dropdown: withCtx(() => [
10613
+ createVNode(_component_el_dropdown_menu, null, {
10614
+ default: withCtx(() => [
10615
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.profile.menus, (profileMenu, index2) => {
10616
+ return openBlock(), createBlock(_component_el_dropdown_item, {
10617
+ key: index2,
10618
+ icon: profileMenu.icon,
10619
+ command: index2
10620
+ }, {
10621
+ default: withCtx(() => [
10622
+ createTextVNode(toDisplayString(profileMenu.label), 1)
10623
+ ]),
10624
+ _: 2
10625
+ }, 1032, ["icon", "command"]);
10626
+ }), 128))
10627
+ ]),
10628
+ _: 1
10629
+ })
10630
+ ]),
10631
+ default: withCtx(() => [
10632
+ createVNode(_sfc_main$3, { profile: _ctx.profile }, null, 8, ["profile"])
10633
+ ]),
10634
+ _: 1
10635
+ })) : (openBlock(), createBlock(_sfc_main$3, {
10636
+ key: 1,
10637
+ profile: _ctx.profile
10638
+ }, null, 8, ["profile"]))
10639
+ ], 64)) : createCommentVNode("", true)
10640
+ ]);
10641
+ };
10642
+ }
10643
+ });
10644
+ const _hoisted_1$1 = { class: "layout-tab" };
10645
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10646
+ __name: "LayoutTabView",
10647
+ setup(__props) {
10648
+ const route = useRoute();
10649
+ const navStore = useNavStore();
10650
+ console.log(route, navStore);
10651
+ return (_ctx, _cache) => {
10652
+ return openBlock(), createElementBlock("div", _hoisted_1$1);
10653
+ };
10654
+ }
10655
+ });
10656
+ const _hoisted_1 = { class: "flex column wrapper layout-main" };
10447
10657
  const _hoisted_2 = { class: "flex flex-1 fit-size" };
10658
+ const _hoisted_3 = { class: "flex-1 fit-size" };
10448
10659
  const _sfc_main = /* @__PURE__ */ defineComponent({
10449
10660
  __name: "LayoutMainView",
10661
+ props: {
10662
+ headerProps: {},
10663
+ showTabs: { type: Boolean },
10664
+ keepAliveView: { type: Boolean }
10665
+ },
10450
10666
  setup(__props) {
10667
+ const keepAlivePropsComputed = computed(() => {
10668
+ return [];
10669
+ });
10451
10670
  return (_ctx, _cache) => {
10452
10671
  const _component_router_view = resolveComponent("router-view");
10453
10672
  return openBlock(), createElementBlock("div", _hoisted_1, [
10454
- createVNode(LayoutHeader),
10673
+ createVNode(_sfc_main$2, normalizeProps(guardReactiveProps(_ctx.headerProps)), null, 16),
10455
10674
  createElementVNode("div", _hoisted_2, [
10456
- createVNode(_component_router_view)
10675
+ _ctx.showTabs ? (openBlock(), createBlock(_sfc_main$1, { key: 0 })) : createCommentVNode("", true),
10676
+ createElementVNode("div", _hoisted_3, [
10677
+ createVNode(_component_router_view, null, {
10678
+ default: withCtx(({ Component }) => [
10679
+ createVNode(Transition, { name: "fadeLeft" }, {
10680
+ default: withCtx(() => [
10681
+ _ctx.keepAliveView ? (openBlock(), createBlock(KeepAlive, normalizeProps(mergeProps({ key: 0 }, keepAlivePropsComputed.value)), [
10682
+ (openBlock(), createBlock(resolveDynamicComponent(Component)))
10683
+ ], 1040)) : (openBlock(), createBlock(resolveDynamicComponent(Component), { key: 1 }))
10684
+ ]),
10685
+ _: 2
10686
+ }, 1024)
10687
+ ]),
10688
+ _: 1
10689
+ })
10690
+ ])
10457
10691
  ])
10458
10692
  ]);
10459
10693
  };
@@ -10461,7 +10695,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10461
10695
  });
10462
10696
  const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10463
10697
  __proto__: null,
10464
- DataWrapper: _sfc_main$b,
10698
+ DataWrapper: _sfc_main$e,
10699
+ LayoutViewDeclare,
10465
10700
  Main: _sfc_main
10466
10701
  }, Symbol.toStringTag, { value: "Module" }));
10467
10702
  const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -10479,22 +10714,33 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
10479
10714
  }, Symbol.toStringTag, { value: "Module" }));
10480
10715
  const indexPcViews = {
10481
10716
  install(app, param) {
10717
+ const navStore = useNavStore();
10718
+ navStore.setRouter(param.router);
10482
10719
  app.config.globalProperties.$ZUtils = ZUtils;
10720
+ app.config.globalProperties.$ZWebUtils = ZWebUtils;
10483
10721
  app.config.globalProperties.$ZDecorators = ZDecorators;
10484
10722
  setApi(param.api);
10485
10723
  app.use(directiveInstaller);
10486
10724
  app.use(ElementPlus, {
10487
10725
  locale: zhCn
10488
10726
  });
10489
- for (const [key2, component] of Object.entries(ElementPlusIconsVue)) {
10727
+ const elPlusIconEntries = Object.entries(ElementPlusIconsVue);
10728
+ for (const [key2, component] of elPlusIconEntries) {
10490
10729
  app.component(key2, component);
10491
10730
  }
10731
+ const { iconMap } = param;
10732
+ if (iconMap) {
10733
+ const iconEntries = Object.entries(iconMap);
10734
+ for (const [key2, component] of iconEntries) {
10735
+ app.component(key2, component);
10736
+ }
10737
+ }
10492
10738
  }
10493
10739
  };
10494
10740
  export {
10495
10741
  index as PcViews,
10496
10742
  ZDecorators,
10497
10743
  ZUtils,
10498
- index$b as ZWebUtils,
10744
+ ZWebUtils,
10499
10745
  indexPcViews as default
10500
10746
  };