Commit b00886d2 by 李伟康

提交

1 parent 8d7516fc
...@@ -220,6 +220,7 @@ export default { ...@@ -220,6 +220,7 @@ export default {
const { editGroupText, addState, $message } = this const { editGroupText, addState, $message } = this
try { try {
if (!editGroupText.newGroup) throw '请输入话术组!' if (!editGroupText.newGroup) throw '请输入话术组!'
if (addState) { if (addState) {
this.chatGroup.map(e => { this.chatGroup.map(e => {
if (e.value == editGroupText.newGroup) throw '该话术组已存在!' if (e.value == editGroupText.newGroup) throw '该话术组已存在!'
...@@ -233,11 +234,19 @@ export default { ...@@ -233,11 +234,19 @@ export default {
type: 'success' type: 'success'
}) })
} else { } else {
const { data, message } = await this.$apis.chatLibrary.updateChatGroup(editGroupText) const { isAdd } = this.chatGroup.find(e => e.value == editGroupText.oldGroup)
$message({ if (isAdd) {
message: data ? '修改成功' : message, $message({
type: data ? 'success' : 'error' message: '修改成功',
}) type: 'success'
})
} else {
const { data, message } = await this.$apis.chatLibrary.updateChatGroup(editGroupText)
$message({
message: data ? '修改成功' : message,
type: data ? 'success' : 'error'
})
}
this.chatGroup.find(e => { this.chatGroup.find(e => {
if (e.value == editGroupText.oldGroup) { if (e.value == editGroupText.oldGroup) {
e.value = editGroupText.newGroup e.value = editGroupText.newGroup
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!