web-component-gallery 2.2.32 → 2.2.34
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/js.umd.js +1 -1
- package/dist/styles.css +21 -0
- package/dist/styles.umd.js +1 -0
- package/lib/descriptions-list/index.jsx +51 -57
- package/lib/descriptions-list/style/index.less +5 -6
- package/lib/form-comp/ARangePicker.vue +1 -1
- package/lib/model/Model.js +1 -0
- package/lib/table/index.vue +148 -111
- package/lib/table-examples/TransferTable.vue +278 -0
- package/lib/table-examples/index.js +22 -0
- package/lib/table-examples/styles/TransferTable.less +20 -0
- package/lib/table-examples/styles/index.js +1 -0
- package/lib/table-examples/styles/index.less +1 -0
- package/package.json +1 -1
- package/utils/Utils.js +19 -3
- package/utils/ColorPalette.js +0 -57
package/dist/styles.css
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
|
2
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
3
|
+
/* stylelint-disable */
|
|
4
|
+
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
|
5
|
+
.TransferTable {
|
|
6
|
+
flex: 1;
|
|
7
|
+
display: flex;
|
|
8
|
+
gap: 8px 0;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
}
|
|
11
|
+
.TransferTable__Content {
|
|
12
|
+
flex: 1;
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: 0 8px;
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
}
|
|
17
|
+
.TransferTable__Left,
|
|
18
|
+
.TransferTable__Right {
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.rui=t():e.rui=t()}(self,function(){return function(){var e={73472:function(e,t,o){"use strict";o.r(t)}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var u=t[r]={exports:{}};return e[r](u,u.exports,o),u.exports}o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};return o(73472),{}}()});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import PropTypes from 'ant-design-vue/es/_util/vue-types'
|
|
3
2
|
import Descriptions from 'ant-design-vue/es/descriptions'
|
|
4
3
|
import Browse from '../browse/index.jsx'
|
|
@@ -13,7 +12,7 @@ const descDefaultAttrs = {
|
|
|
13
12
|
|
|
14
13
|
const DescriptionsProps = {
|
|
15
14
|
title: PropTypes.string,
|
|
16
|
-
column: PropTypes.oneOfType([PropTypes.number, PropTypes.object]).def(
|
|
15
|
+
column: PropTypes.oneOfType([PropTypes.number, PropTypes.object]).def(4),
|
|
17
16
|
descDetails: PropTypes.object,
|
|
18
17
|
descSettings: PropTypes.array,
|
|
19
18
|
descAttrs: PropTypes.object,
|
|
@@ -45,41 +44,33 @@ const renderContent = (h, item, details) => {
|
|
|
45
44
|
const DescriptionsList = {
|
|
46
45
|
name: 'DescriptionsList',
|
|
47
46
|
props: DescriptionsProps,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
xxl: 4,
|
|
52
|
-
xl: 3,
|
|
53
|
-
lg: 3,
|
|
54
|
-
md: 3,
|
|
55
|
-
sm: 2,
|
|
56
|
-
xs: 1
|
|
57
|
-
}
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
responsiveColumn: 1
|
|
58
50
|
}
|
|
59
51
|
},
|
|
60
52
|
mounted() {
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
this.setDescContentWidth()
|
|
54
|
+
this.$bus.$onWindow(this, 'resize', this.setDescContentWidth)
|
|
63
55
|
},
|
|
64
56
|
methods: {
|
|
65
57
|
getCurrentColumn(width) {
|
|
66
|
-
if (width >= 1600) return this.
|
|
67
|
-
if (width >= 1200) return this.
|
|
68
|
-
if (width >= 992) return this.
|
|
69
|
-
if (width >=
|
|
70
|
-
|
|
71
|
-
return this.responsiveColumn.xs
|
|
58
|
+
if (width >= 1600) return this.column || 4
|
|
59
|
+
if (width >= 1200) return Math.min(4, this.column)
|
|
60
|
+
if (width >= 992) return Math.min(3, this.column)
|
|
61
|
+
if (width >= 576) return Math.min(2, this.column)
|
|
62
|
+
return 1
|
|
72
63
|
},
|
|
73
64
|
|
|
74
|
-
calculateItemWidth(totalWidth,
|
|
75
|
-
const effectiveSpan = itemSpan &&
|
|
76
|
-
return totalWidth * (effectiveSpan /
|
|
65
|
+
calculateItemWidth(totalWidth, itemSpan) {
|
|
66
|
+
const effectiveSpan = itemSpan && this.responsiveColumn > itemSpan ? itemSpan : 1
|
|
67
|
+
return totalWidth * (effectiveSpan / this.responsiveColumn)
|
|
77
68
|
},
|
|
78
69
|
|
|
79
70
|
setDescContentWidth() {
|
|
80
71
|
const retry = () => {
|
|
81
72
|
const container = this.$refs.Descriptions
|
|
82
|
-
if (!container) return
|
|
73
|
+
if (!container) return
|
|
83
74
|
|
|
84
75
|
const viewElement = container.querySelector('.ant-descriptions-view')
|
|
85
76
|
if (!viewElement) return
|
|
@@ -90,39 +81,42 @@ const DescriptionsList = {
|
|
|
90
81
|
return
|
|
91
82
|
}
|
|
92
83
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
84
|
+
this.responsiveColumn = this.getCurrentColumn(width)
|
|
85
|
+
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
const rowElements = container.querySelectorAll('.ant-descriptions-row')
|
|
88
|
+
// 记录数量
|
|
89
|
+
let count = 0
|
|
90
|
+
|
|
91
|
+
for (let i = 0; i < rowElements.length; i++) {
|
|
92
|
+
const labelElements = rowElements[i].querySelectorAll('.ant-descriptions-item-label')
|
|
93
|
+
const contentElements = rowElements[i].querySelectorAll('.ant-descriptions-item-content')
|
|
94
|
+
// 计算平均宽度
|
|
95
|
+
const meanWidth = width / labelElements.length
|
|
96
|
+
|
|
97
|
+
for (let j = 0; j < labelElements.length; j++) {
|
|
98
|
+
const itemSpan = this.descSettings[count]?.span || 1
|
|
99
|
+
const eachWidth = width / this.responsiveColumn * itemSpan
|
|
100
|
+
|
|
101
|
+
// 设置标签固定宽度
|
|
102
|
+
labelElements[j].style = `
|
|
103
|
+
width: 160px;
|
|
104
|
+
min-width: 160px;
|
|
105
|
+
max-width: 160px;
|
|
106
|
+
`
|
|
107
|
+
|
|
108
|
+
// 设置内容区域默认宽度
|
|
109
|
+
contentElements[j].style = `
|
|
110
|
+
width: ${eachWidth - 160}px;
|
|
111
|
+
min-width: ${eachWidth - 160}px;
|
|
112
|
+
max-width: ${eachWidth - 160}px;
|
|
113
|
+
`
|
|
114
|
+
|
|
115
|
+
count++
|
|
116
|
+
}
|
|
124
117
|
}
|
|
125
|
-
}
|
|
118
|
+
}, 0)
|
|
119
|
+
|
|
126
120
|
}
|
|
127
121
|
retry()
|
|
128
122
|
}
|
|
@@ -161,4 +155,4 @@ DescriptionsList.install = function(Vue) {
|
|
|
161
155
|
Vue.component('DescriptionsList', DescriptionsList)
|
|
162
156
|
}
|
|
163
157
|
|
|
164
|
-
export default DescriptionsList
|
|
158
|
+
export default DescriptionsList
|
|
@@ -4,18 +4,17 @@
|
|
|
4
4
|
.scrollbarStyle();
|
|
5
5
|
|
|
6
6
|
.ant-descriptions-bordered {
|
|
7
|
+
|
|
8
|
+
.ant-descriptions-view > table {
|
|
9
|
+
table-layout: fixed;
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
.ant-descriptions-item-label {
|
|
8
|
-
width: 160px;
|
|
9
|
-
min-width: 160px;
|
|
10
|
-
max-width: 160px;
|
|
11
13
|
text-align: left;
|
|
12
14
|
word-wrap: break-word;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
.ant-descriptions-item-content {
|
|
16
|
-
width: calc(100% - 160px);
|
|
17
|
-
min-width: calc(100% - 160px);
|
|
18
|
-
max-width: calc(100% - 160px);
|
|
19
18
|
word-wrap: break-word;
|
|
20
19
|
|
|
21
20
|
.Browse {
|
package/lib/model/Model.js
CHANGED
package/lib/table/index.vue
CHANGED
|
@@ -1,51 +1,72 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- 表格容器,根据tableStyle动态设置样式类 -->
|
|
2
3
|
<div :class="[tableStyle, 'WebComponentTable']" ref="Table">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
<!-- 表格头部插槽 -->
|
|
5
|
+
<div v-if="$slots.ATableHead" class="WebComponentTable__Head" ref="TableHead">
|
|
6
|
+
<slot name="ATableHead" />
|
|
7
|
+
</div>
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
<!-- 主表格组件 -->
|
|
10
|
+
<Table
|
|
11
|
+
ref="TableList"
|
|
12
|
+
:size="tableSize"
|
|
13
|
+
:data-source="tableDatas"
|
|
14
|
+
v-on="$listeners"
|
|
15
|
+
v-bind="setAttrs"
|
|
16
|
+
class="WebComponentTable__List"
|
|
17
|
+
>
|
|
18
|
+
<!-- 表格标题插槽 -->
|
|
19
|
+
<div v-if="$slots.ATableTitle" class="WebComponentTable__List__Title" ref="TableListTitle" slot="title">
|
|
20
|
+
<slot name="ATableTitle" />
|
|
21
|
+
</div>
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<template #customRender="text, record, i, column">
|
|
27
|
-
<slot :name="column.dataIndex" :customProps="record" :text="text" :index="i" />
|
|
28
|
-
</template>
|
|
29
|
-
</Table>
|
|
23
|
+
<!-- 自定义头部渲染 -->
|
|
24
|
+
<template v-for="{ dataIndex } in $attrs.columns" #[dataIndex]>
|
|
25
|
+
<slot :name="dataIndex" />
|
|
26
|
+
</template>
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
<!-- 新增:查看文件 -->
|
|
29
|
+
<template #checkFile="text, record, i, column">
|
|
30
|
+
<Button type="link" @click="handleCheckFile(record, column.props)">查看</Button>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<!-- 新增:携带自定义操作 -->
|
|
34
|
+
<template #viewOperate="text, record, i, column">
|
|
35
|
+
<Button type="link" @click="handleViewOperate(record, column)">
|
|
36
|
+
{{ column.customRender(record) || record[column.props] }}
|
|
37
|
+
</Button>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<!-- 自定义渲染插槽 -->
|
|
41
|
+
<template #customRender="text, record, i, column">
|
|
42
|
+
<slot
|
|
43
|
+
:name="column.dataIndex"
|
|
44
|
+
:customProps="record"
|
|
45
|
+
:text="text"
|
|
46
|
+
:index="i"
|
|
47
|
+
:column="column"
|
|
48
|
+
/>
|
|
49
|
+
</template>
|
|
50
|
+
</Table>
|
|
48
51
|
|
|
52
|
+
<!-- 分页组件容器 -->
|
|
53
|
+
<div class="WebComponentTable__Pagination" ref="TablePagination">
|
|
54
|
+
<slot name="ATablePagination">
|
|
55
|
+
<Pagination
|
|
56
|
+
size="small"
|
|
57
|
+
:pageSizeOptions="pageSizeOptions"
|
|
58
|
+
:show-total="total => `共 ${total} 条记录`"
|
|
59
|
+
show-size-changer
|
|
60
|
+
show-quick-jumper
|
|
61
|
+
:defaultCurrent="1"
|
|
62
|
+
:pageSize.sync="pagination.size"
|
|
63
|
+
:current="pagination.current"
|
|
64
|
+
@showSizeChange="handlePaginationChange"
|
|
65
|
+
@change="handlePaginationChange"
|
|
66
|
+
:total="pagination.total"
|
|
67
|
+
/>
|
|
68
|
+
</slot>
|
|
69
|
+
</div>
|
|
49
70
|
</div>
|
|
50
71
|
</template>
|
|
51
72
|
|
|
@@ -55,39 +76,24 @@ import IconFont from '../icon-font'
|
|
|
55
76
|
import { Table, Pagination } from 'ant-design-vue/es'
|
|
56
77
|
|
|
57
78
|
export default {
|
|
79
|
+
name: 'WTable',
|
|
58
80
|
components: {
|
|
59
81
|
Table,
|
|
60
82
|
Pagination
|
|
61
|
-
},
|
|
62
|
-
name: 'WTable',
|
|
63
|
-
data() {
|
|
64
|
-
return {
|
|
65
|
-
pagination: {
|
|
66
|
-
total: 0,
|
|
67
|
-
size: 10,
|
|
68
|
-
current: 1
|
|
69
|
-
},
|
|
70
|
-
// 尺寸观察器
|
|
71
|
-
resizeObserver: null,
|
|
72
|
-
tableScrollBody: 600,
|
|
73
|
-
/** 跨分页记录选中数据 */
|
|
74
|
-
selectedRecords: []
|
|
75
|
-
}
|
|
76
83
|
},
|
|
77
84
|
props: {
|
|
78
|
-
// 紧凑型和宽松型
|
|
79
|
-
// relax 宽松型
|
|
80
|
-
// compact 紧凑型
|
|
81
85
|
tableStyle: {
|
|
82
86
|
type: String,
|
|
83
87
|
default: 'compact'
|
|
84
88
|
},
|
|
85
|
-
// compact 紧凑型情况下是否有分割线
|
|
86
89
|
tableSplit: {
|
|
87
90
|
type: Boolean,
|
|
88
91
|
default: true
|
|
89
92
|
},
|
|
90
|
-
|
|
93
|
+
rowKey: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: 'id'
|
|
96
|
+
},
|
|
91
97
|
datas: {
|
|
92
98
|
type: Array,
|
|
93
99
|
default: () => []
|
|
@@ -96,12 +102,10 @@ export default {
|
|
|
96
102
|
type: String,
|
|
97
103
|
default: '-'
|
|
98
104
|
},
|
|
99
|
-
// 选中数据项
|
|
100
105
|
selectedRowKeys: {
|
|
101
106
|
type: Array,
|
|
102
107
|
default: () => []
|
|
103
108
|
},
|
|
104
|
-
// 分页默认值
|
|
105
109
|
paginationParams: {
|
|
106
110
|
type: Object,
|
|
107
111
|
default: () => ({
|
|
@@ -110,36 +114,54 @@ export default {
|
|
|
110
114
|
current: 1
|
|
111
115
|
})
|
|
112
116
|
},
|
|
113
|
-
// 配置分页数据
|
|
114
117
|
pageSizeOptions: {
|
|
115
118
|
type: Array,
|
|
116
119
|
default: () => ['10', '15', '20', '30', '50']
|
|
117
120
|
}
|
|
118
121
|
},
|
|
122
|
+
data() {
|
|
123
|
+
return {
|
|
124
|
+
pagination: {
|
|
125
|
+
total: 0,
|
|
126
|
+
size: 10,
|
|
127
|
+
current: 1
|
|
128
|
+
},
|
|
129
|
+
resizeObserver: null,
|
|
130
|
+
tableScrollBody: 600,
|
|
131
|
+
selectedRecords: []
|
|
132
|
+
}
|
|
133
|
+
},
|
|
119
134
|
computed: {
|
|
120
135
|
setAttrs() {
|
|
121
136
|
return {
|
|
122
137
|
pagination: false,
|
|
123
|
-
rowKey: (record, i) => record.
|
|
124
|
-
rowSelection: {
|
|
138
|
+
rowKey: (record, i) => record[this.rowKey] ?? `${this.pagination.current}${i}`,
|
|
139
|
+
rowSelection: {
|
|
140
|
+
selectedRowKeys: this.selectedRowKeys,
|
|
141
|
+
onChange: this.handleSelectChange
|
|
142
|
+
},
|
|
125
143
|
locale: {
|
|
126
|
-
emptyText:
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
144
|
+
emptyText: (
|
|
145
|
+
<div class="WebComponentTable__List__Empty">
|
|
146
|
+
<IconFont type="noData_data" />
|
|
147
|
+
<span>暂无数据</span>
|
|
148
|
+
</div>
|
|
149
|
+
)
|
|
150
|
+
},
|
|
151
|
+
scroll: {
|
|
152
|
+
y: this.tableScrollBody,
|
|
153
|
+
x: this.$attrs.scrollX
|
|
130
154
|
},
|
|
131
|
-
scroll: { y: this.tableScrollBody, x: this.$attrs.scrollX },
|
|
132
155
|
...this.$attrs
|
|
133
156
|
}
|
|
134
157
|
},
|
|
135
158
|
tableSize() {
|
|
136
|
-
return this.tableStyle
|
|
159
|
+
return this.tableStyle === 'compact' ? 'middle' : 'default'
|
|
137
160
|
},
|
|
138
161
|
tableDatas() {
|
|
139
|
-
|
|
140
|
-
const dataKeys = this.$attrs.columns.map(column => column.dataIndex)
|
|
162
|
+
const dataKeys = this.$attrs?.columns?.map(column => column.dataIndex) || []
|
|
141
163
|
return this.datas.map(dataItem => {
|
|
142
|
-
const cloneItem = {...dataItem}
|
|
164
|
+
const cloneItem = { ...dataItem }
|
|
143
165
|
dataKeys.forEach(key => {
|
|
144
166
|
const value = cloneItem[key]
|
|
145
167
|
if (value === null || value === undefined ||
|
|
@@ -150,39 +172,42 @@ export default {
|
|
|
150
172
|
return cloneItem
|
|
151
173
|
})
|
|
152
174
|
}
|
|
153
|
-
},
|
|
175
|
+
},
|
|
154
176
|
watch: {
|
|
155
|
-
paginationParams
|
|
156
|
-
|
|
177
|
+
paginationParams: {
|
|
178
|
+
handler(newValue) {
|
|
179
|
+
this.pagination = { ...this.pagination, ...newValue }
|
|
180
|
+
},
|
|
181
|
+
immediate: true
|
|
157
182
|
}
|
|
158
183
|
},
|
|
159
184
|
mounted() {
|
|
160
|
-
this.pagination = { ...this.pagination, ...this.paginationParams }
|
|
161
|
-
// 监听父级高度
|
|
162
185
|
this.initResizeObserver()
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
186
|
+
this.$nextTick(() => {
|
|
187
|
+
setTimeout(this.getTableBodyHeight, 100)
|
|
188
|
+
})
|
|
189
|
+
this.$bus.$onWindow(this, 'resize', this.getTableBodyHeight)
|
|
190
|
+
},
|
|
191
|
+
beforeDestroy() {
|
|
192
|
+
if (this.resizeObserver) {
|
|
193
|
+
this.resizeObserver.disconnect()
|
|
194
|
+
this.resizeObserver = null
|
|
195
|
+
}
|
|
169
196
|
},
|
|
170
197
|
methods: {
|
|
171
|
-
// 初始化尺寸观察器
|
|
172
198
|
initResizeObserver() {
|
|
173
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
199
|
+
if (typeof ResizeObserver !== 'undefined' && this.$refs.Table) {
|
|
174
200
|
this.resizeObserver = new ResizeObserver(() => {
|
|
175
|
-
this.
|
|
201
|
+
this.getTableBodyHeight()
|
|
176
202
|
})
|
|
177
203
|
this.resizeObserver.observe(this.$refs.Table)
|
|
178
204
|
}
|
|
179
205
|
},
|
|
180
|
-
|
|
181
|
-
getScrollBodyH() {
|
|
206
|
+
getTableBodyHeight() {
|
|
182
207
|
if (!this.$refs.Table || !this.$refs.TableHead || !this.$refs.TablePagination) return
|
|
183
208
|
|
|
184
209
|
const tableTitleHeight = this.$refs.TableListTitle ? this.$refs.TableListTitle.offsetHeight : 0
|
|
185
|
-
const tableHeader =
|
|
210
|
+
const tableHeader = this.$refs.TableList.querySelector('.ant-table-thead')
|
|
186
211
|
const headerHeight = tableHeader ? tableHeader.offsetHeight : 0
|
|
187
212
|
|
|
188
213
|
this.tableScrollBody =
|
|
@@ -193,37 +218,49 @@ export default {
|
|
|
193
218
|
tableTitleHeight -
|
|
194
219
|
headerHeight -
|
|
195
220
|
24 // 浮动空间缓冲
|
|
196
|
-
/** 24为获取高度时抹掉的小数点后两位的浮动空间(存在叠加多个获取错误的情况) */
|
|
197
221
|
},
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
222
|
+
handleCheckFile(record, props) {
|
|
223
|
+
this.$postM({
|
|
224
|
+
type: 'customModal',
|
|
225
|
+
name: 'browse',
|
|
226
|
+
params: {
|
|
227
|
+
data: record[props]
|
|
228
|
+
}
|
|
229
|
+
})
|
|
206
230
|
},
|
|
207
|
-
|
|
208
|
-
const
|
|
231
|
+
handleViewOperate(record, column) {
|
|
232
|
+
const { customOperate, customView } = column
|
|
233
|
+
|
|
234
|
+
if (typeof customOperate === 'function') return customOperate(record)
|
|
235
|
+
if (!customView || !customView.code) return
|
|
236
|
+
|
|
237
|
+
this.$postM({
|
|
238
|
+
name: customView.code,
|
|
239
|
+
method: 'modalOpen',
|
|
240
|
+
params: record
|
|
241
|
+
})
|
|
242
|
+
},
|
|
243
|
+
handleSelectChange(selectedKey, selectedRecord) {
|
|
244
|
+
const currentIds = new Set(this.selectedRecords.map(r => r[this.rowKey]))
|
|
209
245
|
const newIds = new Set(selectedKey)
|
|
210
246
|
|
|
211
247
|
this.selectedRecords = newIds.size > currentIds.size
|
|
212
|
-
? [
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
248
|
+
? [
|
|
249
|
+
...this.selectedRecords,
|
|
250
|
+
...selectedRecord.filter(r => newIds.has(r[this.rowKey]) && !currentIds.has(r[this.rowKey]))
|
|
251
|
+
]
|
|
252
|
+
: this.selectedRecords.filter(r => newIds.has(r[this.rowKey]))
|
|
216
253
|
|
|
217
254
|
this.$emit('selectedRecords', selectedKey, this.selectedRecords)
|
|
218
255
|
},
|
|
219
|
-
|
|
256
|
+
handlePaginationChange(current, pageSize) {
|
|
220
257
|
this.pagination = {
|
|
221
258
|
...this.pagination,
|
|
222
259
|
size: pageSize,
|
|
223
260
|
current
|
|
224
261
|
}
|
|
225
262
|
this.$emit('pageSizeChange', this.pagination)
|
|
226
|
-
}
|
|
263
|
+
}
|
|
227
264
|
}
|
|
228
265
|
}
|
|
229
|
-
</script>
|
|
266
|
+
</script>
|