@epxing/dashboard 0.0.0-stage → 5.3.0-beta.2

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 (64) hide show
  1. package/API.md +80 -0
  2. package/README.md +41 -2
  3. package/dist/_virtual/_plugin-vue_export-helper.js +10 -0
  4. package/dist/_virtual/preload-helper.js +88 -0
  5. package/dist/assets/technology_bg-oWIS2awO.jpg +0 -0
  6. package/dist/src/Dashboard.js +333 -0
  7. package/dist/src/DashboardGrid.js +183 -0
  8. package/dist/src/DesignGrid.js +712 -0
  9. package/dist/src/DesignItem.js +64 -0
  10. package/dist/src/Div.js +409 -0
  11. package/dist/src/Header.js +386 -0
  12. package/dist/src/Preview.js +28 -0
  13. package/dist/src/Tabs.js +469 -0
  14. package/dist/src/Title.js +102 -0
  15. package/dist/src/Widget.js +267 -0
  16. package/dist/src/chart-request-scope.js +33 -0
  17. package/dist/src/design-target.js +58 -0
  18. package/dist/src/grid/compact.js +69 -0
  19. package/dist/src/grid/compat/GridItem.js +36 -0
  20. package/dist/src/grid/compat/GridLayout.js +77 -0
  21. package/dist/src/grid/designState.js +22 -0
  22. package/dist/src/grid/engines.js +26 -0
  23. package/dist/src/grid/geometry.js +45 -0
  24. package/dist/src/grid/gridstackParams.js +70 -0
  25. package/dist/src/grid/mixins.js +109 -0
  26. package/dist/src/grid/model.js +224 -0
  27. package/dist/src/grid/useViewportGate.js +56 -0
  28. package/dist/src/index.js +27 -0
  29. package/dist/src/layout-util.js +109 -0
  30. package/dist/src/mobile-design.js +51 -0
  31. package/dist/src/theme-style.js +134 -0
  32. package/dist/style.css +1009 -0
  33. package/package.json +86 -3
  34. package/src/Dashboard.vue +459 -0
  35. package/src/DashboardGrid.vue +189 -0
  36. package/src/DesignGrid.vue +851 -0
  37. package/src/DesignItem.vue +124 -0
  38. package/src/Div.vue +419 -0
  39. package/src/Header.vue +501 -0
  40. package/src/Preview.vue +30 -0
  41. package/src/Tabs.vue +484 -0
  42. package/src/Title.vue +107 -0
  43. package/src/Widget.vue +354 -0
  44. package/src/chart-request-scope.js +22 -0
  45. package/src/design-target.js +55 -0
  46. package/src/grid/compact.js +81 -0
  47. package/src/grid/compat/GridItem.vue +30 -0
  48. package/src/grid/compat/GridLayout.vue +76 -0
  49. package/src/grid/designState.js +17 -0
  50. package/src/grid/engines.js +22 -0
  51. package/src/grid/geometry.js +55 -0
  52. package/src/grid/gridstackParams.js +72 -0
  53. package/src/grid/mixins.js +114 -0
  54. package/src/grid/model.js +259 -0
  55. package/src/grid/useViewportGate.js +57 -0
  56. package/src/index.js +28 -0
  57. package/src/layout-util.js +157 -0
  58. package/src/mobile-design.js +50 -0
  59. package/src/theme-style.js +185 -0
  60. package/types/div.d.ts +1 -0
  61. package/types/index.d.ts +7 -0
  62. package/types/tabs.d.ts +1 -0
  63. package/types/title.d.ts +1 -0
  64. package/types/widget.d.ts +1 -0
@@ -0,0 +1,469 @@
1
+ import '../style.css';
2
+ import { __vitePreload as __epxPackagePreload } from "../_virtual/preload-helper.js";
3
+ import { defineAsyncComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createCommentVNode, Fragment, renderList, withModifiers, withDirectives, vModelText, toDisplayString, normalizeStyle, createBlock, withCtx, resolveDynamicComponent, createVNode, createTextVNode } from "vue";
4
+ import { normalizeGridItem } from "./layout-util.js";
5
+ import DashboardGrid from "./DashboardGrid.js";
6
+ import { containerGridMixin } from "./grid/mixins.js";
7
+ /* empty css */
8
+ import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
9
+ const _sfc_main = {
10
+ name: "epx-dashboard-tabs",
11
+ // 运行态网格参数 / 门控策略 / 嵌套容器网格透传(compGrid prop、gridParams / loadWay / childGrid)来自 containerGridMixin
12
+ mixins: [containerGridMixin],
13
+ components: {
14
+ [DashboardGrid.name]: DashboardGrid,
15
+ // 设计态画布(gridstack 封装)与项 chrome 按需加载,运行态不拉 gridstack
16
+ "epx-dashboard-design-grid": defineAsyncComponent(() => __epxPackagePreload(() => import("./DesignGrid.js"), true ? [] : void 0, import.meta.url)),
17
+ "epx-dashboard-design-item": defineAsyncComponent(() => __epxPackagePreload(() => import("./DesignItem.js"), true ? [] : void 0, import.meta.url))
18
+ },
19
+ inject: {
20
+ // 父网格 api(页面级画布或上级容器的 DesignGrid 提供):激活页签的子网格挂到它下面;独立挂载时为空,子网格退化为独立网格
21
+ epxDashboardDesignGrid: { default: null },
22
+ // 设计态共享选中态(页面级画布提供):容器内与页面级只有一个选中项
23
+ epxDashboardDesign: { default: null }
24
+ },
25
+ props: {
26
+ items: {
27
+ type: Array,
28
+ default() {
29
+ return [];
30
+ }
31
+ },
32
+ itemConfigs: {
33
+ type: Object,
34
+ default() {
35
+ return {};
36
+ }
37
+ },
38
+ theme: String,
39
+ // 本容器项的 id:设计态选中项的 owner 标记(与 Div 对齐)
40
+ compId: String,
41
+ mode: String,
42
+ allComponentList: Array,
43
+ chartCache: Boolean,
44
+ dashboardId: String
45
+ },
46
+ data() {
47
+ return {
48
+ activeTab: "",
49
+ reloadComponent: {},
50
+ isDragElement: false,
51
+ editTabId: "",
52
+ editTabName: "",
53
+ // 设计态页签内容区可视高度,传给激活页签的子网格做 min-height
54
+ designMinHeight: 0
55
+ };
56
+ },
57
+ computed: {
58
+ tab() {
59
+ return this.items.find((item) => item.id === this.activeTab);
60
+ },
61
+ tabIndex() {
62
+ return this.items.findIndex((item) => item.id === this.activeTab);
63
+ },
64
+ getCompConfigs() {
65
+ return (component) => {
66
+ const { configs = {}, id, title, contentType, ...otherConfigs } = component;
67
+ const compId = this.getDashboardLegacy() && this.dashboardId ? this.dashboardId + "-" + id : id;
68
+ const itemConfig = this.itemConfigs[compId] || {};
69
+ const _configs = { ...otherConfigs, ...configs, ...itemConfig };
70
+ if (title) {
71
+ _configs.componentName = title;
72
+ }
73
+ return _configs;
74
+ };
75
+ },
76
+ design() {
77
+ return this.epxDashboardDesign;
78
+ },
79
+ activeComponent() {
80
+ return this.design ? this.design.state.activeItem : null;
81
+ }
82
+ },
83
+ watch: {
84
+ items: {
85
+ handler(tabs = []) {
86
+ for (const tab of tabs) {
87
+ for (const item of tab.items || []) {
88
+ normalizeGridItem(item);
89
+ }
90
+ }
91
+ },
92
+ deep: true,
93
+ immediate: true
94
+ }
95
+ },
96
+ methods: {
97
+ addTab() {
98
+ const newTabName = this.items.length + "";
99
+ const tabs = this.items;
100
+ tabs.push({
101
+ name: "标签页" + (this.items.length + 1),
102
+ id: newTabName,
103
+ items: []
104
+ });
105
+ this.$emit("changeItems", tabs);
106
+ },
107
+ removeTab(targetName) {
108
+ const tabs = this.items;
109
+ if (tabs.length <= 1) {
110
+ this.$message.error("最少有一个标签");
111
+ return;
112
+ }
113
+ let activeName = this.activeTab;
114
+ let activeIndex = -1;
115
+ if (activeName === targetName) {
116
+ tabs.forEach((tab, index) => {
117
+ if (tab.id === targetName) {
118
+ activeIndex = index;
119
+ const nextTab = tabs[index + 1] || tabs[index - 1];
120
+ if (nextTab) {
121
+ activeName = nextTab.id;
122
+ }
123
+ }
124
+ });
125
+ }
126
+ this.activeTab = activeName;
127
+ tabs.splice(activeIndex, 1);
128
+ this.$emit("changeItems", tabs);
129
+ },
130
+ editTab(tab) {
131
+ if (this.mode !== "design") return;
132
+ this.editTabId = tab.id;
133
+ this.editTabName = tab.name;
134
+ this.$nextTick(() => {
135
+ this.$refs.editTabInput[0].focus();
136
+ });
137
+ },
138
+ updateTabName() {
139
+ if (this.editTabId && this.editTabName) {
140
+ const index = this.items.findIndex((item) => item.id === this.editTabId);
141
+ this.items.splice(index, 1, { ...this.items[index], name: this.editTabName });
142
+ this.$emit("changeItems", this.items);
143
+ this.editTabId = null;
144
+ this.editTabName = "";
145
+ }
146
+ },
147
+ addGridItem(v) {
148
+ const tab = this.tabs.find((item) => item.name === this.activeTab);
149
+ if (tab) {
150
+ tab.items.push(v);
151
+ }
152
+ },
153
+ // 库改了子项坐标(拖拽 / 缩放 / 推挤 / 首次对账):画布已就地写回,只需通知上层保存
154
+ onDesignChange() {
155
+ this.$emit("changeItems", this.items);
156
+ },
157
+ // 跨网格搬出(页签内项被拖到页面或别的容器):源侧必须同步移出,否则子网格下一次同步会把壳重新加回来
158
+ onTransferOut(tab, item) {
159
+ const index = (tab.items || []).findIndex((i) => i.id === item.id);
160
+ if (index !== -1) tab.items.splice(index, 1);
161
+ this.$emit("changeItems", this.items);
162
+ },
163
+ // 跨网格搬入当前页签:画布已按本网格换算过 w/h
164
+ onTransferIn(tab, item) {
165
+ if (!tab.items) tab.items = [];
166
+ tab.items.push(item);
167
+ this.$emit("changeItems", this.items);
168
+ },
169
+ // 页签里嵌套容器的子项变化:替换该容器项对象后上报(与页面级画布 changeSubItems 同手法)
170
+ changeSubItems(tab, item, v) {
171
+ const index = (tab.items || []).findIndex((i) => i.id === item.id);
172
+ if (index === -1) return;
173
+ tab.items.splice(index, 1, { ...tab.items[index], items: v });
174
+ this.$emit("changeItems", this.items);
175
+ },
176
+ openConfigPanel(component) {
177
+ if (this.design) this.design.select(component, this.compId);
178
+ },
179
+ // 设计态页签内容区可视高度(所有页签共用同一个内容区)
180
+ measureDesignHeight() {
181
+ if (this.$refs.tabsContent) this.designMinHeight = this.$refs.tabsContent.clientHeight;
182
+ },
183
+ designReport(component) {
184
+ const configs = this.getCompConfigs(component, component.id);
185
+ this.goPage({
186
+ component: "report-design",
187
+ params: {
188
+ id: configs.id,
189
+ callback: () => {
190
+ this.reloadComponent[component.id] = true;
191
+ this.$nextTick(() => {
192
+ this.reloadComponent[component.id] = false;
193
+ });
194
+ }
195
+ }
196
+ });
197
+ },
198
+ editComponent(activeComponent) {
199
+ const componentInfo = this.allComponentList.find((item) => item.CODE === activeComponent.contentType) || { CODE: activeComponent.contentType };
200
+ const configs = this.getCompConfigs(activeComponent, activeComponent.id);
201
+ this.$emit("open-config", activeComponent.id, componentInfo, configs);
202
+ },
203
+ deleteComponent(component, command) {
204
+ const activeComponent = component || this.activeComponent;
205
+ const index = this.tab.items.findIndex((item) => item.id === activeComponent.id);
206
+ if (activeComponent.contentType === "report-chat" && command === "all") {
207
+ const configs = this.getCompConfigs(activeComponent, activeComponent.id);
208
+ this.$http.removeMulti({
209
+ entityId: "FM_REPORT_BASE",
210
+ ids: configs.id
211
+ });
212
+ }
213
+ if (index !== -1) {
214
+ this.tab.items.splice(index, 1);
215
+ this.$emit("changeItems", this.items);
216
+ if (this.design && this.design.isActive(activeComponent)) this.design.clear();
217
+ }
218
+ }
219
+ },
220
+ mounted() {
221
+ if (!this.items || this.items.length === 0) {
222
+ const items = [{
223
+ id: "tab_" + (/* @__PURE__ */ new Date()).getTime(),
224
+ name: "标签页1",
225
+ items: []
226
+ }];
227
+ this.$emit("changeItems", items);
228
+ this.activeTab = items[0].id;
229
+ } else {
230
+ this.activeTab = this.items[0].id;
231
+ }
232
+ if (this.mode !== "design") return;
233
+ this.measureDesignHeight();
234
+ if (typeof ResizeObserver !== "undefined" && this.$refs.tabsContent) {
235
+ this.designResizeObserver = new ResizeObserver(() => this.measureDesignHeight());
236
+ this.designResizeObserver.observe(this.$refs.tabsContent);
237
+ }
238
+ },
239
+ beforeUnmount() {
240
+ if (this.designResizeObserver) this.designResizeObserver.disconnect();
241
+ }
242
+ };
243
+ const _hoisted_1 = { class: "tabs el-tabs el-tabs--card el-tabs--top" };
244
+ const _hoisted_2 = { class: "el-tabs__header is-top" };
245
+ const _hoisted_3 = {
246
+ key: 0,
247
+ tabindex: "0",
248
+ class: "el-tabs__new-tab"
249
+ };
250
+ const _hoisted_4 = { class: "el-tabs__nav-wrap is-top" };
251
+ const _hoisted_5 = { class: "el-tabs__nav-scroll" };
252
+ const _hoisted_6 = {
253
+ role: "tablist",
254
+ class: "el-tabs__nav is-top"
255
+ };
256
+ const _hoisted_7 = ["onDblclick", "onClick"];
257
+ const _hoisted_8 = ["onClick"];
258
+ const _hoisted_9 = {
259
+ class: "el-tabs__content",
260
+ ref: "tabsContent"
261
+ };
262
+ const _hoisted_10 = { class: "drag-component" };
263
+ const _hoisted_11 = {
264
+ key: 0,
265
+ class: "drag-component"
266
+ };
267
+ const _hoisted_12 = { key: 1 };
268
+ const _hoisted_13 = ["onClick"];
269
+ const _hoisted_14 = ["onClick"];
270
+ const _hoisted_15 = ["onClick"];
271
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
272
+ const _component_epx_dashboard_grid = resolveComponent("epx-dashboard-grid");
273
+ const _component_epx_component = resolveComponent("epx-component");
274
+ const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
275
+ const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
276
+ const _component_el_dropdown = resolveComponent("el-dropdown");
277
+ const _component_epx_dashboard_design_item = resolveComponent("epx-dashboard-design-item");
278
+ const _component_epx_dashboard_design_grid = resolveComponent("epx-dashboard-design-grid");
279
+ return openBlock(), createElementBlock("div", {
280
+ ref: "container",
281
+ class: normalizeClass(["container", "container--" + $props.theme, { "drag-element": $data.isDragElement }, { "is-design": $props.mode === "design" }]),
282
+ onClick: _cache[3] || (_cache[3] = (...args) => $options.updateTabName && $options.updateTabName(...args))
283
+ }, [
284
+ createElementVNode("div", _hoisted_1, [
285
+ createElementVNode("div", _hoisted_2, [
286
+ $props.mode === "design" ? (openBlock(), createElementBlock("span", _hoisted_3, [
287
+ createElementVNode("i", {
288
+ class: "el-icon-plus",
289
+ onClick: _cache[0] || (_cache[0] = (...args) => $options.addTab && $options.addTab(...args))
290
+ })
291
+ ])) : createCommentVNode("", true),
292
+ createElementVNode("div", _hoisted_4, [
293
+ createElementVNode("div", _hoisted_5, [
294
+ createElementVNode("div", _hoisted_6, [
295
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.items, (tab) => {
296
+ return openBlock(), createElementBlock("div", {
297
+ class: normalizeClass(["el-tabs__item", "is-top", { "is-closable": $props.mode === "design" }, { "is-active": $data.activeTab === tab.id }]),
298
+ key: tab.id,
299
+ onDblclick: ($event) => $options.editTab(tab),
300
+ onClick: withModifiers(($event) => $data.activeTab = tab.id, ["stop"])
301
+ }, [
302
+ $data.editTabId === tab.id ? withDirectives((openBlock(), createElementBlock("input", {
303
+ key: 0,
304
+ class: "edit-tab__input",
305
+ ref_for: true,
306
+ ref: "editTabInput",
307
+ type: "text",
308
+ placeholder: "",
309
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.editTabName = $event),
310
+ maxlength: "10"
311
+ }, null, 512)), [
312
+ [vModelText, $data.editTabName]
313
+ ]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
314
+ createElementVNode("span", null, toDisplayString(tab.name), 1),
315
+ $props.mode === "design" ? (openBlock(), createElementBlock("span", {
316
+ key: 0,
317
+ class: "el-icon-close",
318
+ onClick: withModifiers(($event) => $options.removeTab(tab.id), ["stop"])
319
+ }, null, 8, _hoisted_8)) : createCommentVNode("", true)
320
+ ], 64))
321
+ ], 42, _hoisted_7);
322
+ }), 128))
323
+ ])
324
+ ])
325
+ ])
326
+ ]),
327
+ createElementVNode("div", _hoisted_9, [
328
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.items, (tab) => {
329
+ return openBlock(), createElementBlock("div", {
330
+ class: "el-tab-pane",
331
+ key: tab.id,
332
+ style: normalizeStyle({ display: $data.activeTab === tab.id ? "block" : "none" })
333
+ }, [
334
+ $props.mode !== "design" ? (openBlock(), createBlock(_component_epx_dashboard_grid, {
335
+ key: 0,
336
+ class: "epx-dashboard-tabs__grid",
337
+ items: _ctx.mobileItems(tab.items || []),
338
+ grid: _ctx.gridParams,
339
+ "load-way": _ctx.loadWay,
340
+ "body-height": _ctx.bodyHeight,
341
+ "scroll-root-selector": ".epx-dashboard__container, .dashboard-container"
342
+ }, {
343
+ item: withCtx(({ item }) => [
344
+ createElementVNode("div", _hoisted_10, [
345
+ (openBlock(), createBlock(resolveDynamicComponent("epx-" + item.contentType), {
346
+ ref_for: true,
347
+ ref: `component_${item.i}`,
348
+ class: "epx-dashboard__component",
349
+ "is-dashboard": "",
350
+ key: item.id,
351
+ "comp-id": item.id,
352
+ "comp-title": item.title,
353
+ "comp-style": item.style,
354
+ "comp-configs": $options.getCompConfigs(item, item.id),
355
+ "comp-grid": _ctx.childGrid(item),
356
+ "chart-cache": $props.chartCache,
357
+ "mobile-appearance": _ctx.mobileStacked ? item.mobileAppearance : void 0,
358
+ items: item.items,
359
+ "item-configs": $props.itemConfigs,
360
+ theme: $props.theme
361
+ }, null, 8, ["comp-id", "comp-title", "comp-style", "comp-configs", "comp-grid", "chart-cache", "mobile-appearance", "items", "item-configs", "theme"]))
362
+ ])
363
+ ]),
364
+ _: 1
365
+ }, 8, ["items", "grid", "load-way", "body-height"])) : $data.activeTab === tab.id ? (openBlock(), createBlock(_component_epx_dashboard_design_grid, {
366
+ key: 1,
367
+ class: "epx-dashboard-tabs__design-grid",
368
+ "sub-grid-of": $options.epxDashboardDesignGrid,
369
+ items: tab.items || [],
370
+ grid: _ctx.gridParams,
371
+ "body-height": _ctx.bodyHeight,
372
+ "min-height": $data.designMinHeight,
373
+ onChange: $options.onDesignChange,
374
+ onTransferOut: (item) => $options.onTransferOut(tab, item),
375
+ onTransferIn: (item) => $options.onTransferIn(tab, item)
376
+ }, {
377
+ item: withCtx(({ item }) => [
378
+ createVNode(_component_epx_dashboard_design_item, {
379
+ item,
380
+ active: !!$options.design && $options.design.isActive(item),
381
+ floatable: _ctx.gridParams.mode !== "float",
382
+ onSelect: $options.openConfigPanel
383
+ }, {
384
+ operates: withCtx(() => [
385
+ item.contentType === "report-chart" ? (openBlock(), createElementBlock("i", {
386
+ key: 0,
387
+ class: "component-operate__item el-icon-edit-outline",
388
+ onClick: ($event) => $options.designReport(item)
389
+ }, null, 8, _hoisted_13)) : createCommentVNode("", true),
390
+ createElementVNode("i", {
391
+ class: "component-operate__item el-icon-setting",
392
+ onClick: ($event) => $options.editComponent(item)
393
+ }, null, 8, _hoisted_14),
394
+ item.contentType === "report-chart" ? (openBlock(), createBlock(_component_el_dropdown, {
395
+ key: 1,
396
+ class: "componnet-dropdown",
397
+ onCommand: (v) => $options.deleteComponent(item, v)
398
+ }, {
399
+ dropdown: withCtx(() => [
400
+ createVNode(_component_el_dropdown_menu, null, {
401
+ default: withCtx(() => [
402
+ createVNode(_component_el_dropdown_item, { command: "only" }, {
403
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
404
+ createTextVNode("仅从仪表盘中删除", -1)
405
+ ])]),
406
+ _: 1
407
+ }),
408
+ createVNode(_component_el_dropdown_item, { command: "all" }, {
409
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
410
+ createTextVNode("从仪表盘和报表库中删除", -1)
411
+ ])]),
412
+ _: 1
413
+ })
414
+ ]),
415
+ _: 1
416
+ })
417
+ ]),
418
+ default: withCtx(() => [
419
+ _cache[6] || (_cache[6] = createElementVNode("i", { class: "component-operate__item el-icon-delete" }, null, -1))
420
+ ]),
421
+ _: 1
422
+ }, 8, ["onCommand"])) : (openBlock(), createElementBlock("i", {
423
+ key: 2,
424
+ class: "component-operate__item el-icon-delete",
425
+ onClick: ($event) => $options.deleteComponent(item)
426
+ }, null, 8, _hoisted_15))
427
+ ]),
428
+ default: withCtx(() => [
429
+ item.contentType && !$data.reloadComponent[item.id] ? (openBlock(), createElementBlock("div", _hoisted_11, [
430
+ (openBlock(), createBlock(_component_epx_component, {
431
+ name: item.contentType,
432
+ ref_for: true,
433
+ ref: `component_${item.i}`,
434
+ class: "epx-dashboard__component",
435
+ "is-dashboard": "",
436
+ key: item.id,
437
+ "comp-id": item.id,
438
+ "comp-title": item.title,
439
+ "comp-style": item.style,
440
+ "comp-configs": $options.getCompConfigs(item, item.id),
441
+ "comp-grid": _ctx.childGrid(item),
442
+ "comp-item": item,
443
+ items: item.items,
444
+ "item-configs": $props.itemConfigs,
445
+ "dashboard-id": $props.dashboardId,
446
+ "all-component-list": $props.allComponentList,
447
+ theme: $props.theme,
448
+ mode: "design",
449
+ "mobile-appearance": _ctx.mobileStacked ? item.mobileAppearance : void 0,
450
+ onChangeItems: (v) => $options.changeSubItems(tab, item, v),
451
+ onOpenConfig: _cache[2] || (_cache[2] = (...args) => _ctx.$emit("open-config", ...args))
452
+ }, null, 8, ["name", "comp-id", "comp-title", "comp-style", "comp-configs", "comp-grid", "comp-item", "items", "item-configs", "dashboard-id", "all-component-list", "theme", "mobile-appearance", "onChangeItems"]))
453
+ ])) : (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(item.i), 1))
454
+ ]),
455
+ _: 2
456
+ }, 1032, ["item", "active", "floatable", "onSelect"])
457
+ ]),
458
+ _: 2
459
+ }, 1032, ["sub-grid-of", "items", "grid", "body-height", "min-height", "onChange", "onTransferOut", "onTransferIn"])) : createCommentVNode("", true)
460
+ ], 4);
461
+ }), 128))
462
+ ], 512)
463
+ ])
464
+ ], 2);
465
+ }
466
+ const DashboardTabs = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-503fe9af"]]);
467
+ export {
468
+ DashboardTabs as default
469
+ };
@@ -0,0 +1,102 @@
1
+ import '../style.css';
2
+ import component from "@epxing/core/src/mixins/component";
3
+ import { openBlock, createElementBlock, normalizeStyle, normalizeClass, createCommentVNode, createTextVNode, toDisplayString } from "vue";
4
+ /* empty css */
5
+ import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
6
+ const _sfc_main = {
7
+ name: "epx-dashboard-title",
8
+ mixins: [component],
9
+ // ↓↓↓ 配置点默认值(页面配置可覆盖)
10
+ subTitle: "",
11
+ // 副标题文案,配置后展示在标题下方
12
+ subTitleFontStyle: {},
13
+ // 副标题字体样式(PC 端)
14
+ subTitleFontStyleMobile: {},
15
+ // 副标题字体样式(移动端,在 PC 样式基础上覆盖,只需配置差异项)
16
+ titleFontStyle: {},
17
+ // 主标题字体样式(PC 端)
18
+ titleFontStyleMobile: {},
19
+ // 主标题字体样式(移动端,在 PC 样式基础上覆盖,只需配置差异项)
20
+ horizontal: "center",
21
+ // 水平对齐:flex-start 居左 / center 居中 / flex-end 居右
22
+ vertical: "center",
23
+ // 垂直对齐:flex-start 顶部 / center 居中 / flex-end 底部
24
+ props: {
25
+ theme: String
26
+ },
27
+ computed: {
28
+ subTitle() {
29
+ const { subTitle = "" } = this.$configs;
30
+ return subTitle;
31
+ },
32
+ titleStyle() {
33
+ const { titleFontStyle = {}, titleFontStyleMobile = {} } = this.$configs;
34
+ const style = { ...titleFontStyle };
35
+ if (this.$isMobile) Object.assign(style, titleFontStyleMobile);
36
+ return style;
37
+ },
38
+ subTitleStyle() {
39
+ const { subTitleFontStyle = {}, subTitleFontStyleMobile = {} } = this.$configs;
40
+ const style = { ...subTitleFontStyle };
41
+ if (this.$isMobile) Object.assign(style, subTitleFontStyleMobile);
42
+ return style;
43
+ },
44
+ layoutStyle() {
45
+ const { horizontal = "center", vertical = "center" } = this.$configs;
46
+ const { textAlign } = this.$component.style || {};
47
+ const align = { left: "flex-start", center: "center", right: "flex-end" }[textAlign] || horizontal;
48
+ return {
49
+ alignItems: align,
50
+ justifyContent: vertical,
51
+ textAlign: { "flex-start": "left", center: "center", "flex-end": "right" }[align]
52
+ };
53
+ }
54
+ }
55
+ };
56
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
57
+ return openBlock(), createElementBlock("div", {
58
+ class: normalizeClass(["epx-dashboard-title", "epx-dashboard-title--" + $props.theme]),
59
+ style: normalizeStyle([$options.layoutStyle, _ctx.$component.style])
60
+ }, [
61
+ _ctx.$configs.level === "h3" ? (openBlock(), createElementBlock("h3", {
62
+ key: 0,
63
+ style: normalizeStyle($options.titleStyle)
64
+ }, [
65
+ _ctx.$configs.icon ? (openBlock(), createElementBlock("i", {
66
+ key: 0,
67
+ class: normalizeClass(_ctx.$configs.icon),
68
+ style: normalizeStyle({ color: _ctx.$configs.iconColor })
69
+ }, null, 6)) : createCommentVNode("", true),
70
+ createTextVNode(toDisplayString(_ctx.$component.title), 1)
71
+ ], 4)) : _ctx.$configs.level === "h2" ? (openBlock(), createElementBlock("h2", {
72
+ key: 1,
73
+ style: normalizeStyle($options.titleStyle)
74
+ }, [
75
+ _ctx.$configs.icon ? (openBlock(), createElementBlock("i", {
76
+ key: 0,
77
+ class: normalizeClass(_ctx.$configs.icon),
78
+ style: normalizeStyle({ color: _ctx.$configs.iconColor })
79
+ }, null, 6)) : createCommentVNode("", true),
80
+ createTextVNode(toDisplayString(_ctx.$component.title), 1)
81
+ ], 4)) : (openBlock(), createElementBlock("h1", {
82
+ key: 2,
83
+ style: normalizeStyle($options.titleStyle)
84
+ }, [
85
+ _ctx.$configs.icon ? (openBlock(), createElementBlock("i", {
86
+ key: 0,
87
+ class: normalizeClass(_ctx.$configs.icon),
88
+ style: normalizeStyle({ color: _ctx.$configs.iconColor })
89
+ }, null, 6)) : createCommentVNode("", true),
90
+ createTextVNode(toDisplayString(_ctx.$component.title), 1)
91
+ ], 4)),
92
+ $options.subTitle ? (openBlock(), createElementBlock("p", {
93
+ key: 3,
94
+ class: "epx-dashboard-title__sub-title",
95
+ style: normalizeStyle($options.subTitleStyle)
96
+ }, toDisplayString($options.subTitle), 5)) : createCommentVNode("", true)
97
+ ], 6);
98
+ }
99
+ const DashboardTitle = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
100
+ export {
101
+ DashboardTitle as default
102
+ };