1.添加手动添加群组的能力
2.添加异步入库的能力
This commit is contained in:
@@ -10,6 +10,13 @@
|
||||
<el-card shadow="hover">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>群机器人管理</span>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
style="float: right; margin-left: 10px;"
|
||||
@click="showAddGroupDialog">
|
||||
添加群组
|
||||
</el-button>
|
||||
<el-input
|
||||
placeholder="搜索群组..."
|
||||
v-model="searchQuery"
|
||||
@@ -107,6 +114,22 @@
|
||||
<el-button @click="permissionDialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 添加群组对话框 -->
|
||||
<el-dialog
|
||||
title="添加群组"
|
||||
:visible.sync="addGroupDialogVisible"
|
||||
width="30%">
|
||||
<el-form :model="addGroupForm" :rules="addGroupRules" ref="addGroupForm">
|
||||
<el-form-item label="群组ID" prop="groupId">
|
||||
<el-input v-model="addGroupForm.groupId" placeholder="请输入群组ID"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addGroupDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitAddGroup">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -123,7 +146,18 @@
|
||||
currentGroupName: '',
|
||||
searchQuery: '',
|
||||
selectedGroups: [],
|
||||
permissionDialogVisible: false
|
||||
permissionDialogVisible: false,
|
||||
// 添加群组相关数据
|
||||
addGroupDialogVisible: false,
|
||||
addGroupForm: {
|
||||
groupId: ''
|
||||
},
|
||||
addGroupRules: {
|
||||
groupId: [
|
||||
{ required: true, message: '请输入群组ID', trigger: 'blur' },
|
||||
{ pattern: /^\S+$/, message: '群组ID不能包含空格', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -237,6 +271,38 @@
|
||||
this.$message.error('更新权限失败: ' + error.message);
|
||||
});
|
||||
},
|
||||
// 显示添加群组对话框
|
||||
showAddGroupDialog() {
|
||||
this.addGroupForm.groupId = '';
|
||||
this.addGroupDialogVisible = true;
|
||||
},
|
||||
|
||||
// 提交添加群组
|
||||
submitAddGroup() {
|
||||
this.$refs.addGroupForm.validate((valid) => {
|
||||
if (valid) {
|
||||
axios.post('/api/robot/add_group', {
|
||||
group_id: this.addGroupForm.groupId
|
||||
})
|
||||
.then(response => {
|
||||
if (response.data.success) {
|
||||
this.$message.success(response.data.message);
|
||||
// 添加新群组到列表
|
||||
if (response.data.group) {
|
||||
this.groups.push(response.data.group);
|
||||
}
|
||||
this.addGroupDialogVisible = false;
|
||||
} else {
|
||||
this.$message.error(response.data.error || '添加失败');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('添加群组失败:', error);
|
||||
this.$message.error('添加群组失败: ' + (error.response?.data?.error || error.message));
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
enableAllPermissions() {
|
||||
this.$confirm('确定要启用所有功能吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -419,4 +485,4 @@
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user