feat: 新增聊天机器人

This commit is contained in:
Shen 2024-09-04 15:12:16 +08:00
parent 0f380ec86e
commit a647255179
2 changed files with 26 additions and 8 deletions

View File

@ -6,10 +6,27 @@
<script>
export default {
name: 'App'
name: 'App',
mounted() {
// console.log('')
//
window.difyChatbotConfig = {
token: 'pEaqgEzss5GXwtBk',
baseUrl: 'http://9552chyh1609.vicp.fun'
};
//
const script = document.createElement('script');
script.src = 'http://9552chyh1609.vicp.fun/embed.min.js';
script.id = 'pEaqgEzss5GXwtBk';
script.defer = true;
document.head.appendChild(script);
},
}
</script>
<style lang="scss" scoped>
#dify-chatbot-bubble-button {
background-color: #1C64F2 !important;
}
</style>

View File

@ -102,7 +102,7 @@
>
<el-select v-model="user.deptId" placeholder="请选择">
<el-option
v-for="(dep, index) in departmentList"
v-for="dep in departmentList"
:key="dep.id"
:label="dep.deptName"
:value="dep.id"
@ -232,7 +232,7 @@ export default {
queryInfo.name = this.name
}
const resOfFetchUserList = await this.$API.user.reqGetUserList(queryInfo)
if (resOfFetchUserList.code == 0) {
if (resOfFetchUserList.code === 0) {
this.total = resOfFetchUserList.data.total
this.users = resOfFetchUserList.data.list
this.loadingOfGetUserList = false
@ -265,7 +265,7 @@ export default {
const resOfAddOrUpdateUser = await this.$API.user[
this.user.id ? 'reqUpdateUser' : 'reqAddUser'
](this.user)
if (resOfAddOrUpdateUser.code == 0) {
if (resOfAddOrUpdateUser.code === 0) {
this.$message({
type: 'success',
message: `${this.user.id ? '修改' : '添加'}用户成功!`
@ -301,7 +301,7 @@ export default {
.then(async() => {
const ids = [row.id]
const resOfDeleteUser = await this.$API.user.reqDeleteUser(ids)
if (resOfDeleteUser.code == 0) {
if (resOfDeleteUser.code === 0) {
this.$message({
type: 'success',
message: '删除成功!'
@ -331,7 +331,7 @@ export default {
ids
)
// console.log(resOfRemoveRolesInBatches);
if (resOfRemoveUsersInBatches.code == 0) {
if (resOfRemoveUsersInBatches.code === 0) {
this.$message({
type: 'success',
message: '批量删除成功!'
@ -351,8 +351,9 @@ export default {
handleSelectionChange(selection) {
this.selectedUsers = selection
},
// id
roleName(id) {
const theRole = this.roles.find((role) => role.id == id)
const theRole = this.roles.find((role) => role.id === id)
if (theRole) {
return theRole.name
}