adtec-core-package 1.2.4 → 1.2.6
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.en.md +36 -36
- package/eslint.config.js +11 -21
- package/package.json +66 -64
- package/src/api/BasicApi.ts +26 -26
- package/src/api/DeptInfoApi.ts +19 -19
- package/src/api/DocumentApi.ts +27 -27
- package/src/api/EmployeeInfoApi.ts +17 -17
- package/src/api/SysDictCacheApi.ts +29 -29
- package/src/api/SysUserApi.ts +35 -35
- package/src/api/framework.ts +12 -12
- package/src/api/workflow/workflow.ts +31 -31
- package/src/api/workflow/workflowInstApi.ts +72 -72
- package/src/assets/style/ant.scss +19 -19
- package/src/assets/style/index.less +180 -180
- package/src/components/ElFlex/ElFlex.vue +297 -297
- package/src/components/ElTotalTools.vue +70 -70
- package/src/components/OperationAuth/operationAuth.vue +26 -26
- package/src/components/RichTextEditor/RichTextEditor.vue +144 -144
- package/src/components/Scrollbars/ElScrollbars.vue +21 -21
- package/src/components/Search/ElIconSearch.vue +267 -267
- package/src/components/Search/ElSearch.vue +154 -154
- package/src/components/SelectInDicators/SelectInDicators.vue +225 -225
- package/src/components/SelectInDicators/api/DataIndicatorsApi.ts +28 -28
- package/src/components/SelectInDicators/interface/IComIndex.ts +26 -26
- package/src/components/SelectInDicators/interface/IComIndexAttri.ts +18 -18
- package/src/components/Table/ElTableColumnDynamic.vue +25 -25
- package/src/components/Table/ElTableColumnEdit.vue +264 -263
- package/src/components/Table/ElTableTool.ts +37 -37
- package/src/components/Title/ElTitle.vue +53 -53
- package/src/components/autoToolTip/ElAutoToolTip.vue +62 -62
- package/src/components/baseEcharts/index.vue +48 -48
- package/src/components/bpmntree/api/modules/role.ts +31 -31
- package/src/components/bpmntree/api/modules/user.ts +17 -17
- package/src/components/bpmntree/components/AdvancedFilter/Operator.vue +112 -112
- package/src/components/bpmntree/components/AdvancedFilter/Trigger.vue +23 -23
- package/src/components/bpmntree/components/AdvancedFilter/index.vue +230 -230
- package/src/components/bpmntree/components/AdvancedFilter/type.ts +20 -20
- package/src/components/bpmntree/components/FlowIcon/index.scss +7 -7
- package/src/components/bpmntree/components/FlowIcon/index.tsx +68 -68
- package/src/components/bpmntree/components/Render/render.vue +90 -90
- package/src/components/bpmntree/components/Render/type.ts +12 -12
- package/src/components/bpmntree/components/RoleSelector/RolePicker.vue +264 -264
- package/src/components/bpmntree/components/RoleSelector/RoleTag.vue +48 -48
- package/src/components/bpmntree/components/RoleSelector/index.vue +113 -113
- package/src/components/bpmntree/components/UserSelector/UserTag.vue +73 -73
- package/src/components/bpmntree/components/UserSelector/index.vue +140 -140
- package/src/components/bpmntree/hooks/useDraggableScroll.ts +44 -44
- package/src/components/bpmntree/typings/index.d.ts +1 -1
- package/src/components/bpmntree/views/flowDesign/index.vue +652 -652
- package/src/components/bpmntree/views/flowDesign/nodes/Add.vue +184 -184
- package/src/components/bpmntree/views/flowDesign/nodes/ApprovalNode.vue +127 -127
- package/src/components/bpmntree/views/flowDesign/nodes/CcNode.vue +93 -93
- package/src/components/bpmntree/views/flowDesign/nodes/ConcurrentNode.vue +61 -61
- package/src/components/bpmntree/views/flowDesign/nodes/ConditionNode.vue +59 -59
- package/src/components/bpmntree/views/flowDesign/nodes/EndNode.vue +80 -80
- package/src/components/bpmntree/views/flowDesign/nodes/ExclusiveNode.vue +20 -20
- package/src/components/bpmntree/views/flowDesign/nodes/GatewayNode.vue +173 -173
- package/src/components/bpmntree/views/flowDesign/nodes/InclusiveNode.vue +20 -20
- package/src/components/bpmntree/views/flowDesign/nodes/JumpNode.vue +49 -49
- package/src/components/bpmntree/views/flowDesign/nodes/Node.vue +346 -346
- package/src/components/bpmntree/views/flowDesign/nodes/NotifyNode.vue +115 -115
- package/src/components/bpmntree/views/flowDesign/nodes/ParallelNode.vue +20 -20
- package/src/components/bpmntree/views/flowDesign/nodes/PopoverView.vue +78 -78
- package/src/components/bpmntree/views/flowDesign/nodes/StartNode.vue +84 -84
- package/src/components/bpmntree/views/flowDesign/nodes/TimerNode.vue +50 -50
- package/src/components/bpmntree/views/flowDesign/nodes/TreeNode.vue +45 -45
- package/src/components/bpmntree/views/flowDesign/nodes/type.ts +192 -192
- package/src/components/bpmntree/views/flowDesign/panels/ApprovalPanel.vue +516 -516
- package/src/components/bpmntree/views/flowDesign/panels/AssigneePanel.vue +120 -120
- package/src/components/bpmntree/views/flowDesign/panels/CcPanel.vue +99 -99
- package/src/components/bpmntree/views/flowDesign/panels/ConditionPanel.vue +41 -41
- package/src/components/bpmntree/views/flowDesign/panels/EndPanel.vue +18 -18
- package/src/components/bpmntree/views/flowDesign/panels/ExecutionListeners.vue +110 -110
- package/src/components/bpmntree/views/flowDesign/panels/JumpPanel.vue +32 -32
- package/src/components/bpmntree/views/flowDesign/panels/NotifyPanel.vue +101 -101
- package/src/components/bpmntree/views/flowDesign/panels/ParaPanel.vue +248 -248
- package/src/components/bpmntree/views/flowDesign/panels/StartPanel.vue +159 -159
- package/src/components/bpmntree/views/flowDesign/panels/TaskListeners.vue +110 -110
- package/src/components/bpmntree/views/flowDesign/panels/TimerPanel.vue +51 -51
- package/src/components/bpmntree/views/flowDesign/panels/index.vue +85 -85
- package/src/components/bpmntree/views/view.index.vue +291 -291
- package/src/components/business/comp.userForm.vue +292 -286
- package/src/components/business/userSelect.vue +413 -413
- package/src/components/icon/ElIconBtn.vue +210 -210
- package/src/components/upload/ElUploads.vue +285 -285
- package/src/components/upload/FileView.vue +159 -159
- package/src/components/upload/FileViewComponents.vue +56 -56
- package/src/components/workflow/TaskOperation.vue +212 -212
- package/src/components/workflow/WorkflowTodoDialog.vue +81 -81
- package/src/components/workflow/components/AddOrMinusMultiDialog.vue +159 -159
- package/src/components/workflow/components/CheckDialog.vue +315 -316
- package/src/components/workflow/components/ProcessDetailComp.vue +133 -133
- package/src/components/workflow/components/ProcessDetailDialog.vue +129 -129
- package/src/components/workflow/components/ProcessInstance.vue +117 -117
- package/src/components/workflow/components/ProcessInstanceStep.vue +226 -226
- package/src/components/workflow/components/SelectAssigneeDialog.vue +109 -109
- package/src/components/workflow/components/SelectReturnActivityDialog.vue +104 -104
- package/src/config/ElementPlusConfig.ts +95 -95
- package/src/config/VxeTableConfig.ts +35 -0
- package/src/css/elementUI/autocomplete.scss +89 -89
- package/src/css/elementUI/common/var.scss +1549 -1549
- package/src/css/elementUI/date-picker/picker.scss +219 -219
- package/src/css/elementUI/descriptions.scss +152 -152
- package/src/css/elementUI/drawer.scss +164 -164
- package/src/css/elementUI/table.scss +694 -694
- package/src/css/elementUI/tabs.scss +659 -659
- package/src/css/vxeTableUI/all.scss +7 -0
- package/src/css/vxeTableUI/base.scss +16 -0
- package/src/css/vxeTableUI/components/colgroup.scss +0 -0
- package/src/css/vxeTableUI/components/column.scss +0 -0
- package/src/css/vxeTableUI/components/grid.scss +83 -0
- package/src/css/vxeTableUI/components/icon.scss +205 -0
- package/src/css/vxeTableUI/components/old-icon.scss +715 -0
- package/src/css/vxeTableUI/components/table-module/all.scss +7 -0
- package/src/css/vxeTableUI/components/table-module/custom.scss +491 -0
- package/src/css/vxeTableUI/components/table-module/edit.scss +0 -0
- package/src/css/vxeTableUI/components/table-module/export.scss +130 -0
- package/src/css/vxeTableUI/components/table-module/filter.scss +128 -0
- package/src/css/vxeTableUI/components/table-module/keyboard.scss +0 -0
- package/src/css/vxeTableUI/components/table-module/menu.scss +86 -0
- package/src/css/vxeTableUI/components/table-module/validator.scss +0 -0
- package/src/css/vxeTableUI/components/table.scss +2242 -0
- package/src/css/vxeTableUI/components/toolbar.scss +100 -0
- package/src/css/vxeTableUI/components/ui.scss +0 -0
- package/src/css/vxeTableUI/components/v-x-e-table.scss +0 -0
- package/src/css/vxeTableUI/cssvar.scss +3 -0
- package/src/css/vxeTableUI/default.scss +3 -0
- package/src/css/vxeTableUI/helpers/baseMixin.scss +82 -0
- package/src/css/vxeTableUI/icon/iconfont.ttf +0 -0
- package/src/css/vxeTableUI/icon/iconfont.woff +0 -0
- package/src/css/vxeTableUI/icon/iconfont.woff2 +0 -0
- package/src/css/vxeTableUI/index.scss +4 -0
- package/src/css/vxeTableUI/modules.scss +5 -0
- package/src/css/vxeTableUI/theme/base.scss +89 -0
- package/src/css/vxeTableUI/theme/dark.scss +46 -0
- package/src/css/vxeTableUI/theme/light.scss +42 -0
- package/src/css/vxeTableUI/variable.scss +41 -0
- package/src/directives/vKeydown.ts +91 -91
- package/src/hooks/useDictHooks.ts +119 -119
- package/src/hooks/useEcharts.ts +58 -58
- package/src/hooks/useFileView.ts +34 -11
- package/src/hooks/useMessageHooks.ts +132 -132
- package/src/hooks/usePermissionToolHooks.ts +21 -21
- package/src/hooks/useResetRefHooks.ts +18 -18
- package/src/hooks/userWorkflowHooks.ts +92 -92
- package/src/interface/BaseEntity.ts +30 -30
- package/src/interface/IMdmDept.ts +84 -84
- package/src/interface/IMdmEmployee.ts +134 -134
- package/src/interface/IMdmEmployeeQuery.ts +20 -19
- package/src/interface/IMdmOrg.ts +29 -29
- package/src/interface/IMdmOrgQuery.ts +13 -13
- package/src/interface/IOrgDeptInfo.ts +12 -12
- package/src/interface/ISysDictDataCacheVo.ts +46 -46
- package/src/interface/ISysDictType.ts +37 -37
- package/src/interface/ISysMenuDataVo.ts +22 -22
- package/src/interface/ISysMenuInfoVo.ts +83 -83
- package/src/interface/ISysMenuOperationVo.ts +21 -21
- package/src/interface/ISysUploadFiles.ts +16 -16
- package/src/interface/ISysUserInfo.ts +70 -70
- package/src/interface/IUserPermissionVo.ts +34 -34
- package/src/interface/Message.ts +73 -73
- package/src/interface/PageData.ts +17 -17
- package/src/interface/ResponseData.ts +16 -16
- package/src/interface/dictMapType.ts +11 -11
- package/src/interface/enum/MessageEnum.ts +41 -41
- package/src/interface/workflow/IWfProcessDefVo.ts +14 -14
- package/src/interface/workflow/IWfReturnNodeVo.ts +15 -16
- package/src/interface/workflow/IWfTaskAskVo.ts +61 -65
- package/src/interface/workflow/IWfTaskQueryVo.ts +30 -30
- package/src/interface/workflow/IWfTaskUsersVo.ts +21 -21
- package/src/interface/workflow/IWfTaskVo.ts +187 -187
- package/src/interface/workflow/workflow.ts +22 -22
- package/src/mixin/globalMixin.ts +45 -45
- package/src/packages/index.ts +18 -18
- package/src/packages/text.vue +13 -13
- package/src/plugins/echartsConfig.ts +73 -73
- package/src/plugins/plugins.ts +12 -12
- package/src/plugins/renderDialog.ts +74 -74
- package/src/stores/dictStore.ts +51 -51
- package/src/stores/messageStore.ts +49 -49
- package/src/stores/permissionStore.ts +108 -108
- package/src/stores/storeConfig.ts +23 -23
- package/src/stores/userInfoStore.ts +31 -31
- package/src/utils/AxiosConfig.ts +219 -219
- package/src/utils/modules.ts +8 -8
- package/src/utils/request.ts +76 -76
- package/adtec-core-package/adtec-core-package.css +0 -1
- package/adtec-core-package/adtec-core-package.js +0 -41605
- package/adtec-core-package/adtec-core-package.umd.cjs +0 -79
- package/adtec-core-package/favicon.ico +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Field } from '../Render/type'
|
|
3
|
-
import type { FilterRules } from './type'
|
|
4
|
-
import { useVModel } from '@vueuse/core'
|
|
5
|
-
|
|
6
|
-
const $props = defineProps<{
|
|
7
|
-
modelValue: any
|
|
8
|
-
options: Field[]
|
|
9
|
-
filterRules: FilterRules
|
|
10
|
-
}>()
|
|
11
|
-
const $emits = defineEmits<{
|
|
12
|
-
(e: 'update:modelValue', modelValue: string): void
|
|
13
|
-
}>()
|
|
14
|
-
const data = useVModel($props, 'modelValue', $emits)
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<el-select class="trigger-container" v-model="data" filterable placeholder="选择字段">
|
|
19
|
-
<el-option v-for="item in $props.options" :key="item.id" :label="item.label" :value="item.id" />
|
|
20
|
-
</el-select>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Field } from '../Render/type'
|
|
3
|
+
import type { FilterRules } from './type'
|
|
4
|
+
import { useVModel } from '@vueuse/core'
|
|
5
|
+
|
|
6
|
+
const $props = defineProps<{
|
|
7
|
+
modelValue: any
|
|
8
|
+
options: Field[]
|
|
9
|
+
filterRules: FilterRules
|
|
10
|
+
}>()
|
|
11
|
+
const $emits = defineEmits<{
|
|
12
|
+
(e: 'update:modelValue', modelValue: string): void
|
|
13
|
+
}>()
|
|
14
|
+
const data = useVModel($props, 'modelValue', $emits)
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<el-select class="trigger-container" v-model="data" filterable placeholder="选择字段">
|
|
19
|
+
<el-option v-for="item in $props.options" :key="item.id" :label="item.label" :value="item.id" />
|
|
20
|
+
</el-select>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<style scoped lang="scss"></style>
|
|
@@ -1,230 +1,230 @@
|
|
|
1
|
-
<script setup lang="ts" name="AdvancedFilter">
|
|
2
|
-
import type { FilterRules } from './type'
|
|
3
|
-
import type { Field } from '../Render/type'
|
|
4
|
-
import Render from '../Render/render.vue'
|
|
5
|
-
import AdvancedFilter from './index.vue'
|
|
6
|
-
import { useVModel } from '@vueuse/core'
|
|
7
|
-
import Trigger from './Trigger.vue'
|
|
8
|
-
import Operator from './Operator.vue'
|
|
9
|
-
|
|
10
|
-
const $props = defineProps<{
|
|
11
|
-
filterFields: Field[]
|
|
12
|
-
modelValue: FilterRules
|
|
13
|
-
}>()
|
|
14
|
-
const $emits = defineEmits<{
|
|
15
|
-
(e: 'update:modelValue', modelValue: FilterRules): void
|
|
16
|
-
(e: 'addCondition', index: number): void
|
|
17
|
-
(e: 'delCondition', index: number): void
|
|
18
|
-
(e: 'delGroup'): void
|
|
19
|
-
}>()
|
|
20
|
-
const filterRules = useVModel($props, 'modelValue', $emits)
|
|
21
|
-
/**
|
|
22
|
-
* 添加条件
|
|
23
|
-
*/
|
|
24
|
-
const addRule = () => {
|
|
25
|
-
filterRules.value.conditions.push({
|
|
26
|
-
field: null,
|
|
27
|
-
operator: 'eq',
|
|
28
|
-
value: null,
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* 删除条件
|
|
33
|
-
* @param index
|
|
34
|
-
*/
|
|
35
|
-
const handleDel = (index: number) => {
|
|
36
|
-
filterRules.value.conditions.splice(index, 1)
|
|
37
|
-
if (filterRules.value.conditions.length <= 0) {
|
|
38
|
-
$emits('delGroup')
|
|
39
|
-
}
|
|
40
|
-
$emits('delCondition', index)
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* 条件条件组
|
|
44
|
-
*/
|
|
45
|
-
const addGroup = () => {
|
|
46
|
-
filterRules.value.groups.push({
|
|
47
|
-
operator: 'and',
|
|
48
|
-
conditions: [
|
|
49
|
-
{
|
|
50
|
-
field: null,
|
|
51
|
-
operator: '',
|
|
52
|
-
value: null,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
groups: [],
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* 删除条件组
|
|
60
|
-
* @param index
|
|
61
|
-
*/
|
|
62
|
-
const delGroup = (index: number) => {
|
|
63
|
-
filterRules.value.groups.splice(index, 1)
|
|
64
|
-
}
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<template>
|
|
68
|
-
<div class="filter-container">
|
|
69
|
-
<div class="logical-operator">
|
|
70
|
-
<div class="logical-operator__line"></div>
|
|
71
|
-
<el-switch
|
|
72
|
-
v-model="filterRules.operator"
|
|
73
|
-
inline-prompt
|
|
74
|
-
style="--el-switch-on-color: #409eff; --el-switch-off-color: #67c23a"
|
|
75
|
-
active-value="and"
|
|
76
|
-
inactive-value="or"
|
|
77
|
-
active-text="且"
|
|
78
|
-
inactive-text="或"
|
|
79
|
-
/>
|
|
80
|
-
</div>
|
|
81
|
-
<div class="filter-option-content">
|
|
82
|
-
<el-form :label-width="0" style="width: 100%" :inline="true" :model="filterRules">
|
|
83
|
-
<el-row
|
|
84
|
-
style="width: 100%"
|
|
85
|
-
v-for="(item, index) in filterRules.conditions"
|
|
86
|
-
:key="`${item.field}-${index}`"
|
|
87
|
-
:gutter="5"
|
|
88
|
-
class="filter-item-rule"
|
|
89
|
-
>
|
|
90
|
-
<el-col :span="7">
|
|
91
|
-
<el-form-item :prop="'conditions.' + index + '.field'" style="width: 100%">
|
|
92
|
-
<trigger
|
|
93
|
-
ref="triggerRef"
|
|
94
|
-
:options="$props.filterFields.filter((e) => e.value !== undefined)"
|
|
95
|
-
:filter-rules="filterRules"
|
|
96
|
-
v-model="item.field"
|
|
97
|
-
@update:model-value="item.value = null"
|
|
98
|
-
/>
|
|
99
|
-
</el-form-item>
|
|
100
|
-
</el-col>
|
|
101
|
-
<el-col :span="5" v-if="item.field">
|
|
102
|
-
<el-form-item :prop="'conditions.' + index + '.operator'" style="width: 100%">
|
|
103
|
-
<operator
|
|
104
|
-
ref="operatorRef"
|
|
105
|
-
:type="$props.filterFields.find((e) => e.id === item.field)?.name"
|
|
106
|
-
v-model="item.operator"
|
|
107
|
-
/>
|
|
108
|
-
</el-form-item>
|
|
109
|
-
</el-col>
|
|
110
|
-
<el-col :span="10" v-if="item.field">
|
|
111
|
-
<el-form-item :prop="'conditions.' + index + '.value'" style="width: 100%">
|
|
112
|
-
<Render
|
|
113
|
-
:field="$props.filterFields.find((e) => e.id === item.field) as Field"
|
|
114
|
-
v-model="item.value"
|
|
115
|
-
/>
|
|
116
|
-
</el-form-item>
|
|
117
|
-
</el-col>
|
|
118
|
-
<!-- style="display: flex; align-items: center; flex-direction: row-reverse"-->
|
|
119
|
-
<el-col :span="2" align="top">
|
|
120
|
-
<el-button plain text type="danger" icon="Delete" @click="handleDel(index)" />
|
|
121
|
-
</el-col>
|
|
122
|
-
</el-row>
|
|
123
|
-
<AdvancedFilter
|
|
124
|
-
v-for="(item, index) in filterRules.groups"
|
|
125
|
-
:key="index"
|
|
126
|
-
@delGroup="delGroup(index)"
|
|
127
|
-
v-model="filterRules.groups[index]"
|
|
128
|
-
:filterFields="filterFields"
|
|
129
|
-
>
|
|
130
|
-
<el-button @click="delGroup(index)" icon="CircleClose" class="filter-filter-item__add">
|
|
131
|
-
删除条件组
|
|
132
|
-
</el-button>
|
|
133
|
-
</AdvancedFilter>
|
|
134
|
-
<div
|
|
135
|
-
v-if="filterRules.groups.length === 0 && filterRules.conditions.length === 0"
|
|
136
|
-
class="filter-item-rule"
|
|
137
|
-
/>
|
|
138
|
-
</el-form>
|
|
139
|
-
<div class="filter-item-rule">
|
|
140
|
-
<el-button @click="addRule" icon="CirclePlus" class="filter-filter-item__add">
|
|
141
|
-
添加条件
|
|
142
|
-
</el-button>
|
|
143
|
-
<el-button @click="addGroup" icon="CirclePlus" class="filter-filter-item__add">
|
|
144
|
-
添加条件组
|
|
145
|
-
</el-button>
|
|
146
|
-
<slot />
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
</div>
|
|
150
|
-
</template>
|
|
151
|
-
|
|
152
|
-
<style scoped lang="scss">
|
|
153
|
-
:deep(.el-form-item) {
|
|
154
|
-
margin-right: 0;
|
|
155
|
-
margin-bottom: 0;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.filter-container {
|
|
159
|
-
background-color: var(--el-fill-color-blank);
|
|
160
|
-
border-radius: 3px;
|
|
161
|
-
display: flex;
|
|
162
|
-
|
|
163
|
-
.logical-operator {
|
|
164
|
-
position: relative;
|
|
165
|
-
display: flex;
|
|
166
|
-
align-items: center;
|
|
167
|
-
overflow: hidden;
|
|
168
|
-
min-width: 60px;
|
|
169
|
-
padding-right: 5px;
|
|
170
|
-
|
|
171
|
-
.logical-operator__line {
|
|
172
|
-
position: absolute;
|
|
173
|
-
left: calc(32% - 1px);
|
|
174
|
-
width: 30px;
|
|
175
|
-
border-width: 1px 0 1px 1px;
|
|
176
|
-
border-top-style: solid;
|
|
177
|
-
border-bottom-style: solid;
|
|
178
|
-
border-left-style: solid;
|
|
179
|
-
border-top-color: var(--el-border-color);
|
|
180
|
-
border-bottom-color: var(--el-border-color);
|
|
181
|
-
border-left-color: var(--el-border-color);
|
|
182
|
-
border-image: initial;
|
|
183
|
-
border-right-style: initial;
|
|
184
|
-
border-right-color: initial;
|
|
185
|
-
border-radius: 5px 0 0 5px;
|
|
186
|
-
height: calc(100% - 48px);
|
|
187
|
-
|
|
188
|
-
&::before {
|
|
189
|
-
content: '';
|
|
190
|
-
position: absolute;
|
|
191
|
-
top: 0;
|
|
192
|
-
right: 0;
|
|
193
|
-
transform: translateX(100%) translateY(-50%);
|
|
194
|
-
width: 6px;
|
|
195
|
-
height: 6px;
|
|
196
|
-
border: var(--el-border);
|
|
197
|
-
border-radius: 50%;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
&::after {
|
|
201
|
-
content: '';
|
|
202
|
-
position: absolute;
|
|
203
|
-
bottom: 0;
|
|
204
|
-
right: 0;
|
|
205
|
-
transform: translateX(100%) translateY(50%);
|
|
206
|
-
width: 6px;
|
|
207
|
-
height: 6px;
|
|
208
|
-
border: var(--el-border);
|
|
209
|
-
border-radius: 50%;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.filter-option-content {
|
|
215
|
-
position: relative;
|
|
216
|
-
width: 100%;
|
|
217
|
-
|
|
218
|
-
.filter-item-rule {
|
|
219
|
-
display: flex;
|
|
220
|
-
//align-items: center;
|
|
221
|
-
min-height: 48px;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.filter-filter-item__add {
|
|
225
|
-
border-style: dashed;
|
|
226
|
-
width: 100%;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
</style>
|
|
1
|
+
<script setup lang="ts" name="AdvancedFilter">
|
|
2
|
+
import type { FilterRules } from './type'
|
|
3
|
+
import type { Field } from '../Render/type'
|
|
4
|
+
import Render from '../Render/render.vue'
|
|
5
|
+
import AdvancedFilter from './index.vue'
|
|
6
|
+
import { useVModel } from '@vueuse/core'
|
|
7
|
+
import Trigger from './Trigger.vue'
|
|
8
|
+
import Operator from './Operator.vue'
|
|
9
|
+
|
|
10
|
+
const $props = defineProps<{
|
|
11
|
+
filterFields: Field[]
|
|
12
|
+
modelValue: FilterRules
|
|
13
|
+
}>()
|
|
14
|
+
const $emits = defineEmits<{
|
|
15
|
+
(e: 'update:modelValue', modelValue: FilterRules): void
|
|
16
|
+
(e: 'addCondition', index: number): void
|
|
17
|
+
(e: 'delCondition', index: number): void
|
|
18
|
+
(e: 'delGroup'): void
|
|
19
|
+
}>()
|
|
20
|
+
const filterRules = useVModel($props, 'modelValue', $emits)
|
|
21
|
+
/**
|
|
22
|
+
* 添加条件
|
|
23
|
+
*/
|
|
24
|
+
const addRule = () => {
|
|
25
|
+
filterRules.value.conditions.push({
|
|
26
|
+
field: null,
|
|
27
|
+
operator: 'eq',
|
|
28
|
+
value: null,
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 删除条件
|
|
33
|
+
* @param index
|
|
34
|
+
*/
|
|
35
|
+
const handleDel = (index: number) => {
|
|
36
|
+
filterRules.value.conditions.splice(index, 1)
|
|
37
|
+
if (filterRules.value.conditions.length <= 0) {
|
|
38
|
+
$emits('delGroup')
|
|
39
|
+
}
|
|
40
|
+
$emits('delCondition', index)
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 条件条件组
|
|
44
|
+
*/
|
|
45
|
+
const addGroup = () => {
|
|
46
|
+
filterRules.value.groups.push({
|
|
47
|
+
operator: 'and',
|
|
48
|
+
conditions: [
|
|
49
|
+
{
|
|
50
|
+
field: null,
|
|
51
|
+
operator: '',
|
|
52
|
+
value: null,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
groups: [],
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 删除条件组
|
|
60
|
+
* @param index
|
|
61
|
+
*/
|
|
62
|
+
const delGroup = (index: number) => {
|
|
63
|
+
filterRules.value.groups.splice(index, 1)
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<div class="filter-container">
|
|
69
|
+
<div class="logical-operator">
|
|
70
|
+
<div class="logical-operator__line"></div>
|
|
71
|
+
<el-switch
|
|
72
|
+
v-model="filterRules.operator"
|
|
73
|
+
inline-prompt
|
|
74
|
+
style="--el-switch-on-color: #409eff; --el-switch-off-color: #67c23a"
|
|
75
|
+
active-value="and"
|
|
76
|
+
inactive-value="or"
|
|
77
|
+
active-text="且"
|
|
78
|
+
inactive-text="或"
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="filter-option-content">
|
|
82
|
+
<el-form :label-width="0" style="width: 100%" :inline="true" :model="filterRules">
|
|
83
|
+
<el-row
|
|
84
|
+
style="width: 100%"
|
|
85
|
+
v-for="(item, index) in filterRules.conditions"
|
|
86
|
+
:key="`${item.field}-${index}`"
|
|
87
|
+
:gutter="5"
|
|
88
|
+
class="filter-item-rule"
|
|
89
|
+
>
|
|
90
|
+
<el-col :span="7">
|
|
91
|
+
<el-form-item :prop="'conditions.' + index + '.field'" style="width: 100%">
|
|
92
|
+
<trigger
|
|
93
|
+
ref="triggerRef"
|
|
94
|
+
:options="$props.filterFields.filter((e) => e.value !== undefined)"
|
|
95
|
+
:filter-rules="filterRules"
|
|
96
|
+
v-model="item.field"
|
|
97
|
+
@update:model-value="item.value = null"
|
|
98
|
+
/>
|
|
99
|
+
</el-form-item>
|
|
100
|
+
</el-col>
|
|
101
|
+
<el-col :span="5" v-if="item.field">
|
|
102
|
+
<el-form-item :prop="'conditions.' + index + '.operator'" style="width: 100%">
|
|
103
|
+
<operator
|
|
104
|
+
ref="operatorRef"
|
|
105
|
+
:type="$props.filterFields.find((e) => e.id === item.field)?.name"
|
|
106
|
+
v-model="item.operator"
|
|
107
|
+
/>
|
|
108
|
+
</el-form-item>
|
|
109
|
+
</el-col>
|
|
110
|
+
<el-col :span="10" v-if="item.field">
|
|
111
|
+
<el-form-item :prop="'conditions.' + index + '.value'" style="width: 100%">
|
|
112
|
+
<Render
|
|
113
|
+
:field="$props.filterFields.find((e) => e.id === item.field) as Field"
|
|
114
|
+
v-model="item.value"
|
|
115
|
+
/>
|
|
116
|
+
</el-form-item>
|
|
117
|
+
</el-col>
|
|
118
|
+
<!-- style="display: flex; align-items: center; flex-direction: row-reverse"-->
|
|
119
|
+
<el-col :span="2" align="top">
|
|
120
|
+
<el-button plain text type="danger" icon="Delete" @click="handleDel(index)" />
|
|
121
|
+
</el-col>
|
|
122
|
+
</el-row>
|
|
123
|
+
<AdvancedFilter
|
|
124
|
+
v-for="(item, index) in filterRules.groups"
|
|
125
|
+
:key="index"
|
|
126
|
+
@delGroup="delGroup(index)"
|
|
127
|
+
v-model="filterRules.groups[index]"
|
|
128
|
+
:filterFields="filterFields"
|
|
129
|
+
>
|
|
130
|
+
<el-button @click="delGroup(index)" icon="CircleClose" class="filter-filter-item__add">
|
|
131
|
+
删除条件组
|
|
132
|
+
</el-button>
|
|
133
|
+
</AdvancedFilter>
|
|
134
|
+
<div
|
|
135
|
+
v-if="filterRules.groups.length === 0 && filterRules.conditions.length === 0"
|
|
136
|
+
class="filter-item-rule"
|
|
137
|
+
/>
|
|
138
|
+
</el-form>
|
|
139
|
+
<div class="filter-item-rule">
|
|
140
|
+
<el-button @click="addRule" icon="CirclePlus" class="filter-filter-item__add">
|
|
141
|
+
添加条件
|
|
142
|
+
</el-button>
|
|
143
|
+
<el-button @click="addGroup" icon="CirclePlus" class="filter-filter-item__add">
|
|
144
|
+
添加条件组
|
|
145
|
+
</el-button>
|
|
146
|
+
<slot />
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</template>
|
|
151
|
+
|
|
152
|
+
<style scoped lang="scss">
|
|
153
|
+
:deep(.el-form-item) {
|
|
154
|
+
margin-right: 0;
|
|
155
|
+
margin-bottom: 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.filter-container {
|
|
159
|
+
background-color: var(--el-fill-color-blank);
|
|
160
|
+
border-radius: 3px;
|
|
161
|
+
display: flex;
|
|
162
|
+
|
|
163
|
+
.logical-operator {
|
|
164
|
+
position: relative;
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
min-width: 60px;
|
|
169
|
+
padding-right: 5px;
|
|
170
|
+
|
|
171
|
+
.logical-operator__line {
|
|
172
|
+
position: absolute;
|
|
173
|
+
left: calc(32% - 1px);
|
|
174
|
+
width: 30px;
|
|
175
|
+
border-width: 1px 0 1px 1px;
|
|
176
|
+
border-top-style: solid;
|
|
177
|
+
border-bottom-style: solid;
|
|
178
|
+
border-left-style: solid;
|
|
179
|
+
border-top-color: var(--el-border-color);
|
|
180
|
+
border-bottom-color: var(--el-border-color);
|
|
181
|
+
border-left-color: var(--el-border-color);
|
|
182
|
+
border-image: initial;
|
|
183
|
+
border-right-style: initial;
|
|
184
|
+
border-right-color: initial;
|
|
185
|
+
border-radius: 5px 0 0 5px;
|
|
186
|
+
height: calc(100% - 48px);
|
|
187
|
+
|
|
188
|
+
&::before {
|
|
189
|
+
content: '';
|
|
190
|
+
position: absolute;
|
|
191
|
+
top: 0;
|
|
192
|
+
right: 0;
|
|
193
|
+
transform: translateX(100%) translateY(-50%);
|
|
194
|
+
width: 6px;
|
|
195
|
+
height: 6px;
|
|
196
|
+
border: var(--el-border);
|
|
197
|
+
border-radius: 50%;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&::after {
|
|
201
|
+
content: '';
|
|
202
|
+
position: absolute;
|
|
203
|
+
bottom: 0;
|
|
204
|
+
right: 0;
|
|
205
|
+
transform: translateX(100%) translateY(50%);
|
|
206
|
+
width: 6px;
|
|
207
|
+
height: 6px;
|
|
208
|
+
border: var(--el-border);
|
|
209
|
+
border-radius: 50%;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.filter-option-content {
|
|
215
|
+
position: relative;
|
|
216
|
+
width: 100%;
|
|
217
|
+
|
|
218
|
+
.filter-item-rule {
|
|
219
|
+
display: flex;
|
|
220
|
+
//align-items: center;
|
|
221
|
+
min-height: 48px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.filter-filter-item__add {
|
|
225
|
+
border-style: dashed;
|
|
226
|
+
width: 100%;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
</style>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 字段筛选结果
|
|
3
|
-
*/
|
|
4
|
-
export interface Condition {
|
|
5
|
-
// 筛选字段
|
|
6
|
-
field: string | null
|
|
7
|
-
// 条件运算符
|
|
8
|
-
operator: string
|
|
9
|
-
// 筛选值
|
|
10
|
-
value: any | null
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 筛选规则
|
|
15
|
-
*/
|
|
16
|
-
export interface FilterRules {
|
|
17
|
-
operator: 'or' | 'and'
|
|
18
|
-
conditions: Condition[]
|
|
19
|
-
groups: FilterRules[]
|
|
20
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 字段筛选结果
|
|
3
|
+
*/
|
|
4
|
+
export interface Condition {
|
|
5
|
+
// 筛选字段
|
|
6
|
+
field: string | null
|
|
7
|
+
// 条件运算符
|
|
8
|
+
operator: string
|
|
9
|
+
// 筛选值
|
|
10
|
+
value: any | null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 筛选规则
|
|
15
|
+
*/
|
|
16
|
+
export interface FilterRules {
|
|
17
|
+
operator: 'or' | 'and'
|
|
18
|
+
conditions: Condition[]
|
|
19
|
+
groups: FilterRules[]
|
|
20
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.svg-icon {
|
|
2
|
-
width: 1em;
|
|
3
|
-
height: 1em;
|
|
4
|
-
vertical-align: -0.15em;
|
|
5
|
-
fill: currentColor;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
}
|
|
1
|
+
.svg-icon {
|
|
2
|
+
width: 1em;
|
|
3
|
+
height: 1em;
|
|
4
|
+
vertical-align: -0.15em;
|
|
5
|
+
fill: currentColor;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|