@elementplus-kit/uikit 1.0.1 → 1.0.3
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/components/button/index.ts +4 -0
- package/components/button/src/constants.ts +50 -0
- package/components/button/src/index.ts +91 -0
- package/components/dictLabel/index.ts +4 -0
- package/components/dictLabel/src/index.vue +21 -0
- package/components/form/src/index.ts +18 -3
- package/components/form/style/index.scss +5 -0
- package/components/{index.js → index.ts} +6 -0
- package/components/search/index.ts +2 -2
- package/components/search/src/{index.vue → index-/346/272/220.vue} +67 -64
- package/components/search/src/index.tsx +172 -0
- package/components/search/style/index.scss +93 -0
- package/components/{table2 → table}/src/TableColumn.ts +1 -1
- package/components/table/src/index.ts +245 -7
- package/components/table/src/tableDictLabel.vue +21 -0
- package/components/table2/src/index.ts +7 -205
- package/components/{table → table2}/src/types.ts +39 -39
- package/components/table2/style/index.scss +0 -0
- package/components//346/250/241/346/235/277/index.tsx +57 -0
- package/components//346/250/241/346/235/277/ttt.ts +3 -2
- package/components//346/250/241/346/235/277/ttt.vue +18 -0
- package/package.json +2 -2
- /package/components/{table → button}/style/index.scss +0 -0
- /package/components/{table2 → table}/src/constants.ts +0 -0
- /package/components/{table2 → table}/src/index2.ts +0 -0
- /package/components/{table2 → table}/src/index3.ts +0 -0
- /package/components/{table2 → table}/src/tableaa.ts +0 -0
- /package/components/{table2 → table}/src/type.ts +0 -0
- /package/components/{table2 → table}/type/index.scss +0 -0
- /package/components/{table → table2}/src/config.ts +0 -0
- /package/components/{table → table2}/src/render.ts +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const typeActiveMap = {
|
|
2
|
+
reset: {
|
|
3
|
+
name: "重置",
|
|
4
|
+
type: "info",
|
|
5
|
+
},
|
|
6
|
+
search: {
|
|
7
|
+
name: "查询",
|
|
8
|
+
type: "primary",
|
|
9
|
+
},
|
|
10
|
+
submit: {
|
|
11
|
+
name: "提交",
|
|
12
|
+
type: "primary",
|
|
13
|
+
},
|
|
14
|
+
save: {
|
|
15
|
+
name: "保存",
|
|
16
|
+
type: "primary",
|
|
17
|
+
},
|
|
18
|
+
create: {
|
|
19
|
+
name: "新增",
|
|
20
|
+
type: "primary",
|
|
21
|
+
},
|
|
22
|
+
delete: {
|
|
23
|
+
name: "删除",
|
|
24
|
+
type: "danger",
|
|
25
|
+
},
|
|
26
|
+
edit: {
|
|
27
|
+
name: "编辑",
|
|
28
|
+
type: "primary",
|
|
29
|
+
},
|
|
30
|
+
view: {
|
|
31
|
+
name: "查看",
|
|
32
|
+
type: "primary",
|
|
33
|
+
},
|
|
34
|
+
publish: {
|
|
35
|
+
name: "发布",
|
|
36
|
+
type: "primary",
|
|
37
|
+
},
|
|
38
|
+
import: {
|
|
39
|
+
name: "导入",
|
|
40
|
+
type: "primary",
|
|
41
|
+
},
|
|
42
|
+
export: {
|
|
43
|
+
name: "导出",
|
|
44
|
+
type: "primary",
|
|
45
|
+
},
|
|
46
|
+
exportAll: {
|
|
47
|
+
name: "导出全部",
|
|
48
|
+
type: "primary",
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineComponent, h } from "vue";
|
|
2
|
+
import { ElButton } from "element-plus";
|
|
3
|
+
|
|
4
|
+
// import '../style/index.scss';
|
|
5
|
+
import { typeActiveMap } from "./constants.ts";
|
|
6
|
+
import { has, isBoolean, isFunction, isArray } from "lodash-es";
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
props: {
|
|
9
|
+
params: {
|
|
10
|
+
// 用于验证自定义函数的外部数据
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => ({}),
|
|
13
|
+
},
|
|
14
|
+
// modelValue: {
|
|
15
|
+
// type: Object,
|
|
16
|
+
// default: {}
|
|
17
|
+
// },
|
|
18
|
+
buttonOptions: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: () => [],
|
|
21
|
+
},
|
|
22
|
+
// 权限函数
|
|
23
|
+
hasPermission: {
|
|
24
|
+
type: Function,
|
|
25
|
+
default: () => true,
|
|
26
|
+
},
|
|
27
|
+
// // 权限函数
|
|
28
|
+
// hasRole: {
|
|
29
|
+
// type: Function,
|
|
30
|
+
// default: () => true
|
|
31
|
+
// },
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
setup(props, { emit, slots, attrs, expose }) {
|
|
35
|
+
// const slotsList = ["active", "btn-left", "btn-right"];
|
|
36
|
+
// console.log('slots', slots);
|
|
37
|
+
// console.log('attrs', attrs);
|
|
38
|
+
|
|
39
|
+
// 解析插槽
|
|
40
|
+
const getAttrs = (item) => {
|
|
41
|
+
let defaultAttrs = {};
|
|
42
|
+
// const { alias, hasPermission, vIf, ...p } = item;
|
|
43
|
+
if (item?.alias && typeActiveMap[item.alias]) {
|
|
44
|
+
defaultAttrs = typeActiveMap[item.alias];
|
|
45
|
+
}
|
|
46
|
+
// 过滤掉非elbutton属性
|
|
47
|
+
defaultAttrs = {
|
|
48
|
+
...defaultAttrs,
|
|
49
|
+
...item,
|
|
50
|
+
};
|
|
51
|
+
return defaultAttrs;
|
|
52
|
+
};
|
|
53
|
+
const render = () => {
|
|
54
|
+
console.log("render 执行");
|
|
55
|
+
// 过滤权限
|
|
56
|
+
let list = [];
|
|
57
|
+
props.buttonOptions.map((item) => {
|
|
58
|
+
if (has(item, "permission") && isArray(item.permission)) {
|
|
59
|
+
if (props.hasPermission && props.hasPermission(item.permission)) {
|
|
60
|
+
list.push(item);
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
list.push(item);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const listR = [];
|
|
68
|
+
list.map((item) => {
|
|
69
|
+
// if (has(item, "vIf")) {
|
|
70
|
+
if (has(item, "vIf") && isFunction(item.vIf) && item.vIf(props.params) !== undefined) {
|
|
71
|
+
console.log('aaaaaaaaaa', item.vIf(props.params));
|
|
72
|
+
if (item.vIf(props.params)) {
|
|
73
|
+
listR.push(item);
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
listR.push(item);
|
|
77
|
+
}
|
|
78
|
+
// } else {
|
|
79
|
+
// listR.push(item);
|
|
80
|
+
// }
|
|
81
|
+
});
|
|
82
|
+
console.log("🚀 ~ render ~ listR:", listR);
|
|
83
|
+
return listR.map((item) => {
|
|
84
|
+
return h(ElButton, getAttrs(item), {
|
|
85
|
+
default: () => item?.name,
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
return () => render();
|
|
90
|
+
},
|
|
91
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
{{ label }}
|
|
3
|
+
</template>
|
|
4
|
+
<script setup lang="ts">
|
|
5
|
+
import { computed, PropType } from 'vue'
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
options: {
|
|
8
|
+
type: Array,
|
|
9
|
+
default: () => []
|
|
10
|
+
},
|
|
11
|
+
value: {
|
|
12
|
+
type: String as PropType<any>,
|
|
13
|
+
default: ''
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
const label = computed(() => {
|
|
17
|
+
// 处理value为数字的情况 后端字典都是字符串
|
|
18
|
+
const item = props.options?.find((item) => item.value == props.value.toString());
|
|
19
|
+
return item?.label || props.value;
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
@@ -14,7 +14,7 @@ import zhCn from "element-plus/es/locale/lang/zh-cn";
|
|
|
14
14
|
import CFormItem from "./FormItem.ts";
|
|
15
15
|
import { has, isArray, isBoolean, isFunction, isNumber } from "lodash-es";
|
|
16
16
|
import { getEmits } from "./constants"; // 获取所有的事件
|
|
17
|
-
|
|
17
|
+
import '../style/index.scss'
|
|
18
18
|
const propsAttrs = {
|
|
19
19
|
// 表单数据
|
|
20
20
|
model: { type: Object, default: () => ({}) },
|
|
@@ -30,6 +30,8 @@ const propsAttrs = {
|
|
|
30
30
|
},
|
|
31
31
|
// row 列数
|
|
32
32
|
col: { type: Number, default: undefined },
|
|
33
|
+
// 额外业务全局参数
|
|
34
|
+
params: { type: Object, default: () => ({}) },
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>;
|
|
@@ -81,6 +83,7 @@ export default defineComponent({
|
|
|
81
83
|
|
|
82
84
|
// 渲染 row
|
|
83
85
|
const renderRow = () => {
|
|
86
|
+
const formItemVdom = renderFormItem();
|
|
84
87
|
if (isLayout.value) {
|
|
85
88
|
return h(
|
|
86
89
|
ElRow,
|
|
@@ -91,16 +94,28 @@ export default defineComponent({
|
|
|
91
94
|
...$attrs,
|
|
92
95
|
},
|
|
93
96
|
{
|
|
94
|
-
default: () =>
|
|
97
|
+
default: () => formItemVdom,
|
|
95
98
|
}
|
|
96
99
|
);
|
|
97
100
|
} else {
|
|
98
|
-
return
|
|
101
|
+
return formItemVdom;
|
|
99
102
|
}
|
|
100
103
|
};
|
|
101
104
|
|
|
102
105
|
// 渲染表单项
|
|
103
106
|
const renderFormItem = () => {
|
|
107
|
+
// 过滤权限
|
|
108
|
+
const list = []
|
|
109
|
+
formOptions.value.map((item) => {
|
|
110
|
+
// 处理 vIf 显示隐藏
|
|
111
|
+
if(has(item, 'vIf')) {
|
|
112
|
+
if (isFunction(item.vIf) && item.vIf(props.model, props.params)) {
|
|
113
|
+
list.push(item)
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
list.push(item)
|
|
117
|
+
}
|
|
118
|
+
})
|
|
104
119
|
return formOptions.value.map((item) => {
|
|
105
120
|
// const { label, prop, type, required, col, formItem, attrs } = item
|
|
106
121
|
// const { label, prop, type, required, col, formItem, attrs, ...args } = item
|
|
@@ -33,6 +33,12 @@ import Search from "./search/index.ts";
|
|
|
33
33
|
export * from "./search/index.ts";
|
|
34
34
|
export const CSearch = Search;
|
|
35
35
|
|
|
36
|
+
// 按钮
|
|
37
|
+
import Button from "./button/index.ts";
|
|
38
|
+
export * from "./button/index.ts";
|
|
39
|
+
export const CButton = Button;
|
|
40
|
+
|
|
41
|
+
|
|
36
42
|
// 测试单个引入-----------------------------
|
|
37
43
|
// export * from "./dialog/index.ts"; // 弹窗
|
|
38
44
|
// export * from "./drawer/index.ts"; // 抽屉
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
<div class="c-search-simple-btn">
|
|
13
13
|
<slot name="btn-left" />
|
|
14
|
-
<
|
|
14
|
+
<div class="c-search-simple-icon" @click="handleShow" v-if="showCount < props.formOptions.length"
|
|
15
15
|
:class="{ 'icon-rotate': showSearchForm }">
|
|
16
|
-
<
|
|
17
|
-
|
|
16
|
+
<el-icon class="c-search-icon">
|
|
17
|
+
<ArrowUpBold />
|
|
18
|
+
</el-icon>
|
|
19
|
+
</div>
|
|
18
20
|
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
|
19
21
|
<el-button type="primary" @click="handleReset">重置</el-button>
|
|
20
22
|
<slot name="btn-right" />
|
|
@@ -23,7 +25,7 @@
|
|
|
23
25
|
<!-- 下拉悬浮 -->
|
|
24
26
|
<transition name="search-form-transition">
|
|
25
27
|
<el-card class="c-search-form" v-if="showSearchForm && props.isDrawer">
|
|
26
|
-
<c-form v-bind="getEvent()" inline :model="formData"
|
|
28
|
+
<c-form v-bind="getEvent(), getSlot('form')"" inline :model="formData"
|
|
27
29
|
:formOptions="props.formOptions.filter((item, index) => index >= showCount)" ref="formRef">
|
|
28
30
|
</c-form>
|
|
29
31
|
<div style="text-align: right;">
|
|
@@ -86,6 +88,7 @@ const getEvent = (name: string) => {
|
|
|
86
88
|
})
|
|
87
89
|
return obj
|
|
88
90
|
}
|
|
91
|
+
|
|
89
92
|
// 解析插槽
|
|
90
93
|
const getSlot = (type: 'form' | 'search') => {
|
|
91
94
|
let searchObj: any = {}
|
|
@@ -101,18 +104,15 @@ const getSlot = (type: 'form' | 'search') => {
|
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
const handleSearch = () => {
|
|
104
|
-
console.log('搜索内容:')
|
|
105
107
|
emit('search')
|
|
106
108
|
showSearchForm.value = false
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
const handleReset = () => {
|
|
110
|
-
console.log('搜索重置:')
|
|
111
112
|
emit('reset')
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
const handleClose = () => {
|
|
115
|
-
console.log('搜索关闭:')
|
|
116
116
|
showSearchForm.value = false
|
|
117
117
|
emit('close')
|
|
118
118
|
}
|
|
@@ -173,81 +173,84 @@ const handleShow = () => {
|
|
|
173
173
|
.c-search-simple-btn {
|
|
174
174
|
display: flex;
|
|
175
175
|
margin-left: auto;
|
|
176
|
+
}
|
|
176
177
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
color:
|
|
191
|
-
|
|
192
|
-
&:hover {
|
|
193
|
-
background-color: rgb(121, 187, 255);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
&:active {
|
|
197
|
-
background-color: rgb(51, 126, 204);
|
|
198
|
-
}
|
|
178
|
+
.c-search-simple-icon {
|
|
179
|
+
display: flex;
|
|
180
|
+
justify-content: center;
|
|
181
|
+
align-items: center;
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
height: 32px;
|
|
184
|
+
width: 32px;
|
|
185
|
+
margin-right: 10px;
|
|
186
|
+
border-radius: 4px;
|
|
187
|
+
background-color: #409eff;
|
|
188
|
+
transition: all 0.2s;
|
|
189
|
+
|
|
190
|
+
&:hover {
|
|
191
|
+
background-color: rgb(121, 187, 255);
|
|
199
192
|
}
|
|
200
193
|
|
|
201
|
-
|
|
202
|
-
transform: rotate(180deg);
|
|
194
|
+
&:active {
|
|
203
195
|
background-color: rgb(51, 126, 204);
|
|
204
196
|
}
|
|
205
197
|
}
|
|
206
198
|
|
|
199
|
+
.c-search-icon {
|
|
200
|
+
// 添加鼠标悬停效果
|
|
201
|
+
display: inline-block;
|
|
202
|
+
color: #fff;
|
|
203
|
+
transition: all 0.2s;
|
|
204
|
+
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.icon-rotate {
|
|
208
|
+
background-color: rgb(51, 126, 204);
|
|
209
|
+
|
|
210
|
+
.c-search-icon {
|
|
211
|
+
transform: rotate(180deg);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
207
215
|
.c-search-form {
|
|
208
|
-
// padding: 16px;
|
|
209
|
-
// background-color: #333;
|
|
210
216
|
width: 100%;
|
|
211
217
|
position: absolute;
|
|
212
218
|
top: 50px;
|
|
213
219
|
left: 0;
|
|
214
220
|
overflow: hidden;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
:deep(.el-card__body) {
|
|
218
|
-
// padding: 0;
|
|
219
|
-
}
|
|
221
|
+
z-index: 10;
|
|
222
|
+
background-color: #fff;
|
|
220
223
|
}
|
|
224
|
+
}
|
|
221
225
|
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
/* 下拉动画效果 */
|
|
227
|
+
.search-form-transition {
|
|
224
228
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
&-enter-active,
|
|
230
|
+
&-leave-active {
|
|
231
|
+
transition: all 0.3s ease;
|
|
232
|
+
/* 动画过渡时间和缓动函数 */
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
max-height: 500px;
|
|
235
|
+
/* 确保足够大的最大高度以容纳内容 */
|
|
236
|
+
}
|
|
233
237
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
&-enter-from {
|
|
239
|
+
max-height: 0;
|
|
240
|
+
/* 入场开始时高度为0 */
|
|
241
|
+
opacity: 0;
|
|
242
|
+
/* 可以添加透明度效果增强视觉体验 */
|
|
243
|
+
padding-top: 0;
|
|
244
|
+
padding-bottom: 0;
|
|
245
|
+
}
|
|
242
246
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
247
|
+
&-leave-to {
|
|
248
|
+
max-height: 0;
|
|
249
|
+
/* 出场结束时高度为0 */
|
|
250
|
+
opacity: 0;
|
|
251
|
+
/* 可以添加透明度效果增强视觉体验 */
|
|
252
|
+
padding-top: 0;
|
|
253
|
+
padding-bottom: 0;
|
|
251
254
|
}
|
|
252
255
|
}
|
|
253
256
|
</style>
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
computed,
|
|
4
|
+
defineComponent,
|
|
5
|
+
} from "vue";
|
|
6
|
+
|
|
7
|
+
import { CForm, CDrawer } from "@elementplus-kit/uikit";
|
|
8
|
+
import { ArrowUpBold } from "@element-plus/icons-vue";
|
|
9
|
+
import '../style/index.scss';
|
|
10
|
+
|
|
11
|
+
export default defineComponent({
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: {}
|
|
16
|
+
},
|
|
17
|
+
formOptions: {
|
|
18
|
+
type: Array,
|
|
19
|
+
default: () => []
|
|
20
|
+
},
|
|
21
|
+
isDrawer: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
emits: ['update:modelValue', 'search', 'reset', 'close'],
|
|
27
|
+
|
|
28
|
+
setup(props, { emit, slots, attrs, expose }) {
|
|
29
|
+
// 自己的 slot
|
|
30
|
+
const slotsList = ["active", "btn-left", "btn-right"];
|
|
31
|
+
// console.log('slots', slots);
|
|
32
|
+
// console.log('attrs', attrs);
|
|
33
|
+
// 解析 attrs 中的事件
|
|
34
|
+
const getEvent = () => {
|
|
35
|
+
let formObj: any = {};
|
|
36
|
+
Object.keys(attrs)?.forEach((name) => {
|
|
37
|
+
if (name.indexOf("on") === 0) {
|
|
38
|
+
formObj[name] = attrs[name];
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
return formObj
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// 解析插槽
|
|
45
|
+
const getSlot = () => {
|
|
46
|
+
let formObj = {};
|
|
47
|
+
Object.keys(slots).forEach((key) => {
|
|
48
|
+
if (!slotsList.includes(key)) {
|
|
49
|
+
formObj[key] = slots[key];
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return formObj
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// 搜索
|
|
56
|
+
const handleSearch = () => {
|
|
57
|
+
emit("search");
|
|
58
|
+
showSearchForm.value = false;
|
|
59
|
+
};
|
|
60
|
+
// 重置
|
|
61
|
+
const handleReset = () => {
|
|
62
|
+
emit("reset");
|
|
63
|
+
};
|
|
64
|
+
// 关闭
|
|
65
|
+
const handleClose = () => {
|
|
66
|
+
showSearchForm.value = false;
|
|
67
|
+
emit("close");
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const showCountC = computed(() => {
|
|
71
|
+
return props.showCount;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const showCount = ref(3); // 显示个数
|
|
75
|
+
const showSearchForm = ref(false); // 显示搜索表单
|
|
76
|
+
const handleShow = () => {
|
|
77
|
+
showSearchForm.value = !showSearchForm.value;
|
|
78
|
+
};
|
|
79
|
+
return () => (
|
|
80
|
+
<div className="c-search">
|
|
81
|
+
<div className="c-search-simple">
|
|
82
|
+
<div className="c-search-simple-form">
|
|
83
|
+
<CForm
|
|
84
|
+
{...getEvent()}
|
|
85
|
+
inline
|
|
86
|
+
model={props.modelValue}
|
|
87
|
+
formOptions={props.formOptions?.filter(
|
|
88
|
+
(item, index) => index < showCount.value
|
|
89
|
+
)}
|
|
90
|
+
ref="formRef"
|
|
91
|
+
>
|
|
92
|
+
{getSlot()}
|
|
93
|
+
</CForm>
|
|
94
|
+
</div>
|
|
95
|
+
<div className="c-search-simple-btn">
|
|
96
|
+
{slots["btn-left"]?.()}
|
|
97
|
+
{showCount.value < props.formOptions?.length && (
|
|
98
|
+
<div
|
|
99
|
+
className={
|
|
100
|
+
`c-search-simple-icon ${showSearchForm.value ? "icon-rotate" : ""}`
|
|
101
|
+
}
|
|
102
|
+
onClick={handleShow}
|
|
103
|
+
>
|
|
104
|
+
<el-icon className="el-icon c-search-icon">
|
|
105
|
+
<ArrowUpBold />
|
|
106
|
+
</el-icon>
|
|
107
|
+
</div>
|
|
108
|
+
)}
|
|
109
|
+
<el-button type="primary" onClick={handleSearch}>
|
|
110
|
+
搜索
|
|
111
|
+
</el-button>
|
|
112
|
+
<el-button type="primary" onClick={handleReset}>
|
|
113
|
+
重置
|
|
114
|
+
</el-button>
|
|
115
|
+
{slots["btn-right"]?.()}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
{/* 下拉悬浮 */}
|
|
120
|
+
{!props.isDrawer && showSearchForm.value && (
|
|
121
|
+
<transition name="search-form-transition">
|
|
122
|
+
<el-card className="c-search-form el-card is-always-shadow">
|
|
123
|
+
<CForm
|
|
124
|
+
{...getEvent()}
|
|
125
|
+
inline
|
|
126
|
+
model={props.modelValue}
|
|
127
|
+
formOptions={props.formOptions.filter(
|
|
128
|
+
(item, index) => index >= showCount.value
|
|
129
|
+
)}
|
|
130
|
+
ref="formRef"
|
|
131
|
+
>
|
|
132
|
+
{getSlot()}
|
|
133
|
+
</CForm>
|
|
134
|
+
<div style="text-align: right;">
|
|
135
|
+
<el-button type="primary" onClick={handleSearch}>
|
|
136
|
+
搜索
|
|
137
|
+
</el-button>
|
|
138
|
+
<el-button type="primary" onClick={handleClose}>
|
|
139
|
+
关闭
|
|
140
|
+
</el-button>
|
|
141
|
+
</div>
|
|
142
|
+
</el-card>
|
|
143
|
+
</transition>
|
|
144
|
+
)}
|
|
145
|
+
|
|
146
|
+
{props.isDrawer && (
|
|
147
|
+
<CDrawer title="搜索" v-model={showSearchForm.value} size="660px">
|
|
148
|
+
<CForm
|
|
149
|
+
{...getEvent()}
|
|
150
|
+
col={12}
|
|
151
|
+
model={props.modelValue}
|
|
152
|
+
formOptions={props.formOptions.filter(
|
|
153
|
+
(item, index) => index >= showCount.value
|
|
154
|
+
)}
|
|
155
|
+
ref="formRef"
|
|
156
|
+
>
|
|
157
|
+
{getSlot()}
|
|
158
|
+
</CForm>
|
|
159
|
+
<div style="text-align: right;">
|
|
160
|
+
<el-button type="primary" onClick={handleSearch}>
|
|
161
|
+
搜索
|
|
162
|
+
</el-button>
|
|
163
|
+
<el-button type="primary" onClick={handleClose}>
|
|
164
|
+
关闭
|
|
165
|
+
</el-button>
|
|
166
|
+
</div>
|
|
167
|
+
</CDrawer>
|
|
168
|
+
)}
|
|
169
|
+
</div>
|
|
170
|
+
)
|
|
171
|
+
},
|
|
172
|
+
})
|