@ctzy-web-client/plugin-component-vue 1.0.26 → 1.0.27

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 (228) hide show
  1. package/es/_virtual/_plugin-vue_export-helper.mjs +11 -0
  2. package/es/advance-select/advance-operation.mjs +48 -51
  3. package/es/advance-select/advance-option.mjs +128 -163
  4. package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs +11 -5
  5. package/es/advance-select/advance-select.mjs +323 -370
  6. package/es/advance-select/events-helpers.mjs +9 -0
  7. package/es/advance-select/index.mjs +9 -0
  8. package/es/advance-select/use-advance-option.mjs +9 -0
  9. package/es/advance-select/use-advance-select.mjs +9 -0
  10. package/es/application-slot/application-slot.mjs +9 -0
  11. package/es/application-slot/breadcrumb-item.mjs +26 -20
  12. package/es/application-slot/header-tools-item.mjs +26 -20
  13. package/es/application-slot/index.mjs +9 -0
  14. package/es/breadcrumb-select/breadcrumb-select.mjs +123 -137
  15. package/es/breadcrumb-select/index.mjs +9 -0
  16. package/es/components.mjs +9 -0
  17. package/es/contextmenu/contextmenu-item.mjs +24 -19
  18. package/es/contextmenu/contextmenu.mjs +68 -73
  19. package/es/contextmenu/index.mjs +9 -0
  20. package/es/contextmenu/use-contextmenu.mjs +10 -1
  21. package/es/data-form/data-form-item.mjs +41 -49
  22. package/es/data-form/data-form.mjs +176 -213
  23. package/es/data-form/dynamic-component.mjs +9 -0
  24. package/es/data-form/form-components/Blots/AtBlot.mjs +9 -0
  25. package/es/data-form/form-components/bwa-date-picker.mjs +50 -51
  26. package/es/data-form/form-components/bwa-date-time-picker.mjs +55 -56
  27. package/es/data-form/form-components/bwa-input-float.mjs +48 -48
  28. package/es/data-form/form-components/bwa-input-integer.mjs +61 -68
  29. package/es/data-form/form-components/bwa-input.mjs +43 -43
  30. package/es/data-form/form-components/bwa-multi-select.mjs +40 -40
  31. package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +230 -555
  32. package/es/data-form/form-components/bwa-rich-text.mjs +326 -404
  33. package/es/data-form/form-components/bwa-select.mjs +81 -84
  34. package/es/data-form/form-components/bwa-textarea.mjs +38 -38
  35. package/es/data-form/form-components/bwa-upload.mjs +160 -173
  36. package/es/data-form/form-components/bwa-user-multi-select.mjs +35 -35
  37. package/es/data-form/form-components/bwa-user-select.mjs +72 -86
  38. package/es/data-form/index.mjs +9 -0
  39. package/es/data-table/data-column-view.mjs +124 -146
  40. package/es/data-table/data-table-card.mjs +49 -48
  41. package/es/data-table/data-table-column.mjs +55 -58
  42. package/es/data-table/data-table.mjs +328 -404
  43. package/es/data-table/dynamic-component.mjs +9 -0
  44. package/es/data-table/index.mjs +9 -0
  45. package/es/data-table/use-datatable-drag.mjs +9 -0
  46. package/es/datatable-settings/datatable-settings.mjs +286 -328
  47. package/es/datatable-settings/index.mjs +9 -0
  48. package/es/date-range/date-picker.mjs +125 -131
  49. package/es/date-range/date-range.mjs +173 -216
  50. package/es/date-range/index.mjs +9 -0
  51. package/es/drag-list/constants.mjs +10 -0
  52. package/es/drag-list/drag-item.mjs +51 -56
  53. package/es/drag-list/drag-list.mjs +58 -60
  54. package/es/drag-list/index.mjs +9 -0
  55. package/es/drag-list/use-drag-list.mjs +10 -1
  56. package/es/dragable/constants.mjs +10 -0
  57. package/es/dragable/dragable-item.mjs +27 -23
  58. package/es/dragable/dragable-operation.mjs +33 -32
  59. package/es/dragable/dragable.mjs +33 -32
  60. package/es/dragable/index.mjs +9 -0
  61. package/es/dragable/use-dragable.mjs +9 -0
  62. package/es/filter-panel/conditions/condition.mjs +9 -0
  63. package/es/filter-panel/conditions/date-range-condition.mjs +51 -50
  64. package/es/filter-panel/conditions/department-condition/department-condition.mjs +82 -99
  65. package/es/filter-panel/conditions/department-condition/department-node.mjs +69 -73
  66. package/es/filter-panel/conditions/index.mjs +9 -0
  67. package/es/filter-panel/conditions/input-condition.mjs +88 -91
  68. package/es/filter-panel/conditions/multi-user-condition.mjs +66 -67
  69. package/es/filter-panel/conditions/multiple-menu-condition.mjs +44 -54
  70. package/es/filter-panel/conditions/single-menu-condition.mjs +71 -65
  71. package/es/filter-panel/conditions/single-user-condition.mjs +66 -67
  72. package/es/filter-panel/filter-panel-item.mjs +51 -55
  73. package/es/filter-panel/filter-panel.mjs +147 -156
  74. package/es/filter-panel/index.mjs +9 -0
  75. package/es/filter-panel/use-filter-panel-item.mjs +9 -0
  76. package/es/filter-panel/use-filter-panel.mjs +9 -0
  77. package/es/hooks/use-data/index.mjs +9 -0
  78. package/es/index.mjs +9 -0
  79. package/es/layout/index.mjs +9 -0
  80. package/es/layout/layout.mjs +87 -85
  81. package/es/make-installer.mjs +9 -0
  82. package/es/math/Rectangle.mjs +10 -0
  83. package/es/menu/index.mjs +9 -0
  84. package/es/menu/menu-item.mjs +65 -70
  85. package/es/menu/menu.mjs +64 -70
  86. package/es/node_modules/.pnpm/{@vueuse_core@9.6.0_vue@3.2.41 → @vueuse_core@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/core/index.mjs +680 -454
  87. package/es/node_modules/.pnpm/{@vueuse_shared@9.6.0_vue@3.2.41 → @vueuse_shared@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/shared/index.mjs +108 -46
  88. package/es/panel/index.mjs +9 -0
  89. package/es/panel/panel.mjs +49 -53
  90. package/es/panel-tabs/index.mjs +9 -0
  91. package/es/panel-tabs/panel-tabs.mjs +9 -0
  92. package/es/pct-filter-panel/index.mjs +9 -0
  93. package/es/pct-filter-panel/pct-compents/index.mjs +9 -0
  94. package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +73 -75
  95. package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +77 -77
  96. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +345 -374
  97. package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +149 -154
  98. package/es/pct-filter-panel/pct-filter-panel-item.mjs +52 -56
  99. package/es/pct-filter-panel/pct-filter-panel.mjs +235 -248
  100. package/es/pct-filter-panel/use-filter-panel-item.mjs +9 -0
  101. package/es/pct-filter-panel/use-filter-panel.mjs +9 -0
  102. package/es/plugins.mjs +9 -0
  103. package/es/progress/index.mjs +9 -0
  104. package/es/progress/progress-item.mjs +71 -81
  105. package/es/progress/progress.mjs +74 -78
  106. package/es/progress/use-progress.mjs +9 -0
  107. package/es/utils/db.mjs +9 -0
  108. package/es/utils.css +1 -0
  109. package/es/utils.mjs +9 -0
  110. package/es/where-filter-panel/index.mjs +9 -1
  111. package/es/where-filter-panel/use-where-filter-panel.mjs +9 -0
  112. package/es/where-filter-panel/where-filter-panel.mjs +21 -15
  113. package/lib/_virtual/_plugin-vue_export-helper.js +11 -0
  114. package/lib/advance-select/advance-operation.js +47 -50
  115. package/lib/advance-select/advance-option.js +127 -162
  116. package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.js +11 -6
  117. package/lib/advance-select/advance-select.js +322 -369
  118. package/lib/advance-select/events-helpers.js +9 -0
  119. package/lib/advance-select/index.js +9 -0
  120. package/lib/advance-select/use-advance-option.js +9 -0
  121. package/lib/advance-select/use-advance-select.js +9 -0
  122. package/lib/application-slot/application-slot.js +9 -0
  123. package/lib/application-slot/breadcrumb-item.js +25 -19
  124. package/lib/application-slot/header-tools-item.js +25 -19
  125. package/lib/application-slot/index.js +9 -0
  126. package/lib/breadcrumb-select/breadcrumb-select.js +122 -136
  127. package/lib/breadcrumb-select/index.js +9 -0
  128. package/lib/components.js +9 -0
  129. package/lib/contextmenu/contextmenu-item.js +23 -18
  130. package/lib/contextmenu/contextmenu.js +67 -72
  131. package/lib/contextmenu/index.js +9 -0
  132. package/lib/contextmenu/use-contextmenu.js +10 -1
  133. package/lib/data-form/data-form-item.js +40 -48
  134. package/lib/data-form/data-form.js +175 -212
  135. package/lib/data-form/dynamic-component.js +9 -0
  136. package/lib/data-form/form-components/Blots/AtBlot.js +9 -0
  137. package/lib/data-form/form-components/bwa-date-picker.js +49 -50
  138. package/lib/data-form/form-components/bwa-date-time-picker.js +54 -55
  139. package/lib/data-form/form-components/bwa-input-float.js +47 -47
  140. package/lib/data-form/form-components/bwa-input-integer.js +60 -67
  141. package/lib/data-form/form-components/bwa-input.js +42 -42
  142. package/lib/data-form/form-components/bwa-multi-select.js +39 -39
  143. package/lib/data-form/form-components/bwa-rich-text-tinymce.js +229 -554
  144. package/lib/data-form/form-components/bwa-rich-text.js +325 -403
  145. package/lib/data-form/form-components/bwa-select.js +80 -83
  146. package/lib/data-form/form-components/bwa-textarea.js +37 -37
  147. package/lib/data-form/form-components/bwa-upload.js +159 -172
  148. package/lib/data-form/form-components/bwa-user-multi-select.js +34 -34
  149. package/lib/data-form/form-components/bwa-user-select.js +71 -85
  150. package/lib/data-form/index.js +9 -0
  151. package/lib/data-table/data-column-view.js +124 -146
  152. package/lib/data-table/data-table-card.js +49 -48
  153. package/lib/data-table/data-table-column.js +54 -57
  154. package/lib/data-table/data-table.js +327 -403
  155. package/lib/data-table/dynamic-component.js +9 -0
  156. package/lib/data-table/index.js +9 -0
  157. package/lib/data-table/use-datatable-drag.js +9 -0
  158. package/lib/datatable-settings/datatable-settings.js +285 -327
  159. package/lib/datatable-settings/index.js +9 -0
  160. package/lib/date-range/date-picker.js +124 -130
  161. package/lib/date-range/date-range.js +172 -215
  162. package/lib/date-range/index.js +9 -0
  163. package/lib/drag-list/constants.js +10 -0
  164. package/lib/drag-list/drag-item.js +50 -55
  165. package/lib/drag-list/drag-list.js +57 -59
  166. package/lib/drag-list/index.js +9 -0
  167. package/lib/drag-list/use-drag-list.js +10 -1
  168. package/lib/dragable/constants.js +10 -0
  169. package/lib/dragable/dragable-item.js +26 -22
  170. package/lib/dragable/dragable-operation.js +32 -31
  171. package/lib/dragable/dragable.js +32 -31
  172. package/lib/dragable/index.js +9 -0
  173. package/lib/dragable/use-dragable.js +9 -0
  174. package/lib/filter-panel/conditions/condition.js +9 -0
  175. package/lib/filter-panel/conditions/date-range-condition.js +50 -49
  176. package/lib/filter-panel/conditions/department-condition/department-condition.js +81 -98
  177. package/lib/filter-panel/conditions/department-condition/department-node.js +68 -72
  178. package/lib/filter-panel/conditions/index.js +9 -0
  179. package/lib/filter-panel/conditions/input-condition.js +87 -90
  180. package/lib/filter-panel/conditions/multi-user-condition.js +65 -66
  181. package/lib/filter-panel/conditions/multiple-menu-condition.js +43 -53
  182. package/lib/filter-panel/conditions/single-menu-condition.js +70 -64
  183. package/lib/filter-panel/conditions/single-user-condition.js +65 -66
  184. package/lib/filter-panel/filter-panel-item.js +50 -54
  185. package/lib/filter-panel/filter-panel.js +146 -155
  186. package/lib/filter-panel/index.js +9 -0
  187. package/lib/filter-panel/use-filter-panel-item.js +9 -0
  188. package/lib/filter-panel/use-filter-panel.js +9 -0
  189. package/lib/hooks/use-data/index.js +9 -0
  190. package/lib/index.js +9 -0
  191. package/lib/layout/index.js +9 -0
  192. package/lib/layout/layout.js +86 -84
  193. package/lib/make-installer.js +9 -0
  194. package/lib/math/Rectangle.js +10 -0
  195. package/lib/menu/index.js +9 -0
  196. package/lib/menu/menu-item.js +64 -69
  197. package/lib/menu/menu.js +63 -69
  198. package/lib/node_modules/.pnpm/{@vueuse_core@9.6.0_vue@3.2.41 → @vueuse_core@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/core/index.js +685 -451
  199. package/lib/node_modules/.pnpm/{@vueuse_shared@9.6.0_vue@3.2.41 → @vueuse_shared@9.13.0_vue@3.5.29_typescript@4.9.5_}/node_modules/@vueuse/shared/index.js +109 -44
  200. package/lib/panel/index.js +9 -0
  201. package/lib/panel/panel.js +48 -52
  202. package/lib/panel-tabs/index.js +9 -0
  203. package/lib/panel-tabs/panel-tabs.js +9 -0
  204. package/lib/pct-filter-panel/index.js +9 -0
  205. package/lib/pct-filter-panel/pct-compents/index.js +9 -0
  206. package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +72 -74
  207. package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +76 -76
  208. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +344 -373
  209. package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +148 -153
  210. package/lib/pct-filter-panel/pct-filter-panel-item.js +51 -55
  211. package/lib/pct-filter-panel/pct-filter-panel.js +234 -247
  212. package/lib/pct-filter-panel/use-filter-panel-item.js +9 -0
  213. package/lib/pct-filter-panel/use-filter-panel.js +9 -0
  214. package/lib/plugins.js +9 -0
  215. package/lib/progress/index.js +9 -0
  216. package/lib/progress/progress-item.js +70 -80
  217. package/lib/progress/progress.js +73 -77
  218. package/lib/progress/use-progress.js +9 -0
  219. package/lib/utils/db.js +9 -0
  220. package/lib/utils.css +1 -0
  221. package/lib/utils.js +9 -0
  222. package/lib/where-filter-panel/index.js +9 -0
  223. package/lib/where-filter-panel/use-where-filter-panel.js +9 -0
  224. package/lib/where-filter-panel/where-filter-panel.js +20 -14
  225. package/package.json +1 -1
  226. package/style/index.css +1 -1
  227. package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +0 -28
  228. package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +0 -32
@@ -1,4 +1,4 @@
1
- import { ref, onMounted, nextTick, useAttrs, computed, inject, unref, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createVNode, isRef, withCtx, createTextVNode, createElementVNode, Fragment, renderList, createBlock, withModifiers, renderSlot } from 'vue';
1
+ import { defineComponent, ref, onMounted, nextTick, useAttrs, computed, inject, unref, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createVNode, withCtx, createTextVNode, createElementVNode, Fragment, renderList, createBlock, withModifiers, renderSlot } from 'vue';
2
2
  import { ElTooltip, ElTag, ElIcon, ElInput } from 'element-plus';
3
3
  import { ArrowUp, ArrowDown } from '@element-plus/icons';
4
4
  import { useService, HttpRequest, useNamespace, filterPanelItemKey } from '@ctzy-web-client/web-base-client-vue';
@@ -7,332 +7,307 @@ import BwaAdvanceSelect from '../../advance-select/advance-select.mjs';
7
7
  import BwaAdvanceOption from '../../advance-select/advance-option.mjs';
8
8
  import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
9
9
 
10
+ // Inject __name helper
11
+ if (typeof __name === 'undefined') {
12
+ function __name(obj, name) {
13
+ Object.defineProperty(obj, "name", {
14
+ value: name,
15
+ configurable: true
16
+ });
17
+ }
18
+ }
10
19
  const _hoisted_1 = { key: 0 };
11
-
12
-
13
- const _sfc_main = {
14
- __name: 'pct-multiple-menu-condition',
15
- props: {
16
- ...dataProps,
17
- modelValue: {
18
- type: null,
19
- },
20
- options: {
21
- type: Array,
22
- default: () => [],
23
- },
24
- labelProp: {
25
- type: String,
26
- default: 'label',
27
- },
28
- valueProp: {
29
- type: String,
30
- default: 'value',
31
- },
32
- multiple: {
33
- type: Boolean,
34
- default: true,
35
- },
36
- showSearch: {
37
- type: Boolean,
38
- default: true,
39
- },
40
- placeholder: {
41
- type: String,
42
- default: '请选择',
43
- },
44
- remote: {
45
- type: Boolean,
46
- default: true,
47
- },
48
- size: {
49
- type: String,
50
- default: 'small',
51
- },
52
- searchPlaceholder: {
53
- type: String,
54
- default: '',
55
- },
56
- labelAttr: '',
57
- valueAttr: '',
58
- searchAttr: '',
59
- itfInfo: null,
60
- // 自定义选项时 是否通过展开自动触发自定义search
61
- isRequiredByVisibleChange: {
62
- type: Boolean,
63
- default: false,
64
- },
65
- },
66
- emits: ['update:modelValue', 'search'],
67
- setup(__props, { expose, emit }) {
68
-
69
- const props = __props;
70
-
71
- const httpRequest = useService(HttpRequest);
72
- defineOptions({
73
- name: 'BwaPctMultipleMenuCondition',
74
- __conditionTitle__: '多选列表',
75
- __conditionDefault__: () => [],
76
- });
77
-
78
-
79
- const popperWidth = ref('240px');
80
- onMounted(() => {
81
- nextTick(() => {
82
- const offsetWidth = document.getElementsByClassName('bwa-pctfilterpanel-item__options')[0]?.offsetWidth;
83
- if (offsetWidth > 0) {
84
- popperWidth.value = offsetWidth + 'px';
85
- }
86
- });
87
- });
88
- const ns = useNamespace('pctfilterpanel-item');
89
- const isShowPopper = ref(false);
90
- const isHoverIcon = ref(false);
91
-
92
- const attrs = useAttrs();
93
- const showTitle = computed(() => attrs.showTitle);
94
-
95
- const data = ref([]);
96
- const loading = ref(false);
97
-
98
-
99
- const filterPanelItem = inject(filterPanelItemKey, null);
100
- const column = computed(() => filterPanelItem?.column ?? null);
101
-
102
- /**
103
- * 页面参数层级覆盖配置文件传递的参数层级
104
- */
105
- if (props.itfInfo) {
106
- column.value.componentProps = {
107
- itfInfo: props.itfInfo || {},
108
- labelAttr: props.labelAttr || 'label',
109
- valueAttr: props.valueAttr || 'value',
110
- searchAttr: props.searchAttr || 'search'
111
- };
112
- }
113
-
114
- const searchPlaceholderStr = computed(() => column.value?.componentProps?.searchPlaceholder || props.searchPlaceholder);
115
- const placeholderStr = computed(() => showTitle.value ? props.placeholder : column.value.title);
116
-
117
- const labelPropStr = computed(() => column.value?.componentProps?.labelAttr || props.labelProp);
118
- const valuePropStr = computed(() => column.value?.componentProps?.valueAttr || props.valueProp);
119
- const handleClose = (val)=>{
120
-
121
- // 优化后
122
- // 1. 空值兜底:避免 modelValue.value 为 null/undefined 时报错
123
- const currentModelValue = Array.isArray(modelValue.value) ? modelValue.value : [];
124
- // 2. 严格相等 + 类型统一:解决 1 vs "1" 不匹配,同时避免隐式类型转换
125
- modelValue.value = currentModelValue.filter(item =>
126
- String(item) !== String(val.value)
127
- );
128
-
129
- };
130
- const handleIconClick = () => {
131
- if (isHoverIcon.value) {
132
- // 多选清空逻辑:重置 modelValue 为空数组
133
- modelValue.value = [];
134
- isHoverIcon.value = false; // 重置悬浮状态
135
- return;
136
- }
137
- // 原有逻辑:切换下拉显隐
138
- isShowPopper.value = !isShowPopper.value;
139
- };
140
- const getData = async (query) => {
141
- loading.value = true;
142
- const { itfInfo, searchAttr } = column.value.componentProps;
143
- const {url, method, options, params } = {
144
- url: unref(itfInfo).url,
145
- method: unref(itfInfo).method || 'POST',
146
- options: unref(itfInfo).options || {},
147
- params: { ...unref(itfInfo).params, [searchAttr]: query || ''} || {},
148
- };
149
- data.value = (await unref(httpRequest)[method.toLowerCase()](url, params, options))?.data;
150
- loading.value = false;
151
- };
152
-
153
- data.value = props.options ?? [];
154
- const visibleChange = (val) => {
155
- isShowPopper.value = val;
156
- if (!val || !column.value.componentProps || column.value?.componentProps?.options) {
157
- if (isShowPopper.value && props.isRequiredByVisibleChange) {
158
- emit('search', '');
159
- }
160
- return
161
- }
162
- getData();
163
- };
164
-
165
- const handleFieldSearch = (query) => {
166
- if (column.value.componentProps) {
167
- getData(query);
168
- } else {
169
- emit('search', query);
170
- }
171
- };
172
-
173
- const search = ref('');
174
- watch(() => search.value, val => {
175
- handleFieldSearch(val);
176
- });
177
-
178
- const modelValue = computed({
179
- get: () => {
180
- if (props.multiple) {
181
- return Array.isArray(props.modelValue)
182
- ? props.modelValue.map((item) => item )
183
- : [];
184
- } else {
185
- return props.modelValue == null || Array.isArray(props.modelValue) ? '' : props.modelValue;
186
- }
187
- },
188
- set: (v) => emit('update:modelValue', v),
189
- });
190
-
191
- /**
192
- * 清除已选
193
- */
194
- const advanceSelectRef = ref(null);
195
- const handleClearClick = () => {
196
- if (advanceSelectRef.value) {
197
- advanceSelectRef.value.handleClearClick();
198
- }
199
- };
200
-
201
- expose({
202
- data
203
- });
204
-
205
- return (_ctx, _cache) => {
206
- const _component_CircleClose = resolveComponent("CircleClose");
207
-
208
- return (openBlock(), createElementBlock("div", {
209
- class: normalizeClass(unref(ns).e('conditbox'))
210
- }, [
211
- (unref(showTitle))
212
- ? (openBlock(), createElementBlock("div", {
20
+ const __default__ = defineComponent({
21
+ name: "BwaPctMultipleMenuCondition",
22
+ __conditionTitle__: "\u591A\u9009\u5217\u8868",
23
+ __conditionDefault__: () => []
24
+ });
25
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
26
+ props: {
27
+ ...dataProps,
28
+ modelValue: {
29
+ type: null
30
+ },
31
+ options: {
32
+ type: Array,
33
+ default: () => []
34
+ },
35
+ labelProp: {
36
+ type: String,
37
+ default: "label"
38
+ },
39
+ valueProp: {
40
+ type: String,
41
+ default: "value"
42
+ },
43
+ multiple: {
44
+ type: Boolean,
45
+ default: true
46
+ },
47
+ showSearch: {
48
+ type: Boolean,
49
+ default: true
50
+ },
51
+ placeholder: {
52
+ type: String,
53
+ default: "\u8BF7\u9009\u62E9"
54
+ },
55
+ remote: {
56
+ type: Boolean,
57
+ default: true
58
+ },
59
+ size: {
60
+ type: String,
61
+ default: "small"
62
+ },
63
+ searchPlaceholder: {
64
+ type: String,
65
+ default: ""
66
+ },
67
+ labelAttr: "",
68
+ valueAttr: "",
69
+ searchAttr: "",
70
+ itfInfo: null,
71
+ isRequiredByVisibleChange: {
72
+ type: Boolean,
73
+ default: false
74
+ }
75
+ },
76
+ emits: ["update:modelValue", "search"],
77
+ setup(__props, { expose: __expose, emit: __emit }) {
78
+ var _a;
79
+ const httpRequest = useService(HttpRequest);
80
+ ;
81
+ const props = __props;
82
+ const popperWidth = ref("240px");
83
+ onMounted(() => {
84
+ nextTick(() => {
85
+ var _a2;
86
+ const offsetWidth = (_a2 = document.getElementsByClassName("bwa-pctfilterpanel-item__options")[0]) == null ? void 0 : _a2.offsetWidth;
87
+ if (offsetWidth > 0) {
88
+ popperWidth.value = offsetWidth + "px";
89
+ }
90
+ });
91
+ });
92
+ const ns = useNamespace("pctfilterpanel-item");
93
+ const isShowPopper = ref(false);
94
+ const isHoverIcon = ref(false);
95
+ const attrs = useAttrs();
96
+ const showTitle = computed(() => attrs.showTitle);
97
+ const data = ref([]);
98
+ const loading = ref(false);
99
+ const emit = __emit;
100
+ const filterPanelItem = inject(filterPanelItemKey, null);
101
+ const column = computed(() => {
102
+ var _a2;
103
+ return (_a2 = filterPanelItem == null ? void 0 : filterPanelItem.column) != null ? _a2 : null;
104
+ });
105
+ if (props.itfInfo) {
106
+ column.value.componentProps = {
107
+ itfInfo: props.itfInfo || {},
108
+ labelAttr: props.labelAttr || "label",
109
+ valueAttr: props.valueAttr || "value",
110
+ searchAttr: props.searchAttr || "search"
111
+ };
112
+ }
113
+ const searchPlaceholderStr = computed(() => {
114
+ var _a2, _b;
115
+ return ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.searchPlaceholder) || props.searchPlaceholder;
116
+ });
117
+ const placeholderStr = computed(() => showTitle.value ? props.placeholder : column.value.title);
118
+ const labelPropStr = computed(() => {
119
+ var _a2, _b;
120
+ return ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.labelAttr) || props.labelProp;
121
+ });
122
+ const valuePropStr = computed(() => {
123
+ var _a2, _b;
124
+ return ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.valueAttr) || props.valueProp;
125
+ });
126
+ const handleClose = (val) => {
127
+ const currentModelValue = Array.isArray(modelValue.value) ? modelValue.value : [];
128
+ modelValue.value = currentModelValue.filter(
129
+ (item) => String(item) !== String(val.value)
130
+ );
131
+ };
132
+ const handleIconClick = () => {
133
+ if (isHoverIcon.value) {
134
+ modelValue.value = [];
135
+ isHoverIcon.value = false;
136
+ return;
137
+ }
138
+ isShowPopper.value = !isShowPopper.value;
139
+ };
140
+ const getData = async (query) => {
141
+ var _a2;
142
+ loading.value = true;
143
+ const { itfInfo, searchAttr } = column.value.componentProps;
144
+ const { url, method, options, params } = {
145
+ url: unref(itfInfo).url,
146
+ method: unref(itfInfo).method || "POST",
147
+ options: unref(itfInfo).options || {},
148
+ params: { ...unref(itfInfo).params, [searchAttr]: query || "" }
149
+ };
150
+ data.value = (_a2 = await unref(httpRequest)[method.toLowerCase()](url, params, options)) == null ? void 0 : _a2.data;
151
+ loading.value = false;
152
+ };
153
+ data.value = (_a = props.options) != null ? _a : [];
154
+ const visibleChange = (val) => {
155
+ var _a2, _b;
156
+ isShowPopper.value = val;
157
+ if (!val || !column.value.componentProps || ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.options)) {
158
+ if (isShowPopper.value && props.isRequiredByVisibleChange) {
159
+ emit("search", "");
160
+ }
161
+ return;
162
+ }
163
+ getData();
164
+ };
165
+ const handleFieldSearch = (query) => {
166
+ if (column.value.componentProps) {
167
+ getData(query);
168
+ } else {
169
+ emit("search", query);
170
+ }
171
+ };
172
+ const search = ref("");
173
+ watch(() => search.value, (val) => {
174
+ handleFieldSearch(val);
175
+ });
176
+ const modelValue = computed({
177
+ get: () => {
178
+ if (props.multiple) {
179
+ return Array.isArray(props.modelValue) ? props.modelValue.map((item) => item) : [];
180
+ } else {
181
+ return props.modelValue == null || Array.isArray(props.modelValue) ? "" : props.modelValue;
182
+ }
183
+ },
184
+ set: (v) => emit("update:modelValue", v)
185
+ });
186
+ const advanceSelectRef = ref(null);
187
+ const handleClearClick = () => {
188
+ if (advanceSelectRef.value) {
189
+ advanceSelectRef.value.handleClearClick();
190
+ }
191
+ };
192
+ __expose({
193
+ data
194
+ });
195
+ return (_ctx, _cache) => {
196
+ const _component_CircleClose = resolveComponent("CircleClose");
197
+ return openBlock(), createElementBlock("div", {
198
+ class: normalizeClass(unref(ns).e("conditbox"))
199
+ }, [
200
+ showTitle.value ? (openBlock(), createElementBlock("div", {
213
201
  key: 0,
214
- class: normalizeClass(unref(ns).e('title'))
215
- }, toDisplayString(unref(column).title), 3 /* TEXT, CLASS */))
216
- : createCommentVNode("v-if", true),
217
- createVNode(BwaAdvanceSelect, {
218
- multiple: __props.multiple,
219
- modelValue: unref(modelValue),
220
- "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (isRef(modelValue) ? (modelValue).value = $event : null)),
221
- onSearch: handleFieldSearch,
222
- class: normalizeClass(unref(ns).e('options')),
223
- onVisibleChange: visibleChange,
224
- source: "pct",
225
- showSearch: false,
226
- showSelectIcon: !__props.multiple,
227
- showSelection: false,
228
- loading: loading.value,
229
- width: popperWidth.value,
230
- borderRadius: "4px",
231
- ref_key: "advanceSelectRef",
232
- ref: advanceSelectRef
233
- }, {
234
- "reference-content": withCtx(({ selected }) => [
235
- (__props.multiple)
236
- ? (openBlock(), createElementBlock("div", {
202
+ class: normalizeClass(unref(ns).e("title"))
203
+ }, toDisplayString(column.value.title), 3)) : createCommentVNode("v-if", true),
204
+ createVNode(BwaAdvanceSelect, {
205
+ multiple: __props.multiple,
206
+ modelValue: modelValue.value,
207
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => modelValue.value = $event),
208
+ onSearch: handleFieldSearch,
209
+ class: normalizeClass(unref(ns).e("options")),
210
+ onVisibleChange: visibleChange,
211
+ source: "pct",
212
+ showSearch: false,
213
+ showSelectIcon: !__props.multiple,
214
+ showSelection: false,
215
+ loading: loading.value,
216
+ width: popperWidth.value,
217
+ borderRadius: "4px",
218
+ ref_key: "advanceSelectRef",
219
+ ref: advanceSelectRef
220
+ }, {
221
+ "reference-content": withCtx(({ selected }) => [
222
+ __props.multiple ? (openBlock(), createElementBlock("div", {
237
223
  key: 0,
238
- class: normalizeClass(unref(ns).e('content'))
224
+ class: normalizeClass(unref(ns).e("content"))
239
225
  }, [
240
- (selected && selected.length > 0)
241
- ? (openBlock(), createElementBlock("div", _hoisted_1, [
242
- createVNode(unref(ElTooltip), {
243
- content: selected[0].label,
244
- placement: "top",
245
- effect: "light",
246
- "append-to": ".bwa-application"
226
+ selected && selected.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
227
+ createVNode(unref(ElTooltip), {
228
+ content: selected[0].label,
229
+ placement: "top",
230
+ effect: "light",
231
+ "append-to": ".bwa-application"
232
+ }, {
233
+ default: withCtx(() => [
234
+ createVNode(unref(ElTag), {
235
+ class: normalizeClass(unref(ns).e("tag")),
236
+ closable: "",
237
+ onClose: ($event) => handleClose(selected[0]),
238
+ type: "info"
247
239
  }, {
248
240
  default: withCtx(() => [
249
- createVNode(unref(ElTag), {
250
- class: normalizeClass(unref(ns).e('tag')),
251
- closable: "",
252
- onClose: $event => (handleClose(selected[0])),
253
- type: "info"
254
- }, {
255
- default: withCtx(() => [
256
- createTextVNode(toDisplayString(selected[0].label), 1 /* TEXT */)
257
- ]),
258
- _: 2 /* DYNAMIC */
259
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "onClose"])
241
+ createTextVNode(toDisplayString(selected[0].label), 1)
260
242
  ]),
261
- _: 2 /* DYNAMIC */
262
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["content"]),
263
- createVNode(unref(ElTooltip), {
264
- content: "Bottom center",
265
- placement: "top",
266
- effect: "light",
267
- "append-to": ".bwa-application"
243
+ _: 2
244
+ }, 1032, ["class", "onClose"])
245
+ ]),
246
+ _: 2
247
+ }, 1032, ["content"]),
248
+ createVNode(unref(ElTooltip), {
249
+ content: "Bottom center",
250
+ placement: "top",
251
+ effect: "light",
252
+ "append-to": ".bwa-application"
253
+ }, {
254
+ content: withCtx(() => [
255
+ createElementVNode("div", {
256
+ class: normalizeClass(unref(ns).e("tag_box"))
257
+ }, [
258
+ (openBlock(true), createElementBlock(Fragment, null, renderList(selected, (item, index) => {
259
+ return openBlock(), createElementBlock(Fragment, null, [
260
+ index !== 0 ? (openBlock(), createBlock(unref(ElTag), {
261
+ key: 0,
262
+ class: normalizeClass(unref(ns).e("tag_details")),
263
+ type: "info",
264
+ closable: "",
265
+ onClose: ($event) => handleClose(item)
266
+ }, {
267
+ default: withCtx(() => [
268
+ createTextVNode(toDisplayString(item.label), 1)
269
+ ]),
270
+ _: 2
271
+ }, 1032, ["class", "onClose"])) : createCommentVNode("v-if", true)
272
+ ], 64);
273
+ }), 256))
274
+ ], 2)
275
+ ]),
276
+ default: withCtx(() => [
277
+ selected.length > 1 ? (openBlock(), createBlock(unref(ElTag), {
278
+ key: 0,
279
+ class: normalizeClass(unref(ns).e("tag")),
280
+ type: "info"
268
281
  }, {
269
- content: withCtx(() => [
270
- createElementVNode("div", {
271
- class: normalizeClass(unref(ns).e('tag_box'))
272
- }, [
273
- (openBlock(true), createElementBlock(Fragment, null, renderList(selected, (item, index) => {
274
- return (openBlock(), createElementBlock(Fragment, null, [
275
- (index !== 0)
276
- ? (openBlock(), createBlock(unref(ElTag), {
277
- key: 0,
278
- class: normalizeClass(unref(ns).e('tag_details')),
279
- type: "info",
280
- closable: "",
281
- onClose: $event => (handleClose(item))
282
- }, {
283
- default: withCtx(() => [
284
- createTextVNode(toDisplayString(item.label), 1 /* TEXT */)
285
- ]),
286
- _: 2 /* DYNAMIC */
287
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "onClose"]))
288
- : createCommentVNode("v-if", true)
289
- ], 64 /* STABLE_FRAGMENT */))
290
- }), 256 /* UNKEYED_FRAGMENT */))
291
- ], 2 /* CLASS */)
292
- ]),
293
282
  default: withCtx(() => [
294
- (selected.length > 1)
295
- ? (openBlock(), createBlock(unref(ElTag), {
296
- key: 0,
297
- class: normalizeClass(unref(ns).e('tag')),
298
- type: "info"
299
- }, {
300
- default: withCtx(() => [
301
- createTextVNode("+" + toDisplayString(selected.length - 1), 1 /* TEXT */)
302
- ]),
303
- _: 2 /* DYNAMIC */
304
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class"]))
305
- : createCommentVNode("v-if", true)
283
+ createTextVNode("+" + toDisplayString(selected.length - 1), 1)
306
284
  ]),
307
- _: 2 /* DYNAMIC */
308
- }, 1024 /* DYNAMIC_SLOTS */)
309
- ]))
310
- : (openBlock(), createElementBlock("div", {
311
- key: 1,
312
- class: normalizeClass(unref(ns).e('contentBox_placeholder'))
313
- }, toDisplayString(unref(placeholderStr)), 3 /* TEXT, CLASS */)),
285
+ _: 2
286
+ }, 1032, ["class"])) : createCommentVNode("v-if", true)
287
+ ]),
288
+ _: 2
289
+ }, 1024)
290
+ ])) : (openBlock(), createElementBlock("div", {
291
+ key: 1,
292
+ class: normalizeClass(unref(ns).e("contentBox_placeholder"))
293
+ }, toDisplayString(placeholderStr.value), 3)),
314
294
  createVNode(unref(ElIcon), {
315
- onMouseenter: _cache[0] || (_cache[0] = $event => (isHoverIcon.value = true)),
316
- onMouseleave: _cache[1] || (_cache[1] = $event => (isHoverIcon.value = false)),
295
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => isHoverIcon.value = true),
296
+ onMouseleave: _cache[1] || (_cache[1] = ($event) => isHoverIcon.value = false),
317
297
  onClick: withModifiers(handleIconClick, ["stop"]),
318
- class: normalizeClass(unref(ns).be('option', 'selected'))
298
+ class: normalizeClass(unref(ns).be("option", "selected"))
319
299
  }, {
320
300
  default: withCtx(() => [
321
- (isHoverIcon.value && selected.length > 0)
322
- ? (openBlock(), createBlock(_component_CircleClose, {
323
- key: 0,
324
- class: "delete-icon"
325
- }))
326
- : (isShowPopper.value)
327
- ? (openBlock(), createBlock(unref(ArrowUp), { key: 1 }))
328
- : (openBlock(), createBlock(unref(ArrowDown), { key: 2 }))
301
+ isHoverIcon.value && selected.length > 0 ? (openBlock(), createBlock(_component_CircleClose, {
302
+ key: 0,
303
+ class: "delete-icon"
304
+ })) : isShowPopper.value ? (openBlock(), createBlock(unref(ArrowUp), { key: 1 })) : (openBlock(), createBlock(unref(ArrowDown), { key: 2 }))
329
305
  ]),
330
- _: 2 /* DYNAMIC */
331
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "class"])
332
- ], 2 /* CLASS */))
333
- : (openBlock(), createElementBlock("div", {
306
+ _: 2
307
+ }, 1032, ["class"])
308
+ ], 2)) : (openBlock(), createElementBlock("div", {
334
309
  key: 1,
335
- class: normalizeClass(unref(ns).e('content'))
310
+ class: normalizeClass(unref(ns).e("content"))
336
311
  }, [
337
312
  createVNode(unref(ElTooltip), {
338
313
  disabled: !selected.label,
@@ -342,73 +317,69 @@ return (_ctx, _cache) => {
342
317
  "append-to": ".bwa-application"
343
318
  }, {
344
319
  default: withCtx(() => [
345
- (selected.label)
346
- ? (openBlock(), createElementBlock("div", {
347
- key: 0,
348
- class: normalizeClass([unref(ns).e('contentBox'), unref(ns).e('contentBox_label')])
349
- }, toDisplayString(selected.label || unref(placeholderStr)), 3 /* TEXT, CLASS */))
350
- : (openBlock(), createElementBlock("div", {
351
- key: 1,
352
- class: normalizeClass([unref(ns).e('contentBox'), unref(ns).e('contentBox_placeholder')])
353
- }, toDisplayString(unref(placeholderStr)), 3 /* TEXT, CLASS */))
320
+ selected.label ? (openBlock(), createElementBlock("div", {
321
+ key: 0,
322
+ class: normalizeClass([unref(ns).e("contentBox"), unref(ns).e("contentBox_label")])
323
+ }, toDisplayString(selected.label || placeholderStr.value), 3)) : (openBlock(), createElementBlock("div", {
324
+ key: 1,
325
+ class: normalizeClass([unref(ns).e("contentBox"), unref(ns).e("contentBox_placeholder")])
326
+ }, toDisplayString(placeholderStr.value), 3))
354
327
  ]),
355
- _: 2 /* DYNAMIC */
356
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["disabled", "content"]),
328
+ _: 2
329
+ }, 1032, ["disabled", "content"]),
357
330
  createVNode(unref(ElIcon), {
358
- class: normalizeClass(unref(ns).be('option', 'selected'))
331
+ class: normalizeClass(unref(ns).be("option", "selected"))
359
332
  }, {
360
333
  default: withCtx(() => [
361
- (isShowPopper.value)
362
- ? (openBlock(), createBlock(unref(ArrowUp), { key: 0 }))
363
- : (openBlock(), createBlock(unref(ArrowDown), { key: 1 }))
334
+ isShowPopper.value ? (openBlock(), createBlock(unref(ArrowUp), { key: 0 })) : (openBlock(), createBlock(unref(ArrowDown), { key: 1 }))
364
335
  ]),
365
- _: 1 /* STABLE */
366
- }, 8 /* PROPS */, ["class"])
367
- ], 2 /* CLASS */))
368
- ]),
369
- contentTop: withCtx(() => [
370
- (__props.showSearch && !unref(column).componentProps?.options)
371
- ? (openBlock(), createElementBlock("div", {
372
- key: 0,
373
- class: normalizeClass(unref(ns).e('contentTop'))
374
- }, [
375
- createVNode(unref(ElInput), {
376
- modelValue: search.value,
377
- "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => ((search).value = $event)),
378
- class: normalizeClass(unref(ns).e('select')),
379
- placeholder: unref(searchPlaceholderStr),
380
- type: "text",
381
- "prefix-icon": "Search",
382
- clearable: ""
383
- }, null, 8 /* PROPS */, ["modelValue", "class", "placeholder"])
384
- ], 2 /* CLASS */))
385
- : createCommentVNode("v-if", true)
386
- ]),
387
- contentBottom: withCtx(() => [
388
- createElementVNode("div", {
389
- class: normalizeClass(unref(ns).e('clear')),
390
- onClick: handleClearClick
391
- }, "清除已选", 2 /* CLASS */)
392
- ]),
393
- default: withCtx(() => [
394
- renderSlot(_ctx.$slots, "default", {}, () => [
395
- (openBlock(true), createElementBlock(Fragment, null, renderList(data.value, (item) => {
396
- return (openBlock(), createBlock(BwaAdvanceOption, {
397
- key: item[unref(valuePropStr)] + '',
398
- value: item[unref(valuePropStr)] + '',
399
- label: item[unref(labelPropStr)] + '',
400
- class: normalizeClass(unref(ns).be('filter', 'option'))
401
- }, null, 8 /* PROPS */, ["value", "label", "class"]))
402
- }), 128 /* KEYED_FRAGMENT */))
403
- ])
404
- ]),
405
- _: 3 /* FORWARDED */
406
- }, 8 /* PROPS */, ["multiple", "modelValue", "class", "showSelectIcon", "loading", "width"])
407
- ], 2 /* CLASS */))
408
- }
409
- }
410
-
411
- };
412
- var PctMultipleMenuCondition = /*#__PURE__*/_export_sfc(_sfc_main, [['__file',"pct-multiple-menu-condition.vue"]]);
336
+ _: 1
337
+ }, 8, ["class"])
338
+ ], 2))
339
+ ]),
340
+ contentTop: withCtx(() => {
341
+ var _a2;
342
+ return [
343
+ __props.showSearch && !((_a2 = column.value.componentProps) == null ? void 0 : _a2.options) ? (openBlock(), createElementBlock("div", {
344
+ key: 0,
345
+ class: normalizeClass(unref(ns).e("contentTop"))
346
+ }, [
347
+ createVNode(unref(ElInput), {
348
+ modelValue: search.value,
349
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => search.value = $event),
350
+ class: normalizeClass(unref(ns).e("select")),
351
+ placeholder: searchPlaceholderStr.value,
352
+ type: "text",
353
+ "prefix-icon": "Search",
354
+ clearable: ""
355
+ }, null, 8, ["modelValue", "class", "placeholder"])
356
+ ], 2)) : createCommentVNode("v-if", true)
357
+ ];
358
+ }),
359
+ contentBottom: withCtx(() => [
360
+ createElementVNode("div", {
361
+ class: normalizeClass(unref(ns).e("clear")),
362
+ onClick: handleClearClick
363
+ }, "\u6E05\u9664\u5DF2\u9009", 2)
364
+ ]),
365
+ default: withCtx(() => [
366
+ renderSlot(_ctx.$slots, "default", {}, () => [
367
+ (openBlock(true), createElementBlock(Fragment, null, renderList(data.value, (item) => {
368
+ return openBlock(), createBlock(BwaAdvanceOption, {
369
+ key: item[valuePropStr.value] + "",
370
+ value: item[valuePropStr.value] + "",
371
+ label: item[labelPropStr.value] + "",
372
+ class: normalizeClass(unref(ns).be("filter", "option"))
373
+ }, null, 8, ["value", "label", "class"]);
374
+ }), 128))
375
+ ])
376
+ ]),
377
+ _: 3
378
+ }, 8, ["multiple", "modelValue", "class", "showSelectIcon", "loading", "width"])
379
+ ], 2);
380
+ };
381
+ }
382
+ });
383
+ var PctMultipleMenuCondition = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "pct-multiple-menu-condition.vue"]]);
413
384
 
414
385
  export { PctMultipleMenuCondition as default };