@lambo-design/schema-paging-table 1.0.0-beta.33 → 1.0.0-beta.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/package.json +4 -4
- package/src/index.vue +22 -8
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.35",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"standard-version": "^9.5.0",
|
|
14
|
-
"@lambo-design/
|
|
14
|
+
"@lambo-design/shared": "^1.0.0-beta.201",
|
|
15
15
|
"@lambo-design/core": "^4.7.1-beta.139",
|
|
16
|
-
"@lambo-design/
|
|
17
|
-
"@lambo-design/
|
|
16
|
+
"@lambo-design/schema-form": "^1.0.0-beta.58",
|
|
17
|
+
"@lambo-design/paging-table": "^1.0.0-beta.77"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"release": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
|
package/src/index.vue
CHANGED
|
@@ -317,23 +317,37 @@ export default {
|
|
|
317
317
|
let self = this;
|
|
318
318
|
if (item.clickEvent?.type === "route") {
|
|
319
319
|
const routeInfo = item.clickEvent.route;
|
|
320
|
-
const keysExist = routeInfo.keys && routeInfo.keys.length !== 0
|
|
320
|
+
const keysExist = routeInfo.keys && routeInfo.keys.length !== 0;
|
|
321
321
|
const selection = keysExist ? self.getSelection() : null;
|
|
322
|
-
if (keysExist && selection.length
|
|
323
|
-
self.$Message.info('
|
|
322
|
+
if (keysExist && selection.length === 0) {
|
|
323
|
+
self.$Message.info('请选择一条记录!');
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
326
|
+
if (self.multiSelect) {
|
|
327
|
+
const query = selection.map((select, index) => {
|
|
328
|
+
if (item.clickEvent?.method?.keys) {
|
|
329
|
+
let obj = item.clickEvent?.method?.keys?.reduce((acc, sourceItem) => {
|
|
330
|
+
return Object.assign(acc, {[sourceItem]: select[sourceItem]})
|
|
331
|
+
}, {})
|
|
332
|
+
return obj
|
|
333
|
+
} else {
|
|
334
|
+
return item
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
self.$router.push({ path: routeInfo.path, query })
|
|
338
|
+
} else {
|
|
339
|
+
const query = keysExist
|
|
340
|
+
? routeInfo.keys.reduce((acc, key) => ({ ...acc, [key]: selection[0][key] }), {})
|
|
341
|
+
: null;
|
|
342
|
+
self.$router.push({ path: routeInfo.path, query })
|
|
343
|
+
}
|
|
330
344
|
} else if (item.clickEvent?.type === "method") {
|
|
331
345
|
let selection = self.getSelection()
|
|
332
346
|
if (selection.length === 0 && item.clickEvent?.method?.keys.length !== 0) {
|
|
333
347
|
self.$Message.info('请选择一条记录!')
|
|
334
348
|
return
|
|
335
349
|
}
|
|
336
|
-
if (
|
|
350
|
+
if (self.multiSelect) {
|
|
337
351
|
let param = selection.map((select, index) => {
|
|
338
352
|
if (item.clickEvent?.method?.keys) {
|
|
339
353
|
let obj = item.clickEvent?.method?.keys?.reduce((acc, sourceItem) => {
|