@ctzy-web-client/plugin-component-vue 1.0.22 → 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.
- package/es/advance-select/advance-operation.mjs +51 -37
- package/es/advance-select/advance-option.mjs +167 -97
- package/es/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.mjs +7 -0
- package/es/advance-select/advance-select.mjs +368 -310
- package/es/advance-select/index.mjs +5 -5
- package/es/application-slot/breadcrumb-item.mjs +20 -17
- package/es/application-slot/header-tools-item.mjs +20 -17
- package/es/breadcrumb-select/breadcrumb-select.mjs +134 -112
- package/es/contextmenu/contextmenu-item.mjs +19 -15
- package/es/contextmenu/contextmenu.mjs +72 -56
- package/es/data-form/data-form-item.mjs +48 -30
- package/es/data-form/data-form.mjs +213 -166
- package/es/data-form/form-components/bwa-date-picker.mjs +51 -39
- package/es/data-form/form-components/bwa-date-time-picker.mjs +56 -44
- package/es/data-form/form-components/bwa-input-float.mjs +48 -37
- package/es/data-form/form-components/bwa-input-integer.mjs +68 -50
- package/es/data-form/form-components/bwa-input.mjs +43 -32
- package/es/data-form/form-components/bwa-multi-select.mjs +40 -29
- package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +554 -218
- package/es/data-form/form-components/bwa-rich-text.mjs +404 -316
- package/es/data-form/form-components/bwa-select.mjs +84 -70
- package/es/data-form/form-components/bwa-textarea.mjs +38 -27
- package/es/data-form/form-components/bwa-upload.mjs +172 -148
- package/es/data-form/form-components/bwa-user-multi-select.mjs +35 -24
- package/es/data-form/form-components/bwa-user-select.mjs +86 -61
- package/es/data-table/data-column-view.mjs +146 -115
- package/es/data-table/data-table-card.mjs +48 -40
- package/es/data-table/data-table-column.mjs +58 -45
- package/es/data-table/data-table.mjs +402 -316
- package/es/datatable-settings/datatable-settings.mjs +329 -254
- package/es/date-range/date-picker.mjs +130 -116
- package/es/date-range/date-range.mjs +215 -168
- package/es/drag-list/drag-item.mjs +56 -42
- package/es/drag-list/drag-list.mjs +60 -47
- package/es/dragable/dragable-item.mjs +23 -18
- package/es/dragable/dragable-operation.mjs +32 -24
- package/es/dragable/dragable.mjs +32 -23
- package/es/filter-panel/conditions/date-range-condition.mjs +50 -40
- package/es/filter-panel/conditions/department-condition/department-condition.mjs +99 -72
- package/es/filter-panel/conditions/department-condition/department-node.mjs +73 -59
- package/es/filter-panel/conditions/input-condition.mjs +90 -76
- package/es/filter-panel/conditions/multi-user-condition.mjs +67 -57
- package/es/filter-panel/conditions/multiple-menu-condition.mjs +54 -35
- package/es/filter-panel/conditions/single-menu-condition.mjs +65 -60
- package/es/filter-panel/conditions/single-user-condition.mjs +67 -57
- package/es/filter-panel/filter-panel-item.mjs +54 -39
- package/es/filter-panel/filter-panel.mjs +153 -135
- package/es/layout/layout.mjs +85 -78
- package/es/menu/menu-item.mjs +67 -52
- package/es/menu/menu.mjs +70 -53
- package/es/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs +28 -0
- package/es/panel/panel.mjs +53 -40
- package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +74 -63
- package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +76 -67
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +406 -178
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +153 -138
- package/es/pct-filter-panel/pct-filter-panel-item.mjs +55 -40
- package/es/pct-filter-panel/pct-filter-panel.mjs +247 -227
- package/es/progress/progress-item.mjs +81 -61
- package/es/progress/progress.mjs +78 -64
- package/es/where-filter-panel/where-filter-panel.mjs +15 -12
- package/lib/advance-select/advance-operation.js +50 -36
- package/lib/advance-select/advance-option.js +166 -96
- package/lib/advance-select/advance-option.vue_vue_type_style_index_0_scoped_bc8f5626_lang.js +12 -0
- package/lib/advance-select/advance-select.js +366 -308
- package/lib/application-slot/breadcrumb-item.js +19 -16
- package/lib/application-slot/header-tools-item.js +19 -16
- package/lib/breadcrumb-select/breadcrumb-select.js +133 -111
- package/lib/contextmenu/contextmenu-item.js +18 -14
- package/lib/contextmenu/contextmenu.js +71 -55
- package/lib/data-form/data-form-item.js +47 -29
- package/lib/data-form/data-form.js +212 -165
- package/lib/data-form/form-components/bwa-date-picker.js +50 -38
- package/lib/data-form/form-components/bwa-date-time-picker.js +55 -43
- package/lib/data-form/form-components/bwa-input-float.js +47 -36
- package/lib/data-form/form-components/bwa-input-integer.js +67 -49
- package/lib/data-form/form-components/bwa-input.js +42 -31
- package/lib/data-form/form-components/bwa-multi-select.js +39 -28
- package/lib/data-form/form-components/bwa-rich-text-tinymce.js +553 -217
- package/lib/data-form/form-components/bwa-rich-text.js +403 -315
- package/lib/data-form/form-components/bwa-select.js +83 -69
- package/lib/data-form/form-components/bwa-textarea.js +37 -26
- package/lib/data-form/form-components/bwa-upload.js +171 -147
- package/lib/data-form/form-components/bwa-user-multi-select.js +34 -23
- package/lib/data-form/form-components/bwa-user-select.js +85 -60
- package/lib/data-table/data-column-view.js +146 -115
- package/lib/data-table/data-table-card.js +48 -40
- package/lib/data-table/data-table-column.js +57 -44
- package/lib/data-table/data-table.js +401 -315
- package/lib/datatable-settings/datatable-settings.js +328 -253
- package/lib/date-range/date-picker.js +129 -115
- package/lib/date-range/date-range.js +213 -170
- package/lib/drag-list/drag-item.js +55 -41
- package/lib/drag-list/drag-list.js +59 -46
- package/lib/dragable/dragable-item.js +22 -17
- package/lib/dragable/dragable-operation.js +31 -23
- package/lib/dragable/dragable.js +31 -22
- package/lib/filter-panel/conditions/date-range-condition.js +49 -39
- package/lib/filter-panel/conditions/department-condition/department-condition.js +98 -71
- package/lib/filter-panel/conditions/department-condition/department-node.js +72 -58
- package/lib/filter-panel/conditions/input-condition.js +89 -75
- package/lib/filter-panel/conditions/multi-user-condition.js +66 -56
- package/lib/filter-panel/conditions/multiple-menu-condition.js +53 -34
- package/lib/filter-panel/conditions/single-menu-condition.js +64 -59
- package/lib/filter-panel/conditions/single-user-condition.js +66 -56
- package/lib/filter-panel/filter-panel-item.js +53 -38
- package/lib/filter-panel/filter-panel.js +152 -134
- package/lib/layout/layout.js +84 -77
- package/lib/menu/menu-item.js +66 -51
- package/lib/menu/menu.js +69 -52
- package/lib/node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js +32 -0
- package/lib/panel/panel.js +52 -39
- package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +73 -62
- package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +75 -66
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +405 -177
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +152 -137
- package/lib/pct-filter-panel/pct-filter-panel-item.js +54 -39
- package/lib/pct-filter-panel/pct-filter-panel.js +246 -226
- package/lib/progress/progress-item.js +80 -60
- package/lib/progress/progress.js +77 -63
- package/lib/where-filter-panel/where-filter-panel.js +14 -11
- package/package.json +2 -1
- package/src/advance-select/advance-option.vue +64 -13
- package/src/data-form/form-components/bwa-rich-text-tinymce.vue +1 -1
- package/src/datatable-settings/datatable-settings.vue +33 -3
- package/src/date-range/date-picker.vue +1 -1
- package/src/date-range/date-range.vue +3 -3
- package/src/filter-panel/filter-panel.vue +2 -2
- package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +64 -64
- package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +61 -61
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +302 -178
- package/src/pct-filter-panel/pct-filter-panel.vue +4 -4
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="ns.e('cont')">
|
|
3
|
-
<div v-if="column && showTitle" :class="ns.e('label')">{{ column.title }}</div>
|
|
4
|
-
<el-date-picker
|
|
5
|
-
v-model="value"
|
|
6
|
-
type="daterange"
|
|
7
|
-
range-separator="至"
|
|
8
|
-
start-placeholder="开始日期"
|
|
9
|
-
end-placeholder="结束日期"
|
|
10
|
-
:value-format="valueFormat"
|
|
11
|
-
|
|
12
|
-
/>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script setup>
|
|
17
|
-
import {computed, inject} from 'vue';
|
|
18
|
-
import {useNamespace, filterPanelItemKey} from '@ctzy-web-client/web-base-client-vue';
|
|
19
|
-
const ns = useNamespace('pct-daterange');
|
|
20
|
-
defineOptions({
|
|
21
|
-
name: 'BwaPctDateRangeCondition',
|
|
22
|
-
__conditionTitle__: '日期选择',
|
|
23
|
-
__conditionDefault__: () => ({ start: '', end: '' }),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const props = defineProps({
|
|
27
|
-
modelValue: {
|
|
28
|
-
type: null,
|
|
29
|
-
},
|
|
30
|
-
valueFormat: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: 'YYYY-MM-DD',
|
|
33
|
-
},
|
|
34
|
-
showTitle: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const emit = defineEmits(['update:modelValue']);
|
|
41
|
-
|
|
42
|
-
const filterPanelItem = inject(filterPanelItemKey);
|
|
43
|
-
const column = computed(() => filterPanelItem?.column ?? null);
|
|
44
|
-
|
|
45
|
-
const value = computed({
|
|
46
|
-
get: () => {
|
|
47
|
-
if (props.modelValue && props.modelValue.start && props.modelValue.end) {
|
|
48
|
-
return [props.modelValue.start, props.modelValue.end];
|
|
49
|
-
}
|
|
50
|
-
return [];
|
|
51
|
-
},
|
|
52
|
-
set: (v) => {
|
|
53
|
-
if (v && v.length === 2) {
|
|
54
|
-
emit('update:modelValue', { start: v[0], end: v[1] });
|
|
55
|
-
} else {
|
|
56
|
-
emit('update:modelValue', { start: '', end: '' });
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
</script>
|
|
61
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="ns.e('cont')">
|
|
3
|
+
<div v-if="column && showTitle" :class="ns.e('label')">{{ column.title }}</div>
|
|
4
|
+
<el-date-picker
|
|
5
|
+
v-model="value"
|
|
6
|
+
type="daterange"
|
|
7
|
+
range-separator="至"
|
|
8
|
+
start-placeholder="开始日期"
|
|
9
|
+
end-placeholder="结束日期"
|
|
10
|
+
:value-format="valueFormat"
|
|
11
|
+
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import {computed, inject} from 'vue';
|
|
18
|
+
import {useNamespace, filterPanelItemKey} from '@ctzy-web-client/web-base-client-vue';
|
|
19
|
+
const ns = useNamespace('pct-daterange');
|
|
20
|
+
defineOptions({
|
|
21
|
+
name: 'BwaPctDateRangeCondition',
|
|
22
|
+
__conditionTitle__: '日期选择',
|
|
23
|
+
__conditionDefault__: () => ({ start: '', end: '' }),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: null,
|
|
29
|
+
},
|
|
30
|
+
valueFormat: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'YYYY-MM-DD',
|
|
33
|
+
},
|
|
34
|
+
showTitle: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const emit = defineEmits(['update:modelValue']);
|
|
41
|
+
|
|
42
|
+
const filterPanelItem = inject(filterPanelItemKey);
|
|
43
|
+
const column = computed(() => filterPanelItem?.column ?? null);
|
|
44
|
+
|
|
45
|
+
const value = computed({
|
|
46
|
+
get: () => {
|
|
47
|
+
if (props.modelValue && props.modelValue.start && props.modelValue.end) {
|
|
48
|
+
return [props.modelValue.start, props.modelValue.end];
|
|
49
|
+
}
|
|
50
|
+
return [];
|
|
51
|
+
},
|
|
52
|
+
set: (v) => {
|
|
53
|
+
if (v && v.length === 2) {
|
|
54
|
+
emit('update:modelValue', { start: v[0], end: v[1] });
|
|
55
|
+
} else {
|
|
56
|
+
emit('update:modelValue', { start: '', end: '' });
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
61
|
+
|
|
@@ -1,178 +1,302 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="ns.e('conditbox')">
|
|
3
|
-
<div v-if="showTitle" :class="ns.e('title')">{{column.title}}</div>
|
|
4
|
-
<
|
|
5
|
-
:multiple="multiple"
|
|
6
|
-
v-model="modelValue"
|
|
7
|
-
@
|
|
8
|
-
:class="ns.e('options')"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:
|
|
12
|
-
:
|
|
13
|
-
:
|
|
14
|
-
:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="ns.e('conditbox')">
|
|
3
|
+
<div v-if="showTitle" :class="ns.e('title')">{{column.title}}</div>
|
|
4
|
+
<BwaAdvanceSelect
|
|
5
|
+
:multiple="multiple"
|
|
6
|
+
v-model="modelValue"
|
|
7
|
+
@search="handleFieldSearch"
|
|
8
|
+
:class="ns.e('options')"
|
|
9
|
+
@visible-change="visibleChange"
|
|
10
|
+
source="pct"
|
|
11
|
+
:showSearch="false"
|
|
12
|
+
:showSelectIcon="!multiple"
|
|
13
|
+
:showSelection="false"
|
|
14
|
+
:loading="loading"
|
|
15
|
+
:width="popperWidth"
|
|
16
|
+
borderRadius="4px"
|
|
17
|
+
ref="advanceSelectRef"
|
|
18
|
+
>
|
|
19
|
+
<template #reference-content="{ selected }">
|
|
20
|
+
<div :class="ns.e('content')" v-if="multiple">
|
|
21
|
+
<div v-if="selected && selected.length > 0">
|
|
22
|
+
<ElTooltip :content="selected[0].label" placement="top" effect="light" append-to=".bwa-application">
|
|
23
|
+
<el-tag :class="ns.e('tag')" closable @close="handleClose(selected[0])" type="info">{{selected[0].label}}
|
|
24
|
+
</el-tag>
|
|
25
|
+
</ElTooltip>
|
|
26
|
+
<ElTooltip content="Bottom center" placement="top" effect="light" append-to=".bwa-application">
|
|
27
|
+
<template #content>
|
|
28
|
+
<div :class="ns.e('tag_box')">
|
|
29
|
+
<template v-for="(item, index) in selected">
|
|
30
|
+
<el-tag
|
|
31
|
+
:class="ns.e('tag_details')"
|
|
32
|
+
type="info"
|
|
33
|
+
closable @close="handleClose(item)"
|
|
34
|
+
v-if="index !== 0"
|
|
35
|
+
>
|
|
36
|
+
{{item.label}}
|
|
37
|
+
</el-tag>
|
|
38
|
+
</template>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
</template>
|
|
42
|
+
<el-tag :class="ns.e('tag')" type="info" v-if="selected.length > 1">+{{selected.length - 1}}</el-tag>
|
|
43
|
+
</ElTooltip>
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
<div v-else :class="ns.e('contentBox_placeholder')">{{placeholderStr}}</div>
|
|
47
|
+
<ElIcon
|
|
48
|
+
@mouseenter="isHoverIcon = true"
|
|
49
|
+
@mouseleave="isHoverIcon = false"
|
|
50
|
+
@click.stop="handleIconClick"
|
|
51
|
+
:class="ns.be('option', 'selected')"
|
|
52
|
+
>
|
|
53
|
+
<CircleClose
|
|
54
|
+
v-if="isHoverIcon && selected.length > 0"
|
|
55
|
+
class="delete-icon"
|
|
56
|
+
/>
|
|
57
|
+
<ArrowUp v-else-if="isShowPopper" />
|
|
58
|
+
<ArrowDown v-else />
|
|
59
|
+
</ElIcon>
|
|
60
|
+
</div>
|
|
61
|
+
<div v-else :class="ns.e('content')">
|
|
62
|
+
<ElTooltip :disabled="!selected.label" :content="selected.label" placement="top" effect="light" append-to=".bwa-application">
|
|
63
|
+
<div :class="[ns.e('contentBox'), ns.e('contentBox_label')]" v-if="selected.label">{{selected.label || placeholderStr}}</div>
|
|
64
|
+
<div :class="[ns.e('contentBox'), ns.e('contentBox_placeholder')]" v-else>{{placeholderStr}}</div>
|
|
65
|
+
</ElTooltip>
|
|
66
|
+
<ElIcon
|
|
67
|
+
:class="ns.be('option', 'selected')"
|
|
68
|
+
>
|
|
69
|
+
<ArrowUp v-if="isShowPopper" />
|
|
70
|
+
<ArrowDown v-else />
|
|
71
|
+
</ElIcon>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<template #contentTop>
|
|
76
|
+
<div :class="ns.e('contentTop')" v-if="showSearch && !column.componentProps?.options">
|
|
77
|
+
<ElInput
|
|
78
|
+
v-model="search"
|
|
79
|
+
:class="ns.e('select')"
|
|
80
|
+
:placeholder="searchPlaceholderStr"
|
|
81
|
+
type="text"
|
|
82
|
+
prefix-icon="Search"
|
|
83
|
+
clearable
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
87
|
+
<slot>
|
|
88
|
+
<BwaAdvanceOption
|
|
89
|
+
v-for="item in data"
|
|
90
|
+
:key="item[valuePropStr] + ''"
|
|
91
|
+
:value="item[valuePropStr] + ''"
|
|
92
|
+
:label="item[labelPropStr] + ''"
|
|
93
|
+
:class="ns.be('filter', 'option')"
|
|
94
|
+
>
|
|
95
|
+
</BwaAdvanceOption>
|
|
96
|
+
</slot>
|
|
97
|
+
<template #contentBottom>
|
|
98
|
+
<div :class="ns.e('clear')" @click="handleClearClick">清除已选</div>
|
|
99
|
+
</template>
|
|
100
|
+
</BwaAdvanceSelect>
|
|
101
|
+
</div>
|
|
102
|
+
</template>
|
|
103
|
+
|
|
104
|
+
<script setup>
|
|
105
|
+
import {ElOption, ElSelect, ElTooltip, ElIcon, ElInput, ElTag} from 'element-plus';
|
|
106
|
+
import {ArrowUp, ArrowDown} from '@element-plus/icons';
|
|
107
|
+
import { useNamespace } from '@ctzy-web-client/web-base-client-vue';
|
|
108
|
+
import {computed, unref, defineEmits, inject, ref, useAttrs, watch, onMounted, nextTick} from 'vue';
|
|
109
|
+
import {dataProps} from "../../hooks/use-data";
|
|
110
|
+
|
|
111
|
+
import {
|
|
112
|
+
useService,
|
|
113
|
+
HttpRequest,
|
|
114
|
+
filterPanelItemKey
|
|
115
|
+
} from '@ctzy-web-client/web-base-client-vue';
|
|
116
|
+
import BwaAdvanceSelect from '../../advance-select/advance-select.vue';
|
|
117
|
+
import BwaAdvanceOption from '../../advance-select/advance-option.vue';
|
|
118
|
+
|
|
119
|
+
const httpRequest = useService(HttpRequest);
|
|
120
|
+
defineOptions({
|
|
121
|
+
name: 'BwaPctMultipleMenuCondition',
|
|
122
|
+
__conditionTitle__: '多选列表',
|
|
123
|
+
__conditionDefault__: () => [],
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const props = defineProps({
|
|
127
|
+
...dataProps,
|
|
128
|
+
modelValue: {
|
|
129
|
+
type: null,
|
|
130
|
+
},
|
|
131
|
+
options: {
|
|
132
|
+
type: Array,
|
|
133
|
+
default: () => [],
|
|
134
|
+
},
|
|
135
|
+
labelProp: {
|
|
136
|
+
type: String,
|
|
137
|
+
default: 'label',
|
|
138
|
+
},
|
|
139
|
+
valueProp: {
|
|
140
|
+
type: String,
|
|
141
|
+
default: 'value',
|
|
142
|
+
},
|
|
143
|
+
multiple: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: true,
|
|
146
|
+
},
|
|
147
|
+
showSearch: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
default: true,
|
|
150
|
+
},
|
|
151
|
+
placeholder: {
|
|
152
|
+
type: String,
|
|
153
|
+
default: '请选择',
|
|
154
|
+
},
|
|
155
|
+
remote: {
|
|
156
|
+
type: Boolean,
|
|
157
|
+
default: true,
|
|
158
|
+
},
|
|
159
|
+
size: {
|
|
160
|
+
type: String,
|
|
161
|
+
default: 'small',
|
|
162
|
+
},
|
|
163
|
+
searchPlaceholder: {
|
|
164
|
+
type: String,
|
|
165
|
+
default: '',
|
|
166
|
+
},
|
|
167
|
+
labelAttr: '',
|
|
168
|
+
valueAttr: '',
|
|
169
|
+
searchAttr: '',
|
|
170
|
+
itfInfo: null,
|
|
171
|
+
// 自定义选项时 是否通过展开自动触发自定义search
|
|
172
|
+
isRequiredByVisibleChange: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
default: false,
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
const popperWidth = ref('240px')
|
|
178
|
+
onMounted(() => {
|
|
179
|
+
nextTick(() => {
|
|
180
|
+
const offsetWidth = document.getElementsByClassName('bwa-pctfilterpanel-item__options')[0]?.offsetWidth
|
|
181
|
+
if (offsetWidth > 0) {
|
|
182
|
+
popperWidth.value = offsetWidth + 'px'
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
})
|
|
186
|
+
const ns = useNamespace('pctfilterpanel-item');
|
|
187
|
+
const isShowPopper = ref(false)
|
|
188
|
+
const isHoverIcon = ref(false)
|
|
189
|
+
|
|
190
|
+
const attrs = useAttrs();
|
|
191
|
+
const showTitle = computed(() => attrs.showTitle)
|
|
192
|
+
|
|
193
|
+
const data = ref([])
|
|
194
|
+
const loading = ref(false)
|
|
195
|
+
const emit = defineEmits(['update:modelValue', 'search']);
|
|
196
|
+
|
|
197
|
+
const filterPanelItem = inject(filterPanelItemKey, null);
|
|
198
|
+
const column = computed(() => filterPanelItem?.column ?? null);
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 页面参数层级覆盖配置文件传递的参数层级
|
|
202
|
+
*/
|
|
203
|
+
if (props.itfInfo) {
|
|
204
|
+
column.value.componentProps = {
|
|
205
|
+
itfInfo: props.itfInfo || {},
|
|
206
|
+
labelAttr: props.labelAttr || 'label',
|
|
207
|
+
valueAttr: props.valueAttr || 'value',
|
|
208
|
+
searchAttr: props.searchAttr || 'search'
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const searchPlaceholderStr = computed(() => column.value?.componentProps?.searchPlaceholder || props.searchPlaceholder)
|
|
213
|
+
const placeholderStr = computed(() => showTitle.value ? props.placeholder : column.value.title)
|
|
214
|
+
|
|
215
|
+
const labelPropStr = computed(() => column.value?.componentProps?.labelAttr || props.labelProp)
|
|
216
|
+
const valuePropStr = computed(() => column.value?.componentProps?.valueAttr || props.valueProp)
|
|
217
|
+
const handleClose = (val)=>{
|
|
218
|
+
|
|
219
|
+
// 优化后
|
|
220
|
+
// 1. 空值兜底:避免 modelValue.value 为 null/undefined 时报错
|
|
221
|
+
const currentModelValue = Array.isArray(modelValue.value) ? modelValue.value : [];
|
|
222
|
+
// 2. 严格相等 + 类型统一:解决 1 vs "1" 不匹配,同时避免隐式类型转换
|
|
223
|
+
modelValue.value = currentModelValue.filter(item =>
|
|
224
|
+
String(item) !== String(val.value)
|
|
225
|
+
);
|
|
226
|
+
|
|
227
|
+
}
|
|
228
|
+
const handleIconClick = () => {
|
|
229
|
+
if (isHoverIcon.value) {
|
|
230
|
+
// 多选清空逻辑:重置 modelValue 为空数组
|
|
231
|
+
modelValue.value = []
|
|
232
|
+
isHoverIcon.value = false; // 重置悬浮状态
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
// 原有逻辑:切换下拉显隐
|
|
236
|
+
isShowPopper.value = !isShowPopper.value;
|
|
237
|
+
};
|
|
238
|
+
const getData = async (query) => {
|
|
239
|
+
loading.value = true
|
|
240
|
+
const { itfInfo, searchAttr } = column.value.componentProps
|
|
241
|
+
const {url, method, options, params } = {
|
|
242
|
+
url: unref(itfInfo).url,
|
|
243
|
+
method: unref(itfInfo).method || 'POST',
|
|
244
|
+
options: unref(itfInfo).options || {},
|
|
245
|
+
params: { ...unref(itfInfo).params, [searchAttr]: query || ''} || {},
|
|
246
|
+
}
|
|
247
|
+
data.value = (await unref(httpRequest)[method.toLowerCase()](url, params, options))?.data
|
|
248
|
+
loading.value = false
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
data.value = props.options ?? []
|
|
252
|
+
const visibleChange = (val) => {
|
|
253
|
+
isShowPopper.value = val
|
|
254
|
+
if (!val || !column.value.componentProps || column.value?.componentProps?.options) {
|
|
255
|
+
if (isShowPopper.value && props.isRequiredByVisibleChange) {
|
|
256
|
+
emit('search', '')
|
|
257
|
+
}
|
|
258
|
+
return
|
|
259
|
+
}
|
|
260
|
+
getData()
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const handleFieldSearch = (query) => {
|
|
264
|
+
if (column.value.componentProps) {
|
|
265
|
+
getData(query)
|
|
266
|
+
} else {
|
|
267
|
+
emit('search', query)
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const search = ref('')
|
|
272
|
+
watch(() => search.value, val => {
|
|
273
|
+
handleFieldSearch(val)
|
|
274
|
+
})
|
|
275
|
+
|
|
276
|
+
const modelValue = computed({
|
|
277
|
+
get: () => {
|
|
278
|
+
if (props.multiple) {
|
|
279
|
+
return Array.isArray(props.modelValue)
|
|
280
|
+
? props.modelValue.map((item) => item )
|
|
281
|
+
: [];
|
|
282
|
+
} else {
|
|
283
|
+
return props.modelValue == null || Array.isArray(props.modelValue) ? '' : props.modelValue;
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
set: (v) => emit('update:modelValue', v),
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* 清除已选
|
|
291
|
+
*/
|
|
292
|
+
const advanceSelectRef = ref(null)
|
|
293
|
+
const handleClearClick = () => {
|
|
294
|
+
if (advanceSelectRef.value) {
|
|
295
|
+
advanceSelectRef.value.handleClearClick()
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
defineExpose({
|
|
300
|
+
data
|
|
301
|
+
})
|
|
302
|
+
</script>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
<div v-if="showTitle" :class="ns.e('title')" style="padding-right: 8px">{{searchTitle}}</div>
|
|
43
43
|
<ElInput
|
|
44
44
|
prefix-icon="Search"
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
clearable
|
|
47
47
|
v-model="searchValue"
|
|
48
48
|
:placeholder="searchPlaceholder"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
>
|
|
61
61
|
<template #reference-content>
|
|
62
62
|
<ElButton
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
:class="ns.e('filterBut')"
|
|
65
65
|
>
|
|
66
66
|
<div :class="ns.be('filter', 'plus')"></div>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
<ElButton
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
type="primary"
|
|
95
95
|
:class="ns.e('reset')"
|
|
96
96
|
@click="handleSearch"
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
查询
|
|
99
99
|
</ElButton>
|
|
100
100
|
<ElButton
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
:class="ns.e('reset')"
|
|
103
103
|
@click="handleReset"
|
|
104
104
|
>
|