udpate 混料批次编辑
This commit is contained in:
@@ -59,23 +59,23 @@ export default {
|
||||
let emitFull = false;
|
||||
let eventType = "default";
|
||||
let customField;
|
||||
let payload = {};
|
||||
if (typeof opt === "object") {
|
||||
eventType = opt.name;
|
||||
customField = opt.emitField || "id";
|
||||
emitFull = opt.emitFull || false;
|
||||
if ("url" in opt) {
|
||||
payload.url = this.injectData.url;
|
||||
}
|
||||
if ("toRouter" in opt) {
|
||||
payload.toRouter = opt.toRouter;
|
||||
}
|
||||
} else {
|
||||
eventType = opt;
|
||||
}
|
||||
|
||||
/** 处理 toRouter */
|
||||
let payload = { type: eventType, data: emitFull ? this.injectData : customField ? this.injectData[customField] : this.injectData.id };
|
||||
if ("url" in opt) {
|
||||
payload.url = this.injectData.url;
|
||||
}
|
||||
if ("toRouter" in opt) {
|
||||
payload.toRouter = opt.toRouter;
|
||||
}
|
||||
// this.$emit('emit-data', { type: eventType, data: emitFull ? this.injectData : customField ? this.injectData[customField] : this.injectData.id, url: this.injectData.url, toRouter: opt.toRouter })
|
||||
payload = { ...payload, type: eventType, data: emitFull ? this.injectData : customField ? this.injectData[customField] : this.injectData.id };
|
||||
this.$emit("emit-data", payload);
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user