@lx-frontend/wrap-element-ui 1.0.28-beta.3 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +21 -12
- package/src/components/AddMembers/index.vue +100 -89
- package/src/components/AuditSteps/index.vue +107 -74
- package/src/components/DemoComponent/index.vue +8 -5
- package/src/components/EditableTable/bizHooks/useColumnHeaderOperation.ts +5 -4
- package/src/components/EditableTable/bizHooks/useDefaultOperation.ts +12 -4
- package/src/components/EditableTable/bizHooks/useDragSort.ts +6 -2
- package/src/components/EditableTable/bizHooks/useRowBgColor.ts +6 -2
- package/src/components/EditableTable/bizHooks/useViewSetting.ts +2 -1
- package/src/components/EditableTable/features/bizColorSelect.vue +4 -3
- package/src/components/EditableTable/features/bizEditCell.vue +6 -6
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue +3 -3
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue +3 -4
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue +8 -8
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue +2 -2
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue +2 -2
- package/src/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue +3 -4
- package/src/components/EditableTable/features/bizTableHeaderPopover/index.vue +28 -19
- package/src/components/EditableTable/features/bizTableOperatePopover.vue +11 -9
- package/src/components/EditableTable/features/bizViewSettingDialog.vue +10 -6
- package/src/components/EditableTable/index.less +189 -186
- package/src/components/EditableTable/index.vue +25 -15
- package/src/components/EditableTable/types/index.ts +4 -4
- package/src/components/Ellipsis/MultilineEllipsis.vue +96 -109
- package/src/components/Ellipsis/index.vue +114 -89
- package/src/components/LxTable/index.vue +98 -143
- package/src/components/PopoverForm/index.vue +52 -47
- package/src/components/SearchForm/index.vue +128 -138
- package/src/components/SearchForm/types/index.ts +4 -4
- package/src/components/SearchSelect/index.vue +83 -67
- package/src/components/index.ts +1 -1
- package/src/components/singleMessage/index.ts +15 -44
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<template>
|
|
12
12
|
<div class="table-content">
|
|
13
|
-
<
|
|
13
|
+
<ElTable
|
|
14
14
|
ref="lxTableRef"
|
|
15
15
|
v-loading="loading"
|
|
16
16
|
v-bind="$attrs"
|
|
@@ -40,15 +40,14 @@
|
|
|
40
40
|
:fixed="getFieldFromConfig(keys[index], 'fixed')"
|
|
41
41
|
>
|
|
42
42
|
<template
|
|
43
|
-
|
|
44
|
-
slot-scope="scope"
|
|
43
|
+
#header="scope"
|
|
45
44
|
>
|
|
46
45
|
<slot
|
|
47
46
|
v-if="getFieldFromConfig(keys[index], 'scopeHeader')"
|
|
48
47
|
template
|
|
49
48
|
:name="`${keys[index]}_header`"
|
|
50
49
|
:keys="keys[index]"
|
|
51
|
-
:row="scope.row"
|
|
50
|
+
:row="(scope as any).row"
|
|
52
51
|
:lable="scope.column"
|
|
53
52
|
:column="scope.$index"
|
|
54
53
|
/>
|
|
@@ -56,7 +55,7 @@
|
|
|
56
55
|
{{ item }}
|
|
57
56
|
</span>
|
|
58
57
|
</template>
|
|
59
|
-
<template
|
|
58
|
+
<template #default="scope">
|
|
60
59
|
<!-- 支持keys字段为'car.id'或者'id' -->
|
|
61
60
|
<div v-if="keys[index].indexOf('.') != -1">
|
|
62
61
|
<!-- 一个td需要展示多个字段名 -->
|
|
@@ -87,17 +86,17 @@
|
|
|
87
86
|
<div v-else>
|
|
88
87
|
<!-- 传入不需要截取的列 -->
|
|
89
88
|
<span v-if="getFieldFromConfig(keys[index], 'templateCutOut')">
|
|
90
|
-
{{ scope.row[keys[index].split('.')[0]][keys[index].split('.')[1]]
|
|
89
|
+
{{ formateValue(scope.row[keys[index].split('.')[0]][keys[index].split('.')[1]]) }}
|
|
91
90
|
</span>
|
|
92
91
|
<Ellipsis
|
|
93
92
|
v-else
|
|
94
93
|
:popover-name="popoverName"
|
|
95
94
|
:line-count="getFieldFromConfig(keys[index], 'lineCount')"
|
|
96
|
-
:content="[
|
|
95
|
+
:content="[String(formateValue(scope.row[keys[index].split('.')[0]][keys[index].split('.')[1]]))]"
|
|
97
96
|
>
|
|
98
|
-
<
|
|
99
|
-
<div>{{ scope.row[keys[index].split('.')[0]][keys[index].split('.')[1]]
|
|
100
|
-
</
|
|
97
|
+
<template #popover>
|
|
98
|
+
<div>{{ formateValue(scope.row[keys[index].split('.')[0]][keys[index].split('.')[1]]) }}</div>
|
|
99
|
+
</template>
|
|
101
100
|
</Ellipsis>
|
|
102
101
|
</div>
|
|
103
102
|
</div>
|
|
@@ -130,23 +129,23 @@
|
|
|
130
129
|
<div v-else>
|
|
131
130
|
<!-- 传入不需要截取的列 -->
|
|
132
131
|
<span v-if="getFieldFromConfig(keys[index], 'templateCutOut')">
|
|
133
|
-
{{ scope.row[keys[index]]
|
|
132
|
+
{{ formateValue(scope.row[keys[index]]) }}
|
|
134
133
|
</span>
|
|
135
134
|
<Ellipsis
|
|
136
135
|
v-else
|
|
137
136
|
:popover-name="popoverName"
|
|
138
137
|
:line-count="getFieldFromConfig(keys[index], 'lineCount')"
|
|
139
|
-
:content="[
|
|
138
|
+
:content="[String(formateValue(scope.row[keys[index]]))]"
|
|
140
139
|
>
|
|
141
|
-
<
|
|
142
|
-
<div>{{ scope.row[keys[index]]
|
|
143
|
-
</
|
|
140
|
+
<template #popover>
|
|
141
|
+
<div>{{ formateValue(scope.row[keys[index]]) }}</div>
|
|
142
|
+
</template>
|
|
144
143
|
</Ellipsis>
|
|
145
144
|
</div>
|
|
146
145
|
</div>
|
|
147
146
|
</template>
|
|
148
147
|
</ElTableColumn>
|
|
149
|
-
</
|
|
148
|
+
</ElTable>
|
|
150
149
|
<ElPagination
|
|
151
150
|
:background="background"
|
|
152
151
|
v-if="currentPage"
|
|
@@ -158,136 +157,92 @@
|
|
|
158
157
|
/>
|
|
159
158
|
</div>
|
|
160
159
|
</template>
|
|
161
|
-
<script>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
160
|
+
<script setup lang="ts">
|
|
161
|
+
import { ElTable, ElTableColumn, ElPagination } from 'element-plus'
|
|
162
|
+
import Ellipsis from '../Ellipsis/index.vue'
|
|
163
|
+
|
|
164
|
+
defineOptions({ name: 'LxTable' })
|
|
165
|
+
|
|
166
|
+
interface IProps {
|
|
167
|
+
tableData?: any[]
|
|
168
|
+
cloumns?: any[]
|
|
169
|
+
customConfig?: Record<string, any>
|
|
170
|
+
keys?: any[]
|
|
171
|
+
defaultSort?: { prop: string; order: string | null }
|
|
172
|
+
stripe?: boolean
|
|
173
|
+
loading?: boolean
|
|
174
|
+
background?: boolean
|
|
175
|
+
totals?: number
|
|
176
|
+
pageSize?: number
|
|
177
|
+
currentPage?: number
|
|
178
|
+
popoverName?: string
|
|
179
|
+
parentFn?: string
|
|
180
|
+
highlightCurrentRow?: boolean
|
|
181
|
+
tableRowClassName?: string | ((data: any) => string)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
interface IEmits {
|
|
185
|
+
(e: 'handleCurrentChange', val: number): void
|
|
186
|
+
(e: 'handleSelectionChange', val: any[]): void
|
|
187
|
+
(e: 'handleRowClick', row: any, column: any, cell: any, event: Event): void
|
|
188
|
+
(e: 'handleCellClick', row: any, column: any, cell: any, event: Event): void
|
|
189
|
+
(e: 'sortChange', column: any, prop: any, order: any): void
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
193
|
+
tableData: () => [],
|
|
194
|
+
cloumns: () => [],
|
|
195
|
+
customConfig: () => ({}),
|
|
196
|
+
keys: () => [],
|
|
197
|
+
defaultSort: () => ({ prop: '', order: null }),
|
|
198
|
+
stripe: true,
|
|
199
|
+
loading: false,
|
|
200
|
+
background: true,
|
|
201
|
+
parentFn: '',
|
|
202
|
+
highlightCurrentRow: true,
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
const emit = defineEmits<IEmits>()
|
|
206
|
+
|
|
207
|
+
const handleCurrentChange = (val: number) => {
|
|
208
|
+
emit('handleCurrentChange', val)
|
|
209
|
+
}
|
|
191
210
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
customConfig: Object,
|
|
216
|
-
keys: {
|
|
217
|
-
type : Array,
|
|
218
|
-
default: () => [],
|
|
219
|
-
},
|
|
220
|
-
defaultSort: {
|
|
221
|
-
prop: '',
|
|
222
|
-
order: null,
|
|
223
|
-
},
|
|
224
|
-
stripe: {
|
|
225
|
-
type: Boolean,
|
|
226
|
-
default: true,
|
|
227
|
-
},
|
|
228
|
-
loading: {
|
|
229
|
-
type: Boolean,
|
|
230
|
-
default: false,
|
|
231
|
-
},
|
|
232
|
-
background: {
|
|
233
|
-
type: Boolean,
|
|
234
|
-
default: true,
|
|
235
|
-
},
|
|
236
|
-
totals: Number,
|
|
237
|
-
pageSize: Number,
|
|
238
|
-
currentPage: Number,
|
|
239
|
-
popoverName: String,
|
|
240
|
-
parentFn: {
|
|
241
|
-
type : String,
|
|
242
|
-
default: '',
|
|
243
|
-
},
|
|
244
|
-
highlightCurrentRow: {
|
|
245
|
-
type: Boolean,
|
|
246
|
-
default: true,
|
|
247
|
-
},
|
|
248
|
-
tableRowClassName: {},
|
|
249
|
-
},
|
|
250
|
-
data() {
|
|
251
|
-
return {
|
|
252
|
-
scope: 'scope',
|
|
253
|
-
};
|
|
254
|
-
},
|
|
255
|
-
methods: {
|
|
256
|
-
handleCurrentChange(val) {
|
|
257
|
-
this.$emit('handleCurrentChange', val);
|
|
258
|
-
},
|
|
259
|
-
handleSelectionChange(val) {
|
|
260
|
-
this.$emit('handleSelectionChange', val);
|
|
261
|
-
},
|
|
262
|
-
handleRowClick(row, column, cell, event) {
|
|
263
|
-
this.$emit('handleRowClick', row, column, cell, event);
|
|
264
|
-
},
|
|
265
|
-
handleCellClick(row, column, cell, event){
|
|
266
|
-
this.$emit('handleCellClick', row, column, cell, event);
|
|
267
|
-
},
|
|
268
|
-
sortChange(column, prop, order) {
|
|
269
|
-
this.$emit('sortChange', column, prop, order);
|
|
270
|
-
},
|
|
271
|
-
formatterMethods(key, keyData) {
|
|
272
|
-
// 返回数据,可类型转换; 可添加单位;
|
|
273
|
-
let value = '--';
|
|
274
|
-
if (key || key === 0) {
|
|
275
|
-
const keyValue = keyData[key] || key;
|
|
276
|
-
const unit = keyData.unit || '';
|
|
277
|
-
value = `${keyValue}${unit}`;
|
|
278
|
-
}
|
|
279
|
-
return value;
|
|
280
|
-
},
|
|
281
|
-
formateValue (val) {
|
|
282
|
-
return val || val === 0 ? val : '--';
|
|
283
|
-
},
|
|
284
|
-
getFieldFromConfig(index, name) {
|
|
285
|
-
return this.customConfig && this.customConfig[index] && this.customConfig[index][name];
|
|
286
|
-
},
|
|
287
|
-
}
|
|
211
|
+
const handleSelectionChange = (val: any[]) => {
|
|
212
|
+
emit('handleSelectionChange', val)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const handleRowClick = (row: any, column: any, cell: any, event: Event) => {
|
|
216
|
+
emit('handleRowClick', row, column, cell, event)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const handleCellClick = (row: any, column: any, cell: any, event: Event) => {
|
|
220
|
+
emit('handleCellClick', row, column, cell, event)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const sortChange = (column: any, prop: any, order: any) => {
|
|
224
|
+
emit('sortChange', column, prop, order)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const formatterMethods = (key: any, keyData: any) => {
|
|
228
|
+
let value = '--'
|
|
229
|
+
if (key || key === 0) {
|
|
230
|
+
const keyValue = keyData[key] || key
|
|
231
|
+
const unit = keyData.unit || ''
|
|
232
|
+
value = `${keyValue}${unit}`
|
|
288
233
|
}
|
|
234
|
+
return value
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const formateValue = (val: any) => {
|
|
238
|
+
return val || val === 0 ? val : '--'
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const getFieldFromConfig = (index: string, name: string) => {
|
|
242
|
+
return props.customConfig && props.customConfig[index] && props.customConfig[index][name]
|
|
243
|
+
}
|
|
289
244
|
</script>
|
|
290
|
-
<style
|
|
245
|
+
<style lang="less">
|
|
291
246
|
.table-content .el-pagination {
|
|
292
247
|
text-align: right;
|
|
293
248
|
padding: 14px 0;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-popover :placement="placement" :disabled="isDisabled" :width="width || 300" v-model="show" trigger="click" :
|
|
2
|
+
<el-popover :placement="placement" :disabled="isDisabled" :width="width || 300" v-model:visible="show" trigger="click" :show-arrow="true">
|
|
3
3
|
<div class="el-popover__header">
|
|
4
4
|
{{title}}
|
|
5
5
|
<slot name="title"></slot>
|
|
6
|
-
<el-button
|
|
6
|
+
<el-button
|
|
7
|
+
type="text"
|
|
8
|
+
@click="handleClose"
|
|
9
|
+
>
|
|
10
|
+
<el-icon><Close /></el-icon>
|
|
11
|
+
</el-button>
|
|
7
12
|
</div>
|
|
8
13
|
<slot name="form"></slot>
|
|
9
14
|
|
|
@@ -11,53 +16,53 @@
|
|
|
11
16
|
<slot name="footer"></slot>
|
|
12
17
|
<el-button type="primary" class="wp100" @click="handleSubmit">{{ okText }}</el-button>
|
|
13
18
|
</div>
|
|
14
|
-
<
|
|
15
|
-
<slot name=
|
|
16
|
-
</
|
|
19
|
+
<template #reference>
|
|
20
|
+
<slot name="reference" />
|
|
21
|
+
</template>
|
|
17
22
|
</el-popover>
|
|
18
23
|
</template>
|
|
19
|
-
<script>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import { ref, watch } from 'vue'
|
|
26
|
+
import { Close } from '@element-plus/icons-vue'
|
|
27
|
+
|
|
28
|
+
defineOptions({ name: 'PopoverForm' })
|
|
29
|
+
|
|
30
|
+
interface IProps {
|
|
31
|
+
title?: string
|
|
32
|
+
width?: number
|
|
33
|
+
placement?: string
|
|
34
|
+
withSubmitBtn?: boolean
|
|
35
|
+
isDisabled?: boolean
|
|
36
|
+
okText?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface IEmits {
|
|
40
|
+
(e: 'on-change', val: boolean): void
|
|
41
|
+
(e: 'on-sure'): void
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
45
|
+
placement: 'left',
|
|
46
|
+
withSubmitBtn: true,
|
|
47
|
+
isDisabled: false,
|
|
48
|
+
okText: '确认',
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const emit = defineEmits<IEmits>()
|
|
52
|
+
|
|
53
|
+
const show = ref(false)
|
|
54
|
+
|
|
55
|
+
watch(show, (val) => {
|
|
56
|
+
emit('on-change', val)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const handleClose = () => {
|
|
60
|
+
show.value = false
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const handleSubmit = () => {
|
|
64
|
+
emit('on-sure')
|
|
65
|
+
}
|
|
61
66
|
</script>
|
|
62
67
|
<style type="scss" scoped>
|
|
63
68
|
.wp100{
|