@lambo-design/schema-paging-table 1.0.0-beta.10 → 1.0.0-beta.12
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 -3
- package/src/index.vue +36 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/schema-paging-table",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@lambo-design/core": "^4.7.1-beta.105",
|
|
14
|
-
"@lambo-design/schema-form": "^1.0.0-beta.
|
|
14
|
+
"@lambo-design/schema-form": "^1.0.0-beta.29",
|
|
15
15
|
"@lambo-design/shared": "^1.0.0-beta.97",
|
|
16
|
-
"@lambo-design/paging-table": "^1.0.0-beta.
|
|
16
|
+
"@lambo-design/paging-table": "^1.0.0-beta.72"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {}
|
|
19
19
|
}
|
package/src/index.vue
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
v-model="queryForm"
|
|
18
18
|
:form-type="'search'"
|
|
19
19
|
:fieldList="formFields"
|
|
20
|
-
:labelWidth="
|
|
20
|
+
:labelWidth="labelWidth"
|
|
21
21
|
:default-rows="2"
|
|
22
22
|
:grid-columns="4"
|
|
23
23
|
:customComponents="customComponents"
|
|
@@ -107,6 +107,11 @@ export default {
|
|
|
107
107
|
require: false,
|
|
108
108
|
default: ""
|
|
109
109
|
},
|
|
110
|
+
labelWidth: {
|
|
111
|
+
type: Number,
|
|
112
|
+
require: false,
|
|
113
|
+
default: 100
|
|
114
|
+
},
|
|
110
115
|
form:{
|
|
111
116
|
type: Object,
|
|
112
117
|
required: true,
|
|
@@ -199,6 +204,11 @@ export default {
|
|
|
199
204
|
dropDownButton: function () {
|
|
200
205
|
return this.buttonList.slice(3 - this.buttonList.length)
|
|
201
206
|
},
|
|
207
|
+
multiSelect: function() {
|
|
208
|
+
return this.columnList.some((item)=>{
|
|
209
|
+
return item.type === "selection"
|
|
210
|
+
})
|
|
211
|
+
}
|
|
202
212
|
},
|
|
203
213
|
watch:{
|
|
204
214
|
form: function(val) {
|
|
@@ -221,10 +231,31 @@ export default {
|
|
|
221
231
|
})
|
|
222
232
|
}else if(item.clickEvent?.type==="method"){
|
|
223
233
|
// self.$Message.info(item.clickEvent.name)
|
|
224
|
-
let
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
234
|
+
let selection = self.getSelection()
|
|
235
|
+
if(self.multiSelect){
|
|
236
|
+
let param = selection.map((select,index)=>{
|
|
237
|
+
if(item.clickEvent?.method?.keys){
|
|
238
|
+
let obj = item.clickEvent?.method?.keys?.reduce((acc,sourceItem)=>{
|
|
239
|
+
return Object.assign(acc,{[sourceItem]:select[sourceItem]})
|
|
240
|
+
},{})
|
|
241
|
+
return obj
|
|
242
|
+
}else{
|
|
243
|
+
return item
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
self.$emit(item.clickEvent?.method?.name,param)
|
|
247
|
+
}else{
|
|
248
|
+
let selection = self.getSelection()
|
|
249
|
+
if(item.clickEvent?.method?.keys){
|
|
250
|
+
let param = item.clickEvent?.method?.keys?.reduce((acc,sourceItem)=>{
|
|
251
|
+
return Object.assign(acc,{[sourceItem]:selection[0][sourceItem]})
|
|
252
|
+
},{})
|
|
253
|
+
self.$emit(item.clickEvent?.method?.name,param)
|
|
254
|
+
}else{
|
|
255
|
+
let param = selection[0]
|
|
256
|
+
self.$emit(item.clickEvent?.method?.name,param)
|
|
257
|
+
}
|
|
258
|
+
}
|
|
228
259
|
}else if(item.clickEvent?.type==="modal"){
|
|
229
260
|
self.$Message.info(item.clickEvent.name)
|
|
230
261
|
}
|