lw-cdp-ui 1.2.34 → 1.2.35
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/dist/components/lwSearch/select/select.vue +1 -1
- package/dist/components/lwTable/index.js +229 -241
- package/dist/components/lwTable/index.scss +1 -0
- package/dist/components/lwTable/index.vue +112 -215
- package/dist/components/lwUpload/index.vue +187 -136
- package/dist/lw-cdp-ui.esm.js +4782 -4774
- package/dist/lw-cdp-ui.umd.js +11 -11
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<el-select :disabled="item.disabled" :placeholder="item.label || '请选择'" :popper-append-to-body="item.appendToBody" v-model="value" clearable filterable :multiple="item.multiple" collapse-tags allow-search size="" style="width: 100%;">
|
|
3
|
+
<el-select :disabled="item.disabled" :placeholder="item.label || '请选择'" :popper-append-to-body="item.appendToBody" v-model="value" clearable filterable :multiple="item.multiple" collapse-tags allow-search size="" style="width: 100%;" :allow-create="item.allowCreate">
|
|
4
4
|
<el-option v-for="(items, index) in item.options" :disabled="items.disabled" :key="item.key ? item.key : item.valueKey ? items[item.valueKey] + items[item.labelKey] + index : items.code + items.name + index" :label="item.isCodeAndName ? ((item.valueKey ? items[item.valueKey] : items.code) + ' - ' + (item.labelKey ? items[item.labelKey] : items.name)) : (item.labelKey ? items[item.labelKey] : items.name)" :value="item.valueKey ? items[item.valueKey] : items.code">
|
|
5
5
|
<el-tooltip :content="item.isCodeAndName ? ((item.valueKey ? items[item.valueKey] : items.code) + ' - ' + (item.labelKey ? items[item.labelKey] : items.name)) : (item.labelKey ? items[item.labelKey] : items.name)">
|
|
6
6
|
<span>{{ item.isCodeAndName ? ((item.valueKey ? items[item.valueKey] : items.code) + ' - ' + (item.labelKey ? items[item.labelKey] : items.name)) : (item.labelKey ? items[item.labelKey] : items.name) }}</span>
|
|
@@ -1,285 +1,273 @@
|
|
|
1
|
-
import { useFullscreen } from './useFullscreen'
|
|
2
|
-
import { onBeforeMount, reactive, ref, watch, toRefs, getCurrentInstance } from 'vue'
|
|
3
|
-
import dayjs from 'dayjs'
|
|
4
|
-
|
|
5
1
|
export default {
|
|
6
2
|
name: 'lwTable',
|
|
7
|
-
|
|
8
|
-
// 组件属性定义
|
|
9
3
|
props: {
|
|
10
|
-
|
|
4
|
+
// 表格基础配置
|
|
5
|
+
refName: { type: String, default: 'multipleTableRef' }, // 表格的 ref 名称
|
|
11
6
|
tableName: { type: String, default: '' }, // 表格名称
|
|
12
|
-
|
|
7
|
+
tableData: { type: Array, default: () => [] }, // 表格数据
|
|
8
|
+
tableColumns: { type: Array, default: () => [] }, // 表格列配置
|
|
9
|
+
loading: { type: Boolean, default: false }, // 加载状态
|
|
10
|
+
tableSize: { type: String, default: 'large' }, // 表格尺寸
|
|
11
|
+
|
|
12
|
+
// 表格样式配置
|
|
13
13
|
bordered: { type: Boolean, default: true }, // 是否显示边框
|
|
14
14
|
stripe: { type: Boolean, default: false }, // 是否显示斑马纹
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
hoverable: { type: Boolean, default: true }, // 是否启用鼠标悬停效果
|
|
16
|
+
maxHeight: { type: String, default: 'calc(100vh - 270px)' }, // 表格最大高度
|
|
17
|
+
|
|
18
|
+
// 选择功能配置
|
|
19
|
+
rowSelection: { type: Boolean, default: false }, // 是否可选择行
|
|
20
|
+
isRadio: { type: Boolean, default: false }, // 是否为单选模式
|
|
21
|
+
rowKey: { type: String, default: 'id' }, // 行数据的唯一标识字段
|
|
17
22
|
defaultSelectData: { type: Array, default: () => [] }, // 默认选中的数据
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
selectedKeys: { type: Array }, // 选中的行 key 值
|
|
24
|
+
selectDatas: { type: Array }, // 选中的行数据
|
|
25
|
+
selectStatus: { type: Function, default: () => true }, // 选择状态回调
|
|
26
|
+
|
|
27
|
+
// 分页配置
|
|
21
28
|
isShowPagination: { type: Boolean, default: true }, // 是否显示分页
|
|
22
|
-
|
|
23
|
-
totalCount: { type: Number, default: 0 }, //
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
searchParams: { type: Object, default: () => ({ page: 1, size: 20 }) }, // 查询参数
|
|
30
|
+
totalCount: { type: Number, default: 0 }, // 总数据条数
|
|
31
|
+
pageSizes: { type: Array, default: () => [10, 20, 30, 40, 50] }, // 分页可选条数
|
|
32
|
+
|
|
33
|
+
// 高级功能配置
|
|
26
34
|
defaultExpandAll: { type: Boolean, default: false }, // 是否默认展开所有行
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
orderPage: { type: Boolean, default: false }, // 是否为订单页面
|
|
30
|
-
tableSize: { type: String, default: 'large' }, // 表格大小
|
|
31
|
-
loading: { type: Boolean, default: false }, // 加载状态
|
|
32
|
-
rowSelection: { type: Boolean, default: false }, // 是否可选择行
|
|
33
|
-
selectedKeys: { type: Array }, // 选中的键值数组
|
|
34
|
-
selectDatas: { type: Array }, // 选中的数据数组
|
|
35
|
+
virtualListProps: { type: Object, default: undefined }, // 虚拟滚动配置
|
|
36
|
+
summaryMethod: { type: Function, default: () => [] }, // 自定义合计方法
|
|
35
37
|
hideTool: { type: Boolean, default: true }, // 是否隐藏工具栏
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
isSetting: { type: Boolean, default: false }, // 是否显示列设置
|
|
39
|
+
saveKey: { type: String, default: '' }, // 本地存储 key,用于保存表格配置
|
|
40
|
+
draggable: { type: Object } // 是否可拖拽列配置
|
|
39
41
|
},
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// 响应式状态
|
|
52
|
-
const state = reactive({
|
|
53
|
-
dialogVisible: false, // 对话框可见性
|
|
54
|
-
tableSettingTitle: '选择字段', // 表格设置标题
|
|
55
|
-
tableHeaderListAll: [], // 所有表头列表
|
|
56
|
-
checkedList: [], // 已选中列表
|
|
57
|
-
defaultProps: {
|
|
58
|
-
children: 'children',
|
|
59
|
-
label: 'label'
|
|
60
|
-
},
|
|
61
|
-
num: 0, // 计数器
|
|
62
|
-
endFixed: false, // 是否固定末尾
|
|
63
|
-
filterHeader: [], // 过滤后的表头
|
|
64
|
-
tableSize: props.tableSize, // 表格大小
|
|
65
|
-
checkedKeys: [], // 选中的键
|
|
66
|
-
treeData: [], // 树形数据
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
// 表格基础状态
|
|
46
|
+
tableHeaders: [], // 表格列配置
|
|
47
|
+
localTableSize: this.tableSize, // 表格大小
|
|
48
|
+
|
|
49
|
+
// 列设置相关
|
|
50
|
+
checkedKeys: [], // 选中的列
|
|
51
|
+
treeData: [], // 所有列数据
|
|
67
52
|
allCheck: true, // 是否全选
|
|
68
|
-
|
|
69
|
-
tableHeaders: [], // 表格表头
|
|
70
|
-
fixNum: 0 // 固定列数量
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
// 过滤数据处理
|
|
74
|
-
const filterData = () => {
|
|
75
|
-
let list = props.tableColumns
|
|
76
|
-
state.checkedKeys = []
|
|
77
|
-
let arr = []
|
|
78
|
-
list.forEach((item, index) => {
|
|
79
|
-
if (!item.key) {
|
|
80
|
-
item.key = $tool.getUUID()
|
|
81
|
-
}
|
|
82
|
-
if (!!item.checked || item.checked == undefined) {
|
|
83
|
-
state.checkedKeys.push(item.key)
|
|
84
|
-
arr.push(item)
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
state.treeData = list
|
|
88
|
-
state.tableHeaders = arr
|
|
89
|
-
}
|
|
53
|
+
fixNum: 0, // 固定列数量
|
|
90
54
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
let isFull = document.mozFullScreen ||
|
|
96
|
-
document.fullScreen ||
|
|
97
|
-
document.webkitIsFullScreen ||
|
|
98
|
-
document.webkitRequestFullScreen ||
|
|
99
|
-
document.mozRequestFullScreen ||
|
|
100
|
-
document.msFullscreenEnabled
|
|
101
|
-
if (isFull === undefined) {
|
|
102
|
-
isFull = false
|
|
103
|
-
}
|
|
104
|
-
if (isFull == false) {
|
|
105
|
-
$bus.$emit('tableFullScreen', false)
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
// 监听表格列变化
|
|
111
|
-
watch(() => props.tableColumns, (newVal) => {
|
|
112
|
-
filterData()
|
|
113
|
-
}, { deep: true, immediate: true })
|
|
114
|
-
|
|
115
|
-
// 选择相关的响应式引用
|
|
116
|
-
const selectedKeysForm = ref([])
|
|
117
|
-
const selectGoodsDatas = ref([])
|
|
118
|
-
const selectAllGoods = ref([])
|
|
119
|
-
|
|
120
|
-
// 监听表格数据变化
|
|
121
|
-
watch(() => props.tableData, (newVal) => {
|
|
122
|
-
// 合并并去重数据
|
|
123
|
-
const allArr = [...newVal, ...selectAllGoods.value]
|
|
124
|
-
const allObj = {}
|
|
125
|
-
const newAllArr = allArr.reduce((cur, next) => {
|
|
126
|
-
allObj[next[props.rowKey]] ? '' : (allObj[next[props.rowKey]] = true && cur.push(next))
|
|
127
|
-
return cur
|
|
128
|
-
}, [])
|
|
129
|
-
selectAllGoods.value = newAllArr || []
|
|
130
|
-
}, { deep: true, immediate: true })
|
|
131
|
-
|
|
132
|
-
// 监听选中键变化
|
|
133
|
-
watch(() => props.selectedKeys, (newVal) => {
|
|
134
|
-
selectedKeysForm.value = newVal
|
|
135
|
-
selectGoodsDatas.value = []
|
|
136
|
-
|
|
137
|
-
if (selectAllGoods.value.length && !!newVal) {
|
|
138
|
-
// 过滤并合并选中数据
|
|
139
|
-
const data = selectAllGoods.value.filter((item) => {
|
|
140
|
-
return newVal.includes(item[props.rowKey])
|
|
141
|
-
})
|
|
142
|
-
const arr = [...data, ...selectGoodsDatas.value]
|
|
143
|
-
const obj = {}
|
|
144
|
-
const newArr = arr.reduce((cur, next) => {
|
|
145
|
-
obj[next[props.rowKey]] ? '' : (obj[next[props.rowKey]] = true && cur.push(next))
|
|
146
|
-
return cur
|
|
147
|
-
}, [])
|
|
148
|
-
selectGoodsDatas.value = newArr || []
|
|
149
|
-
context.emit('update:selectDatas', newArr)
|
|
150
|
-
}
|
|
151
|
-
}, { deep: true, immediate: true })
|
|
55
|
+
// 选择相关
|
|
56
|
+
selectedKeysForm: [], // 选中的键
|
|
57
|
+
selectGoodsDatas: [], // 选中的数据
|
|
58
|
+
selectAllGoods: [], // 所有可选数据
|
|
152
59
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
context.emit('draggable', currentData)
|
|
60
|
+
// 全屏相关
|
|
61
|
+
isFullscreen: false
|
|
156
62
|
}
|
|
63
|
+
},
|
|
157
64
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
65
|
+
watch: {
|
|
66
|
+
tableColumns: {
|
|
67
|
+
handler() {
|
|
68
|
+
this.filterData()
|
|
69
|
+
},
|
|
70
|
+
deep: true,
|
|
71
|
+
immediate: true
|
|
72
|
+
},
|
|
161
73
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
74
|
+
tableData: {
|
|
75
|
+
handler(newVal) {
|
|
76
|
+
// 合并去重数据
|
|
77
|
+
const mergedData = [...newVal, ...this.selectAllGoods]
|
|
78
|
+
const uniqueData = Array.from(new Set(mergedData.map(item => item[this.rowKey])))
|
|
79
|
+
.map(id => mergedData.find(item => item[this.rowKey] === id))
|
|
80
|
+
this.selectAllGoods = uniqueData
|
|
81
|
+
},
|
|
82
|
+
deep: true,
|
|
83
|
+
immediate: true
|
|
84
|
+
},
|
|
165
85
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
86
|
+
selectedKeys: {
|
|
87
|
+
handler(newVal) {
|
|
88
|
+
if (!newVal) return
|
|
170
89
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
context.emit('getTableData', props.searchParams.page)
|
|
174
|
-
}
|
|
90
|
+
this.selectedKeysForm = newVal
|
|
91
|
+
this.selectGoodsDatas = []
|
|
175
92
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
93
|
+
if (this.selectAllGoods.length) {
|
|
94
|
+
const selectedData = this.selectAllGoods.filter(item => newVal.includes(item[this.rowKey]))
|
|
95
|
+
const mergedData = [...selectedData, ...this.selectGoodsDatas]
|
|
96
|
+
const uniqueData = Array.from(new Set(mergedData.map(item => item[this.rowKey])))
|
|
97
|
+
.map(id => mergedData.find(item => item[this.rowKey] === id))
|
|
179
98
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
99
|
+
this.selectGoodsDatas = uniqueData
|
|
100
|
+
this.$emit('update:selectDatas', uniqueData)
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
deep: true,
|
|
104
|
+
immediate: true
|
|
183
105
|
}
|
|
106
|
+
},
|
|
184
107
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
108
|
+
created() {
|
|
109
|
+
// 监听窗口大小变化
|
|
110
|
+
window.addEventListener('resize', this.handleResize)
|
|
111
|
+
},
|
|
188
112
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
113
|
+
beforeDestroy() {
|
|
114
|
+
// 移除事件监听
|
|
115
|
+
window.removeEventListener('resize', this.handleResize)
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
methods: {
|
|
119
|
+
/**
|
|
120
|
+
* 过滤和处理表格列配置
|
|
121
|
+
*/
|
|
122
|
+
filterData() {
|
|
123
|
+
const columns = this.tableColumns
|
|
124
|
+
this.checkedKeys = []
|
|
125
|
+
const visibleColumns = []
|
|
126
|
+
|
|
127
|
+
columns.forEach(column => {
|
|
128
|
+
if (!column.key) {
|
|
129
|
+
column.key = this.$tool.getUUID()
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (column.checked === undefined || column.checked) {
|
|
133
|
+
this.checkedKeys.push(column.key)
|
|
134
|
+
visibleColumns.push(column)
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
this.treeData = columns
|
|
139
|
+
this.tableHeaders = visibleColumns
|
|
140
|
+
},
|
|
193
141
|
|
|
194
|
-
|
|
142
|
+
/**
|
|
143
|
+
* 全选/取消全选所有列
|
|
144
|
+
*/
|
|
145
|
+
checkAll(selected) {
|
|
195
146
|
if (selected) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
if (!
|
|
199
|
-
|
|
147
|
+
this.tableHeaders = JSON.parse(JSON.stringify(this.tableColumns))
|
|
148
|
+
this.checkedKeys = this.tableHeaders.map(col => {
|
|
149
|
+
if (!col.key) {
|
|
150
|
+
col.key = this.$tool.getUUID()
|
|
200
151
|
}
|
|
201
|
-
|
|
152
|
+
return col.key
|
|
202
153
|
})
|
|
203
154
|
} else {
|
|
204
|
-
|
|
205
|
-
|
|
155
|
+
this.tableHeaders = []
|
|
156
|
+
this.checkedKeys = []
|
|
206
157
|
}
|
|
207
158
|
|
|
208
|
-
|
|
209
|
-
|
|
159
|
+
this.treeData.forEach(col => {
|
|
160
|
+
col.checked = selected
|
|
210
161
|
})
|
|
211
|
-
}
|
|
162
|
+
},
|
|
212
163
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
164
|
+
/**
|
|
165
|
+
* 更新列的选中状态
|
|
166
|
+
*/
|
|
167
|
+
treeCheck() {
|
|
168
|
+
this.tableHeaders = this.treeData.filter(col =>
|
|
169
|
+
this.checkedKeys.includes(col.key)
|
|
170
|
+
)
|
|
171
|
+
},
|
|
217
172
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
173
|
+
/**
|
|
174
|
+
* 处理行变化
|
|
175
|
+
*/
|
|
176
|
+
handleChange(currentData) {
|
|
177
|
+
this.$emit('draggable', currentData)
|
|
178
|
+
},
|
|
223
179
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
180
|
+
/**
|
|
181
|
+
* 处理选择变化
|
|
182
|
+
*/
|
|
183
|
+
handleSelectionChange(val) {
|
|
184
|
+
this.$emit('multipleSelection', val)
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* 处理当前行变化
|
|
189
|
+
*/
|
|
190
|
+
handleCurrentChange(val) {
|
|
191
|
+
this.$emit('currentChange', val)
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* 处理每页条数变化
|
|
196
|
+
*/
|
|
197
|
+
sizeChange(val) {
|
|
198
|
+
this.searchParams.size = val
|
|
199
|
+
this.$emit('getTableData')
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* 处理页码变化
|
|
204
|
+
*/
|
|
205
|
+
currentChange(page) {
|
|
206
|
+
this.searchParams.page = page - 1
|
|
207
|
+
this.$emit('getTableData', this.searchParams.page)
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* 刷新表格数据
|
|
212
|
+
*/
|
|
213
|
+
refresh() {
|
|
214
|
+
this.currentChange(1)
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* 处理表格大小变化
|
|
219
|
+
*/
|
|
220
|
+
handleSelect(v) {
|
|
221
|
+
this.localTableSize = v
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* 切换全屏显示
|
|
226
|
+
*/
|
|
227
|
+
tableToggleFullScreen() {
|
|
228
|
+
this.$bus.$emit('tableFullScreen', !this.isFullscreen)
|
|
229
|
+
this.isFullscreen = !this.isFullscreen
|
|
230
|
+
// 这里需要实现具体的全屏切换逻辑
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* 处理窗口大小变化
|
|
235
|
+
*/
|
|
236
|
+
handleResize() {
|
|
237
|
+
const isFull = document.fullscreenElement ||
|
|
238
|
+
document.mozFullScreenElement ||
|
|
239
|
+
document.webkitFullscreenElement ||
|
|
240
|
+
document.msFullscreenElement
|
|
241
|
+
|
|
242
|
+
if (!isFull) {
|
|
243
|
+
this.$bus.$emit('tableFullScreen', false)
|
|
244
|
+
this.isFullscreen = false
|
|
240
245
|
}
|
|
241
|
-
}
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* 过滤列表操作按钮
|
|
250
|
+
*/
|
|
251
|
+
filterOperations(operations, row) {
|
|
252
|
+
return operations?.filter(o => {
|
|
253
|
+
const hasAuth = !o.auth || this.checkAuth(o.auth)
|
|
254
|
+
const isVisible = !o.isShow || o.isShow(row)
|
|
255
|
+
return hasAuth && isVisible
|
|
256
|
+
}) || []
|
|
257
|
+
},
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* 检查权限
|
|
261
|
+
*/
|
|
262
|
+
checkAuth(auth) {
|
|
263
|
+
const { menus = [], authorities = [] } = JSON.parse(localStorage.getItem('userAuthInfo') || '{}')
|
|
264
|
+
const allPermissions = [...menus, ...authorities]
|
|
242
265
|
|
|
243
|
-
// 权限检查
|
|
244
|
-
const checkAuth = (auth) => {
|
|
245
|
-
const data = JSON.parse(localStorage.getItem('userAuthInfo'))
|
|
246
|
-
const { menus, authorities } = data
|
|
247
266
|
if (!auth) return true
|
|
248
267
|
if (Array.isArray(auth)) {
|
|
249
|
-
return auth.some(
|
|
250
|
-
} else if (typeof auth === 'string') {
|
|
251
|
-
return [...menus, ...authorities].includes(auth)
|
|
268
|
+
return auth.some(permission => allPermissions.includes(permission))
|
|
252
269
|
}
|
|
253
|
-
return
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// 操作按钮过滤
|
|
257
|
-
const filterOperations = (operations, row) => {
|
|
258
|
-
return operations.filter((o) => (!o?.isShow || o.isShow(row)) && checkAuth(o.auth))
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return {
|
|
262
|
-
...toRefs(state),
|
|
263
|
-
checkAuth,
|
|
264
|
-
filterOperations,
|
|
265
|
-
refresh,
|
|
266
|
-
dayjs,
|
|
267
|
-
handleChange,
|
|
268
|
-
handleSelectionChange,
|
|
269
|
-
handleCurrentChange,
|
|
270
|
-
sizeChange,
|
|
271
|
-
currentChange,
|
|
272
|
-
multipleTable,
|
|
273
|
-
toggleRowChange,
|
|
274
|
-
clearTableSelection,
|
|
275
|
-
handleSelect,
|
|
276
|
-
checkAll,
|
|
277
|
-
tableToggleFullScreen,
|
|
278
|
-
isFullscreen,
|
|
279
|
-
treeCheck,
|
|
280
|
-
fixNumChange,
|
|
281
|
-
selectedKeysForm,
|
|
282
|
-
selectGoodsDatas
|
|
270
|
+
return allPermissions.includes(auth)
|
|
283
271
|
}
|
|
284
272
|
}
|
|
285
273
|
}
|