ci-plus 1.1.7 → 1.1.9
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 +3 -2
- package/src/fileRelated/seeFile.vue +6 -4
- package/src/identificationCard/identificationCard.vue +23 -8
- package/src/sortableTable/headerInput.vue +14 -103
- package/src/sortableTable/sortableTable copy.vue +221 -0
- package/src/sortableTable/sortableTable.vue +106 -160
- package/src/sortableTable/utils/sortableTableColumnCell.vue +15 -12
- package/src/sortableTable/utils/sortableTableColumnCell2.vue +26 -28
- package/src/sortableTable/utils/sortableTableDragItem.vue +39 -46
- package/src/sortableTable/utils/sortableTableDragItem2.vue +109 -57
- package/src/utils/baseApi.ts +54 -29
- package/src/utils/cardPrint.ts +91 -42
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-table
|
|
2
|
+
<el-table
|
|
3
|
+
v-bind="table || {}"
|
|
4
|
+
:header-cell-class-name="setClass"
|
|
5
|
+
:data="data"
|
|
6
|
+
ref="elTableRef"
|
|
7
|
+
@vue:mounted="columnDrop"
|
|
8
|
+
>
|
|
3
9
|
<slot></slot>
|
|
10
|
+
<!-- <sortable-table-column-cell v-if="props.modelValue" v-for="v in rowValue" :key="v.id" :data="v" /> -->
|
|
4
11
|
<sortable-table-column-cell
|
|
12
|
+
:label-class-name="`sortable sortable_0_0_${i}`"
|
|
13
|
+
:i="0"
|
|
14
|
+
:level="0"
|
|
5
15
|
v-if="props.modelValue"
|
|
6
|
-
v-for="v in rowValue"
|
|
16
|
+
v-for="(v, i) in rowValue"
|
|
7
17
|
:key="v.id"
|
|
8
18
|
:data="v"
|
|
19
|
+
:no-search="noSearch"
|
|
9
20
|
/>
|
|
10
21
|
</el-table>
|
|
11
22
|
</template>
|
|
@@ -13,7 +24,7 @@
|
|
|
13
24
|
defineOptions({ name: 'ci-table' })
|
|
14
25
|
import { CellCls, ElTable } from 'element-plus'
|
|
15
26
|
import Sortable from 'sortablejs'
|
|
16
|
-
import {
|
|
27
|
+
import { VNode, computed, ref } from 'vue'
|
|
17
28
|
import { SortableTableIns, SortColumn } from './utils/interface'
|
|
18
29
|
import sortableTableColumnCell from './index/sortableTableColumnCell'
|
|
19
30
|
import { cloneDeep } from 'lodash'
|
|
@@ -37,177 +48,112 @@ const data = computed({
|
|
|
37
48
|
}
|
|
38
49
|
})
|
|
39
50
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const columnDrop = (elem?: HTMLTableElement) => {
|
|
51
|
+
// 只能同行并在同一个children中可以拖拽
|
|
52
|
+
const columnDrop = (vnode: VNode) => {
|
|
53
|
+
if (props.noMove) return
|
|
54
|
+
const elem = vnode.el as HTMLDivElement
|
|
45
55
|
// 如果没有传入elem,则返回
|
|
46
56
|
if (!elem) return
|
|
47
57
|
// 获取表格的表头元素
|
|
48
58
|
const header = elem.querySelector('.el-table__header-wrapper')
|
|
49
59
|
// 如果没有表头元素,则返回
|
|
50
60
|
if (!header) return
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
let tem = cloneDeep(rowValue.value)
|
|
113
|
-
// 设置新的路径和新的排序值
|
|
114
|
-
setValue(cloneDeep(getValue(oldPath)), newPath, tem)
|
|
115
|
-
// 设置旧的路径和旧的排序值
|
|
116
|
-
setValue(cloneDeep(getValue(newPath)), oldPath, tem)
|
|
117
|
-
// 设置新的排序值
|
|
118
|
-
rowValue.value = tem
|
|
61
|
+
// 获取表头中的所有行元素
|
|
62
|
+
const trs = header.querySelectorAll('thead > tr')
|
|
63
|
+
// 遍历行元素
|
|
64
|
+
trs.forEach((v) => {
|
|
65
|
+
let tr = v as HTMLElement
|
|
66
|
+
// 创建拖拽排序对象
|
|
67
|
+
Sortable.create(tr, {
|
|
68
|
+
// 动画时间
|
|
69
|
+
animation: 180,
|
|
70
|
+
// 延迟时间
|
|
71
|
+
delay: 0,
|
|
72
|
+
// 拖拽元素
|
|
73
|
+
draggable: '.sortable',
|
|
74
|
+
// 过滤器
|
|
75
|
+
filter: (evt, item) => !canDrag(item),
|
|
76
|
+
// 拖拽排序时触发的函数
|
|
77
|
+
onMove: ({ dragged, related }) => {
|
|
78
|
+
return isSameGroup(dragged, related)
|
|
79
|
+
},
|
|
80
|
+
// 拖拽排序后的函数
|
|
81
|
+
onUpdate({ newIndex, item }) {
|
|
82
|
+
const location = getLocation(item)
|
|
83
|
+
if (!location) return
|
|
84
|
+
if (typeof newIndex !== 'number') return
|
|
85
|
+
let newArr: SortColumn[] = []
|
|
86
|
+
const newItem = header.querySelector(`.sortable_index_${location[0]}_${newIndex}`)
|
|
87
|
+
if (!newItem) return
|
|
88
|
+
const newLocation = getLocation(newItem)
|
|
89
|
+
if (!newLocation) return
|
|
90
|
+
if (!location[0]) {
|
|
91
|
+
rowValue.value.forEach((v, i) => {
|
|
92
|
+
if (i === newLocation[2]) {
|
|
93
|
+
if (location[2] > newLocation[2]) {
|
|
94
|
+
newArr.push(rowValue.value[location[2]])
|
|
95
|
+
newArr.push(v)
|
|
96
|
+
} else {
|
|
97
|
+
newArr.push(v)
|
|
98
|
+
newArr.push(rowValue.value[location[2]])
|
|
99
|
+
}
|
|
100
|
+
} else if (i !== location[2]) newArr.push(v)
|
|
101
|
+
})
|
|
102
|
+
} else {
|
|
103
|
+
newArr = cloneDeep(rowValue.value)
|
|
104
|
+
const tem: SortColumn[] = []
|
|
105
|
+
loop(newArr, location[0] - 1, (v, i) => {
|
|
106
|
+
if (i === location[1]) {
|
|
107
|
+
v.children?.forEach((x, j) => {
|
|
108
|
+
if (j === newLocation[2]) {
|
|
109
|
+
if (location[2] > newLocation[2]) {
|
|
110
|
+
tem.push((v.children as SortColumn[])[location[2]])
|
|
111
|
+
tem.push(x)
|
|
112
|
+
} else {
|
|
113
|
+
tem.push(x)
|
|
114
|
+
tem.push((v.children as SortColumn[])[location[2]])
|
|
115
|
+
}
|
|
116
|
+
} else if (j !== location[2]) tem.push(x)
|
|
117
|
+
})
|
|
118
|
+
v.children = tem
|
|
119
|
+
return true
|
|
120
|
+
}
|
|
121
|
+
})
|
|
119
122
|
}
|
|
120
|
-
|
|
123
|
+
rowValue.value = newArr
|
|
124
|
+
}
|
|
121
125
|
})
|
|
122
126
|
})
|
|
123
127
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
// 获取当前元素的父级元素的索引
|
|
136
|
-
const getColumnFatherIndex = (item: SortColumn[], end: number) => {
|
|
137
|
-
let i = 0
|
|
138
|
-
while (end >= 0) {
|
|
139
|
-
const v = item[i]
|
|
140
|
-
i++
|
|
141
|
-
if (v.hide) continue
|
|
142
|
-
let children = v.children
|
|
143
|
-
if (!children) return false
|
|
144
|
-
end -= children.length
|
|
145
|
-
}
|
|
146
|
-
return i
|
|
147
|
-
}
|
|
148
|
-
// 获取当前元素的路径
|
|
149
|
-
const getPath = (level: number, end: number) => {
|
|
150
|
-
if (!rowValue.value) return
|
|
151
|
-
end += hideCount(level, end)
|
|
152
|
-
if (level === 1) return [end]
|
|
153
|
-
let path = Array.from({ length: level }).map((v) => 0)
|
|
154
|
-
if (!end) {
|
|
155
|
-
f(rowValue.value, 0)
|
|
156
|
-
path[level - 1] = 0
|
|
157
|
-
} else
|
|
158
|
-
while (end > 0) {
|
|
159
|
-
f(rowValue.value, 0)
|
|
160
|
-
end--
|
|
161
|
-
}
|
|
162
|
-
function f(data: SortColumn[], depth: number) {
|
|
163
|
-
let flag = 0
|
|
164
|
-
for (let i = 0; i < data.length; i++) {
|
|
165
|
-
let v = data[i]
|
|
166
|
-
if (depth === level - 1) {
|
|
167
|
-
if (flag !== i) {
|
|
168
|
-
flag = i
|
|
169
|
-
path[depth] = 0
|
|
170
|
-
}
|
|
171
|
-
path[depth] += 1
|
|
172
|
-
} else if (v.children) return f(v.children, depth + 1)
|
|
173
|
-
else path[depth] += 1
|
|
174
|
-
}
|
|
128
|
+
|
|
129
|
+
// 循环指定层级
|
|
130
|
+
const loop = (
|
|
131
|
+
arr: SortColumn[],
|
|
132
|
+
level: number,
|
|
133
|
+
fun: (v: SortColumn, i: number) => boolean | void
|
|
134
|
+
) => {
|
|
135
|
+
for (let i = 0; i < arr.length; i++) {
|
|
136
|
+
const v = arr[i]
|
|
137
|
+
if (level && v.children) loop(v.children, level - 1, fun)
|
|
138
|
+
if (fun(v, i)) break
|
|
175
139
|
}
|
|
176
|
-
return path
|
|
177
|
-
}
|
|
178
|
-
// 获取当前元素的值
|
|
179
|
-
const getValue = (
|
|
180
|
-
path: number[],
|
|
181
|
-
parent?: boolean,
|
|
182
|
-
data: SortColumn[] = rowValue.value
|
|
183
|
-
): SortColumn => {
|
|
184
|
-
if (!path.length) path[0] = 0
|
|
185
|
-
if (path.length <= (parent ? 2 : 1)) return data[path[0]]
|
|
186
|
-
return getValue(path.slice(1), parent, data[path[0]].children)
|
|
187
140
|
}
|
|
188
|
-
//
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return value
|
|
141
|
+
// 判断这个元素是否可以拖拽
|
|
142
|
+
const canDrag = (dom: Element) => dom && /sortable_[0-9]+_[0-9]+/g.test(dom.className)
|
|
143
|
+
// 获取这个元素在数据内的位置
|
|
144
|
+
const getLocation = (dom: Element) => {
|
|
145
|
+
const name = dom && dom.className.match(/\bsortable(_[0-9]+)+\b/)?.[0]
|
|
146
|
+
if (!name) return
|
|
147
|
+
return name.split('_').slice(1).map(Number)
|
|
196
148
|
}
|
|
197
|
-
//
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
const levelFlat = (level: number, data = rowValue.value): SortColumn[] => {
|
|
204
|
-
if (level > 1)
|
|
205
|
-
return levelFlat(
|
|
206
|
-
level - 1,
|
|
207
|
-
data.filter((v) => v.children).flatMap((v) => v.children) as SortColumn[]
|
|
208
|
-
)
|
|
209
|
-
return data
|
|
149
|
+
// 判断这个元素是否在一起
|
|
150
|
+
const isSameGroup = (dom1: Element, dom2: Element) => {
|
|
151
|
+
const location1 = getLocation(dom1)
|
|
152
|
+
const location2 = getLocation(dom2)
|
|
153
|
+
if (!location1 || !location2) return false
|
|
154
|
+
return location1[1] === location2[1]
|
|
210
155
|
}
|
|
156
|
+
|
|
211
157
|
// 设置当前元素的类名
|
|
212
158
|
const setClass: CellCls<typeof props.data> = ({ column }) => {
|
|
213
159
|
let className = props.table?.headerCellClassName || ''
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
<!-- /*
|
|
2
|
-
* @module sortableTableColumnCell
|
|
3
|
-
* @author : 杨佳贺&卖女孩的小火柴
|
|
4
|
-
* @description : 表格列单元格
|
|
5
|
-
* @version : 1.0.0
|
|
6
|
-
* @since : 创建时间 2023-12-29 13:40:49
|
|
7
|
-
* @lastTime : 2023-12-29 新增默认居中显示属性
|
|
8
|
-
* @lastTime : 2024-01-03 新增默认超出隐藏悬停显示、拖拽改变列宽
|
|
9
|
-
*/ -->
|
|
10
|
-
|
|
11
1
|
<template>
|
|
12
2
|
<el-table-column v-if="!data.hide && data.children" v-bind="data.col">
|
|
13
|
-
<sortable-table-column-cell
|
|
3
|
+
<sortable-table-column-cell
|
|
4
|
+
:label-class-name="`sortable sortable_${level}_${i}_${j}`"
|
|
5
|
+
:i="j"
|
|
6
|
+
v-for="(v, j) in data.children || []"
|
|
7
|
+
:key="v.key"
|
|
8
|
+
:data="v"
|
|
9
|
+
:level="props.level + 1"
|
|
10
|
+
/>
|
|
14
11
|
</el-table-column>
|
|
15
12
|
<el-table-column
|
|
16
13
|
v-else-if="!data.hide && data.scope"
|
|
@@ -26,6 +23,7 @@
|
|
|
26
23
|
<component :is="headerVue(header)" :header="header"></component>
|
|
27
24
|
</template>
|
|
28
25
|
</el-table-column>
|
|
26
|
+
|
|
29
27
|
<el-table-column
|
|
30
28
|
v-else-if="!data.hide && data.component"
|
|
31
29
|
v-bind="data.col"
|
|
@@ -40,6 +38,7 @@
|
|
|
40
38
|
<component :is="headerVue(header)" :header="header"></component>
|
|
41
39
|
</template>
|
|
42
40
|
</el-table-column>
|
|
41
|
+
|
|
43
42
|
<el-table-column
|
|
44
43
|
v-else-if="!data.hide"
|
|
45
44
|
v-bind="data.col"
|
|
@@ -53,14 +52,18 @@
|
|
|
53
52
|
</el-table-column>
|
|
54
53
|
</template>
|
|
55
54
|
<script setup lang="ts">
|
|
55
|
+
defineOptions({ name: 'ci-columncell' })
|
|
56
56
|
import { Scope, SortColumn } from './interface'
|
|
57
57
|
import { h } from 'vue'
|
|
58
|
-
defineOptions({ name: 'ci-columncell' })
|
|
59
58
|
|
|
60
59
|
const props = defineProps<{
|
|
61
60
|
data: SortColumn
|
|
61
|
+
level?: number
|
|
62
|
+
i?: number
|
|
63
|
+
noSearch?: boolean
|
|
62
64
|
}>()
|
|
63
65
|
const headerVue = (header: Pick<Scope<any>, '$index' | 'column'>) => {
|
|
66
|
+
if (props.noSearch) return h('div', props.data.col.label)
|
|
64
67
|
const item = props.data.header?.(h, header)
|
|
65
68
|
if (!item) return h('div', props.data.col.label)
|
|
66
69
|
if (typeof item === 'string') return h('div', item)
|
|
@@ -1,63 +1,61 @@
|
|
|
1
|
+
<!-- /*
|
|
2
|
+
* @module sortableTableColumnCell
|
|
3
|
+
* @author : 杨佳贺&卖女孩的小火柴
|
|
4
|
+
* @description : 表格列单元格
|
|
5
|
+
* @version : 1.0.0
|
|
6
|
+
* @since : 创建时间 2023-12-29 13:40:49
|
|
7
|
+
* @lastTime : 2023-12-29 新增默认居中显示属性
|
|
8
|
+
* @lastTime : 2024-01-03 新增默认超出隐藏悬停显示、拖拽改变列宽
|
|
9
|
+
*/ -->
|
|
10
|
+
|
|
1
11
|
<template>
|
|
2
|
-
<el-table-column
|
|
3
|
-
v-
|
|
4
|
-
v-bind="data.col"
|
|
5
|
-
>
|
|
6
|
-
<sortable-table-column-cell
|
|
7
|
-
v-for="v in data.children || []"
|
|
8
|
-
:key="v.key"
|
|
9
|
-
:data="v"
|
|
10
|
-
/>
|
|
12
|
+
<el-table-column v-if="!data.hide && data.children" v-bind="data.col">
|
|
13
|
+
<sortable-table-column-cell v-for="v in data.children || []" :key="v.key" :data="v" />
|
|
11
14
|
</el-table-column>
|
|
12
15
|
<el-table-column
|
|
13
16
|
v-else-if="!data.hide && data.scope"
|
|
14
17
|
v-bind="data.col"
|
|
18
|
+
:align="data.col.align || 'center'"
|
|
19
|
+
:showOverflowTooltip="data.col.showOverflowTooltip || true"
|
|
20
|
+
:resizable="data.col.resizable || true"
|
|
15
21
|
>
|
|
16
22
|
<template #default="scope">
|
|
17
23
|
{{ data.scope(scope) }}
|
|
18
24
|
</template>
|
|
19
25
|
<template #header="header">
|
|
20
|
-
<component
|
|
21
|
-
:is="headerVue(header)"
|
|
22
|
-
:header="header"
|
|
23
|
-
></component>
|
|
26
|
+
<component :is="headerVue(header)" :header="header"></component>
|
|
24
27
|
</template>
|
|
25
28
|
</el-table-column>
|
|
26
29
|
<el-table-column
|
|
27
30
|
v-else-if="!data.hide && data.component"
|
|
28
31
|
v-bind="data.col"
|
|
32
|
+
:align="data.col.align || 'center'"
|
|
33
|
+
:showOverflowTooltip="data.col.showOverflowTooltip || true"
|
|
34
|
+
:resizable="data.col.resizable || true"
|
|
29
35
|
>
|
|
30
36
|
<template #default="scope">
|
|
31
|
-
<component
|
|
32
|
-
:is="data.component(h, scope)"
|
|
33
|
-
:scope="scope"
|
|
34
|
-
></component>
|
|
37
|
+
<component :is="data.component(h, scope)" :scope="scope"></component>
|
|
35
38
|
</template>
|
|
36
39
|
<template #header="header">
|
|
37
|
-
<component
|
|
38
|
-
:is="headerVue(header)"
|
|
39
|
-
:header="header"
|
|
40
|
-
></component>
|
|
40
|
+
<component :is="headerVue(header)" :header="header"></component>
|
|
41
41
|
</template>
|
|
42
42
|
</el-table-column>
|
|
43
43
|
<el-table-column
|
|
44
44
|
v-else-if="!data.hide"
|
|
45
45
|
v-bind="data.col"
|
|
46
|
+
:align="data.col.align || 'center'"
|
|
47
|
+
:showOverflowTooltip="data.col.showOverflowTooltip || true"
|
|
48
|
+
:resizable="data.col.resizable || true"
|
|
46
49
|
>
|
|
47
50
|
<template #header="header">
|
|
48
|
-
<component
|
|
49
|
-
:is="headerVue(header)"
|
|
50
|
-
:header="header"
|
|
51
|
-
></component>
|
|
51
|
+
<component :is="headerVue(header)" :header="header"></component>
|
|
52
52
|
</template>
|
|
53
53
|
</el-table-column>
|
|
54
54
|
</template>
|
|
55
55
|
<script setup lang="ts">
|
|
56
56
|
import { Scope, SortColumn } from './interface'
|
|
57
57
|
import { h } from 'vue'
|
|
58
|
-
defineOptions({
|
|
59
|
-
name: 'sortable-table-column-cell',
|
|
60
|
-
})
|
|
58
|
+
defineOptions({ name: 'ci-columncell' })
|
|
61
59
|
|
|
62
60
|
const props = defineProps<{
|
|
63
61
|
data: SortColumn
|
|
@@ -1,61 +1,54 @@
|
|
|
1
|
-
<!-- 2023-12-29 新增显示/隐藏按钮 -->
|
|
2
|
-
|
|
3
1
|
<template>
|
|
4
|
-
<draggable
|
|
2
|
+
<vue-draggable
|
|
5
3
|
class="drag-container"
|
|
6
|
-
|
|
4
|
+
v-model="modelValue"
|
|
7
5
|
chosen-class="hover"
|
|
8
6
|
handle=".mover"
|
|
9
7
|
draggable=".item"
|
|
10
8
|
itemKey="key"
|
|
11
9
|
>
|
|
12
|
-
<
|
|
13
|
-
<div
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
</el-button>
|
|
45
|
-
</div>
|
|
46
|
-
<div class="widths">
|
|
47
|
-
宽度:
|
|
48
|
-
<el-input class="w-50 m-2" v-model="element.col.width" size="small" width="50"></el-input>
|
|
49
|
-
</div>
|
|
50
|
-
<sortable-table-drag-item v-if="element.children" v-model="element.children" />
|
|
10
|
+
<div v-for="(element, index) in modelValue" :class="{ item: true, 'item-hide': element.hide }">
|
|
11
|
+
<div class="mover">
|
|
12
|
+
<el-icon :size="16"><Rank /></el-icon>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="title" @click="element.hide = !element.hide">
|
|
15
|
+
{{ element.col.label }}
|
|
16
|
+
</div>
|
|
17
|
+
<div class="pin" v-if="showPin">
|
|
18
|
+
<span
|
|
19
|
+
v-if="element.col.fixed === true || element.col.fixed === 'left'"
|
|
20
|
+
@click="element.col.fixed = void 0"
|
|
21
|
+
>
|
|
22
|
+
<svg-icon name="regular-left" size="20" color="#2C93FF"></svg-icon>
|
|
23
|
+
</span>
|
|
24
|
+
<span v-else @click="element.col.fixed = 'left'">
|
|
25
|
+
<svg-icon name="regular-center" size="20"></svg-icon>
|
|
26
|
+
</span>
|
|
27
|
+
<span v-if="element.col.fixed === 'right'" @click="element.col.fixed = void 0">
|
|
28
|
+
<svg-icon name="regular-right" size="20" color="#2C93FF"></svg-icon>
|
|
29
|
+
</span>
|
|
30
|
+
<span v-else @click="element.col.fixed = 'right'">
|
|
31
|
+
<svg-icon name="regular-center" size="20"></svg-icon>
|
|
32
|
+
</span>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="ifshow">
|
|
35
|
+
<el-button :type="element.hide ? 'primary' : ''" @click="handleShow(element)" size="small">
|
|
36
|
+
{{ element.hide ? '显示' : '隐藏' }}
|
|
37
|
+
</el-button>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="widths">
|
|
40
|
+
宽度:
|
|
41
|
+
<el-input class="w-50 m-2" v-model="element.col.width" size="small" width="50"></el-input>
|
|
51
42
|
</div>
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
<sortable-table-drag-item v-if="element.children" v-model="element.children" />
|
|
44
|
+
</div>
|
|
45
|
+
</vue-draggable>
|
|
54
46
|
</template>
|
|
55
47
|
<script setup lang="ts">
|
|
56
48
|
import SvgIcon from '../../svgIcon/index'
|
|
57
49
|
import { computed } from 'vue'
|
|
58
|
-
import draggable from 'vuedraggable'
|
|
50
|
+
// import draggable from 'vuedraggable'
|
|
51
|
+
import { VueDraggable } from 'vue-draggable-plus'
|
|
59
52
|
import { SortColumn, SortableTableIns } from './interface'
|
|
60
53
|
import { Rank } from '@element-plus/icons-vue'
|
|
61
54
|
const props = defineProps<{
|