udpate 混料批次编辑

このコミットが含まれているのは:
lb 2023-03-15 14:57:54 +08:00
コミット a94d5c2715
6個のファイルの変更30行の追加26行の削除

ファイルの表示

@ -121,6 +121,10 @@ export default {
type: Boolean,
default: false,
},
// extraParams: {
// type: Object,
// default: () => ({})
// }
},
inject: ["urls"],
data() {
@ -248,7 +252,7 @@ export default {
},
/** init **/
init(id, detailMode, extraParams) {
init(id, detailMode, tagInfo, extraParams) {
// console.log("[DialogJustForm] init", this.dataForm, id, detailMode);
if (this.$refs.dataForm) {
// console.log("[DialogJustForm] clearing form validation...");
@ -258,6 +262,14 @@ export default {
this.detailMode = detailMode ?? false;
/** 判断 extraParams */
if (extraParams && typeof extraParams === "object") {
for (const [key, value] of Object.entries(extraParams)) {
// console.log("[dialog] dataForm | key | value", this.dataForm, key, value);
this.$set(this.dataForm, key, value);
}
}
this.$nextTick(() => {
this.dataForm.id = id || null;
if (this.dataForm.id) {
@ -298,15 +310,6 @@ export default {
});
});
} else {
// extraParams
if (extraParams && typeof extraParams === "object") {
for (const [key, value] of Object.entries(extraParams)) {
this.$set(this.dataForm, key, value);
console.log('[DialogJustForm] setting: ', key, value)
}
}
this.loadingStatus = false;
}
});

ファイルの表示

@ -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);
},
},

ファイルの表示

@ -451,10 +451,11 @@ export default {
if (this.attachListQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.forEach((item) => {
let found = item[this.attachListQueryExtra];
if (found !== null && found !== undefined) extraParams = found;
if (found !== null && found !== undefined) extraParams = item;
});
}
this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`)
this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams);
});
},

ファイルの表示

@ -29,9 +29,9 @@ export default function () {
prop: "operations",
name: "操作",
fixed: "right",
width: 160,
width: 120,
subcomponent: TableOperaionComponent,
options: ['add', { name: 'edit', enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual'} }] // 只有 injectRow.task 为手动时,才允许编辑
options: [{ name: 'edit', enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual' } }] // 只有 injectRow.task 为手动时,才允许编辑
},
];

ファイルの表示

@ -24,7 +24,7 @@ export default {
computed: {
// id
id() {
return this.$route.params.id || "";
return this.$route.query.id || "";
},
},
data() {
@ -39,10 +39,10 @@ export default {
},
watch: {
$route: {
handler: function (val) {
if (val.params.id) {
handler: function (route) {
if (route.query.id) {
this.triggerUpdateKey = Math.random().toString()
console.log('[$oute changed] val.params.id', val.params.id, this.triggerUpdateKey)
console.log('[$oute changed] val.params.id', route.query.id, this.triggerUpdateKey)
}
},
immediate: true,

ファイルの表示

@ -212,7 +212,7 @@ export default {
case 'view-batch': {
this.$router.push({
name: toRouter,
params: {
query: {
id: data // id
}
})