@ctzy-web-client/plugin-component-vue 1.0.32 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/contextmenu/use-contextmenu.mjs +1 -1
- package/es/data-table/data-table.mjs +14 -6
- package/es/datatable-settings/datatable-settings.mjs +1 -2
- package/es/drag-list/use-drag-list.mjs +1 -1
- package/es/node_modules/.pnpm/{@vueuse_core@9.13.0_vue@3.5.29_typescript@4.9.5_ → @vueuse_core@9.13.0_vue@3.5.31_typescript@4.9.5_}/node_modules/@vueuse/core/index.mjs +2 -2
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +131 -271
- package/lib/contextmenu/use-contextmenu.js +1 -1
- package/lib/data-table/data-table.js +13 -5
- package/lib/datatable-settings/datatable-settings.js +1 -2
- package/lib/drag-list/use-drag-list.js +1 -1
- package/lib/node_modules/.pnpm/{@vueuse_core@9.13.0_vue@3.5.29_typescript@4.9.5_ → @vueuse_core@9.13.0_vue@3.5.31_typescript@4.9.5_}/node_modules/@vueuse/core/index.js +1 -1
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +129 -269
- package/package.json +1 -1
- package/src/data-table/data-table-column.vue +1 -1
- package/src/data-table/data-table.vue +9 -3
- package/src/datatable-settings/datatable-settings.vue +2 -3
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +23 -118
- package/style/data-table.css +1 -1
- package/style/index.css +1 -1
- package/style/pct-filter-panel.css +1 -1
- package/style/src/data-table.scss +2 -2
- package/style/src/pct-filter-panel.scss +0 -19
- /package/es/{components.css → index.css} +0 -0
- /package/es/node_modules/.pnpm/{@vueuse_shared@9.13.0_vue@3.5.29_typescript@4.9.5_ → @vueuse_shared@9.13.0_vue@3.5.31_typescript@4.9.5_}/node_modules/@vueuse/shared/index.mjs +0 -0
- /package/lib/{components.css → index.css} +0 -0
- /package/lib/node_modules/.pnpm/{@vueuse_shared@9.13.0_vue@3.5.29_typescript@4.9.5_ → @vueuse_shared@9.13.0_vue@3.5.31_typescript@4.9.5_}/node_modules/@vueuse/shared/index.js +0 -0
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
ref="advanceSelectRef"
|
|
19
19
|
>
|
|
20
20
|
<template #reference-content="{ selected }">
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<div v-if="selected && selected.length > 0" style="display: flex; align-items: center; flex-wrap: wrap; gap: 4px;">
|
|
21
|
+
<div :class="ns.e('content')" v-if="multiple">
|
|
22
|
+
<div v-if="selected && selected.length > 0">
|
|
24
23
|
<ElTooltip :content="selected[0].label" placement="top" effect="light" append-to=".bwa-application">
|
|
25
24
|
<el-tag :class="ns.e('tag')" closable @close="handleClose(selected[0])" type="info">{{selected[0].label}}
|
|
26
25
|
</el-tag>
|
|
@@ -39,47 +38,13 @@
|
|
|
39
38
|
</el-tag>
|
|
40
39
|
</template>
|
|
41
40
|
</div>
|
|
41
|
+
|
|
42
42
|
</template>
|
|
43
43
|
<el-tag :class="ns.e('tag')" type="info" v-if="selected.length > 1">+{{selected.length - 1}}</el-tag>
|
|
44
44
|
</ElTooltip>
|
|
45
|
-
|
|
46
|
-
<div v-if="props.showSearch && !column.componentProps?.options" style="flex: 1; min-width: 80px; position: relative;">
|
|
47
|
-
<span v-if="!isSearchActive && !search" style="color: #999; cursor: text;">{{searchPlaceholderStr || '搜索'}}</span>
|
|
48
|
-
<span v-else style="color: #333;">{{search}}</span>
|
|
49
|
-
<!-- 闪烁光标 -->
|
|
50
|
-
<span v-if="isSearchActive" class="cursor-blink"></span>
|
|
51
|
-
<!-- 隐藏的输入框 -->
|
|
52
|
-
<input
|
|
53
|
-
v-if="props.showSearch && !column.componentProps?.options"
|
|
54
|
-
ref="inputRef"
|
|
55
|
-
v-model="search"
|
|
56
|
-
type="text"
|
|
57
|
-
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: text;"
|
|
58
|
-
@focus="handleInputFocus"
|
|
59
|
-
@blur="handleInputBlur"
|
|
60
|
-
@click.stop
|
|
61
|
-
/>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
<div v-else style="display: flex; align-items: center; justify-content: space-between; width: 100%;">
|
|
65
|
-
<div style="flex: 1; position: relative; cursor: text;" @click="handleContentClick">
|
|
66
|
-
<span v-if="!isSearchActive && !search" :class="ns.e('contentBox_placeholder')">{{placeholderStr}}</span>
|
|
67
|
-
<span v-else style="color: #333;">{{search}}</span>
|
|
68
|
-
<!-- 闪烁光标 -->
|
|
69
|
-
<span v-if="isSearchActive" class="cursor-blink"></span>
|
|
70
|
-
<!-- 隐藏的输入框 -->
|
|
71
|
-
<input
|
|
72
|
-
v-if="props.showSearch && !column.componentProps?.options"
|
|
73
|
-
ref="inputRef"
|
|
74
|
-
v-model="search"
|
|
75
|
-
type="text"
|
|
76
|
-
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: text;"
|
|
77
|
-
@focus="handleInputFocus"
|
|
78
|
-
@blur="handleInputBlur"
|
|
79
|
-
@click.stop
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
45
|
+
|
|
82
46
|
</div>
|
|
47
|
+
<div v-else :class="ns.e('contentBox_placeholder')">{{placeholderStr}}</div>
|
|
83
48
|
<ElIcon
|
|
84
49
|
@mouseenter="isHoverIcon = true"
|
|
85
50
|
@mouseleave="isHoverIcon = false"
|
|
@@ -94,30 +59,11 @@
|
|
|
94
59
|
<ArrowDown v-else />
|
|
95
60
|
</ElIcon>
|
|
96
61
|
</div>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
<div v-else style="display: flex; align-items: center; width: 100%;">
|
|
103
|
-
<span v-if="!isSearchActive && !search" :class="ns.e('contentBox_placeholder')">{{placeholderStr}}</span>
|
|
104
|
-
<span v-else style="color: #333;">{{search}}</span>
|
|
105
|
-
<!-- 闪烁光标 -->
|
|
106
|
-
<span v-if="isSearchActive" class="cursor-blink"></span>
|
|
107
|
-
</div>
|
|
108
|
-
</ElTooltip>
|
|
109
|
-
<!-- 隐藏的输入框 -->
|
|
110
|
-
<input
|
|
111
|
-
v-if="props.showSearch && !column.componentProps?.options"
|
|
112
|
-
ref="inputRef"
|
|
113
|
-
v-model="search"
|
|
114
|
-
type="text"
|
|
115
|
-
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: text;"
|
|
116
|
-
@focus="handleInputFocus"
|
|
117
|
-
@blur="handleInputBlur"
|
|
118
|
-
@click.stop
|
|
119
|
-
/>
|
|
120
|
-
</div>
|
|
62
|
+
<div v-else :class="ns.e('content')">
|
|
63
|
+
<ElTooltip :disabled="!selected.label" :content="selected.label" placement="top" effect="light" append-to=".bwa-application">
|
|
64
|
+
<div :class="[ns.e('contentBox'), ns.e('contentBox_label')]" v-if="selected.label">{{selected.label || placeholderStr}}</div>
|
|
65
|
+
<div :class="[ns.e('contentBox'), ns.e('contentBox_placeholder')]" v-else>{{placeholderStr}}</div>
|
|
66
|
+
</ElTooltip>
|
|
121
67
|
<ElIcon
|
|
122
68
|
:class="ns.be('option', 'selected')"
|
|
123
69
|
>
|
|
@@ -126,6 +72,19 @@
|
|
|
126
72
|
</ElIcon>
|
|
127
73
|
</div>
|
|
128
74
|
</template>
|
|
75
|
+
|
|
76
|
+
<template #contentTop>
|
|
77
|
+
<div :class="ns.e('contentTop')" v-if="showSearch && !column.componentProps?.options">
|
|
78
|
+
<ElInput
|
|
79
|
+
v-model="search"
|
|
80
|
+
:class="ns.e('select')"
|
|
81
|
+
:placeholder="searchPlaceholderStr"
|
|
82
|
+
type="text"
|
|
83
|
+
prefix-icon="Search"
|
|
84
|
+
clearable
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</template>
|
|
129
88
|
<slot>
|
|
130
89
|
<BwaAdvanceOption
|
|
131
90
|
v-for="item in data"
|
|
@@ -233,8 +192,6 @@ onMounted(() => {
|
|
|
233
192
|
const ns = useNamespace('pctfilterpanel-item');
|
|
234
193
|
const isShowPopper = ref(false)
|
|
235
194
|
const isHoverIcon = ref(false)
|
|
236
|
-
const isSearchActive = ref(false)
|
|
237
|
-
const inputRef = ref(null)
|
|
238
195
|
|
|
239
196
|
const attrs = useAttrs();
|
|
240
197
|
const showTitle = computed(() => attrs.showTitle)
|
|
@@ -287,44 +244,6 @@ modelValue.value = currentModelValue.filter(item =>
|
|
|
287
244
|
// 原有逻辑:切换下拉显隐
|
|
288
245
|
isShowPopper.value = !isShowPopper.value;
|
|
289
246
|
};
|
|
290
|
-
|
|
291
|
-
// 处理选择框点击事件
|
|
292
|
-
const handleContentClick = (event) => {
|
|
293
|
-
event.stopPropagation();
|
|
294
|
-
// 显示下拉菜单
|
|
295
|
-
isShowPopper.value = true;
|
|
296
|
-
// 如果支持搜索,聚焦输入框
|
|
297
|
-
if (props.showSearch && !column.value?.componentProps?.options) {
|
|
298
|
-
nextTick(() => {
|
|
299
|
-
if (inputRef.value) {
|
|
300
|
-
inputRef.value.focus();
|
|
301
|
-
isSearchActive.value = true;
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
// 处理输入框聚焦事件
|
|
308
|
-
const handleInputFocus = () => {
|
|
309
|
-
isSearchActive.value = true;
|
|
310
|
-
// 确保下拉菜单显示
|
|
311
|
-
isShowPopper.value = true;
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
// 处理输入框失焦事件
|
|
315
|
-
const handleInputBlur = (event) => {
|
|
316
|
-
// 检查是否点击了下拉菜单内部
|
|
317
|
-
const target = event.relatedTarget;
|
|
318
|
-
if (target && target.closest('.bwa-advance-select__popper')) {
|
|
319
|
-
// 点击了下拉菜单内部,保持搜索状态
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
// 延迟处理,以便点击标签等操作能够正常执行
|
|
323
|
-
setTimeout(() => {
|
|
324
|
-
isSearchActive.value = false;
|
|
325
|
-
// 不清空搜索内容,保持用户输入
|
|
326
|
-
}, 200);
|
|
327
|
-
};
|
|
328
247
|
const getData = async (query) => {
|
|
329
248
|
loading.value = true
|
|
330
249
|
const { itfInfo, searchAttr } = column.value.componentProps
|
|
@@ -359,22 +278,8 @@ const handleFieldSearch = (query) => {
|
|
|
359
278
|
}
|
|
360
279
|
|
|
361
280
|
const search = ref('')
|
|
362
|
-
let searchTimeout = null
|
|
363
281
|
watch(() => search.value, val => {
|
|
364
282
|
handleFieldSearch(val)
|
|
365
|
-
// 清除之前的定时器
|
|
366
|
-
if (searchTimeout) {
|
|
367
|
-
clearTimeout(searchTimeout)
|
|
368
|
-
}
|
|
369
|
-
// 设置新的定时器,0.5秒后唤起下拉菜单并获取数据
|
|
370
|
-
searchTimeout = setTimeout(() => {
|
|
371
|
-
if (val && props.showSearch && !column.value?.componentProps?.options) {
|
|
372
|
-
isShowPopper.value = true
|
|
373
|
-
if (column.value.componentProps) {
|
|
374
|
-
getData(val)
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}, 500)
|
|
378
283
|
})
|
|
379
284
|
|
|
380
285
|
const modelValue = computed({
|
package/style/data-table.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.bwa-datatable{--bwa-datatable-pagination-padding-top:20px;--bwa-datatable-pagination-line-height:36px;--bwa-datatable-pagination-info-margin-right:16px;--bwa-datatable-pagination-info-font-size:12px;--bwa-datatable-pagination-info-text-color:#547781;
|
|
1
|
+
.bwa-datatable{--bwa-datatable-pagination-padding-top:20px;--bwa-datatable-pagination-line-height:36px;--bwa-datatable-pagination-info-margin-right:16px;--bwa-datatable-pagination-info-font-size:12px;--bwa-datatable-pagination-info-text-color:#547781;height:100%;width:100%}.bwa-datatable__pagination{display:flex;line-height:var(--bwa-datatable-pagination-line-height)}.bwa-datatable__pagination::before{content:"";position:relative;flex:1}.bwa-datatable__pagination{padding-top:var(--bwa-datatable-pagination-padding-top)}.bwa-datatable__pagination-info{margin-right:var(--bwa-datatable-pagination-info-margin-right);font-size:var(--bwa-datatable-pagination-info-font-size);color:var(--bwa-datatable-pagination-info-text-color);white-space:nowrap}.bwa-datatable>.el-table{flex:1;height:0}.bwa-datatable__drag{text-align:center;cursor:grab}.bwa-datatable__dragbar{position:fixed;background-color:var(--bwa-color-primary);z-index:99}.bwa-column-view{text-overflow:ellipsis;overflow:hidden}
|