update docs_0810
This commit is contained in:
@@ -151,7 +151,8 @@ export default {
|
||||
if (val && val !== oldVal) {
|
||||
// get list
|
||||
this.page = 1;
|
||||
this.size = "defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
|
||||
this.size =
|
||||
"defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
@@ -180,7 +181,8 @@ export default {
|
||||
inject: ["urls"],
|
||||
mounted() {
|
||||
// 更新页面默认 size
|
||||
const size = "defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
|
||||
const size =
|
||||
"defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
|
||||
this.size = size;
|
||||
|
||||
this.initDataWhenLoad && this.getList();
|
||||
@@ -521,7 +523,9 @@ export default {
|
||||
})
|
||||
.then(() => {
|
||||
this.$http
|
||||
.post(this.urls.detach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } })
|
||||
.post(this.urls.detach, data /* { id: data } */, {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
@@ -562,41 +566,49 @@ export default {
|
||||
break;
|
||||
}
|
||||
case "sync": {
|
||||
let shouldShowOverlay = false;
|
||||
let payload = "";
|
||||
console.log("sync...", type, data);
|
||||
if (typeof data === "object") {
|
||||
const head = data.head;
|
||||
const syncOpt =
|
||||
("options" in head && Array.isArray(head.options) && head.options.find((item) => item.name === "sync")) ||
|
||||
null;
|
||||
if (syncOpt && "showOverlay" in syncOpt && syncOpt.showOverlay) {
|
||||
this.overlayVisible = true;
|
||||
shouldShowOverlay = true;
|
||||
payload = data.id;
|
||||
}
|
||||
} else payload = data;
|
||||
this.$confirm(`是否开始同步`, "提示", {
|
||||
confirmButtonText: "同步",
|
||||
cancelButtonText: "我再想想",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
let shouldShowOverlay = false;
|
||||
let payload = "";
|
||||
// console.log("sync...", type, data);
|
||||
if (typeof data === "object") {
|
||||
const head = data.head;
|
||||
const syncOpt =
|
||||
("options" in head &&
|
||||
Array.isArray(head.options) &&
|
||||
head.options.find((item) => item.name === "sync")) ||
|
||||
null;
|
||||
if (syncOpt && "showOverlay" in syncOpt && syncOpt.showOverlay) {
|
||||
this.overlayVisible = true;
|
||||
shouldShowOverlay = true;
|
||||
payload = data.id;
|
||||
}
|
||||
} else payload = data;
|
||||
|
||||
this.$message({
|
||||
message: "正在发起同步...",
|
||||
type: "success",
|
||||
});
|
||||
|
||||
// 同步单个料仓数据
|
||||
this.$http
|
||||
.post(this.urls.syncSingleUrl, payload, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: res.code === 0 ? "success" : "error",
|
||||
});
|
||||
this.getList();
|
||||
if (shouldShowOverlay) this.overlayVisible = false;
|
||||
this.$message({
|
||||
message: "正在发起同步...",
|
||||
type: "success",
|
||||
});
|
||||
|
||||
// 同步单个料仓数据
|
||||
this.$http
|
||||
.post(this.urls.syncSingleUrl, payload, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: res.code === 0 ? "success" : "error",
|
||||
});
|
||||
this.getList();
|
||||
if (shouldShowOverlay) this.overlayVisible = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user