@lx-frontend/wrap-element-ui 1.0.1-beta.7 → 1.0.1-beta.8
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
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
<!-- 行颜色选择组件 -->
|
|
2
2
|
<template>
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
>
|
|
10
|
-
<div
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
>
|
|
21
|
-
<span :style="{color: color.textColor}">{{ color.name }}</span>
|
|
22
|
-
</div>
|
|
3
|
+
<el-popover
|
|
4
|
+
v-model="visible"
|
|
5
|
+
placement="right"
|
|
6
|
+
trigger="click"
|
|
7
|
+
popper-class="color-popover"
|
|
8
|
+
>
|
|
9
|
+
<div class="color-list">
|
|
10
|
+
<div
|
|
11
|
+
v-for="color in colorList"
|
|
12
|
+
:key="color.id"
|
|
13
|
+
class="color-list__item"
|
|
14
|
+
:style="{ backgroundColor: color.sampleColor }"
|
|
15
|
+
@click="() => {
|
|
16
|
+
visible = false
|
|
17
|
+
handleColorChange(color.id, scope)
|
|
18
|
+
}"
|
|
19
|
+
>
|
|
20
|
+
<span :style="{color: color.textColor}">{{ color.name }}</span>
|
|
23
21
|
</div>
|
|
22
|
+
</div>
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</div>
|
|
24
|
+
<div slot="reference">
|
|
25
|
+
<div
|
|
26
|
+
v-if="isDefaultColor(scope.row.colorId)"
|
|
27
|
+
class="editable-table__color-icon"
|
|
28
|
+
/>
|
|
29
|
+
<div
|
|
30
|
+
v-else
|
|
31
|
+
class="editable-table__selected-color"
|
|
32
|
+
:style="{ backgroundColor: getColorById(scope.row.colorId, 'sample') }"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
</el-popover>
|
|
38
36
|
</template>
|
|
39
37
|
|
|
40
38
|
<script setup lang="ts">
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-popover
|
|
3
|
+
ref="operationPopoverRef"
|
|
4
|
+
placement="bottom"
|
|
5
|
+
trigger="click"
|
|
6
|
+
popper-class="operation-popover"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
slot="reference"
|
|
10
|
+
class="operation-popover__operation-reference btn-pointer"
|
|
11
|
+
>
|
|
12
|
+
<el-button :class="['operation-popover__operation-btn', hoveringCellInfo.rowIndex === scope.$index && 'operation-popover__operation-btn--active']">
|
|
13
|
+
操作
|
|
14
|
+
</el-button>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="operation-popover__operation">
|
|
17
|
+
<div
|
|
18
|
+
v-if="defaultOperations.includes('delete')"
|
|
19
|
+
class="operation-popover__operation-item btn-pointer"
|
|
20
|
+
@click="() => emit('delete')"
|
|
21
|
+
>
|
|
22
|
+
删除
|
|
23
|
+
</div>
|
|
24
|
+
<div
|
|
25
|
+
v-if="defaultOperations.includes('edit')"
|
|
26
|
+
class="operation-popover__operation-item btn-pointer"
|
|
27
|
+
@click="() => emit('edit')"
|
|
28
|
+
>
|
|
29
|
+
编辑
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
v-if="defaultOperations.includes('top')"
|
|
33
|
+
class="operation-popover__operation-item btn-pointer"
|
|
34
|
+
@click="() => emit('rowPinToTop')"
|
|
35
|
+
>
|
|
36
|
+
置顶
|
|
37
|
+
</div>
|
|
38
|
+
<slot />
|
|
39
|
+
</div>
|
|
40
|
+
</el-popover>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import { ref } from 'vue';
|
|
45
|
+
import { IDefaultOperationType } from '../types';
|
|
46
|
+
|
|
47
|
+
defineProps<{
|
|
48
|
+
defaultOperations: IDefaultOperationType[]
|
|
49
|
+
hoveringCellInfo: {
|
|
50
|
+
rowIndex: number
|
|
51
|
+
columnProperty: string
|
|
52
|
+
}
|
|
53
|
+
scope: any
|
|
54
|
+
}>()
|
|
55
|
+
|
|
56
|
+
const emit = defineEmits<{
|
|
57
|
+
(e: 'edit'): void
|
|
58
|
+
(e: 'delete'): void
|
|
59
|
+
(e: 'rowPinToTop'): void
|
|
60
|
+
}>()
|
|
61
|
+
|
|
62
|
+
const operationPopoverRef = ref(null as any)
|
|
63
|
+
|
|
64
|
+
defineExpose({
|
|
65
|
+
doClose: () => operationPopoverRef.value?.doClose?.()
|
|
66
|
+
})
|
|
67
|
+
</script>
|
|
@@ -168,49 +168,22 @@
|
|
|
168
168
|
v-if="column.prop === '$$operation'"
|
|
169
169
|
#default="scope"
|
|
170
170
|
>
|
|
171
|
-
<
|
|
171
|
+
<biz-table-operate-popover
|
|
172
172
|
v-if="editingRowIndex !== scope.$index"
|
|
173
173
|
ref="operationPopoverRef"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
:default-operations="defaultOperations"
|
|
175
|
+
:hovering-cell-info="hoveringCellInfo"
|
|
176
|
+
:scope="scope"
|
|
177
|
+
@edit="() => handleEdit(scope)"
|
|
178
|
+
@delete="() => handleDelete(scope.row, scope.$index)"
|
|
179
|
+
@rowPinToTop="() => handleRowPinToTop(scope)"
|
|
177
180
|
>
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
</el-button>
|
|
185
|
-
</div>
|
|
186
|
-
<div class="operation-popover__operation">
|
|
187
|
-
<div
|
|
188
|
-
v-if="defaultOperations.includes('delete')"
|
|
189
|
-
class="operation-popover__operation-item btn-pointer"
|
|
190
|
-
@click="handleDelete(scope.row, scope.$index)"
|
|
191
|
-
>
|
|
192
|
-
删除
|
|
193
|
-
</div>
|
|
194
|
-
<div
|
|
195
|
-
v-if="defaultOperations.includes('edit')"
|
|
196
|
-
class="operation-popover__operation-item btn-pointer"
|
|
197
|
-
@click="handleEdit(scope)"
|
|
198
|
-
>
|
|
199
|
-
编辑
|
|
200
|
-
</div>
|
|
201
|
-
<div
|
|
202
|
-
v-if="defaultOperations.includes('top')"
|
|
203
|
-
class="operation-popover__operation-item btn-pointer"
|
|
204
|
-
@click="handleRowPinToTop(scope)"
|
|
205
|
-
>
|
|
206
|
-
置顶
|
|
207
|
-
</div>
|
|
208
|
-
<slot
|
|
209
|
-
name="custom-operation"
|
|
210
|
-
v-bind="scope"
|
|
211
|
-
/>
|
|
212
|
-
</div>
|
|
213
|
-
</el-popover>
|
|
181
|
+
<slot
|
|
182
|
+
name="custom-operation"
|
|
183
|
+
v-bind="scope"
|
|
184
|
+
/>
|
|
185
|
+
</biz-table-operate-popover>
|
|
186
|
+
|
|
214
187
|
<div
|
|
215
188
|
v-else
|
|
216
189
|
class="operation-popover__save-cancel"
|
|
@@ -328,6 +301,7 @@ import BizColorSelect from './features/bizColorSelect.vue';
|
|
|
328
301
|
import BizViewSettingDialog from './features/bizViewSettingDialog.vue'
|
|
329
302
|
import BizTableHeaderPopover from './features/bizTableHeaderPopover.vue'
|
|
330
303
|
import BizEditCell from './features/bizEditCell.vue'
|
|
304
|
+
import BizTableOperatePopover from './features/bizTableOperatePopover.vue'
|
|
331
305
|
|
|
332
306
|
import { computed, nextTick, ref, watch } from 'vue';
|
|
333
307
|
import { Message } from 'element-ui';
|