no message
This commit is contained in:
parent
4d1695357e
commit
c18eda026c
@ -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) {
|
||||
// 更改配置
|
||||
|
@ -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) {
|
||||
|
||||
|
@ -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(() => {
|
||||
|
@ -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(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user