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,218 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-file-upload">
|
|
3
|
+
<vxe-upload
|
|
4
|
+
ref="vxeUploadRef"
|
|
5
|
+
v-model="fileList"
|
|
6
|
+
:autoHiddenButton="!multiple"
|
|
7
|
+
show-download-button
|
|
8
|
+
:dragSort="true"
|
|
9
|
+
:urlMode="true"
|
|
10
|
+
:showProgress="true"
|
|
11
|
+
:showButtonText="false"
|
|
12
|
+
:pasteToUpload="true"
|
|
13
|
+
:singleMode="!multiple"
|
|
14
|
+
:multiple="multiple"
|
|
15
|
+
:readonly="readonly"
|
|
16
|
+
:limitSize="limitSize"
|
|
17
|
+
:progressText="'{percent}%'"
|
|
18
|
+
:moreConfig="moreConfig"
|
|
19
|
+
:upload-method="uploadMethod"
|
|
20
|
+
:before-remove-method="beforeRemoveMethod"
|
|
21
|
+
:before-download-method="beforeDownloadMethod"
|
|
22
|
+
:previewMethod="previewMethod"
|
|
23
|
+
>
|
|
24
|
+
</vxe-upload>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup>
|
|
29
|
+
import { ref, watch } from 'vue';
|
|
30
|
+
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
31
|
+
import { SohelpHttp } from '../core-export';
|
|
32
|
+
import { VxeUI } from 'vxe-pc-ui';
|
|
33
|
+
import { EleMessage } from '@/components/ele-admin-plus/components';
|
|
34
|
+
|
|
35
|
+
const modelValue = defineModel('modelValue');
|
|
36
|
+
const data = defineModel('data');
|
|
37
|
+
|
|
38
|
+
const imagePath = `${SohelpHttp.getBaseUrl()}/engine/web/file/download?id=`;
|
|
39
|
+
const props = defineProps({
|
|
40
|
+
readonly: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
multiple: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
limitSize: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 1 //10Mb
|
|
51
|
+
},
|
|
52
|
+
moreConfig: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: () => {
|
|
55
|
+
return {
|
|
56
|
+
maxCount: 1,
|
|
57
|
+
layout: 'horizontal'
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const emit = defineEmits(['update:modelValue']);
|
|
64
|
+
|
|
65
|
+
const vxeUploadRef = ref(null);
|
|
66
|
+
const fileList = ref([]);
|
|
67
|
+
const originList = ref([]);
|
|
68
|
+
|
|
69
|
+
const previewMethod = async ({ option }) => {
|
|
70
|
+
const { name } = option;
|
|
71
|
+
const image = originList.value.find((item) => item.name === name);
|
|
72
|
+
if (image && ['jpg', 'png', 'jpeg', 'gif', 'webp'].includes(image.type)) {
|
|
73
|
+
VxeUI.previewImage({
|
|
74
|
+
urlList: [image.url]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 下载
|
|
81
|
+
* @param param0
|
|
82
|
+
*/
|
|
83
|
+
const beforeDownloadMethod = async ({ option }) => {
|
|
84
|
+
try {
|
|
85
|
+
const blob = await fetch(option.url).then((response) => response.blob());
|
|
86
|
+
await VxeUI.saveFile({
|
|
87
|
+
filename: option.name,
|
|
88
|
+
content: blob
|
|
89
|
+
});
|
|
90
|
+
VxeUI.modal.message({
|
|
91
|
+
content: '下载成功',
|
|
92
|
+
status: 'success'
|
|
93
|
+
});
|
|
94
|
+
} catch (e) {
|
|
95
|
+
VxeUI.modal.message({
|
|
96
|
+
content: '下载失败',
|
|
97
|
+
status: 'error'
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @param param0 删除
|
|
106
|
+
*/
|
|
107
|
+
const beforeRemoveMethod = async ({ option }) => {
|
|
108
|
+
const flag = await ElMessageBox.confirm('确定要删除文件吗?', '系统提示', {
|
|
109
|
+
type: 'warning',
|
|
110
|
+
draggable: false
|
|
111
|
+
})
|
|
112
|
+
.then(async () => {
|
|
113
|
+
const urlObj = new URL(option.url);
|
|
114
|
+
const id = urlObj.searchParams.get('id');
|
|
115
|
+
|
|
116
|
+
if (id) {
|
|
117
|
+
const res = await SohelpHttp.post('/engine/web/file/delete', {
|
|
118
|
+
id: id
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
if (res.meta.success) {
|
|
122
|
+
originList.value = originList.value.filter((item) => item.id !== id);
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
updateModelValue();
|
|
125
|
+
}, 1);
|
|
126
|
+
ElMessage.success(res.meta.message);
|
|
127
|
+
return true;
|
|
128
|
+
} else {
|
|
129
|
+
ElMessage.error(res.meta.message);
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return false;
|
|
134
|
+
})
|
|
135
|
+
.catch(() => {
|
|
136
|
+
return false;
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
return flag;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 上传
|
|
144
|
+
*/
|
|
145
|
+
const uploadMethod = async ({ file }) => {
|
|
146
|
+
const formData = new FormData();
|
|
147
|
+
formData.append('files', file);
|
|
148
|
+
|
|
149
|
+
const res = await SohelpHttp.post('/engine/web/file/upload', formData);
|
|
150
|
+
if (res.meta.success) {
|
|
151
|
+
originList.value.push({
|
|
152
|
+
name: file.name,
|
|
153
|
+
id: res.data[0]
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
updateModelValue();
|
|
157
|
+
EleMessage.success('上传成功!');
|
|
158
|
+
return {
|
|
159
|
+
url: imagePath + res.data[0]
|
|
160
|
+
};
|
|
161
|
+
} else {
|
|
162
|
+
ElMessage.error(res.meta.message);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* 更新modelValue
|
|
168
|
+
*/
|
|
169
|
+
const updateModelValue = () => {
|
|
170
|
+
const arr = props.multiple ? originList.value : [originList.value[0]];
|
|
171
|
+
if (props.multiple) {
|
|
172
|
+
modelValue.value = arr?.map((item) => item.id) || '';
|
|
173
|
+
} else {
|
|
174
|
+
modelValue.value = arr?.length > 0 ? arr[0].id : '';
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
data.value =
|
|
178
|
+
arr?.map((item) => {
|
|
179
|
+
return {
|
|
180
|
+
id: item.id,
|
|
181
|
+
filename: item.name
|
|
182
|
+
};
|
|
183
|
+
}) || [];
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
watch(
|
|
187
|
+
() => modelValue.value,
|
|
188
|
+
(val) => {
|
|
189
|
+
if (val && val != '0' && val !== 0) {
|
|
190
|
+
const arr = Array.isArray(val) ? val : [val];
|
|
191
|
+
const v = Array.isArray(data.value) ? data.value : [data.value];
|
|
192
|
+
originList.value = arr.map((item) => {
|
|
193
|
+
const filename = v?.find((row) => row?.id === item)?.filename || item.id;
|
|
194
|
+
return {
|
|
195
|
+
id: item,
|
|
196
|
+
name: filename,
|
|
197
|
+
url: imagePath + item
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
fileList.value = originList.value;
|
|
201
|
+
} else {
|
|
202
|
+
originList.value = [];
|
|
203
|
+
data.value = [];
|
|
204
|
+
fileList.value = [];
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
immediate: true
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
</script>
|
|
212
|
+
|
|
213
|
+
<script>
|
|
214
|
+
export default {
|
|
215
|
+
name: 'SohelpFileUpload'
|
|
216
|
+
};
|
|
217
|
+
</script>
|
|
218
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-filter-condition">
|
|
3
|
+
<el-form-item :label="label">
|
|
4
|
+
<sohelp-select v-model="value.comparison" :datasource="comparisonOptions" class="sohelp-select-row"></sohelp-select>
|
|
5
|
+
</el-form-item>
|
|
6
|
+
<sohelp-input v-model="value.value"></sohelp-input>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import { reactive, watch } from 'vue';
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
modelValue: Object,
|
|
14
|
+
label: String
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const emit = defineEmits(['update:modelValue']);
|
|
18
|
+
const value = reactive(props.modelValue);
|
|
19
|
+
|
|
20
|
+
const comparisonOptions = [
|
|
21
|
+
{
|
|
22
|
+
label: '包含',
|
|
23
|
+
value: 'LIKE'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: '不包含',
|
|
27
|
+
value: 'NOT_LIKE'
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
{
|
|
31
|
+
label: '等于',
|
|
32
|
+
value: 'EQ'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: '不等于',
|
|
36
|
+
value: 'NE'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: '大于',
|
|
40
|
+
value: 'GT'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: '小于',
|
|
44
|
+
value: 'LT'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: '大于等于',
|
|
48
|
+
value: 'GTE'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: '小于等于',
|
|
52
|
+
value: 'LTE'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: '左包含',
|
|
56
|
+
value: 'LEFT_LIKE'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: '右包含',
|
|
60
|
+
value: 'RIGHT_LIKE'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: '为空',
|
|
64
|
+
value: 'EMPTY'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: '不为空',
|
|
68
|
+
value: 'NOT_EMPTY'
|
|
69
|
+
}
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
watch(
|
|
73
|
+
() => props.modelValue,
|
|
74
|
+
(val) => {
|
|
75
|
+
Object.assign(value, val);
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
deep: true
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
</script>
|
|
82
|
+
<script>
|
|
83
|
+
export default {
|
|
84
|
+
name: 'SohelpFilterCondition'
|
|
85
|
+
};
|
|
86
|
+
</script>
|
|
87
|
+
<style lang="scss" scoped>
|
|
88
|
+
.sohelp-filter-condition {
|
|
89
|
+
width: 180px;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
|
|
93
|
+
.el-form-item{
|
|
94
|
+
margin-bottom: 10px;
|
|
95
|
+
}
|
|
96
|
+
.sohelp-select-row{
|
|
97
|
+
width: 100%;
|
|
98
|
+
background: #f5f5f5!important;
|
|
99
|
+
border-radius: 6px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-filter">
|
|
3
|
+
<filter-condition
|
|
4
|
+
v-for="(item, index) in filterList"
|
|
5
|
+
:key="item.name"
|
|
6
|
+
v-model="filterList[index]"
|
|
7
|
+
:label="propertiesMap[item.name]?.label || ''"
|
|
8
|
+
></filter-condition>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { ref, watch } from 'vue';
|
|
14
|
+
import FilterCondition from './condition.vue';
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
modelValue: Array,
|
|
17
|
+
propertiesMap: Object
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const filterList = ref([]);
|
|
21
|
+
|
|
22
|
+
watch(
|
|
23
|
+
() => props.modelValue,
|
|
24
|
+
(val) => {
|
|
25
|
+
filterList.value = val;
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
immediate: true,
|
|
29
|
+
deep: true
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
</script>
|
|
33
|
+
<script>
|
|
34
|
+
export default {
|
|
35
|
+
name: 'SohelpFilterSchemeFilter'
|
|
36
|
+
};
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style lang="scss" scoped>
|
|
40
|
+
.sohelp-filter {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
gap: 20px;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sohelp-input v-bind="$attrs" style="min-width: 300px"></sohelp-input>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
</script>
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'SohelpFilterSchemeKeywords'
|
|
12
|
+
};
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-radio-group v-model="radioValue">
|
|
3
|
+
<el-radio
|
|
4
|
+
border
|
|
5
|
+
v-for="scheme in schemeList"
|
|
6
|
+
:key="scheme"
|
|
7
|
+
:label="scheme"
|
|
8
|
+
@click.prevent="handleRadioClick(scheme)"
|
|
9
|
+
></el-radio>
|
|
10
|
+
</el-radio-group>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { computed, ref, watch } from 'vue';
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
filterConfig: Object,
|
|
17
|
+
modelValue: String
|
|
18
|
+
});
|
|
19
|
+
const emit = defineEmits(['update:modelValue']);
|
|
20
|
+
const radioValue = ref('');
|
|
21
|
+
|
|
22
|
+
// 方案列表
|
|
23
|
+
const schemeList = computed(() => {
|
|
24
|
+
if (props.filterConfig.scheme?.length) {
|
|
25
|
+
return props.filterConfig.scheme.map((item) => item.label);
|
|
26
|
+
}
|
|
27
|
+
return [];
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
watch(() => props.modelValue, (val) => {
|
|
31
|
+
radioValue.value = val;
|
|
32
|
+
},{
|
|
33
|
+
immediate: true
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* radio 取消点击
|
|
38
|
+
*/
|
|
39
|
+
const handleRadioClick = (val) => {
|
|
40
|
+
radioValue.value = radioValue.value === val ? '' : val;
|
|
41
|
+
emit('update:modelValue', radioValue.value);
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
<script>
|
|
45
|
+
export default {
|
|
46
|
+
name: 'SohelpFilterSchemeScheme'
|
|
47
|
+
};
|
|
48
|
+
</script>
|
|
49
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ele-card :headerStyle="{ padding: '0' }" :bodyStyle="{ padding: '15px 0' }" class="sohelp-filter-scheme-card">
|
|
3
|
+
|
|
4
|
+
<template #header>
|
|
5
|
+
<ele-tabs :items="tabs" v-model="active"> </ele-tabs>
|
|
6
|
+
</template>
|
|
7
|
+
<div class="filter-box">
|
|
8
|
+
<div class="filter-content">
|
|
9
|
+
<keywords-card
|
|
10
|
+
:placeholder="getKeywordsPlaceholder"
|
|
11
|
+
v-model="filterForm.keywords"
|
|
12
|
+
v-if="active === 'keywords'"
|
|
13
|
+
></keywords-card>
|
|
14
|
+
<filter-card :propertiesMap="propertiesMap" v-model="filterForm.filter" v-if="active === 'filter'"></filter-card>
|
|
15
|
+
<scheme-card :propertiesMap="propertiesMap" :filterConfig="filterConfig" v-model="filterForm.scheme" v-if="active === 'scheme'"></scheme-card>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="filter-opt">
|
|
18
|
+
<el-button type="primary" size="small" @click="onFilter">筛选</el-button>
|
|
19
|
+
<el-button size="small" @click="onReset">重置</el-button>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</ele-card>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup>
|
|
26
|
+
import { reactive, ref, computed } from 'vue';
|
|
27
|
+
import KeywordsCard from './components/keywords.vue';
|
|
28
|
+
import FilterCard from './components/filter.vue';
|
|
29
|
+
import SchemeCard from './components/scheme.vue';
|
|
30
|
+
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
filterConfig: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: () => ({}),
|
|
35
|
+
required: true
|
|
36
|
+
},
|
|
37
|
+
refid: String,
|
|
38
|
+
modelValue: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: () => ({
|
|
41
|
+
keywords: '',
|
|
42
|
+
filter: {},
|
|
43
|
+
scheme: ''
|
|
44
|
+
}),
|
|
45
|
+
required: true
|
|
46
|
+
},
|
|
47
|
+
propertiesMap: Object
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const emit = defineEmits(['filter', 'reset', 'update:modelValue']);
|
|
51
|
+
const filterForm = ref({ ...props.modelValue });
|
|
52
|
+
|
|
53
|
+
const tabs = reactive([
|
|
54
|
+
{
|
|
55
|
+
name: 'keywords',
|
|
56
|
+
label: '快捷筛选'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'filter',
|
|
60
|
+
label: '高级筛选'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'scheme',
|
|
64
|
+
label: '场景筛选'
|
|
65
|
+
}
|
|
66
|
+
]);
|
|
67
|
+
const active = ref('keywords');
|
|
68
|
+
const filterConfig = reactive(props.filterConfig);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 获取关键字查询placeholder
|
|
72
|
+
*/
|
|
73
|
+
const getKeywordsPlaceholder = computed(() => {
|
|
74
|
+
const labels = props.filterConfig?.keywords?.map((name) => props.propertiesMap[name]?.label)?.filter(Boolean) || [];
|
|
75
|
+
return labels.length ? `请输入${labels.join('、')}` : '请输入';
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const onFilter = () => {
|
|
79
|
+
emit('update:modelValue', { ...filterForm.value });
|
|
80
|
+
emit('filter');
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const onReset = () => {
|
|
84
|
+
filterForm.value = { ...props.modelValue };
|
|
85
|
+
emit('update:modelValue', { ...props.modelValue });
|
|
86
|
+
emit('filter');
|
|
87
|
+
};
|
|
88
|
+
</script>
|
|
89
|
+
<script>
|
|
90
|
+
export default {
|
|
91
|
+
name: 'SohelpFilterScheme'
|
|
92
|
+
};
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style lang="scss" scoped>
|
|
96
|
+
.sohelp-filter-scheme-card {
|
|
97
|
+
.filter-box {
|
|
98
|
+
display: flex;
|
|
99
|
+
gap: 20px;
|
|
100
|
+
flex-direction: row;
|
|
101
|
+
justify-content: flex-start;
|
|
102
|
+
align-items: flex-end;
|
|
103
|
+
.filter-content {
|
|
104
|
+
}
|
|
105
|
+
.filter-opt {
|
|
106
|
+
margin-bottom: 3px;
|
|
107
|
+
flex: 1;
|
|
108
|
+
width: 60px;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
</style>
|