Skip to content

Commit bf58e0d

Browse files
author
ginnerpeace
committed
Add computed actionUrl 替换来自表格中的 seletionKey
1 parent 8cfebf3 commit bf58e0d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

resources/js/components/form/Form.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ export default {
131131
isEdit() {
132132
return this.attrs.mode === "edit";
133133
},
134+
actionUrl() {
135+
const keys = this.$store.getters.thisPage.grids.selectionKeys;
136+
return this._.replace(this.attrs.action, "selectionKeys", keys);
137+
},
134138
},
135139
data() {
136140
return {
@@ -193,7 +197,7 @@ export default {
193197
194198
if (this.isEdit) {
195199
this.$http
196-
.put(this.attrs.action, formatData)
200+
.put(this.actionUrl, formatData)
197201
.then(({data, code, message}) => {
198202
if (code === 200) {
199203
if (this.attrs.attrs.isDialog) {
@@ -209,7 +213,7 @@ export default {
209213
});
210214
} else {
211215
this.$http
212-
.post(this.attrs.action, formatData)
216+
.post(this.actionUrl, formatData)
213217
.then(({data, code, message}) => {
214218
if (code === 200) {
215219
if (this.attrs.attrs.isDialog) {

0 commit comments

Comments
 (0)