sohelp-eleplus 1.1.13
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/README.md +7 -0
- package/cache/DictCache.js +58 -0
- package/cache/ModuleCache.js +352 -0
- package/components.js +45 -0
- package/core-export.js +4 -0
- package/http/CrudHttp.js +115 -0
- package/http/DictHttp.js +12 -0
- package/http/ModuleHttp.js +68 -0
- package/http/SohelpHttp.js +125 -0
- package/index.js +6 -0
- package/installer.js +8 -0
- package/lang/en_US.js +4 -0
- package/lang/zh_CN.js +4 -0
- package/lang/zh_TW.js +4 -0
- package/package.json +9 -0
- package/sohelp-ace-editor/index.vue +198 -0
- package/sohelp-application-select/index.vue +15 -0
- package/sohelp-autocode/index.vue +53 -0
- package/sohelp-calendar-view/index.vue +11 -0
- package/sohelp-card-view/index.vue +11 -0
- package/sohelp-condition/index.vue +210 -0
- package/sohelp-cry-input/index.vue +64 -0
- package/sohelp-date/index.vue +27 -0
- package/sohelp-datetime/index.vue +44 -0
- package/sohelp-datetime-picker/index.vue +86 -0
- package/sohelp-datetime-range/index.vue +59 -0
- package/sohelp-dict/index.vue +207 -0
- package/sohelp-dict/props.js +68 -0
- package/sohelp-drawer/index.vue +31 -0
- package/sohelp-drop-card/index.vue +94 -0
- package/sohelp-drop-card/props.js +68 -0
- package/sohelp-dyn-select/index.vue +99 -0
- package/sohelp-dyn-select/props.js +67 -0
- package/sohelp-dyn-tree/index.vue +82 -0
- package/sohelp-dyn-tree-select/index.vue +114 -0
- package/sohelp-entity-form/index.vue +524 -0
- package/sohelp-entity-grid/index.vue +30 -0
- package/sohelp-file-upload/index.vue +218 -0
- package/sohelp-filter-scheme/components/condition.vue +102 -0
- package/sohelp-filter-scheme/components/filter.vue +45 -0
- package/sohelp-filter-scheme/components/keywords.vue +15 -0
- package/sohelp-filter-scheme/components/scheme.vue +49 -0
- package/sohelp-filter-scheme/index.vue +113 -0
- package/sohelp-grid/SohelpGridConfig.js~ +408 -0
- package/sohelp-grid/components/filter-condition-item.vue +298 -0
- package/sohelp-grid/index.vue +1886 -0
- package/sohelp-grid/js/ConditionType.js +101 -0
- package/sohelp-grid/js/DefaultGridOptions.js +141 -0
- package/sohelp-grid/js/DefaultProps.js +27 -0
- package/sohelp-grid/js/SohelpConfigFunction.js +0 -0
- package/sohelp-grid/js/SohelpGridConfig.js +101 -0
- package/sohelp-grid/js/useSohelpGridConfig.js +519 -0
- package/sohelp-grid-select/index.vue +245 -0
- package/sohelp-grid-view/filter/config/grid-filter-condition.vue +221 -0
- package/sohelp-grid-view/filter/config/grid-filter-config.vue +27 -0
- package/sohelp-grid-view/filter/config/grid-filter-field.vue +378 -0
- package/sohelp-grid-view/filter/config/grid-filter-keywords.vue +310 -0
- package/sohelp-grid-view/filter/config/grid-filter-list.vue +313 -0
- package/sohelp-grid-view/filter/config/grid-filter-scheme.vue +264 -0
- package/sohelp-grid-view/filter/config/grid-filter-sort.vue +310 -0
- package/sohelp-grid-view/filter/config/index.vue +206 -0
- package/sohelp-grid-view/filter/filter-form.vue +427 -0
- package/sohelp-grid-view/filter/filter-toolbar.vue +110 -0
- package/sohelp-grid-view/filter/index.vue +160 -0
- package/sohelp-grid-view/index.vue +379 -0
- package/sohelp-grid-view-select/index.vue +141 -0
- package/sohelp-group-view/index.vue +11 -0
- package/sohelp-icon-select/index.vue +96 -0
- package/sohelp-icon-select/vxeui-icon.js +90 -0
- package/sohelp-image-upload/index.vue +286 -0
- package/sohelp-input/index.vue +39 -0
- package/sohelp-modal/index.vue +49 -0
- package/sohelp-module/index.vue +54 -0
- package/sohelp-module/useModalManager.js +89 -0
- package/sohelp-module/useSohelpModule.js +66 -0
- package/sohelp-number-input/index.vue +32 -0
- package/sohelp-number-range/index.vue +135 -0
- package/sohelp-org-select/index.vue +30 -0
- package/sohelp-org-tree/index.vue +18 -0
- package/sohelp-org-tree-select/index.vue +93 -0
- package/sohelp-org-user-tree/index.vue +26 -0
- package/sohelp-org-user-tree-select/index.vue +11 -0
- package/sohelp-pagination/index.vue +11 -0
- package/sohelp-power/index.vue +105 -0
- package/sohelp-pro-form/components/pro-form-footer.vue +44 -0
- package/sohelp-pro-form/components/pro-form-item.vue +1133 -0
- package/sohelp-pro-form/index.vue +257 -0
- package/sohelp-pro-form/util.js +140 -0
- package/sohelp-pro-layout/index.vue +11 -0
- package/sohelp-pro-table/index.vue +14 -0
- package/sohelp-process/index.vue +216 -0
- package/sohelp-rate/index.vue +56 -0
- package/sohelp-rate/props.js +71 -0
- package/sohelp-relation/index.vue +11 -0
- package/sohelp-rich-text/index.vue +242 -0
- package/sohelp-rich-text/util.js +231 -0
- package/sohelp-richtext/index.vue +10 -0
- package/sohelp-role-select/index.vue +33 -0
- package/sohelp-search/components/search-config.vue +0 -0
- package/sohelp-search/index.vue +49 -0
- package/sohelp-search-pro-form/index.vue +11 -0
- package/sohelp-select/index.vue +120 -0
- package/sohelp-split-panel/index.vue +15 -0
- package/sohelp-switch/index.vue +56 -0
- package/sohelp-table/index.vue +151 -0
- package/sohelp-tenant-select/index.vue +128 -0
- package/sohelp-text/index.vue +14 -0
- package/sohelp-textarea-input/index.vue +36 -0
- package/sohelp-time/index.vue +10 -0
- package/sohelp-tree/index.vue +37 -0
- package/sohelp-tree-select/index.vue +18 -0
- package/sohelp-user-select/index.vue +44 -0
- package/sohelp-user-select/index.vue~ +53 -0
- package/sohelp-user-select/props.js +71 -0
- package/sohelp-user-tag/index.vue +12 -0
- package/sohelp-user-tree/index.vue +11 -0
- package/sohelp-vform-drawer/index.vue +40 -0
- package/sohelp-vform-eleplus/favicon.ico +0 -0
- package/sohelp-vform-eleplus/index.vue +297 -0
- package/sohelp-vform-eleplus/preview.html +91 -0
- package/sohelp-vform-eleplus/render.es.js +72433 -0
- package/sohelp-vform-eleplus/render.style.css +16 -0
- package/sohelp-vform-eleplus/render.umd.js +57 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +462 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +419 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-modal/index.vue +41 -0
- package/sohelp-vform-select/index.vue +11 -0
- package/sohelp-vform-vant/favicon.ico +0 -0
- package/sohelp-vform-vant/render.es.js +14608 -0
- package/sohelp-vform-vant/render.style.css +1 -0
- package/sohelp-vform-vant/render.umd.js +22 -0
- package/sohelp-vxe-grid/DefaultGridOptions.js +102 -0
- package/sohelp-vxe-grid/DefaultProps.js +37 -0
- package/sohelp-vxe-grid/SohelpGridConfig.js +142 -0
- package/sohelp-vxe-grid/index.vue +518 -0
- package/sohelp-vxe-grid-select/index.vue +148 -0
- package/sohelp-vxe-table/index.vue +184 -0
- package/sohelp-workflow/index.vue +495 -0
- package/sohelp-workflow/nodeWrap.vue +53 -0
- package/sohelp-workflow/nodes/addNode.vue +27 -0
- package/sohelp-workflow/nodes/approver.vue +125 -0
- package/sohelp-workflow/nodes/branch.vue +434 -0
- package/sohelp-workflow/nodes/promoter.vue +80 -0
- package/sohelp-workflow/nodes/send.vue +95 -0
- package/sohelp-workflow-drawer/components/approval-modal.vue +182 -0
- package/sohelp-workflow-drawer/components/draw-box.vue +141 -0
- package/sohelp-workflow-drawer/components/form.vue +79 -0
- package/sohelp-workflow-drawer/components/table.vue +153 -0
- package/sohelp-workflow-drawer/components/timeline.vue +189 -0
- package/sohelp-workflow-drawer/components/workflow.vue +68 -0
- package/sohelp-workflow-drawer/index.vue +311 -0
- package/sohelp-workflow-drawer/js/index.js +119 -0
- package/style/index.scss +0 -0
- package/utils/ProFormConvertUtil.js +76 -0
- package/utils/core.js +310 -0
- package/utils/use-form-data.js +48 -0
- package/utils/use-mobile.js +43 -0
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ele-card
|
|
3
|
+
:class="['sohelp-filter', config.filter?.config.filterPosition.toLowerCase(), { mobile: mobile }]"
|
|
4
|
+
:footerStyle="{ padding: '10px 0 0px 0' }"
|
|
5
|
+
:headerStyle="{ padding: '5px 0', fontSize: '14px' }"
|
|
6
|
+
:bodyStyle="{ height: '100%', padding: '0' }"
|
|
7
|
+
ref="sohelpFilterRef"
|
|
8
|
+
v-loading="loading"
|
|
9
|
+
v-if="propertiesMap"
|
|
10
|
+
>
|
|
11
|
+
<div class="scheme-box" v-show="schemeList.length" v-if="config.filter.config.visibleScheme">
|
|
12
|
+
<ele-text class="scheme-label">{{ t('grid.scheme.filter') }}</ele-text>
|
|
13
|
+
<el-radio-group v-model="filterValue.scheme" class="scheme-list">
|
|
14
|
+
<el-radio
|
|
15
|
+
border
|
|
16
|
+
v-for="scheme in schemeList"
|
|
17
|
+
:key="scheme"
|
|
18
|
+
:label="scheme"
|
|
19
|
+
size="small"
|
|
20
|
+
@click.prevent="handleRadioClick(scheme)"
|
|
21
|
+
>{{ scheme }}
|
|
22
|
+
</el-radio>
|
|
23
|
+
</el-radio-group>
|
|
24
|
+
</div>
|
|
25
|
+
<!-- advanced -->
|
|
26
|
+
<div class="advanced-box" ref="advancedBoxRef">
|
|
27
|
+
<filter-condition-item
|
|
28
|
+
v-for="(item, index) in getFilterList"
|
|
29
|
+
:key="item.name"
|
|
30
|
+
v-model="filterValue.filter[index]"
|
|
31
|
+
:properties="propertiesMap?.[item.name]"
|
|
32
|
+
:ref="(el) => setItemRef(el, item.name)"
|
|
33
|
+
></filter-condition-item>
|
|
34
|
+
|
|
35
|
+
<div
|
|
36
|
+
class="footer-top-right"
|
|
37
|
+
v-if="filterList.length > 0 && config.filter?.config.filterPosition !== 'MODAL'"
|
|
38
|
+
ref="searchButtonRef"
|
|
39
|
+
>
|
|
40
|
+
<el-button size="small" plain @click="reset">{{ t('grid.toolbar.reset') }}</el-button>
|
|
41
|
+
<el-button type="primary" size="small" @click="filter">{{ t('grid.toolbar.filter') }}</el-button>
|
|
42
|
+
<el-link
|
|
43
|
+
plain
|
|
44
|
+
@click="toggleFilter"
|
|
45
|
+
v-if="
|
|
46
|
+
maxRowsConfig.maxRows > 0 &&
|
|
47
|
+
config.filter.config.filterPosition === 'TOP' &&
|
|
48
|
+
filterList.length !== maxRowsConfig.current.index
|
|
49
|
+
"
|
|
50
|
+
style="margin-left: 20px !important"
|
|
51
|
+
>
|
|
52
|
+
<ele-text size="xs" :icon="Plus" v-if="!maxRowsConfig.isExpand"> 展开</ele-text>
|
|
53
|
+
<ele-text size="xs" :icon="Minus" v-else> 收缩</ele-text>
|
|
54
|
+
</el-link>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</ele-card>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup>
|
|
61
|
+
import { computed, nextTick, onMounted, reactive, ref, onBeforeUnmount } from 'vue';
|
|
62
|
+
import FilterConditionItem from '../../sohelp-grid/components/filter-condition-item.vue';
|
|
63
|
+
import { useMobile } from '@/utils/use-mobile';
|
|
64
|
+
import { useI18n } from 'vue-i18n';
|
|
65
|
+
import { Plus, Minus } from '@element-plus/icons-vue';
|
|
66
|
+
|
|
67
|
+
const { mobile } = useMobile();
|
|
68
|
+
const { t } = useI18n();
|
|
69
|
+
|
|
70
|
+
const props = defineProps({
|
|
71
|
+
propertiesMap: Object,
|
|
72
|
+
title: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: '高级筛选'
|
|
75
|
+
},
|
|
76
|
+
config: Object
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const emit = defineEmits(['filter', 'reset', 'changeFilterScheme']);
|
|
80
|
+
const sohelpFilterRef = ref(null);
|
|
81
|
+
const loading = ref(false);
|
|
82
|
+
|
|
83
|
+
const config = defineModel('config');
|
|
84
|
+
const filterValue = defineModel('filterValue');
|
|
85
|
+
const advancedBoxRef = ref(null);
|
|
86
|
+
|
|
87
|
+
const itemRefs = ref(new Map());
|
|
88
|
+
const maxRowsConfig = reactive({
|
|
89
|
+
maxRows: config.value?.filter?.config?.maxRows || 0,
|
|
90
|
+
height: 'auto',
|
|
91
|
+
isExpand: false,
|
|
92
|
+
rowHeight: 69,
|
|
93
|
+
width: '100%',
|
|
94
|
+
gap: 15,
|
|
95
|
+
itemWidth: [],
|
|
96
|
+
current: {},
|
|
97
|
+
searchButtonWidth: 0
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const searchButtonRef = ref(null);
|
|
101
|
+
|
|
102
|
+
// 设置元素引用的函数
|
|
103
|
+
const setItemRef = (el, id) => {
|
|
104
|
+
if (el) {
|
|
105
|
+
itemRefs.value.set(id, el);
|
|
106
|
+
} else {
|
|
107
|
+
itemRefs.value.delete(id);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// 获取所有元素高度
|
|
112
|
+
const getAllHeights = () => {
|
|
113
|
+
const width = new Map();
|
|
114
|
+
itemRefs.value.forEach((el, id) => {
|
|
115
|
+
const { offsetWidth } = el.$el;
|
|
116
|
+
if (offsetWidth) {
|
|
117
|
+
width.set(id, offsetWidth + maxRowsConfig.gap);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
return width;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const toggleFilter = () => {
|
|
124
|
+
maxRowsConfig.isExpand = !maxRowsConfig.isExpand;
|
|
125
|
+
if (maxRowsConfig.isExpand) {
|
|
126
|
+
maxRowsConfig.current.index = filterList.value.length + 1;
|
|
127
|
+
} else {
|
|
128
|
+
maxRowsConfig.current.index = maxRowsConfig.current._index;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
function findAccumulateIndex(map, threshold) {
|
|
133
|
+
let sum = 0;
|
|
134
|
+
let index = 0;
|
|
135
|
+
for (let [key, value] of map) {
|
|
136
|
+
let _sum = sum + value + maxRowsConfig.searchButtonWidth + maxRowsConfig.maxRows * 36;
|
|
137
|
+
if (_sum > threshold) {
|
|
138
|
+
return {
|
|
139
|
+
_index: index,
|
|
140
|
+
index: index, // 从0开始的索引
|
|
141
|
+
key: key, // 对应的键名
|
|
142
|
+
accumulatedSum: sum, // 当前累计总和
|
|
143
|
+
value: value // 当前元素值
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
sum += value;
|
|
147
|
+
index++;
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
index: map.size
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 获取当前显示的元素
|
|
156
|
+
*/
|
|
157
|
+
const getFilterList = computed(() => {
|
|
158
|
+
return filterList.value?.slice(0, maxRowsConfig.current.index);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const load = () => {
|
|
162
|
+
maxRowsConfig.width = advancedBoxRef.value.offsetWidth;
|
|
163
|
+
maxRowsConfig.current = findAccumulateIndex(maxRowsConfig.itemWidth, maxRowsConfig.width * maxRowsConfig.maxRows);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
onMounted(() => {
|
|
167
|
+
loading.value = true;
|
|
168
|
+
nextTick(() => {
|
|
169
|
+
loading.value = false;
|
|
170
|
+
// 高级筛选高度
|
|
171
|
+
maxRowsConfig.height = advancedBoxRef.value.offsetHeight + 'px';
|
|
172
|
+
const advancedRow = advancedBoxRef.value.querySelector('.sohelp-filter-condition');
|
|
173
|
+
if (advancedRow) {
|
|
174
|
+
maxRowsConfig.rowHeight = advancedRow.offsetHeight;
|
|
175
|
+
}
|
|
176
|
+
nextTick(() => {
|
|
177
|
+
maxRowsConfig.searchButtonWidth = searchButtonRef.value.offsetWidth + 35;
|
|
178
|
+
maxRowsConfig.itemWidth = getAllHeights();
|
|
179
|
+
load();
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
//高级筛选过滤某些字段
|
|
185
|
+
const filterList = computed(() => {
|
|
186
|
+
const excludeField = ['id', 'flw_id', '_operation'];
|
|
187
|
+
return config.value?.filter?.field?.filter((item) => {
|
|
188
|
+
return !excludeField.includes(item.name);
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// 方案列表
|
|
193
|
+
const schemeList = computed(() => {
|
|
194
|
+
const { filter } = config.value;
|
|
195
|
+
if (filter.scheme?.length) {
|
|
196
|
+
return filter.scheme?.map((item) => {
|
|
197
|
+
return item.label;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return [];
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* radio 取消点击
|
|
205
|
+
*/
|
|
206
|
+
const handleRadioClick = (val) => {
|
|
207
|
+
filterValue.value.scheme = filterValue.value.scheme === val ? '' : val;
|
|
208
|
+
emit('changeFilterScheme', filterValue.value.scheme, filterValue.value);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
*
|
|
213
|
+
*/
|
|
214
|
+
const filter = () => {
|
|
215
|
+
emit('filter', filterValue.value);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const reset = () => {
|
|
219
|
+
emit('reset', filterValue.value);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
//监听页面尺寸变化时load
|
|
223
|
+
addEventListener('resize', () => {
|
|
224
|
+
maxRowsConfig.isExpand = false;
|
|
225
|
+
load();
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
//销毁时移除监听
|
|
229
|
+
onBeforeUnmount(() => {
|
|
230
|
+
removeEventListener('resize', () => {});
|
|
231
|
+
});
|
|
232
|
+
</script>
|
|
233
|
+
<script>
|
|
234
|
+
export default {
|
|
235
|
+
name: 'FilterForm'
|
|
236
|
+
};
|
|
237
|
+
</script>
|
|
238
|
+
|
|
239
|
+
<style lang="scss" scoped>
|
|
240
|
+
.sohelp-filter.modal {
|
|
241
|
+
width: 100%;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.sohelp-filter.mobile {
|
|
245
|
+
box-sizing: border-box;
|
|
246
|
+
padding-left: 10px;
|
|
247
|
+
|
|
248
|
+
.scheme-box {
|
|
249
|
+
flex-direction: column;
|
|
250
|
+
align-items: flex-start;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.advanced-box {
|
|
254
|
+
.sohelp-filter-condition {
|
|
255
|
+
width: 100% !important;
|
|
256
|
+
|
|
257
|
+
:deep(.filter-condition) {
|
|
258
|
+
width: 100% !important;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.footer-top-right {
|
|
264
|
+
text-align: right;
|
|
265
|
+
margin-left: auto;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.sohelp-filter {
|
|
270
|
+
.footer-right {
|
|
271
|
+
display: flex;
|
|
272
|
+
justify-content: flex-end;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.el-form-item {
|
|
276
|
+
margin: 5px 0 5px 0;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.scheme-box {
|
|
280
|
+
padding-top: 10px;
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
gap: 10px;
|
|
284
|
+
|
|
285
|
+
.scheme-list {
|
|
286
|
+
display: flex;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.advanced-box {
|
|
291
|
+
overflow-y: scroll;
|
|
292
|
+
// padding-right: 10px;
|
|
293
|
+
display: flex;
|
|
294
|
+
flex-direction: column;
|
|
295
|
+
margin-top: 15px;
|
|
296
|
+
gap: 15px;
|
|
297
|
+
position: relative;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.advanced-box .is-expand .ele-text {
|
|
301
|
+
color: #1677ff;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.advanced-box .is-expand:hover {
|
|
305
|
+
opacity: 1;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.sohelp-filter.top {
|
|
310
|
+
width: 100%;
|
|
311
|
+
height: 100%;
|
|
312
|
+
display: flex;
|
|
313
|
+
margin-bottom: 0;
|
|
314
|
+
flex-direction: row;
|
|
315
|
+
overflow: auto;
|
|
316
|
+
|
|
317
|
+
.footer-top-right {
|
|
318
|
+
display: flex;
|
|
319
|
+
align-items: flex-end;
|
|
320
|
+
|
|
321
|
+
.el-button:nth-child(1) {
|
|
322
|
+
margin-left: 0;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
:deep(.ele-card-body) {
|
|
327
|
+
flex: 1;
|
|
328
|
+
padding-bottom: 0 !important;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
:deep(.ele-card-footer) {
|
|
332
|
+
padding-left: 10px !important;
|
|
333
|
+
display: flex;
|
|
334
|
+
box-sizing: border-box;
|
|
335
|
+
align-items: flex-end;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.sohelp-filter.top .advanced-box {
|
|
340
|
+
// height: 100%;
|
|
341
|
+
overflow: hidden;
|
|
342
|
+
flex-direction: row;
|
|
343
|
+
// max-height: 100%;
|
|
344
|
+
flex-wrap: wrap;
|
|
345
|
+
// margin-bottom: 10px;
|
|
346
|
+
|
|
347
|
+
.is-expand {
|
|
348
|
+
display: block;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.sohelp-filter.top .filter-condition {
|
|
353
|
+
width: auto;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.sohelp-filter.right {
|
|
357
|
+
width: 100%;
|
|
358
|
+
height: calc(100% - 70px);
|
|
359
|
+
padding-left: 10px;
|
|
360
|
+
margin-left: 0px;
|
|
361
|
+
box-sizing: border-box;
|
|
362
|
+
border-radius: 0;
|
|
363
|
+
display: flex;
|
|
364
|
+
|
|
365
|
+
overflow: scroll;
|
|
366
|
+
|
|
367
|
+
flex-direction: column;
|
|
368
|
+
|
|
369
|
+
:deep(.ele-card-body) {
|
|
370
|
+
min-width: 230px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
:deep(.ele-card-footer) {
|
|
374
|
+
width: calc(100% - 30px);
|
|
375
|
+
background: #fff;
|
|
376
|
+
z-index: 99999;
|
|
377
|
+
bottom: 0px;
|
|
378
|
+
position: absolute;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.sohelp-filter.right .sohelp-filter-condition {
|
|
383
|
+
width: 100% !important;
|
|
384
|
+
|
|
385
|
+
:deep(.filter-condition) {
|
|
386
|
+
width: 100% !important;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.sohelp-filter.right .advanced-box {
|
|
391
|
+
flex: 1;
|
|
392
|
+
|
|
393
|
+
.is-expand {
|
|
394
|
+
display: none !important;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.sohelp-filter.right :deep(.ele-card-body) {
|
|
399
|
+
flex: 1;
|
|
400
|
+
max-height: calc(100% - 75px);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.sohelp-filter.modal :deep(.ele-card-body) {
|
|
404
|
+
min-height: 300px !important;
|
|
405
|
+
max-height: 60vh !important;
|
|
406
|
+
overflow-y: auto;
|
|
407
|
+
|
|
408
|
+
.advanced-box {
|
|
409
|
+
display: flex;
|
|
410
|
+
// gap: 20px;
|
|
411
|
+
flex-direction: row;
|
|
412
|
+
flex-wrap: wrap;
|
|
413
|
+
|
|
414
|
+
.is-expand {
|
|
415
|
+
display: none !important;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.sohelp-filter-condition {
|
|
419
|
+
width: calc(50% - 10px);
|
|
420
|
+
|
|
421
|
+
.filter-condition {
|
|
422
|
+
width: 100% !important;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
</style>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-filter-header">
|
|
3
|
+
<slot name="left"></slot>
|
|
4
|
+
<ele-tooltip :content="t('grid.toolbar.fix_modal')" effect="light" placement="top">
|
|
5
|
+
<el-button
|
|
6
|
+
@click="changeFilterPosition('MODAL')"
|
|
7
|
+
size="small"
|
|
8
|
+
:type="positionValue === 'MODAL' ? 'primary' : ''"
|
|
9
|
+
text
|
|
10
|
+
>
|
|
11
|
+
<el-icon>
|
|
12
|
+
<TopRight />
|
|
13
|
+
</el-icon>
|
|
14
|
+
</el-button>
|
|
15
|
+
</ele-tooltip>
|
|
16
|
+
|
|
17
|
+
<ele-tooltip :content="t('grid.toolbar.fix_top')" effect="light" placement="top">
|
|
18
|
+
<el-button
|
|
19
|
+
@click="changeFilterPosition('TOP')"
|
|
20
|
+
size="small"
|
|
21
|
+
:type="positionValue === 'TOP' ? 'primary' : ''"
|
|
22
|
+
text
|
|
23
|
+
>
|
|
24
|
+
<el-icon>
|
|
25
|
+
<Upload />
|
|
26
|
+
</el-icon>
|
|
27
|
+
</el-button>
|
|
28
|
+
</ele-tooltip>
|
|
29
|
+
|
|
30
|
+
<ele-tooltip :content="t('grid.toolbar.fix_right')" effect="light" placement="top">
|
|
31
|
+
<el-button
|
|
32
|
+
@click="changeFilterPosition('RIGHT')"
|
|
33
|
+
size="small"
|
|
34
|
+
:type="positionValue === 'RIGHT' ? 'primary' : ''"
|
|
35
|
+
text
|
|
36
|
+
>
|
|
37
|
+
<el-icon style="transform: rotate(90deg)">
|
|
38
|
+
<Upload />
|
|
39
|
+
</el-icon>
|
|
40
|
+
</el-button>
|
|
41
|
+
</ele-tooltip>
|
|
42
|
+
|
|
43
|
+
<ele-tooltip :content="t('grid.toolbar.close')" effect="light" placement="top">
|
|
44
|
+
<el-button @click="closeFilterPosition()" size="small" text>
|
|
45
|
+
<el-icon>
|
|
46
|
+
<Close />
|
|
47
|
+
</el-icon>
|
|
48
|
+
</el-button>
|
|
49
|
+
</ele-tooltip>
|
|
50
|
+
<slot></slot>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script setup>
|
|
55
|
+
import { Close, TopRight, Upload } from "@element-plus/icons-vue";
|
|
56
|
+
import {useI18n} from "vue-i18n";
|
|
57
|
+
|
|
58
|
+
const {t} = useI18n();
|
|
59
|
+
|
|
60
|
+
const emit = defineEmits(["click", "close"]);
|
|
61
|
+
|
|
62
|
+
/** 显示位置 top | right | modal */
|
|
63
|
+
const positionValue = defineModel("positionValue");
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 单击按钮改变高级搜索的位置
|
|
67
|
+
* @param type top | right | modal | close
|
|
68
|
+
*/
|
|
69
|
+
const changeFilterPosition = (type) => {
|
|
70
|
+
//再次点击关闭高级搜索
|
|
71
|
+
if (type === positionValue.value) {
|
|
72
|
+
emit("close");
|
|
73
|
+
} else {
|
|
74
|
+
positionValue.value = type;
|
|
75
|
+
emit("click", type);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 关闭
|
|
81
|
+
*/
|
|
82
|
+
const closeFilterPosition = () => {
|
|
83
|
+
emit("close");
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
</script>
|
|
87
|
+
<script>
|
|
88
|
+
export default {
|
|
89
|
+
name: "FilterToolbar"
|
|
90
|
+
};
|
|
91
|
+
</script>
|
|
92
|
+
<style lang="scss" scoped>
|
|
93
|
+
.sohelp-filter-header {
|
|
94
|
+
margin-left: auto;
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
|
|
98
|
+
.el-button {
|
|
99
|
+
margin-left: 5px;
|
|
100
|
+
height: 22px;
|
|
101
|
+
line-height: 22px;
|
|
102
|
+
margin-top: 2px;
|
|
103
|
+
padding: 0px 5px !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.el-button--primary {
|
|
107
|
+
background: #eee;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import FilterForm from '@/components/sohelp-eleplus/sohelp-grid-view/filter/filter-form.vue';
|
|
3
|
+
import FilterToolbar from '@/components/sohelp-eleplus/sohelp-grid-view/filter/filter-toolbar.vue';
|
|
4
|
+
import { computed, ref } from 'vue';
|
|
5
|
+
import FilterConfig from '@/components/sohelp-eleplus/sohelp-grid-view/filter/config/index.vue';
|
|
6
|
+
import { useI18n } from 'vue-i18n';
|
|
7
|
+
|
|
8
|
+
const emit = defineEmits('change', 'filter', 'update:modelValue', 'close', 'reset', 'save', 'changeFilterScheme');
|
|
9
|
+
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
modelValue: Object,
|
|
12
|
+
propertiesMap: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const { t } = useI18n();
|
|
19
|
+
const filterKey = ref(0);
|
|
20
|
+
const gridConfigVisible = ref(false);
|
|
21
|
+
const config = defineModel('config');
|
|
22
|
+
const filterValue = defineModel('filterValue');
|
|
23
|
+
|
|
24
|
+
const changeFilterScheme = (schemeValue, filterValue) => {
|
|
25
|
+
emit('changeFilterScheme', schemeValue, filterValue);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const filterValueChange = () => {
|
|
29
|
+
emit('change');
|
|
30
|
+
};
|
|
31
|
+
const filter = (visible) => {
|
|
32
|
+
emit('filter', filterValue.value);
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 修改配置后,进行更新
|
|
36
|
+
* @param filterConfig
|
|
37
|
+
*/
|
|
38
|
+
const updateFilterConfig = (filterConfig) => {
|
|
39
|
+
//这里没有赋值成功
|
|
40
|
+
config.value.list = filterConfig.list;
|
|
41
|
+
config.value.filter = filterConfig.filter;
|
|
42
|
+
filterKey.value++;
|
|
43
|
+
//单击确认,并关闭,并触发更新
|
|
44
|
+
emit('save', true);
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* 重置过滤
|
|
48
|
+
*/
|
|
49
|
+
const reset = () => {
|
|
50
|
+
emit('reset');
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 关闭
|
|
55
|
+
*/
|
|
56
|
+
const close = () => {
|
|
57
|
+
emit('close');
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
//弹出窗口
|
|
61
|
+
const filterModalVisible = computed(() => {
|
|
62
|
+
return config.value.filter.config.filterPosition === 'MODAL' && config.value.filter.config.visibleFilter;
|
|
63
|
+
});
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<ele-card
|
|
68
|
+
ref="filterCardRef"
|
|
69
|
+
:style="{
|
|
70
|
+
height: '100%',
|
|
71
|
+
marginLeft: config.filter.config.filterPosition === 'TOP' ? '0' : '10px',
|
|
72
|
+
marginBottom: '0'
|
|
73
|
+
}"
|
|
74
|
+
:class="['sohelp-filter-card', config.filter.config.filterPosition]"
|
|
75
|
+
:header="t('grid.toolbar.adv_filter')"
|
|
76
|
+
:headerStyle="{ padding: '0 10px 10px 0' }"
|
|
77
|
+
:bodyStyle="{ padding: '0', height: 'calc(100% - 40px)', background: '#fff' }"
|
|
78
|
+
>
|
|
79
|
+
<template #extra>
|
|
80
|
+
<filter-toolbar v-model:positionValue="config.filter.config.filterPosition" @close="close">
|
|
81
|
+
<template #left>
|
|
82
|
+
<ele-tooltip :content="t('grid.toolbar.config')" effect="light" placement="top">
|
|
83
|
+
<el-button size="small" plan text class="tooltip-btn" @click="gridConfigVisible = true">
|
|
84
|
+
<el-icon>
|
|
85
|
+
<Setting />
|
|
86
|
+
</el-icon>
|
|
87
|
+
</el-button>
|
|
88
|
+
</ele-tooltip>
|
|
89
|
+
</template>
|
|
90
|
+
</filter-toolbar>
|
|
91
|
+
</template>
|
|
92
|
+
|
|
93
|
+
<filter-form
|
|
94
|
+
ref="sohelpFilterRef"
|
|
95
|
+
:config="config"
|
|
96
|
+
v-model:filterValue="filterValue"
|
|
97
|
+
:propertiesMap="propertiesMap"
|
|
98
|
+
@reset="reset"
|
|
99
|
+
@filter="filter(true)"
|
|
100
|
+
@change-filter-scheme="changeFilterScheme"
|
|
101
|
+
@change="filterValueChange"
|
|
102
|
+
></filter-form>
|
|
103
|
+
</ele-card>
|
|
104
|
+
<!-- 高级筛选弹窗 -->
|
|
105
|
+
<ele-modal
|
|
106
|
+
:width="560"
|
|
107
|
+
v-model="filterModalVisible"
|
|
108
|
+
:bodyStyle="{ padding: '20px 10px 10px 20px' }"
|
|
109
|
+
:close-on-click-modal="false"
|
|
110
|
+
:show-close="false"
|
|
111
|
+
>
|
|
112
|
+
<template #header>
|
|
113
|
+
<div class="flex">
|
|
114
|
+
{{ t('grid.toolbar.adv_filter') }}
|
|
115
|
+
<div class="ml-auto" style="padding-right: 5px">
|
|
116
|
+
<filter-toolbar
|
|
117
|
+
v-model:positionValue="config.filter.config.filterPosition"
|
|
118
|
+
@close="close"
|
|
119
|
+
style="margin-top: -1px"
|
|
120
|
+
>
|
|
121
|
+
<template #left>
|
|
122
|
+
<ele-tooltip :content="t('grid.toolbar.config')" effect="light" placement="top">
|
|
123
|
+
<el-button size="small" plan text class="tooltip-btn" @click="gridConfigVisible = true">
|
|
124
|
+
<el-icon>
|
|
125
|
+
<Setting />
|
|
126
|
+
</el-icon>
|
|
127
|
+
</el-button>
|
|
128
|
+
</ele-tooltip>
|
|
129
|
+
</template>
|
|
130
|
+
</filter-toolbar>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</template>
|
|
134
|
+
<filter-form
|
|
135
|
+
ref="sohelpFilterRef"
|
|
136
|
+
:config="config"
|
|
137
|
+
v-model:filterValue="filterValue"
|
|
138
|
+
:propertiesMap="propertiesMap"
|
|
139
|
+
:position="config.filter.config.filterPosition"
|
|
140
|
+
@reset="reset"
|
|
141
|
+
@filter="filter"
|
|
142
|
+
@change="filterValueChange"
|
|
143
|
+
></filter-form>
|
|
144
|
+
<template #footer>
|
|
145
|
+
<div class="footer-right" v-if="config.filter.config.filterPosition !== 'TOP'">
|
|
146
|
+
<el-button size="small" plain @click="reset">{{ t('grid.toolbar.reset') }}</el-button>
|
|
147
|
+
<el-button type="primary" size="small" @click="filter(false)">{{ t('grid.toolbar.filter') }}</el-button>
|
|
148
|
+
</div>
|
|
149
|
+
</template>
|
|
150
|
+
</ele-modal>
|
|
151
|
+
<!-- 配置弹窗 -->
|
|
152
|
+
<filter-config
|
|
153
|
+
v-model="gridConfigVisible"
|
|
154
|
+
:config="config"
|
|
155
|
+
@done="updateFilterConfig"
|
|
156
|
+
:key="filterKey"
|
|
157
|
+
></filter-config>
|
|
158
|
+
</template>
|
|
159
|
+
|
|
160
|
+
<style scoped lang="scss"></style>
|