@ctzy-web-client/plugin-component-vue 1.0.0
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/package.json +43 -0
- package/src/advance-select/advance-operation.vue +44 -0
- package/src/advance-select/advance-option.vue +115 -0
- package/src/advance-select/advance-select.vue +343 -0
- package/src/advance-select/events-helpers.js +40 -0
- package/src/advance-select/index.js +13 -0
- package/src/advance-select/use-advance-option.js +58 -0
- package/src/advance-select/use-advance-select.js +142 -0
- package/src/application-slot/application-slot.js +70 -0
- package/src/application-slot/breadcrumb-item.vue +12 -0
- package/src/application-slot/header-tools-item.vue +12 -0
- package/src/application-slot/index.js +17 -0
- package/src/breadcrumb-select/breadcrumb-select.vue +97 -0
- package/src/breadcrumb-select/index.js +6 -0
- package/src/components.js +39 -0
- package/src/contextmenu/contextmenu-item.vue +13 -0
- package/src/contextmenu/contextmenu.vue +56 -0
- package/src/contextmenu/index.js +11 -0
- package/src/contextmenu/use-contextmenu.js +117 -0
- package/src/data-form/data-form-item.vue +49 -0
- package/src/data-form/data-form.vue +212 -0
- package/src/data-form/dynamic-component.js +24 -0
- package/src/data-form/form-components/Blots/AtBlot.js +32 -0
- package/src/data-form/form-components/bwa-date-picker.vue +43 -0
- package/src/data-form/form-components/bwa-date-time-picker.vue +49 -0
- package/src/data-form/form-components/bwa-input-float.vue +41 -0
- package/src/data-form/form-components/bwa-input-integer.vue +58 -0
- package/src/data-form/form-components/bwa-input.vue +32 -0
- package/src/data-form/form-components/bwa-multi-select.vue +27 -0
- package/src/data-form/form-components/bwa-rich-text-tinymce.vue +561 -0
- package/src/data-form/form-components/bwa-rich-text.vue +395 -0
- package/src/data-form/form-components/bwa-select.vue +67 -0
- package/src/data-form/form-components/bwa-textarea.vue +28 -0
- package/src/data-form/form-components/bwa-upload.vue +145 -0
- package/src/data-form/form-components/bwa-user-multi-select.vue +25 -0
- package/src/data-form/form-components/bwa-user-select.vue +81 -0
- package/src/data-form/index.js +35 -0
- package/src/data-table/data-column-view.vue +131 -0
- package/src/data-table/data-table-card.vue +81 -0
- package/src/data-table/data-table-column.vue +52 -0
- package/src/data-table/data-table.vue +426 -0
- package/src/data-table/dynamic-component.js +58 -0
- package/src/data-table/index.js +13 -0
- package/src/data-table/use-datatable-drag.js +156 -0
- package/src/datatable-settings/datatable-settings.vue +323 -0
- package/src/datatable-settings/index.js +6 -0
- package/src/date-range/date-picker.vue +115 -0
- package/src/date-range/date-range.vue +202 -0
- package/src/date-range/index.js +6 -0
- package/src/drag-list/constants.js +1 -0
- package/src/drag-list/drag-item.vue +46 -0
- package/src/drag-list/drag-list.vue +50 -0
- package/src/drag-list/index.js +6 -0
- package/src/drag-list/use-drag-list.js +209 -0
- package/src/dragable/constants.js +3 -0
- package/src/dragable/dragable-item.vue +19 -0
- package/src/dragable/dragable-operation.vue +28 -0
- package/src/dragable/dragable.vue +26 -0
- package/src/dragable/index.js +14 -0
- package/src/dragable/use-dragable.js +227 -0
- package/src/filter-panel/conditions/condition.js +35 -0
- package/src/filter-panel/conditions/date-range-condition.vue +35 -0
- package/src/filter-panel/conditions/department-condition/data.json +29537 -0
- package/src/filter-panel/conditions/department-condition/department-condition.vue +92 -0
- package/src/filter-panel/conditions/department-condition/department-node.vue +52 -0
- package/src/filter-panel/conditions/index.js +22 -0
- package/src/filter-panel/conditions/input-condition.vue +63 -0
- package/src/filter-panel/conditions/multi-user-condition.vue +56 -0
- package/src/filter-panel/conditions/multiple-menu-condition.vue +45 -0
- package/src/filter-panel/conditions/single-menu-condition.vue +58 -0
- package/src/filter-panel/conditions/single-user-condition.vue +56 -0
- package/src/filter-panel/filter-panel-item.vue +46 -0
- package/src/filter-panel/filter-panel.vue +149 -0
- package/src/filter-panel/index.js +17 -0
- package/src/filter-panel/use-filter-panel-item.js +59 -0
- package/src/filter-panel/use-filter-panel.js +203 -0
- package/src/hooks/use-data/index.js +234 -0
- package/src/index.js +48 -0
- package/src/layout/index.js +6 -0
- package/src/layout/layout.vue +74 -0
- package/src/make-installer.js +36 -0
- package/src/math/Rectangle.js +28 -0
- package/src/menu/index.js +6 -0
- package/src/menu/menu-item.vue +41 -0
- package/src/menu/menu.vue +53 -0
- package/src/panel/index.js +6 -0
- package/src/panel/panel.vue +42 -0
- package/src/panel-tabs/index.js +6 -0
- package/src/panel-tabs/panel-tabs.js +92 -0
- package/src/pct-filter-panel/index.js +10 -0
- package/src/pct-filter-panel/pct-compents/index.js +10 -0
- package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +63 -0
- package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +60 -0
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +177 -0
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue +142 -0
- package/src/pct-filter-panel/pct-filter-panel-item.vue +46 -0
- package/src/pct-filter-panel/pct-filter-panel.vue +201 -0
- package/src/pct-filter-panel/use-filter-panel-item.js +61 -0
- package/src/pct-filter-panel/use-filter-panel.js +206 -0
- package/src/plugins.js +3 -0
- package/src/progress/index.js +8 -0
- package/src/progress/progress-item.vue +81 -0
- package/src/progress/progress.vue +58 -0
- package/src/progress/use-progress.js +66 -0
- package/src/utils/db.js +8 -0
- package/src/utils.js +263 -0
- package/src/where-filter-panel/index.js +0 -0
- package/src/where-filter-panel/use-where-filter-panel.js +28 -0
- package/src/where-filter-panel/where-filter-panel.vue +9 -0
- package/style/advance-select.scss +316 -0
- package/style/breadcrumb-select.scss +80 -0
- package/style/common/var.scss +240 -0
- package/style/common.scss +48 -0
- package/style/contextmenu.scss +58 -0
- package/style/data-form.scss +35 -0
- package/style/data-table.scss +81 -0
- package/style/datatable-settings.scss +125 -0
- package/style/date-range.scss +136 -0
- package/style/department-condition.scss +39 -0
- package/style/drag-list.scss +68 -0
- package/style/dragable.scss +8 -0
- package/style/filter-panel.scss +199 -0
- package/style/index.scss +22 -0
- package/style/input-condition.scss +30 -0
- package/style/layout.scss +70 -0
- package/style/menu.scss +184 -0
- package/style/mixins/_var.scss +21 -0
- package/style/mixins/config.scss +4 -0
- package/style/mixins/function.scss +62 -0
- package/style/mixins/mixins.scss +88 -0
- package/style/panel-tabs.scss +60 -0
- package/style/panel.scss +110 -0
- package/style/pct-filter-panel.scss +306 -0
- package/style/progress.scss +122 -0
- package/style/rich-text.scss +30 -0
- package/style/theme/theme.scss +161 -0
- package/style/theme/var.scss +34 -0
- package/style/var.scss +21 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<SingleMenuCondition
|
|
3
|
+
:multiple="true"
|
|
4
|
+
:showSearch="false"
|
|
5
|
+
:loading="loading"
|
|
6
|
+
@visible-change="handleVisibleChange"
|
|
7
|
+
>
|
|
8
|
+
<template #value="{ selected }">
|
|
9
|
+
{{ formatValue(selected) }}
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<DepartmentNode v-for="item of data" :item="item"></DepartmentNode>
|
|
13
|
+
</SingleMenuCondition>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import SingleMenuCondition from '../single-menu-condition.vue';
|
|
18
|
+
import DepartmentNode from './department-node.vue';
|
|
19
|
+
import { ref, unref } from 'vue';
|
|
20
|
+
import { useService } from 'web-base-client-vue';
|
|
21
|
+
|
|
22
|
+
defineOptions({
|
|
23
|
+
name: 'BwaDepartmentCondition',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const props = defineProps({});
|
|
27
|
+
|
|
28
|
+
const departmentService = useService('DepartmentService');
|
|
29
|
+
|
|
30
|
+
const data = ref([]);
|
|
31
|
+
|
|
32
|
+
const loading = ref(false);
|
|
33
|
+
|
|
34
|
+
const map = new Map();
|
|
35
|
+
|
|
36
|
+
const formatValue = (selected) => {
|
|
37
|
+
selected = Array.isArray(selected) ? selected : selected ? [selected] : [];
|
|
38
|
+
|
|
39
|
+
selected = selected.map((item) => map.get(item.value + '')).filter(Boolean);
|
|
40
|
+
|
|
41
|
+
if (!selected.length) {
|
|
42
|
+
return '全部';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return selected.map((item) => item.desc).join(',');
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const handleVisibleChange = async (isShow) => {
|
|
49
|
+
if (!isShow || !unref(departmentService)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
loading.value = true;
|
|
55
|
+
|
|
56
|
+
const departmentsResult = await unref(departmentService).getDepartments();
|
|
57
|
+
|
|
58
|
+
if (departmentsResult.code != 0) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const departments = [];
|
|
63
|
+
for (let department of departmentsResult.data || []) {
|
|
64
|
+
department.children = [];
|
|
65
|
+
|
|
66
|
+
if (!department.pid) {
|
|
67
|
+
departments.push(department);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
map.set(department.id + '', department);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
for (const department of departmentsResult.data || []) {
|
|
74
|
+
if (!department.pid) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const parent = map.get(department.pid + '');
|
|
79
|
+
|
|
80
|
+
if (!parent) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
parent.children.push(department);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
data.value = departments;
|
|
88
|
+
} finally {
|
|
89
|
+
loading.value = false;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="ns.b()">
|
|
3
|
+
<div :class="ns.e('content')">
|
|
4
|
+
<div
|
|
5
|
+
:class="ns.e('arrow-wrapper')"
|
|
6
|
+
@click="isShowChildren = !isShowChildren"
|
|
7
|
+
>
|
|
8
|
+
<ElIcon
|
|
9
|
+
:class="[ns.e('arrow'), ns.is('collpase', !isShowChildren)]"
|
|
10
|
+
v-if="item.children.length"
|
|
11
|
+
>
|
|
12
|
+
<CaretBottom />
|
|
13
|
+
</ElIcon>
|
|
14
|
+
</div>
|
|
15
|
+
<BwaAdvanceOption :value="item.id" :label="item.name"></BwaAdvanceOption>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<ElCollapseTransition>
|
|
19
|
+
<div
|
|
20
|
+
v-if="isShowChildren"
|
|
21
|
+
:class="ns.e('children')"
|
|
22
|
+
:style="{ paddingLeft: 22 + level * 5 + 'px' }"
|
|
23
|
+
>
|
|
24
|
+
<BwaDepartmentNode v-for="child of item.children" :item="child" />
|
|
25
|
+
</div>
|
|
26
|
+
</ElCollapseTransition>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup>
|
|
31
|
+
import { ref } from 'vue';
|
|
32
|
+
import { useNamespace } from 'web-base-client-vue';
|
|
33
|
+
|
|
34
|
+
defineOptions({
|
|
35
|
+
name: 'BwaDepartmentNode',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const props = defineProps({
|
|
39
|
+
item: {
|
|
40
|
+
type: Object,
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
level: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 0,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const ns = useNamespace('department-node');
|
|
50
|
+
|
|
51
|
+
const isShowChildren = ref(false);
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { withInstall } from 'element-plus/es/utils/vue/install';
|
|
2
|
+
|
|
3
|
+
import Condition from './condition';
|
|
4
|
+
import DateRangeCondition from './date-range-condition.vue';
|
|
5
|
+
import SingleMenuCondition from './single-menu-condition.vue';
|
|
6
|
+
import MultipleMenuCondition from './multiple-menu-condition.vue';
|
|
7
|
+
import MultiUserCondition from './multi-user-condition.vue';
|
|
8
|
+
import SingleUserCondition from './single-user-condition.vue';
|
|
9
|
+
import InputCondition from './input-condition.vue';
|
|
10
|
+
import DepartmentCondition from './department-condition/department-condition.vue';
|
|
11
|
+
|
|
12
|
+
export const BwaCondition = withInstall(Condition, {
|
|
13
|
+
DateRangeCondition,
|
|
14
|
+
SingleMenuCondition,
|
|
15
|
+
MultipleMenuCondition,
|
|
16
|
+
InputCondition,
|
|
17
|
+
MultiUserCondition,
|
|
18
|
+
DepartmentCondition,
|
|
19
|
+
SingleUserCondition
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default BwaCondition;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElTooltip
|
|
3
|
+
v-model:visible="visible"
|
|
4
|
+
pure
|
|
5
|
+
teleported
|
|
6
|
+
effect="light"
|
|
7
|
+
role="dialog"
|
|
8
|
+
:transition="`el-zoom-in-top`"
|
|
9
|
+
:fallback-placements="['bottom', 'top', 'right', 'left']"
|
|
10
|
+
:gpu-acceleration="false"
|
|
11
|
+
:show-arrow="false"
|
|
12
|
+
:stop-popper-mouse-event="false"
|
|
13
|
+
:hide-after="0"
|
|
14
|
+
persistent
|
|
15
|
+
trigger="click"
|
|
16
|
+
>
|
|
17
|
+
<div :class="[ns.b(), ns.is('active', visible)]">
|
|
18
|
+
<slot name="label">
|
|
19
|
+
<span v-if="column" :class="ns.e('label')">{{ column.title }}</span>
|
|
20
|
+
</slot>
|
|
21
|
+
</div>
|
|
22
|
+
<template #content>
|
|
23
|
+
<div :class="ns.e('content')">
|
|
24
|
+
<ElInput :class="ns.e('input')" v-model="value" clearable />
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
</ElTooltip>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup>
|
|
31
|
+
import { computed, inject, ref } from 'vue';
|
|
32
|
+
import { useNamespace, filterPanelItemKey } from 'web-base-client-vue';
|
|
33
|
+
|
|
34
|
+
defineOptions({
|
|
35
|
+
name: 'BwaInputCondition',
|
|
36
|
+
__conditionTitle__: '输入框',
|
|
37
|
+
__conditionDefault__: '',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
modelValue: {
|
|
42
|
+
type: String,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const emit = defineEmits(['update:modelValue']);
|
|
47
|
+
|
|
48
|
+
const ns = useNamespace('input-condition');
|
|
49
|
+
|
|
50
|
+
if (typeof props.modelValue !== 'string') {
|
|
51
|
+
emit('update:modelValue', '');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const value = computed({
|
|
55
|
+
get: () => props.modelValue || '',
|
|
56
|
+
set: emit.bind(null, 'update:modelValue'),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const filterPanelItem = inject(filterPanelItemKey, null);
|
|
60
|
+
const column = computed(() => filterPanelItem?.column ?? null);
|
|
61
|
+
|
|
62
|
+
const visible = ref(false);
|
|
63
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BwaAdvanceSelect v-bind="attrs" :multiple="true" @search="loadUserList">
|
|
3
|
+
<BwaAdvanceOption
|
|
4
|
+
v-for="item of userList"
|
|
5
|
+
:key="item.value"
|
|
6
|
+
:value="item.value"
|
|
7
|
+
:label="item.label"
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<template #operation>
|
|
11
|
+
<slot name="operation"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
<template #empy>
|
|
14
|
+
<slot name="empy"></slot>
|
|
15
|
+
</template>
|
|
16
|
+
<template #label="{ selectedValue, column }">
|
|
17
|
+
<slot name="label" :selectedValue="selectedValue" :column="column"></slot>
|
|
18
|
+
</template>
|
|
19
|
+
<template #value>
|
|
20
|
+
<slot name="value"></slot>
|
|
21
|
+
</template>
|
|
22
|
+
</BwaAdvanceSelect>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup>
|
|
26
|
+
import { onMounted, ref, unref, useAttrs } from 'vue';
|
|
27
|
+
import { useService } from 'web-base-client-vue';
|
|
28
|
+
import { BwaAdvanceSelect, BwaAdvanceOption } from '../../advance-select';
|
|
29
|
+
|
|
30
|
+
defineOptions({
|
|
31
|
+
name: 'BwaMultiUserCondition',
|
|
32
|
+
__conditionTitle__: '多选用户',
|
|
33
|
+
__conditionDefault__: () => [],
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const attrs = useAttrs();
|
|
37
|
+
const userService = useService('UserService');
|
|
38
|
+
|
|
39
|
+
const userList = ref([]);
|
|
40
|
+
|
|
41
|
+
const loadUserList = async (name = '') => {
|
|
42
|
+
if (!unref(userService)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const userListResult = await unref(userService).getUserList({ name });
|
|
47
|
+
|
|
48
|
+
if (userListResult.code != 0) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
userList.value = userListResult.data || [];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
onMounted(loadUserList);
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BwaAdvanceSelect v-bind="attrs" :multiple="true">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
<template #operation>
|
|
5
|
+
<slot name="operation"></slot>
|
|
6
|
+
</template>
|
|
7
|
+
<template #empy>
|
|
8
|
+
<slot name="empy"></slot>
|
|
9
|
+
</template>
|
|
10
|
+
<template #label="{ selectedValue, column }">
|
|
11
|
+
<slot name="label" :selectedValue="selectedValue" :column="column"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
<template #value>
|
|
14
|
+
<slot name="value"></slot>
|
|
15
|
+
</template>
|
|
16
|
+
</BwaAdvanceSelect>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
import { useAttrs } from 'vue';
|
|
21
|
+
import { BwaAdvanceSelect } from '../../advance-select';
|
|
22
|
+
|
|
23
|
+
defineOptions({
|
|
24
|
+
name: 'BwaMultipleMenuCondition',
|
|
25
|
+
__conditionTitle__: '多选列表',
|
|
26
|
+
__conditionDefault__: () => [],
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const attrs = useAttrs();
|
|
30
|
+
|
|
31
|
+
// const props = defineProps({
|
|
32
|
+
// modelValue: {
|
|
33
|
+
// type: null,
|
|
34
|
+
// },
|
|
35
|
+
// });
|
|
36
|
+
|
|
37
|
+
// const emit = defineEmits(['update:modelValue']);
|
|
38
|
+
|
|
39
|
+
// const value = computed({
|
|
40
|
+
// get: () => props.modelValue,
|
|
41
|
+
// set: (v) => {
|
|
42
|
+
// emit('update:modelValue', v);
|
|
43
|
+
// },
|
|
44
|
+
// });
|
|
45
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BwaAdvanceSelect v-bind="attrs" v-model="value" :multiple="false">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
<template #operation>
|
|
5
|
+
<!-- <BwaAdvanceOperation class="is-border">
|
|
6
|
+
<ElButton
|
|
7
|
+
:class="ns.e('clear')"
|
|
8
|
+
style="width: 100%"
|
|
9
|
+
@click="handleClear"
|
|
10
|
+
>
|
|
11
|
+
清除已选择项
|
|
12
|
+
</ElButton>
|
|
13
|
+
</BwaAdvanceOperation> -->
|
|
14
|
+
<slot name="operation"></slot>
|
|
15
|
+
</template>
|
|
16
|
+
<template #empy>
|
|
17
|
+
<slot name="empy"></slot>
|
|
18
|
+
</template>
|
|
19
|
+
<template #label="{ selectedValue, column }">
|
|
20
|
+
<slot name="label" :selectedValue="selectedValue" :column="column"></slot>
|
|
21
|
+
</template>
|
|
22
|
+
<template #value="{selected}">
|
|
23
|
+
<slot name="value" :selected="selected"></slot>
|
|
24
|
+
</template>
|
|
25
|
+
</BwaAdvanceSelect>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup>
|
|
29
|
+
import { useNamespace } from 'web-base-client-vue';
|
|
30
|
+
import { computed, useAttrs } from 'vue';
|
|
31
|
+
import { BwaAdvanceOperation, BwaAdvanceSelect } from '../../advance-select';
|
|
32
|
+
import { ElButton } from 'element-plus';
|
|
33
|
+
|
|
34
|
+
defineOptions({
|
|
35
|
+
name: 'BwaSingleMenuCondition',
|
|
36
|
+
__conditionTitle__: '单选列表',
|
|
37
|
+
__conditionDefault__: '',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
modelValue: null,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const emit = defineEmits(['update:modelValue']);
|
|
45
|
+
|
|
46
|
+
const value = computed({
|
|
47
|
+
get: () => props.modelValue,
|
|
48
|
+
set: (v) => emit('update:modelValue', v),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const ns = useNamespace('single-menu');
|
|
52
|
+
|
|
53
|
+
const attrs = useAttrs();
|
|
54
|
+
|
|
55
|
+
const handleClear = () => {
|
|
56
|
+
value.value = '';
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BwaAdvanceSelect v-bind="attrs" :multiple="false" @search="loadUserList">
|
|
3
|
+
<BwaAdvanceOption
|
|
4
|
+
v-for="item of userList"
|
|
5
|
+
:key="item.value"
|
|
6
|
+
:value="item.value"
|
|
7
|
+
:label="item.label"
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<template #operation>
|
|
11
|
+
<slot name="operation"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
<template #empy>
|
|
14
|
+
<slot name="empy"></slot>
|
|
15
|
+
</template>
|
|
16
|
+
<template #label="{ selectedValue, column }">
|
|
17
|
+
<slot name="label" :selectedValue="selectedValue" :column="column"></slot>
|
|
18
|
+
</template>
|
|
19
|
+
<template #value>
|
|
20
|
+
<slot name="value"></slot>
|
|
21
|
+
</template>
|
|
22
|
+
</BwaAdvanceSelect>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup>
|
|
26
|
+
import { onMounted, ref, unref, useAttrs } from 'vue';
|
|
27
|
+
import { useService } from 'web-base-client-vue';
|
|
28
|
+
import { BwaAdvanceSelect, BwaAdvanceOption } from '../../advance-select';
|
|
29
|
+
|
|
30
|
+
defineOptions({
|
|
31
|
+
name: 'BwaSingleUserCondition',
|
|
32
|
+
__conditionTitle__: '单选用户',
|
|
33
|
+
__conditionDefault__: () => [],
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const attrs = useAttrs();
|
|
37
|
+
const userService = useService('UserService');
|
|
38
|
+
|
|
39
|
+
const userList = ref([]);
|
|
40
|
+
|
|
41
|
+
const loadUserList = async (name = '') => {
|
|
42
|
+
if (!unref(userService)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const userListResult = await unref(userService).getUserList({ name });
|
|
47
|
+
|
|
48
|
+
if (userListResult.code != 0) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
userList.value = userListResult.data || [];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
onMounted(loadUserList);
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="ns.b('item')">
|
|
3
|
+
<slot :data="data"></slot>
|
|
4
|
+
<i
|
|
5
|
+
v-if="allowClose"
|
|
6
|
+
:class="['ptp-icon', 'ptp-close', ns.be('item', 'close')]"
|
|
7
|
+
@click="closeHandle"
|
|
8
|
+
>
|
|
9
|
+
</i>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { reactive, provide } from 'vue';
|
|
15
|
+
import { useNamespace, filterPanelItemKey } from 'web-base-client-vue';
|
|
16
|
+
import { useFilterPanelItem } from './use-filter-panel-item';
|
|
17
|
+
|
|
18
|
+
defineOptions({
|
|
19
|
+
name: 'BwaFilterPanelItem',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
prop: {
|
|
24
|
+
type: String,
|
|
25
|
+
},
|
|
26
|
+
close: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const emit = defineEmits(['close']);
|
|
33
|
+
|
|
34
|
+
const ns = useNamespace('filterpanel');
|
|
35
|
+
|
|
36
|
+
const { value, column, allowClose, closeHandle } = useFilterPanelItem(props);
|
|
37
|
+
|
|
38
|
+
const data = reactive({ value });
|
|
39
|
+
|
|
40
|
+
provide(
|
|
41
|
+
filterPanelItemKey,
|
|
42
|
+
reactive({
|
|
43
|
+
column,
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="ns.b()">
|
|
3
|
+
<slot>
|
|
4
|
+
<slot
|
|
5
|
+
v-for="column in currentFilterColumns"
|
|
6
|
+
:key="column.attrName"
|
|
7
|
+
:name="`condition-${column.attrName}`"
|
|
8
|
+
:attrName="column.attrName"
|
|
9
|
+
>
|
|
10
|
+
<FilterPanelItem :prop="column.fullAttrName">
|
|
11
|
+
<template #default="{ data }">
|
|
12
|
+
<BwaCondition
|
|
13
|
+
v-model="data.value"
|
|
14
|
+
:column="column"
|
|
15
|
+
:record="searchParams"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
18
|
+
</FilterPanelItem>
|
|
19
|
+
</slot>
|
|
20
|
+
</slot>
|
|
21
|
+
<FilterPanelItem v-if="showFieldOptions">
|
|
22
|
+
<BwaAdvanceSelect
|
|
23
|
+
v-model="selectedColumnAttrNames"
|
|
24
|
+
:show-selectIcon="true"
|
|
25
|
+
@search="handleFieldSearch"
|
|
26
|
+
:class="ns.e('options')"
|
|
27
|
+
>
|
|
28
|
+
<template #reference-content>
|
|
29
|
+
<!-- <ElIcon><Plus /></ElIcon> -->
|
|
30
|
+
<div :class="ns.be('filter', 'plus')"></div>
|
|
31
|
+
|
|
32
|
+
<span :class="ns.be('filter', 'label')"> 筛选 </span>
|
|
33
|
+
</template>
|
|
34
|
+
<BwaAdvanceOption
|
|
35
|
+
v-for="column in closableColumns"
|
|
36
|
+
:value="column.fullAttrName"
|
|
37
|
+
:label="column.title"
|
|
38
|
+
:key="column.fullAttrName"
|
|
39
|
+
:class="ns.be('filter', 'option')"
|
|
40
|
+
>
|
|
41
|
+
<ElCheckbox
|
|
42
|
+
@click.prevent
|
|
43
|
+
:modelValue="selectedColumnAttrNames.includes(column.fullAttrName)"
|
|
44
|
+
:class="ns.be('filter', 'checkbox')"
|
|
45
|
+
>
|
|
46
|
+
{{ column.title }}
|
|
47
|
+
</ElCheckbox>
|
|
48
|
+
<span :class="ns.be('filter', 'title')">
|
|
49
|
+
{{ column.componentTitle }}
|
|
50
|
+
</span>
|
|
51
|
+
</BwaAdvanceOption>
|
|
52
|
+
</BwaAdvanceSelect>
|
|
53
|
+
</FilterPanelItem>
|
|
54
|
+
|
|
55
|
+
<ElInput
|
|
56
|
+
v-if="showSearch"
|
|
57
|
+
prefix-icon="Search"
|
|
58
|
+
size="small"
|
|
59
|
+
clearable
|
|
60
|
+
v-model="searchValue"
|
|
61
|
+
:placeholder="searchPlaceholder"
|
|
62
|
+
:class="ns.e('search')"
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<ElButton
|
|
66
|
+
v-if="isChange"
|
|
67
|
+
size="small"
|
|
68
|
+
:class="ns.e('reset')"
|
|
69
|
+
@click="handleReset"
|
|
70
|
+
>
|
|
71
|
+
重置
|
|
72
|
+
</ElButton>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script setup>
|
|
77
|
+
import { useNamespace, filterPanelKey } from 'web-base-client-vue';
|
|
78
|
+
import { useFilterPanel } from './use-filter-panel';
|
|
79
|
+
import { computed, provide, reactive, unref, watch } from 'vue';
|
|
80
|
+
import FilterPanelItem from './filter-panel-item.vue';
|
|
81
|
+
|
|
82
|
+
defineOptions({
|
|
83
|
+
name: 'BwaFilterPanel',
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const props = defineProps({
|
|
87
|
+
dataTable: {
|
|
88
|
+
type: Object,
|
|
89
|
+
},
|
|
90
|
+
showSearch: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: false,
|
|
93
|
+
},
|
|
94
|
+
showFieldOptions: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: true,
|
|
97
|
+
},
|
|
98
|
+
searchAttr: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: 'search',
|
|
101
|
+
},
|
|
102
|
+
searchPlaceholder: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: '',
|
|
105
|
+
},
|
|
106
|
+
searchFields: {
|
|
107
|
+
type: Array,
|
|
108
|
+
default: () => [],
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const emit = defineEmits(['reset', 'filter']);
|
|
113
|
+
|
|
114
|
+
const ns = useNamespace('filterpanel');
|
|
115
|
+
|
|
116
|
+
const {
|
|
117
|
+
dataTable,
|
|
118
|
+
filterPanel,
|
|
119
|
+
currentFilterColumns,
|
|
120
|
+
selectedColumnAttrNames,
|
|
121
|
+
closableColumns,
|
|
122
|
+
searchParams,
|
|
123
|
+
handleFieldSearch,
|
|
124
|
+
searchValue,
|
|
125
|
+
isChange,
|
|
126
|
+
handleReset,
|
|
127
|
+
} = useFilterPanel(props, { emit });
|
|
128
|
+
|
|
129
|
+
watch(
|
|
130
|
+
filterPanel,
|
|
131
|
+
(filterPanel, _, onCleanup) => {
|
|
132
|
+
filterPanel.existComponent = true;
|
|
133
|
+
|
|
134
|
+
onCleanup(() => {
|
|
135
|
+
filterPanel.existComponent = false;
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
{ immediate: true }
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
provide(
|
|
142
|
+
filterPanelKey,
|
|
143
|
+
reactive({
|
|
144
|
+
dataTable,
|
|
145
|
+
filterPanel,
|
|
146
|
+
currentFilterColumns,
|
|
147
|
+
})
|
|
148
|
+
);
|
|
149
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { withInstall } from 'element-plus/es/utils/vue/install';
|
|
2
|
+
import FilterPanel from "./filter-panel.vue"
|
|
3
|
+
import FilterPanelItem from './filter-panel-item.vue'
|
|
4
|
+
// import FilterPanel from './filter-panel.vue';
|
|
5
|
+
// import FilterPanelItem from './filter-panel-item.vue';
|
|
6
|
+
import { BwaCondition } from './conditions';
|
|
7
|
+
|
|
8
|
+
export const BwaFilterPanel = withInstall(FilterPanel, {
|
|
9
|
+
FilterPanelItem,
|
|
10
|
+
});
|
|
11
|
+
export const BwaFilterpanelItem = withInstall(FilterPanelItem, {
|
|
12
|
+
BwaCondition,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { BwaCondition };
|
|
16
|
+
|
|
17
|
+
export default FilterPanel;
|