没有选择行内数据时,增家提示消息

This commit is contained in:
renpy 2023-07-28 17:18:28 +08:00
parent 5365c497e6
commit d8cf8b6eb7
3 changed files with 123 additions and 96 deletions

View File

@ -293,41 +293,50 @@ export default {
this.visible = true this.visible = true
}, },
onEdit() { onEdit() {
this.isAdd = false if (this.currentId) {
this.visible = true this.isAdd = false
getAction("/sysDatabase/findInfo", {id:this.currentId}).then(res => { this.visible = true
if (res.success) { getAction("/sysDatabase/findInfo", {id:this.currentId}).then(res => {
this.form.setFieldsValue({ if (res.success) {
username: res.result.username, this.form.setFieldsValue({
password: res.result.password, username: res.result.username,
name: res.result.name, password: res.result.password,
type: res.result.type, name: res.result.name,
port: res.result.port, type: res.result.type,
ipAddress: res.result.ipAddress port: res.result.port,
}); ipAddress: res.result.ipAddress
} else { });
this.$message.warning("This operation fails. Contact your system administrator") } else {
} this.$message.warning("This operation fails. Contact your system administrator")
}) }
})
} else {
this.$message.info("Please select a piece of data")
}
}, },
onDelete() { onDelete() {
let _this = this if (this.currentId) {
this.$confirm({ let _this = this
title: 'Are you sure to delete this item?', this.$confirm({
onOk() { title: 'Are you sure to delete this item?',
deleteAction("/sysDatabase/deleteById", {id:_this.currentId}).then(res => { onOk() {
if (res.success) { deleteAction("/sysDatabase/deleteById", {id:_this.currentId}).then(res => {
_this.$message.success("success") if (res.success) {
_this.getSysDatabase() _this.$message.success("success")
} else { this.currentId=""
_this.$message.warning("This operation fails. Contact your system administrator") _this.getSysDatabase()
} } else {
}) _this.$message.warning("This operation fails. Contact your system administrator")
}, }
onCancel() { })
console.log('Cancel'); },
}, onCancel() {
}); console.log('Cancel');
},
});
} else {
this.$message.info("Please select a piece of data")
}
}, },
onRowClick(record) { onRowClick(record) {
this.currentId = record.id this.currentId = record.id

View File

@ -314,42 +314,51 @@ export default {
this.visible = true this.visible = true
}, },
onEdit() { onEdit() {
this.isAdd = false if (this.currentId) {
this.visible = true this.isAdd = false
getAction("/sysEmail/findInfo", {id:this.currentId}).then(res => { this.visible = true
if (res.success) { getAction("/sysEmail/findInfo", {id:this.currentId}).then(res => {
this.form.setFieldsValue({ if (res.success) {
name: res.result.username, this.form.setFieldsValue({
emailServerAddress: res.result.emailServerAddress, name: res.result.username,
username: res.result.username, emailServerAddress: res.result.emailServerAddress,
password: res.result.password, username: res.result.username,
emilType: res.result.emilType, password: res.result.password,
enabled: res.result.enabled, emilType: res.result.emilType,
port: res.result.port enabled: res.result.enabled,
}); port: res.result.port
} else { });
this.$message.warning("This operation fails. Contact your system administrator") } else {
} this.$message.warning("This operation fails. Contact your system administrator")
}) }
})
} else {
this.$message.info("Please select a piece of data")
}
}, },
onDelete() { onDelete() {
let _this = this if (this.currentId) {
this.$confirm({ let _this = this
title: 'Are you sure to delete this item?', this.$confirm({
onOk() { title: 'Are you sure to delete this item?',
deleteAction("/sysEmail/deleteById", {id:_this.currentId}).then(res => { onOk() {
if (res.success) { deleteAction("/sysEmail/deleteById", {id:_this.currentId}).then(res => {
_this.$message.success("success") if (res.success) {
_this.getSysEmail() _this.$message.success("success")
} else { this.currentId=""
_this.$message.warning("This operation fails. Contact your system administrator") _this.getSysEmail()
} } else {
}) _this.$message.warning("This operation fails. Contact your system administrator")
}, }
onCancel() { })
console.log('Cancel'); },
}, onCancel() {
}); console.log('Cancel');
},
});
} else {
this.$message.info("Please select a piece of data")
}
}, },
onRowClick(record) { onRowClick(record) {
console.log(record); console.log(record);

View File

@ -235,37 +235,46 @@ export default {
this.visible = true this.visible = true
}, },
onEdit() { onEdit() {
this.isAdd = false if (this.currentId) {
this.visible = true this.isAdd = false
getAction("/sysServer/findInfo", {id:this.currentId}).then(res => { this.visible = true
if (res.success) { getAction("/sysServer/findInfo", {id:this.currentId}).then(res => {
this.form.setFieldsValue({ if (res.success) {
name: res.result.name, this.form.setFieldsValue({
ipAddress: res.result.ipAddress name: res.result.name,
}); ipAddress: res.result.ipAddress
} else { });
this.$message.warning("This operation fails. Contact your system administrator") } else {
} this.$message.warning("This operation fails. Contact your system administrator")
}) }
})
} else {
this.$message.info("Please select a piece of data")
}
}, },
onDelete() { onDelete() {
let _this = this if (this.currentId) {
this.$confirm({ let _this = this
title: 'Are you sure to delete this item?', this.$confirm({
onOk() { title: 'Are you sure to delete this item?',
deleteAction("/sysServer/deleteById", {id:_this.currentId}).then(res => { onOk() {
if (res.success) { deleteAction("/sysServer/deleteById", {id:_this.currentId}).then(res => {
_this.$message.success("success") if (res.success) {
_this.getSysServer() _this.$message.success("success")
} else { _this.currentId = ""
_this.$message.warning("This operation fails. Contact your system administrator") _this.getSysServer()
} } else {
}) _this.$message.warning("This operation fails. Contact your system administrator")
}, }
onCancel() { })
console.log('Cancel'); },
}, onCancel() {
}); console.log('Cancel');
},
});
} else {
this.$message.info("Please select a piece of data")
}
}, },
onRowClick(record) { onRowClick(record) {
this.currentId = record.id this.currentId = record.id