@ctzy-web-client/plugin-component-vue 1.0.23 → 1.0.24

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 (131) hide show
  1. package/es/advance-select/advance-operation.mjs +51 -37
  2. package/es/advance-select/advance-option.mjs +167 -97
  3. package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs +7 -0
  4. package/es/advance-select/advance-select.mjs +368 -310
  5. package/es/advance-select/index.mjs +5 -5
  6. package/es/application-slot/breadcrumb-item.mjs +20 -17
  7. package/es/application-slot/header-tools-item.mjs +20 -17
  8. package/es/breadcrumb-select/breadcrumb-select.mjs +134 -112
  9. package/es/contextmenu/contextmenu-item.mjs +19 -15
  10. package/es/contextmenu/contextmenu.mjs +72 -56
  11. package/es/data-form/data-form-item.mjs +48 -30
  12. package/es/data-form/data-form.mjs +213 -166
  13. package/es/data-form/form-components/bwa-date-picker.mjs +51 -39
  14. package/es/data-form/form-components/bwa-date-time-picker.mjs +56 -44
  15. package/es/data-form/form-components/bwa-input-float.mjs +48 -37
  16. package/es/data-form/form-components/bwa-input-integer.mjs +68 -50
  17. package/es/data-form/form-components/bwa-input.mjs +43 -32
  18. package/es/data-form/form-components/bwa-multi-select.mjs +40 -29
  19. package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +554 -218
  20. package/es/data-form/form-components/bwa-rich-text.mjs +404 -316
  21. package/es/data-form/form-components/bwa-select.mjs +84 -70
  22. package/es/data-form/form-components/bwa-textarea.mjs +38 -27
  23. package/es/data-form/form-components/bwa-upload.mjs +172 -148
  24. package/es/data-form/form-components/bwa-user-multi-select.mjs +35 -24
  25. package/es/data-form/form-components/bwa-user-select.mjs +86 -61
  26. package/es/data-table/data-column-view.mjs +146 -115
  27. package/es/data-table/data-table-card.mjs +48 -40
  28. package/es/data-table/data-table-column.mjs +58 -45
  29. package/es/data-table/data-table.mjs +402 -316
  30. package/es/datatable-settings/datatable-settings.mjs +329 -254
  31. package/es/date-range/date-picker.mjs +130 -116
  32. package/es/date-range/date-range.mjs +215 -161
  33. package/es/drag-list/drag-item.mjs +56 -42
  34. package/es/drag-list/drag-list.mjs +60 -47
  35. package/es/dragable/dragable-item.mjs +23 -18
  36. package/es/dragable/dragable-operation.mjs +32 -24
  37. package/es/dragable/dragable.mjs +32 -23
  38. package/es/filter-panel/conditions/date-range-condition.mjs +50 -40
  39. package/es/filter-panel/conditions/department-condition/department-condition.mjs +99 -72
  40. package/es/filter-panel/conditions/department-condition/department-node.mjs +73 -59
  41. package/es/filter-panel/conditions/input-condition.mjs +90 -76
  42. package/es/filter-panel/conditions/multi-user-condition.mjs +67 -57
  43. package/es/filter-panel/conditions/multiple-menu-condition.mjs +54 -35
  44. package/es/filter-panel/conditions/single-menu-condition.mjs +65 -60
  45. package/es/filter-panel/conditions/single-user-condition.mjs +67 -57
  46. package/es/filter-panel/filter-panel-item.mjs +54 -39
  47. package/es/filter-panel/filter-panel.mjs +153 -135
  48. package/es/layout/layout.mjs +85 -78
  49. package/es/menu/menu-item.mjs +67 -52
  50. package/es/menu/menu.mjs +70 -53
  51. package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +28 -0
  52. package/es/panel/panel.mjs +53 -40
  53. package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +74 -63
  54. package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +76 -67
  55. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +406 -178
  56. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +153 -138
  57. package/es/pct-filter-panel/pct-filter-panel-item.mjs +55 -40
  58. package/es/pct-filter-panel/pct-filter-panel.mjs +247 -227
  59. package/es/progress/progress-item.mjs +81 -61
  60. package/es/progress/progress.mjs +78 -64
  61. package/es/where-filter-panel/where-filter-panel.mjs +15 -12
  62. package/lib/advance-select/advance-operation.js +50 -36
  63. package/lib/advance-select/advance-option.js +166 -96
  64. package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.js +12 -0
  65. package/lib/advance-select/advance-select.js +366 -308
  66. package/lib/application-slot/breadcrumb-item.js +19 -16
  67. package/lib/application-slot/header-tools-item.js +19 -16
  68. package/lib/breadcrumb-select/breadcrumb-select.js +133 -111
  69. package/lib/contextmenu/contextmenu-item.js +18 -14
  70. package/lib/contextmenu/contextmenu.js +71 -55
  71. package/lib/data-form/data-form-item.js +47 -29
  72. package/lib/data-form/data-form.js +212 -165
  73. package/lib/data-form/form-components/bwa-date-picker.js +50 -38
  74. package/lib/data-form/form-components/bwa-date-time-picker.js +55 -43
  75. package/lib/data-form/form-components/bwa-input-float.js +47 -36
  76. package/lib/data-form/form-components/bwa-input-integer.js +67 -49
  77. package/lib/data-form/form-components/bwa-input.js +42 -31
  78. package/lib/data-form/form-components/bwa-multi-select.js +39 -28
  79. package/lib/data-form/form-components/bwa-rich-text-tinymce.js +553 -217
  80. package/lib/data-form/form-components/bwa-rich-text.js +403 -315
  81. package/lib/data-form/form-components/bwa-select.js +83 -69
  82. package/lib/data-form/form-components/bwa-textarea.js +37 -26
  83. package/lib/data-form/form-components/bwa-upload.js +171 -147
  84. package/lib/data-form/form-components/bwa-user-multi-select.js +34 -23
  85. package/lib/data-form/form-components/bwa-user-select.js +85 -60
  86. package/lib/data-table/data-column-view.js +146 -115
  87. package/lib/data-table/data-table-card.js +48 -40
  88. package/lib/data-table/data-table-column.js +57 -44
  89. package/lib/data-table/data-table.js +401 -315
  90. package/lib/datatable-settings/datatable-settings.js +328 -253
  91. package/lib/date-range/date-picker.js +129 -115
  92. package/lib/date-range/date-range.js +214 -160
  93. package/lib/drag-list/drag-item.js +55 -41
  94. package/lib/drag-list/drag-list.js +59 -46
  95. package/lib/dragable/dragable-item.js +22 -17
  96. package/lib/dragable/dragable-operation.js +31 -23
  97. package/lib/dragable/dragable.js +31 -22
  98. package/lib/filter-panel/conditions/date-range-condition.js +49 -39
  99. package/lib/filter-panel/conditions/department-condition/department-condition.js +98 -71
  100. package/lib/filter-panel/conditions/department-condition/department-node.js +72 -58
  101. package/lib/filter-panel/conditions/input-condition.js +89 -75
  102. package/lib/filter-panel/conditions/multi-user-condition.js +66 -56
  103. package/lib/filter-panel/conditions/multiple-menu-condition.js +53 -34
  104. package/lib/filter-panel/conditions/single-menu-condition.js +64 -59
  105. package/lib/filter-panel/conditions/single-user-condition.js +66 -56
  106. package/lib/filter-panel/filter-panel-item.js +53 -38
  107. package/lib/filter-panel/filter-panel.js +152 -134
  108. package/lib/layout/layout.js +84 -77
  109. package/lib/menu/menu-item.js +66 -51
  110. package/lib/menu/menu.js +69 -52
  111. package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +32 -0
  112. package/lib/panel/panel.js +52 -39
  113. package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +73 -62
  114. package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +75 -66
  115. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +405 -177
  116. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +152 -137
  117. package/lib/pct-filter-panel/pct-filter-panel-item.js +54 -39
  118. package/lib/pct-filter-panel/pct-filter-panel.js +246 -226
  119. package/lib/progress/progress-item.js +80 -60
  120. package/lib/progress/progress.js +77 -63
  121. package/lib/where-filter-panel/where-filter-panel.js +14 -11
  122. package/package.json +2 -1
  123. package/src/advance-select/advance-option.vue +64 -13
  124. package/src/data-form/form-components/bwa-rich-text-tinymce.vue +1 -1
  125. package/src/datatable-settings/datatable-settings.vue +33 -3
  126. package/src/date-range/date-picker.vue +1 -1
  127. package/src/filter-panel/filter-panel.vue +2 -2
  128. package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +64 -64
  129. package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +61 -61
  130. package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +302 -178
  131. package/src/pct-filter-panel/pct-filter-panel.vue +4 -4
@@ -1,180 +1,198 @@
1
- import { defineComponent, watch, provide, reactive, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot, Fragment, renderList, createVNode, withCtx, createBlock, isRef, createCommentVNode, createElementVNode, withModifiers, createTextVNode, toDisplayString } from 'vue';
1
+ import { watch, provide, reactive, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot, Fragment, renderList, createVNode, withCtx, createBlock, isRef, createCommentVNode, createElementVNode, withModifiers, createTextVNode, toDisplayString } from 'vue';
2
2
  import { useNamespace, filterPanelKey } from '@ctzy-web-client/web-base-client-vue';
3
3
  import { useFilterPanel } from './use-filter-panel.mjs';
4
4
  import FilterPanelItem from './filter-panel-item.mjs';
5
5
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
6
6
 
7
- const __default__ = defineComponent({
8
- name: "BwaFilterPanel"
9
- });
10
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
11
- props: {
12
- dataTable: {
13
- type: Object
14
- },
15
- showSearch: {
16
- type: Boolean,
17
- default: false
18
- },
19
- showFieldOptions: {
20
- type: Boolean,
21
- default: true
22
- },
23
- searchAttr: {
24
- type: String,
25
- default: "search"
26
- },
27
- searchPlaceholder: {
28
- type: String,
29
- default: ""
30
- },
31
- searchFields: {
32
- type: Array,
33
- default: () => []
34
- }
35
- },
36
- emits: ["reset", "filter"],
7
+ const _sfc_main = {
8
+ __name: 'filter-panel',
9
+ props: {
10
+ dataTable: {
11
+ type: Object,
12
+ },
13
+ showSearch: {
14
+ type: Boolean,
15
+ default: false,
16
+ },
17
+ showFieldOptions: {
18
+ type: Boolean,
19
+ default: true,
20
+ },
21
+ searchAttr: {
22
+ type: String,
23
+ default: 'search',
24
+ },
25
+ searchPlaceholder: {
26
+ type: String,
27
+ default: '',
28
+ },
29
+ searchFields: {
30
+ type: Array,
31
+ default: () => [],
32
+ },
33
+ },
34
+ emits: ['reset', 'filter'],
37
35
  setup(__props, { emit }) {
38
- const props = __props;
39
- const ns = useNamespace("filterpanel");
40
- const {
41
- dataTable,
42
- filterPanel,
43
- currentFilterColumns,
44
- selectedColumnAttrNames,
45
- closableColumns,
46
- searchParams,
47
- handleFieldSearch,
48
- searchValue,
49
- isChange,
50
- handleReset
51
- } = useFilterPanel(props, { emit });
52
- watch(
53
- filterPanel,
54
- (filterPanel2, _, onCleanup) => {
55
- filterPanel2.existComponent = true;
56
- onCleanup(() => {
57
- filterPanel2.existComponent = false;
58
- });
59
- },
60
- { immediate: true }
61
- );
62
- provide(
63
- filterPanelKey,
64
- reactive({
65
- dataTable,
66
- filterPanel,
67
- currentFilterColumns
68
- })
69
- );
70
- return (_ctx, _cache) => {
71
- const _component_BwaCondition = resolveComponent("BwaCondition");
72
- const _component_ElCheckbox = resolveComponent("ElCheckbox");
73
- const _component_BwaAdvanceOption = resolveComponent("BwaAdvanceOption");
74
- const _component_BwaAdvanceSelect = resolveComponent("BwaAdvanceSelect");
75
- const _component_ElInput = resolveComponent("ElInput");
76
- const _component_ElButton = resolveComponent("ElButton");
77
- return openBlock(), createElementBlock("div", {
78
- class: normalizeClass(unref(ns).b())
79
- }, [
80
- renderSlot(_ctx.$slots, "default", {}, () => [
81
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(currentFilterColumns), (column) => {
82
- return renderSlot(_ctx.$slots, `condition-${column.attrName}`, {
83
- key: column.attrName,
84
- attrName: column.attrName
85
- }, () => [
86
- createVNode(FilterPanelItem, {
87
- prop: column.fullAttrName
88
- }, {
89
- default: withCtx(({ data }) => [
90
- createVNode(_component_BwaCondition, {
91
- modelValue: data.value,
92
- "onUpdate:modelValue": ($event) => data.value = $event,
93
- column,
94
- record: unref(searchParams)
95
- }, null, 8, ["modelValue", "onUpdate:modelValue", "column", "record"])
96
- ]),
97
- _: 2
98
- }, 1032, ["prop"])
99
- ]);
100
- }), 128))
101
- ]),
102
- __props.showFieldOptions ? (openBlock(), createBlock(FilterPanelItem, { key: 0 }, {
36
+
37
+ const props = __props;
38
+
39
+ defineOptions({
40
+ name: 'BwaFilterPanel',
41
+ });
42
+
43
+
44
+
45
+
46
+
47
+ const ns = useNamespace('filterpanel');
48
+
49
+ const {
50
+ dataTable,
51
+ filterPanel,
52
+ currentFilterColumns,
53
+ selectedColumnAttrNames,
54
+ closableColumns,
55
+ searchParams,
56
+ handleFieldSearch,
57
+ searchValue,
58
+ isChange,
59
+ handleReset,
60
+ } = useFilterPanel(props, { emit });
61
+
62
+ watch(
63
+ filterPanel,
64
+ (filterPanel, _, onCleanup) => {
65
+ filterPanel.existComponent = true;
66
+
67
+ onCleanup(() => {
68
+ filterPanel.existComponent = false;
69
+ });
70
+ },
71
+ { immediate: true }
72
+ );
73
+
74
+ provide(
75
+ filterPanelKey,
76
+ reactive({
77
+ dataTable,
78
+ filterPanel,
79
+ currentFilterColumns,
80
+ })
81
+ );
82
+
83
+ return (_ctx, _cache) => {
84
+ const _component_BwaCondition = resolveComponent("BwaCondition");
85
+ const _component_ElCheckbox = resolveComponent("ElCheckbox");
86
+ const _component_BwaAdvanceOption = resolveComponent("BwaAdvanceOption");
87
+ const _component_BwaAdvanceSelect = resolveComponent("BwaAdvanceSelect");
88
+ const _component_ElInput = resolveComponent("ElInput");
89
+ const _component_ElButton = resolveComponent("ElButton");
90
+
91
+ return (openBlock(), createElementBlock("div", {
92
+ class: normalizeClass(unref(ns).b())
93
+ }, [
94
+ renderSlot(_ctx.$slots, "default", {}, () => [
95
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(currentFilterColumns), (column) => {
96
+ return renderSlot(_ctx.$slots, `condition-${column.attrName}`, {
97
+ key: column.attrName,
98
+ attrName: column.attrName
99
+ }, () => [
100
+ createVNode(FilterPanelItem, {
101
+ prop: column.fullAttrName
102
+ }, {
103
+ default: withCtx(({ data }) => [
104
+ createVNode(_component_BwaCondition, {
105
+ modelValue: data.value,
106
+ "onUpdate:modelValue": $event => ((data.value) = $event),
107
+ column: column,
108
+ record: unref(searchParams)
109
+ }, null, 8 /* PROPS */, ["modelValue", "onUpdate:modelValue", "column", "record"])
110
+ ]),
111
+ _: 2 /* DYNAMIC */
112
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["prop"])
113
+ ])
114
+ }), 128 /* KEYED_FRAGMENT */))
115
+ ]),
116
+ (__props.showFieldOptions)
117
+ ? (openBlock(), createBlock(FilterPanelItem, { key: 0 }, {
103
118
  default: withCtx(() => [
104
119
  createVNode(_component_BwaAdvanceSelect, {
105
120
  modelValue: unref(selectedColumnAttrNames),
106
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(selectedColumnAttrNames) ? selectedColumnAttrNames.value = $event : null),
121
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (isRef(selectedColumnAttrNames) ? (selectedColumnAttrNames).value = $event : null)),
107
122
  "show-selectIcon": true,
108
123
  onSearch: unref(handleFieldSearch),
109
- class: normalizeClass(unref(ns).e("options"))
124
+ class: normalizeClass(unref(ns).e('options'))
110
125
  }, {
111
126
  "reference-content": withCtx(() => [
112
127
  createCommentVNode(" <ElIcon><Plus /></ElIcon> "),
113
128
  createElementVNode("div", {
114
- class: normalizeClass(unref(ns).be("filter", "plus"))
115
- }, null, 2),
129
+ class: normalizeClass(unref(ns).be('filter', 'plus'))
130
+ }, null, 2 /* CLASS */),
116
131
  createElementVNode("span", {
117
- class: normalizeClass(unref(ns).be("filter", "label"))
118
- }, " \u7B5B\u9009 ", 2)
132
+ class: normalizeClass(unref(ns).be('filter', 'label'))
133
+ }, " 筛选 ", 2 /* CLASS */)
119
134
  ]),
120
135
  default: withCtx(() => [
121
136
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(closableColumns), (column) => {
122
- return openBlock(), createBlock(_component_BwaAdvanceOption, {
137
+ return (openBlock(), createBlock(_component_BwaAdvanceOption, {
123
138
  value: column.fullAttrName,
124
139
  label: column.title,
125
140
  key: column.fullAttrName,
126
- class: normalizeClass(unref(ns).be("filter", "option"))
141
+ class: normalizeClass(unref(ns).be('filter', 'option'))
127
142
  }, {
128
143
  default: withCtx(() => [
129
144
  createVNode(_component_ElCheckbox, {
130
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
131
- }, ["prevent"])),
145
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
132
146
  modelValue: unref(selectedColumnAttrNames).includes(column.fullAttrName),
133
- class: normalizeClass(unref(ns).be("filter", "checkbox"))
147
+ class: normalizeClass(unref(ns).be('filter', 'checkbox'))
134
148
  }, {
135
149
  default: withCtx(() => [
136
- createTextVNode(toDisplayString(column.title), 1)
150
+ createTextVNode(toDisplayString(column.title), 1 /* TEXT */)
137
151
  ]),
138
- _: 2
139
- }, 1032, ["modelValue", "class"]),
152
+ _: 2 /* DYNAMIC */
153
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["modelValue", "class"]),
140
154
  createElementVNode("span", {
141
- class: normalizeClass(unref(ns).be("filter", "title"))
142
- }, toDisplayString(column.componentTitle), 3)
155
+ class: normalizeClass(unref(ns).be('filter', 'title'))
156
+ }, toDisplayString(column.componentTitle), 3 /* TEXT, CLASS */)
143
157
  ]),
144
- _: 2
145
- }, 1032, ["value", "label", "class"]);
146
- }), 128))
158
+ _: 2 /* DYNAMIC */
159
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["value", "label", "class"]))
160
+ }), 128 /* KEYED_FRAGMENT */))
147
161
  ]),
148
- _: 1
149
- }, 8, ["modelValue", "onSearch", "class"])
162
+ _: 1 /* STABLE */
163
+ }, 8 /* PROPS */, ["modelValue", "onSearch", "class"])
150
164
  ]),
151
- _: 1
152
- })) : createCommentVNode("v-if", true),
153
- __props.showSearch ? (openBlock(), createBlock(_component_ElInput, {
165
+ _: 1 /* STABLE */
166
+ }))
167
+ : createCommentVNode("v-if", true),
168
+ (__props.showSearch)
169
+ ? (openBlock(), createBlock(_component_ElInput, {
154
170
  key: 1,
155
171
  "prefix-icon": "Search",
156
- size: "small",
157
172
  clearable: "",
158
173
  modelValue: unref(searchValue),
159
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(searchValue) ? searchValue.value = $event : null),
174
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (isRef(searchValue) ? (searchValue).value = $event : null)),
160
175
  placeholder: __props.searchPlaceholder,
161
- class: normalizeClass(unref(ns).e("search"))
162
- }, null, 8, ["modelValue", "placeholder", "class"])) : createCommentVNode("v-if", true),
163
- unref(isChange) ? (openBlock(), createBlock(_component_ElButton, {
176
+ class: normalizeClass(unref(ns).e('search'))
177
+ }, null, 8 /* PROPS */, ["modelValue", "placeholder", "class"]))
178
+ : createCommentVNode("v-if", true),
179
+ (unref(isChange))
180
+ ? (openBlock(), createBlock(_component_ElButton, {
164
181
  key: 2,
165
- size: "small",
166
- class: normalizeClass(unref(ns).e("reset")),
182
+ class: normalizeClass(unref(ns).e('reset')),
167
183
  onClick: unref(handleReset)
168
184
  }, {
169
185
  default: withCtx(() => [
170
- createTextVNode(" \u91CD\u7F6E ")
186
+ createTextVNode(" 重置 ")
171
187
  ]),
172
- _: 1
173
- }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
174
- ], 2);
175
- };
176
- }
177
- });
178
- var FilterPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "filter-panel.vue"]]);
188
+ _: 1 /* STABLE */
189
+ }, 8 /* PROPS */, ["class", "onClick"]))
190
+ : createCommentVNode("v-if", true)
191
+ ], 2 /* CLASS */))
192
+ }
193
+ }
194
+
195
+ };
196
+ var FilterPanel = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"filter-panel.vue"]]);
179
197
 
180
198
  export { FilterPanel as default };
@@ -1,86 +1,93 @@
1
- import { defineComponent, computed, unref, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, renderSlot, createElementVNode } from 'vue';
1
+ import { computed, unref, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, renderSlot, createElementVNode } from 'vue';
2
2
  import { useRouter } from 'vue-router';
3
3
  import { useNamespace, useService } from '@ctzy-web-client/web-base-client-vue';
4
4
  import { BwaMenu } from '../menu/index.mjs';
5
5
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
6
6
 
7
- const __default__ = defineComponent({
8
- name: "BwaLayout"
9
- });
10
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
7
+ const _sfc_main = {
8
+ __name: 'layout',
11
9
  setup(__props) {
12
- ;
13
- const router = useRouter();
14
- const ns = useNamespace("layout");
15
- const menuService = useService("MenuService");
16
- const isCollapsed = computed(() => {
17
- var _a, _b;
18
- return (_b = (_a = unref(menuService)) == null ? void 0 : _a.isCollapsed) != null ? _b : false;
19
- });
20
- const menus = computed(() => {
21
- var _a, _b;
22
- return (_b = (_a = unref(menuService)) == null ? void 0 : _a.getMenus()) != null ? _b : [];
23
- });
24
- const currentMenuID = computed(
25
- () => {
26
- var _a, _b, _c;
27
- return (_c = (_b = (_a = unref(menuService)) == null ? void 0 : _a.getCurrentMenu()) == null ? void 0 : _b.id) != null ? _c : "";
28
- }
29
- );
30
- const handleSelect = (menu) => {
31
- if (!menu) {
32
- return;
33
- }
34
- switch (menu == null ? void 0 : menu.type) {
35
- case 0:
36
- unref(menuService).setCurrentMenuById(menu.id);
37
- router.push(menu.path);
38
- break;
39
- case 1:
40
- let openLink = "";
41
- if (path.toLowerCase().indexOf("https://") == 0 || path.toLowerCase().indexOf("http://") == 0) {
42
- openLink = path;
43
- } else if (path.startsWith("//")) {
44
- openLink = location.protocol + path;
45
- } else {
46
- openLink = path;
47
- }
48
- window.open(openLink);
49
- break;
50
- }
51
- };
52
- return (_ctx, _cache) => {
53
- const _component_ElScrollbar = resolveComponent("ElScrollbar");
54
- return openBlock(), createElementBlock("div", {
55
- class: normalizeClass([unref(ns).b(), "justify-between"])
56
- }, [
57
- createVNode(_component_ElScrollbar, {
58
- class: normalizeClass(unref(ns).e("menu-wrapper")),
59
- height: "100%"
60
- }, {
61
- default: withCtx(() => [
62
- renderSlot(_ctx.$slots, "left-panel", {}, () => [
63
- createVNode(unref(BwaMenu), {
64
- class: normalizeClass(unref(ns).e("menu")),
65
- menus: unref(menus),
66
- currentMenuID: unref(currentMenuID),
67
- collapsed: unref(isCollapsed),
68
- onSelect: handleSelect
69
- }, null, 8, ["class", "menus", "currentMenuID", "collapsed"])
70
- ]),
71
- renderSlot(_ctx.$slots, "left-panel-append")
72
- ]),
73
- _: 3
74
- }, 8, ["class"]),
75
- createElementVNode("div", {
76
- class: normalizeClass(unref(ns).e("main"))
77
- }, [
78
- renderSlot(_ctx.$slots, "default")
79
- ], 2)
80
- ], 2);
81
- };
82
- }
83
- });
84
- var Layout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "layout.vue"]]);
10
+
11
+ defineOptions({
12
+ name: 'BwaLayout',
13
+ });
14
+
15
+ const router = useRouter();
16
+
17
+ const ns = useNamespace('layout');
18
+
19
+ const menuService = useService('MenuService');
20
+
21
+ const isCollapsed = computed(() => unref(menuService)?.isCollapsed ?? false);
22
+
23
+ const menus = computed(() => unref(menuService)?.getMenus() ?? []);
24
+ const currentMenuID = computed(
25
+ () => unref(menuService)?.getCurrentMenu()?.id ?? ''
26
+ );
27
+
28
+ const handleSelect = (menu) => {
29
+ if (!menu) {
30
+ return;
31
+ }
32
+
33
+ switch (menu?.type) {
34
+ case 0:
35
+ unref(menuService).setCurrentMenuById(menu.id);
36
+ router.push(menu.path);
37
+ break;
38
+ case 1:
39
+ let openLink = '';
40
+
41
+ if (
42
+ path.toLowerCase().indexOf('https://') == 0 ||
43
+ path.toLowerCase().indexOf('http://') == 0
44
+ ) {
45
+ openLink = path;
46
+ } else if (path.startsWith('//')) {
47
+ openLink = location.protocol + path;
48
+ } else {
49
+ openLink = path;
50
+ }
51
+
52
+ window.open(openLink);
53
+ break;
54
+ }
55
+ };
56
+
57
+ return (_ctx, _cache) => {
58
+ const _component_ElScrollbar = resolveComponent("ElScrollbar");
59
+
60
+ return (openBlock(), createElementBlock("div", {
61
+ class: normalizeClass([unref(ns).b(), 'justify-between'])
62
+ }, [
63
+ createVNode(_component_ElScrollbar, {
64
+ class: normalizeClass(unref(ns).e('menu-wrapper')),
65
+ height: "100%"
66
+ }, {
67
+ default: withCtx(() => [
68
+ renderSlot(_ctx.$slots, "left-panel", {}, () => [
69
+ createVNode(unref(BwaMenu), {
70
+ class: normalizeClass(unref(ns).e('menu')),
71
+ menus: unref(menus),
72
+ currentMenuID: unref(currentMenuID),
73
+ collapsed: unref(isCollapsed),
74
+ onSelect: handleSelect
75
+ }, null, 8 /* PROPS */, ["class", "menus", "currentMenuID", "collapsed"])
76
+ ]),
77
+ renderSlot(_ctx.$slots, "left-panel-append")
78
+ ]),
79
+ _: 3 /* FORWARDED */
80
+ }, 8 /* PROPS */, ["class"]),
81
+ createElementVNode("div", {
82
+ class: normalizeClass(unref(ns).e('main'))
83
+ }, [
84
+ renderSlot(_ctx.$slots, "default")
85
+ ], 2 /* CLASS */)
86
+ ], 2 /* CLASS */))
87
+ }
88
+ }
89
+
90
+ };
91
+ var Layout = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"layout.vue"]]);
85
92
 
86
93
  export { Layout as default };
@@ -1,75 +1,90 @@
1
- import { defineComponent, computed, resolveComponent, unref, openBlock, createBlock, withCtx, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString, Fragment, renderList } from 'vue';
1
+ import { computed, resolveComponent, unref, openBlock, createBlock, withCtx, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString, Fragment, renderList } from 'vue';
2
2
  import { useNamespace } from '@ctzy-web-client/web-base-client-vue';
3
3
  import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
4
4
 
5
- const __default__ = defineComponent({
6
- name: "BwaMenuItem"
7
- });
8
- const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
9
- props: {
10
- item: {
11
- type: Object,
12
- required: true
13
- }
14
- },
5
+ const _sfc_main = {
6
+ __name: 'menu-item',
7
+ props: {
8
+ item: {
9
+ type: Object,
10
+ required: true,
11
+ },
12
+ },
15
13
  setup(__props) {
16
- const props = __props;
17
- const ns = useNamespace("menu");
18
- const id = computed(() => {
19
- if (typeof props.id !== "number" && !props.item.id) {
20
- return "";
21
- }
22
- return props.item.id + "";
23
- });
24
- const children = computed(() => {
25
- var _a;
26
- return ((_a = props.item) == null ? void 0 : _a.children) || [];
27
- });
28
- return (_ctx, _cache) => {
29
- const _component_ElMenuItem = resolveComponent("ElMenuItem");
30
- const _component_BwaMenuItem = resolveComponent("BwaMenuItem");
31
- const _component_ElSubMenu = resolveComponent("ElSubMenu");
32
- return !unref(children).length ? (openBlock(), createBlock(_component_ElMenuItem, {
14
+
15
+ const props = __props;
16
+
17
+ defineOptions({
18
+ name: 'BwaMenuItem',
19
+ });
20
+
21
+ const ns = useNamespace('menu');
22
+
23
+
24
+
25
+ const id = computed(() => {
26
+ if (typeof props.id !== 'number' && !props.item.id) {
27
+ return '';
28
+ }
29
+
30
+ return props.item.id + '';
31
+ });
32
+
33
+ const children = computed(() => props.item?.children || []);
34
+
35
+ return (_ctx, _cache) => {
36
+ const _component_ElMenuItem = resolveComponent("ElMenuItem");
37
+ const _component_BwaMenuItem = resolveComponent("BwaMenuItem");
38
+ const _component_ElSubMenu = resolveComponent("ElSubMenu");
39
+
40
+ return (!unref(children).length)
41
+ ? (openBlock(), createBlock(_component_ElMenuItem, {
33
42
  key: 0,
34
43
  index: unref(id)
35
44
  }, {
36
45
  default: withCtx(() => [
37
- __props.item.iconName ? (openBlock(), createElementBlock("i", {
38
- key: 0,
39
- class: normalizeClass(["ptp-icon", `ptp-${__props.item.iconName}`])
40
- }, null, 2)) : createCommentVNode("v-if", true),
46
+ (__props.item.iconName)
47
+ ? (openBlock(), createElementBlock("i", {
48
+ key: 0,
49
+ class: normalizeClass(['ptp-icon', `ptp-${__props.item.iconName}`])
50
+ }, null, 2 /* CLASS */))
51
+ : createCommentVNode("v-if", true),
41
52
  createElementVNode("span", {
42
- class: normalizeClass(unref(ns).be("item", "content"))
43
- }, toDisplayString(__props.item.title), 3)
53
+ class: normalizeClass(unref(ns).be('item', 'content'))
54
+ }, toDisplayString(__props.item.title), 3 /* TEXT, CLASS */)
44
55
  ]),
45
- _: 1
46
- }, 8, ["index"])) : (openBlock(), createBlock(_component_ElSubMenu, {
56
+ _: 1 /* STABLE */
57
+ }, 8 /* PROPS */, ["index"]))
58
+ : (openBlock(), createBlock(_component_ElSubMenu, {
47
59
  key: 1,
48
60
  index: unref(id),
49
- "popper-class": unref(ns).b("sub")
61
+ "popper-class": unref(ns).b('sub')
50
62
  }, {
51
63
  title: withCtx(() => [
52
- __props.item.iconName ? (openBlock(), createElementBlock("i", {
53
- key: 0,
54
- class: normalizeClass(["ptp-icon", `ptp-${__props.item.iconName}`])
55
- }, null, 2)) : createCommentVNode("v-if", true),
64
+ (__props.item.iconName)
65
+ ? (openBlock(), createElementBlock("i", {
66
+ key: 0,
67
+ class: normalizeClass(['ptp-icon', `ptp-${__props.item.iconName}`])
68
+ }, null, 2 /* CLASS */))
69
+ : createCommentVNode("v-if", true),
56
70
  createElementVNode("span", {
57
- class: normalizeClass(unref(ns).be("item", "content"))
58
- }, toDisplayString(__props.item.title), 3)
71
+ class: normalizeClass(unref(ns).be('item', 'content'))
72
+ }, toDisplayString(__props.item.title), 3 /* TEXT, CLASS */)
59
73
  ]),
60
74
  default: withCtx(() => [
61
75
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(children), (child) => {
62
- return openBlock(), createBlock(_component_BwaMenuItem, {
76
+ return (openBlock(), createBlock(_component_BwaMenuItem, {
63
77
  item: child,
64
78
  key: child.id
65
- }, null, 8, ["item"]);
66
- }), 128))
79
+ }, null, 8 /* PROPS */, ["item"]))
80
+ }), 128 /* KEYED_FRAGMENT */))
67
81
  ]),
68
- _: 1
69
- }, 8, ["index", "popper-class"]));
70
- };
71
- }
72
- });
73
- var MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "menu-item.vue"]]);
82
+ _: 1 /* STABLE */
83
+ }, 8 /* PROPS */, ["index", "popper-class"]))
84
+ }
85
+ }
86
+
87
+ };
88
+ var MenuItem = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"menu-item.vue"]]);
74
89
 
75
90
  export { MenuItem as default };