no message

This commit is contained in:
小陌 2024-01-09 17:37:03 +08:00
parent 4d1695357e
commit c18eda026c
4 changed files with 19 additions and 41 deletions

View File

@ -112,6 +112,11 @@ export default {
Object.assign(this.config, o);
this.loading = true;
if (this.config.param && typeof this.config.param === "object" && this.config.param !== null) {
Object.assign(this.search, this.config.param);
}
this.search.name = this.config.value || this.config.name || this.name;
//
if (typeof this.config.key !== 'undefined' && this.config.key) {
@ -127,7 +132,7 @@ export default {
cacheparameters: this.config.cacheparameters || false
};
this.$http.get(this.config.remoteurl || 'stat/admin/get', this.search, options).then((res) => {
this.$http.get(this.config.url || this.config.remoteurl || 'stat/admin/get', this.search, options).then((res) => {
this.loading = false;
if (res.code == 200) {
//

View File

@ -200,6 +200,19 @@ export default {
},
methods: {
//,
handleSuccess(data, message) {
if (data && this.rowKey && data[this.rowKey]) {
this.tableData.filter(item => item[this.rowKey] === data[this.rowKey]).forEach(item => {
Object.assign(item, data)
})
} else {
this.refresh()
}
this.$message.success(message || "操作成功")
return;
},
//
async operation(o) {

View File

@ -145,26 +145,6 @@ export default {
tabChange() {
this.$refs.table.reload(this.search)
},
//
handleSuccess(data, mode, message) {
if (mode == 'edit') {
if (data) {
this.$refs.table.tableData.filter(item => item[this.key] === data[this.key]).forEach(item => {
Object.assign(item, data, data)
})
} else {
this.$refs.table.refresh()
}
} else {
if (data) {
this.$refs.table.tableData.unshift(data)
} else {
this.$refs.table.reload({})
}
}
this.$message.success(message || "操作成功")
return;
},
//
plus() {
this.$nextTick(() => {

View File

@ -183,26 +183,6 @@ export default {
tabChange() {
this.$refs.table.reload(this.search)
},
//
handleSuccess(data, mode, message) {
if (mode == 'edit') {
if (data) {
this.$refs.table.tableData.filter(item => item[this.key] === data[this.key]).forEach(item => {
Object.assign(item, data, data)
})
} else {
this.$refs.table.refresh()
}
} else {
if (data) {
this.$refs.table.tableData.unshift(data)
} else {
this.$refs.table.reload({})
}
}
this.$message.success(message || "操作成功")
return;
},
//
plus() {
this.$nextTick(() => {