| | |
| | | }, |
| | | proxy: { |
| | | '/base': { |
| | | target: 'http://aiotlink.com:8189', |
| | | // target: 'http://aiotlink.com:8189', |
| | | target: 'http://192.168.20.116:8089', |
| | | changeOrigin: true, |
| | | ws: true, |
| | | // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''), |
| | |
| | | // secure: false |
| | | }, |
| | | '/api': { |
| | | // target: 'http://192.168.20.116:1080', |
| | | target: 'http://192.168.20.116:8089', |
| | | // target: 'http://192.168.20.158:8089', |
| | | target: 'http://aiotlink.com:8189', |
| | | // target: 'http://aiotlink.com:8189', |
| | | changeOrigin: true, |
| | | ws: true, |
| | | // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''), |
| | | }, |
| | | '/api/v1': { |
| | | // target: 'http://192.168.20.116:1080', |
| | | target: 'http://192.168.20.116:8089', |
| | | // target: 'http://192.168.20.158:8089', |
| | | target: 'http://aiotlink.com:8189', |
| | | // target: 'http://aiotlink.com:8189', |
| | | changeOrigin: true, |
| | | ws: true, |
| | | // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''), |
| | |
| | | |
| | | <a-row :gutter="20"> |
| | | <a-col :span="8"> |
| | | <a-card :title="$t('menu.organization.title')" :bordered="false" :style="{ width: '100%',height: '900px', 'overflow-y': 'auto' }"> |
| | | <a-card |
| | | :title="$t('menu.organization.title')" |
| | | :bordered="false" |
| | | style=" 'width': '100%'; height: calc(100vh - 250px);; 'overflow-y': 'auto' " |
| | | > |
| | | <a-tree |
| | | class="tree-demo" |
| | | draggable |
| | |
| | | > |
| | | <template #extra="nodeData"> |
| | | <IconPlus |
| | | style="position: absolute; right: 60px; font-size: 12px; top: 10px; color: #3370ff;" |
| | | style=" |
| | | position: absolute; |
| | | right: 60px; |
| | | font-size: 12px; |
| | | top: 10px; |
| | | color: #3370ff; |
| | | " |
| | | @click="() => onIconClick(nodeData)" |
| | | /> |
| | | <IconDelete style="position: absolute; right: 40px; font-size: 12px; top: 10px; color: #3370ff;" |
| | | @click="() => onIconClickDelete(nodeData)" /> |
| | | <IconDelete |
| | | style=" |
| | | position: absolute; |
| | | right: 40px; |
| | | font-size: 12px; |
| | | top: 10px; |
| | | color: #3370ff; |
| | | " |
| | | @click="() => onIconClickDelete(nodeData)" |
| | | /> |
| | | </template> |
| | | </a-tree> |
| | | |
| | | </a-card> |
| | | </a-col> |
| | | <a-col :span="16"> |
| | | <a-card :title="$t('menu.organization.detail')" :bordered="false" :style="{ width: '100%' }"> |
| | | <a-card |
| | | :title="$t('menu.organization.detail')" |
| | | :bordered="false" |
| | | :style="{ width: '100%' }" |
| | | > |
| | | <a-form :model="deptform" layout="horizontal"> |
| | | <a-form-item field="parentName" label="上级机构"> |
| | | <a-input v-model="deptform.parentId" /> |
| | | </a-form-item> |
| | | <a-form-item field="status" label="机构状态"> |
| | | <a-switch checked-value="0" unchecked-value="1" v-model="deptform.status"></a-switch> |
| | | <a-switch |
| | | checked-value="0" |
| | | unchecked-value="1" |
| | | v-model="deptform.status" |
| | | ></a-switch> |
| | | </a-form-item> |
| | | <a-form-item field="deptName" label="机构名称"> |
| | | <a-input v-model="deptform.deptName" /> |
| | |
| | | </a-card> |
| | | </a-col> |
| | | </a-row> |
| | | <a-modal width="50%" v-model:visible="visible" title="新增" @cancel="handleCancel" @ok="addDept"> |
| | | <a-modal |
| | | width="50%" |
| | | v-model:visible="visible" |
| | | title="新增" |
| | | @cancel="handleCancel" |
| | | @ok="addDept" |
| | | > |
| | | <a-form :model="deptform" layout="horizontal"> |
| | | <a-form-item field="parentName" label="上级机构"> |
| | | <a-input v-model="deptform.parentName" /> |
| | | </a-form-item> |
| | | <a-form-item field="status" label="机构状态"> |
| | | <a-switch checked-value="0" unchecked-value="1" v-model="deptform.status"></a-switch> |
| | | <a-switch |
| | | checked-value="0" |
| | | unchecked-value="1" |
| | | v-model="deptform.status" |
| | | ></a-switch> |
| | | </a-form-item> |
| | | <a-form-item field="deptName" label="机构名称"> |
| | | <a-input v-model="deptform.deptName" /> |
| | |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { ref } from "vue"; |
| | | import { IconPlus } from "@arco-design/web-vue/es/icon"; |
| | | import { ref } from 'vue'; |
| | | import { IconPlus } from '@arco-design/web-vue/es/icon'; |
| | | import { |
| | | Organization, |
| | | OrganizationAdd, |
| | | OrganizationById, |
| | | OrganizationDelete, |
| | | OrganizationList, |
| | | OrganizationUpdate |
| | | } from "@/api/authority"; |
| | | import Authheader from "@/views/authority/components/authheader.vue"; |
| | | import { Modal } from "@arco-design/web-vue"; |
| | | OrganizationUpdate, |
| | | } from '@/api/authority'; |
| | | import Authheader from '@/views/authority/components/authheader.vue'; |
| | | import { Modal } from '@arco-design/web-vue'; |
| | | |
| | | let visible = ref(false); |
| | | let treeData = ref([]); |
| | | let showLine = ref(true); |
| | | let menuTips = ref(["权限管理", "机构"]); |
| | | let menuTips = ref(['权限管理', '机构']); |
| | | let deptform = ref<Organization>({ |
| | | deptName: "", |
| | | email: "", |
| | | leader: "", |
| | | orderNum: "0", |
| | | parentId: "", |
| | | parentName: "", |
| | | phone: "", |
| | | status: "", |
| | | address: "", |
| | | deptId: "" |
| | | deptName: '', |
| | | email: '', |
| | | leader: '', |
| | | orderNum: '0', |
| | | parentId: '', |
| | | parentName: '', |
| | | phone: '', |
| | | status: '', |
| | | address: '', |
| | | deptId: '', |
| | | }); |
| | | |
| | | const onIconClick = (nodeData) => { |
| | |
| | | |
| | | const addDept = async () => { |
| | | await OrganizationAdd({ |
| | | ...deptform.value |
| | | ...deptform.value, |
| | | } as unknown as Organization).then((res) => { |
| | | OrganizationData(""); |
| | | OrganizationData(''); |
| | | }); |
| | | }; |
| | | |
| | | const onIconClickDelete = (nodeData) => { |
| | | OrganizationDelete(nodeData.deptId).then(() => { |
| | | OrganizationData(""); |
| | | OrganizationData(''); |
| | | }); |
| | | }; |
| | | |
| | |
| | | }; |
| | | const editdept=()=>{ |
| | | OrganizationUpdate({ |
| | | ...deptform.value |
| | | ...deptform.value, |
| | | } as unknown as Organization).then((res) => { |
| | | OrganizationData(""); |
| | | OrganizationData(''); |
| | | Modal.success({ |
| | | title: "保存成功", |
| | | content: "保存成功" |
| | | title: '保存成功', |
| | | content: '保存成功', |
| | | }); |
| | | }); |
| | | } |
| | | }; |
| | | const reset=(id)=>{ |
| | | OrganizationById(id).then((res) => { |
| | | deptform.value = {...res.data}; |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const onDrop = ({ dragNode, dropNode, dropPosition }) => { |
| | | const data = treeData.value; |
| | | OrganizationUpdate({ |
| | | orderNum: "0", parentId: dropNode.deptId, deptId: dragNode.deptId |
| | | orderNum: '0', |
| | | parentId: dropNode.deptId, |
| | | deptId: dragNode.deptId, |
| | | }); |
| | | const loop = (data, key, callback) => { |
| | | data.some((item, index, arr) => { |
| | |
| | | }); |
| | | }; |
| | | |
| | | OrganizationData(""); |
| | | OrganizationData(''); |
| | | </script> |
| | | |
| | | |
| | | <style scoped> |
| | | .tree-demo :deep(.tree-node-dropover) > :deep(.arco-tree-node-title), |
| | |
| | | <a-card |
| | | :title="$t('menu.resource.title')" |
| | | :bordered="false" |
| | | :style="{ 'width': '100%', 'height': '900px', 'overflow-y': 'auto' }" |
| | | style=" 'width': '100%'; height: calc(100vh - 250px); 'overflow-y': 'auto' " |
| | | > |
| | | <a-button @click="() => onIconClick(null)">新增父级菜单</a-button> |
| | | <a-tree |
| | |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { ref } from "vue"; |
| | | import { IconPlus } from "@arco-design/web-vue/es/icon"; |
| | | import { Resource, ResourceAdd, ResourceById, ResourceDelete, ResourceList, ResourceUpdate } from "@/api/authority"; |
| | | import Authheader from "@/views/authority/components/authheader.vue"; |
| | | import { Modal } from "@arco-design/web-vue"; |
| | | import { ref } from 'vue'; |
| | | import { IconPlus } from '@arco-design/web-vue/es/icon'; |
| | | import { |
| | | Resource, |
| | | ResourceAdd, |
| | | ResourceById, |
| | | ResourceDelete, |
| | | ResourceList, |
| | | ResourceUpdate, |
| | | } from '@/api/authority'; |
| | | import Authheader from '@/views/authority/components/authheader.vue'; |
| | | import { Modal } from '@arco-design/web-vue'; |
| | | |
| | | let visible = ref(false); |
| | | let treeData = ref([]); |
| | | let showLine = ref(true); |
| | | let menuTips = ref(["权限管理", "资源"]); |
| | | const fieldNames = { value: "key", label: "value" }; |
| | | let menuTips = ref(['权限管理', '资源']); |
| | | const fieldNames = { value: 'key', label: 'value' }; |
| | | // 0目录 1菜单 2按钮 |
| | | let options = ref([ |
| | | { |
| | | key: "3", |
| | | value: "目录" |
| | | key: '3', |
| | | value: '目录', |
| | | }, |
| | | { |
| | | key: "0", |
| | | value: "菜单" |
| | | key: '0', |
| | | value: '菜单', |
| | | }, |
| | | { |
| | | key: "1", |
| | | value: "按钮" |
| | | } |
| | | key: '1', |
| | | value: '按钮', |
| | | }, |
| | | ]); |
| | | let resourceform = ref<Resource>({ |
| | | component: "", |
| | | createTime: "", |
| | | description: "", |
| | | icon: "", |
| | | menuId: "", |
| | | menuName: "", |
| | | menuType: "", |
| | | orderNum: "", |
| | | parentId: "", |
| | | parentName: "", |
| | | component: '', |
| | | createTime: '', |
| | | description: '', |
| | | icon: '', |
| | | menuId: '', |
| | | menuName: '', |
| | | menuType: '', |
| | | orderNum: '', |
| | | parentId: '', |
| | | parentName: '', |
| | | children: [], |
| | | path: "", |
| | | perms: "", |
| | | status: "", |
| | | syesourcetype: "", |
| | | target: "", |
| | | updateTime: "" |
| | | path: '', |
| | | perms: '', |
| | | status: '', |
| | | syesourcetype: '', |
| | | target: '', |
| | | updateTime: '', |
| | | }); |
| | | |
| | | const onIconClick = (nodeData) => { |
| | |
| | | resourceform.value.parentId = nodeData.menuId; |
| | | resourceform.value.parentName = nodeData.menuName; |
| | | } |
| | | resourceform.value.component = ""; |
| | | resourceform.value.createTime = ""; |
| | | resourceform.value.description = ""; |
| | | resourceform.value.icon = ""; |
| | | resourceform.value.menuId = ""; |
| | | resourceform.value.menuName = ""; |
| | | resourceform.value.menuType = ""; |
| | | resourceform.value.orderNum = "0"; |
| | | resourceform.value.path = ""; |
| | | resourceform.value.perms = ""; |
| | | resourceform.value.status = ""; |
| | | resourceform.value.syesourcetype = ""; |
| | | resourceform.value.component = ''; |
| | | resourceform.value.createTime = ''; |
| | | resourceform.value.description = ''; |
| | | resourceform.value.icon = ''; |
| | | resourceform.value.menuId = ''; |
| | | resourceform.value.menuName = ''; |
| | | resourceform.value.menuType = ''; |
| | | resourceform.value.orderNum = '0'; |
| | | resourceform.value.path = ''; |
| | | resourceform.value.perms = ''; |
| | | resourceform.value.status = ''; |
| | | resourceform.value.syesourcetype = ''; |
| | | |
| | | visible.value = true; |
| | | }; |
| | | |
| | | const addresource = async () => { |
| | | await ResourceAdd({ |
| | | ...resourceform.value |
| | | ...resourceform.value, |
| | | } as unknown as Resource).then((res) => { |
| | | ResourceData(""); |
| | | ResourceData(''); |
| | | }); |
| | | }; |
| | | |
| | | const onIconClickDelete = (nodeData) => { |
| | | ResourceDelete(nodeData.menuId).then(() => { |
| | | ResourceData(""); |
| | | ResourceData(''); |
| | | }); |
| | | }; |
| | | |
| | |
| | | }; |
| | | const editresource = () => { |
| | | ResourceUpdate({ |
| | | ...resourceform.value |
| | | ...resourceform.value, |
| | | } as unknown as Resource).then((res) => { |
| | | ResourceData(""); |
| | | ResourceData(''); |
| | | Modal.success({ |
| | | title: "保存成功", |
| | | content: "保存成功" |
| | | title: '保存成功', |
| | | content: '保存成功', |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | const onDrop = ({ dragNode, dropNode, dropPosition }) => { |
| | | const data = treeData.value; |
| | | ResourceUpdate({ |
| | | orderNum: "0", |
| | | orderNum: '0', |
| | | parentId: dropNode.menuId, |
| | | menuId: dragNode.menuId |
| | | menuId: dragNode.menuId, |
| | | }); |
| | | const loop = (data, key, callback) => { |
| | | data.some((item, index, arr) => { |
| | |
| | | }); |
| | | }; |
| | | |
| | | ResourceData(""); |
| | | ResourceData(''); |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | <div class="container"> |
| | | <authheader :items="menuTips"></authheader> |
| | | <a-card ref="account" class="general-card"> |
| | | <a-row> |
| | | <div class="table-page-search-wrapper"> |
| | | <div class="search-wrapper"> |
| | | <div> |
| | | <a-input |
| | | v-model="formModel.name" |
| | | :style="{ width: '320px' }" |
| | | :placeholder="$t('请输入')" |
| | | /> |
| | | </div> |
| | | <div> |
| | | <a-button |
| | | type="primary" |
| | | @click="search" |
| | | style="margin-right: 20px; margin-left: 10px" |
| | | > |
| | | <template #icon> |
| | | <icon-search /> |
| | | </template> |
| | | {{ $t('searchTable.form.search') }} |
| | | </a-button> |
| | | <a-button @click="reset"> |
| | | <template #icon> |
| | | <icon-refresh /> |
| | | </template> |
| | | {{ $t('searchTable.form.reset') }} |
| | | </a-button> |
| | | </div> |
| | | </div> |
| | | <div class="search-wrapper"> |
| | | <div> |
| | | <a-space> |
| | | <a-button type="primary" :align="'right'" @click="operation(0)" |
| | | >+ 新建账户</a-button |
| | | > |
| | | </a-space></div |
| | | > |
| | | <div class="wrapper-icon"> |
| | | <a-tooltip :content="$t('searchTable.actions.refresh')"> |
| | | <div class="action-icon" @click="search"> |
| | | <icon-refresh size="18" /> |
| | | </div> |
| | | </a-tooltip> |
| | | <a-dropdown @select="handleSelectDensity"> |
| | | <a-tooltip :content="$t('searchTable.actions.density')"> |
| | | <div class="action-icon"> |
| | | <icon-line-height size="18" /> |
| | | </div> |
| | | </a-tooltip> |
| | | <template #content> |
| | | <a-doption |
| | | v-for="item in densityList" |
| | | :key="item.value" |
| | | :value="item.value" |
| | | :class="{ active: item.value === size }" |
| | | > |
| | | <span>{{ item.name }}</span> |
| | | </a-doption> |
| | | </template> |
| | | </a-dropdown> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <a-row> |
| | | <a-col :flex="2"></a-col> |
| | | <a-col :flex="1"> |
| | | <a-form :model="formModel" style="margin-top: 30px"> |
| | |
| | | </a-form> |
| | | </a-col> |
| | | <a-col :flex="'200px'" style="text-align: right; margin-top: 30px"> |
| | | <a-button @click="reset" style="margin-right: 20px"> |
| | | <template #icon> |
| | | <icon-refresh /> |
| | | </template> |
| | | {{ $t('searchTable.form.reset') }} |
| | | </a-button> |
| | | <a-button type="primary" @click="search"> |
| | | <a-button type="primary" @click="search" style="margin-right: 20px"> |
| | | <template #icon> |
| | | <icon-search /> |
| | | </template> |
| | | {{ $t('searchTable.form.search') }} |
| | | </a-button> |
| | | <a-button @click="reset"> |
| | | <template #icon> |
| | | <icon-refresh /> |
| | | </template> |
| | | {{ $t('searchTable.form.reset') }} |
| | | </a-button> |
| | | </a-col> |
| | | </a-row> |
| | | <a-divider style="margin-top: 0" /> |
| | | </a-row> --> |
| | | <!-- <a-divider style="margin-top: 0" /> |
| | | <a-row style="margin-bottom: 16px"> |
| | | <a-col :span="12"> |
| | | <a-space> |
| | |
| | | </template> |
| | | </a-dropdown> |
| | | </a-col> |
| | | </a-row> |
| | | </a-row> --> |
| | | <a-table |
| | | row-key="id" |
| | | :loading="loading" |
| | |
| | | let editform = ref<User>({ |
| | | createTime: '', |
| | | dept: undefined, |
| | | deptName:"", |
| | | deptName: '', |
| | | email: '', |
| | | nickName: '', |
| | | phoneNumber: '', |
| | |
| | | record.resources.forEach((val) => { |
| | | checkStrictlyMenu.value.push({ |
| | | menuId: val.menuId, |
| | | menuName: val.menuName |
| | | menuName: val.menuName, |
| | | }); |
| | | checkedKeysMenu.value.push(val.menuId); |
| | | expandKdysMenu.value.push(val.menuId); |
| | |
| | | record.knowledges.forEach((val) => { |
| | | checkStrictlyKnowledge.value.push({ |
| | | knowledgeId: val.id, |
| | | knowledgeName: val.name |
| | | knowledgeName: val.name, |
| | | }); |
| | | checkedKeysKnowledge.value.push(val.id); |
| | | }); |
| | |
| | | record.dialogs.forEach((val) => { |
| | | checkStrictlyDialog.value.push({ |
| | | dialogId: val.id, |
| | | dialogName: val.name |
| | | dialogName: val.name, |
| | | }); |
| | | checkedKeysDialog.value.push(val.id); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | //机构 |
| | | if (t == 5) { |
| | |
| | | record.dept.forEach((val) => { |
| | | checkStrictly.value.push({ |
| | | deptId: val.deptId, |
| | | deptName: val.deptName |
| | | deptName: val.deptName, |
| | | }); |
| | | checkedKeys.value.push(val.deptId); |
| | | expandKdys.value.push(val.deptId); |
| | |
| | | if (user.dept) { |
| | | for (const d of user.dept) { |
| | | if (user.deptName) { |
| | | user.deptName += d.deptName + ","; |
| | | user.deptName += d.deptName + ','; |
| | | } else { |
| | | user.deptName = d.deptName + ","; |
| | | user.deptName = d.deptName + ','; |
| | | } |
| | | } |
| | | } |
| | |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | <style scoped lang="less"> |
| | | .card-demo { |
| | | width: 460px; |
| | | margin-left: 24px; |
| | |
| | | .card-demo:hover { |
| | | transform: translateY(-4px); |
| | | } |
| | | .table-page-search-wrapper { |
| | | padding-top: 20px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | padding-bottom: 20px; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | .search-wrapper { |
| | | display: flex; |
| | | .wrapper-icon { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-left: 40px; |
| | | // margin-right: 40px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="less"> |
| | | .ant-table-wrapper { |
| | | .ant-table-tbody { |
| | | tr { |
| | | td { |
| | | .ant-table-row-cell-break-word { |
| | | .ant-table-column-sorter { |
| | | display: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .search-wrapper { |
| | | display: flex; |
| | | .wrapper-icon { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-left: 40px; |
| | | // margin-right: 40px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="less"> |
| | | .ant-table-wrapper { |
| | | .ant-table-tbody { |
| | | tr { |
| | | td { |
| | | .ant-table-row-cell-break-word { |
| | | .ant-table-column-sorter { |
| | | display: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="less" scoped> |
| | | .table-page-search-wrapper { |
| | | .ant-form-inline { |
| | | :deep(.ant-form-item) { |
| | | display: flex; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | 'searchTable.size.large': '偏大', |
| | | // actions |
| | | 'searchTable.actions.refresh': '刷新', |
| | | 'searchTable.actions.density': '密度', |
| | | 'searchTable.actions.density': '行高', |
| | | 'searchTable.actions.columnSetting': '列设置', |
| | | }; |
| | |
| | | <a-scrollbar |
| | | class="left-list" |
| | | style=" |
| | | height: calc(100vh - 160px); |
| | | height: calc(100vh - 250px); |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | " |
| | | > |
| | | <div |
| | | class="item" |
| | | class="item left-list-item" |
| | | v-for="session in sessionList" |
| | | @click="querySessionDetail(session)" |
| | | :class="{ isLeftActive: activeSessionId === session.id }" |
| | |
| | | maxRows: 5, |
| | | }" |
| | | /> |
| | | </div> |
| | | <div style="margin-left: 10px"> |
| | | <div class="btn-send"> |
| | | <!-- <icon-send size="32" /> --> |
| | | <a-button |
| | | :disabled="chatDis" |
| | | @click="sentClick" |
| | | type="primary" |
| | | style="border-radius: 24px" |
| | | :loading="loading" |
| | | size="large" |
| | | >发送</a-button |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </a-card> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="right-tag"> |
| | | <a-space> |
| | | <a-button type="primary" shape="round" size="mini" class="btn" |
| | | >全部 |
| | | </a-button> |
| | |
| | | <a-button type="outline" shape="round" size="mini" class="btn" |
| | | >知识学习 |
| | | </a-button> |
| | | </a-space> |
| | | <a-space style="margin-top: 10px"> |
| | | <a-button type="outline" shape="round" size="mini" class="btn" |
| | | >效率提升 |
| | | </a-button> |
| | | </a-space> |
| | | <!-- <a-space> |
| | | <a-button type="primary" shape="round" size="mini" class="btn" |
| | | >全部 |
| | | </a-button> |
| | | <a-button type="outline" shape="round" size="mini" class="btn" |
| | | >文档创作 |
| | | </a-button> |
| | | <a-button type="outline" shape="round" size="mini" class="btn" |
| | | >知识学习 |
| | | </a-button> |
| | | <a-button type="outline" shape="round" size="mini" class="btn" |
| | | >效率提升 |
| | | </a-button> |
| | | </a-space> --> |
| | | <!-- <a-space style="margin-top: 10px"> |
| | | |
| | | </a-space> --> |
| | | </div> |
| | | <div class="right-list"> |
| | | <div class="right-item"> |
| | |
| | | getSessionDetailsApi, |
| | | sessionListApi, |
| | | } from '@/api/session'; |
| | | import { getAuthorization } from "@/utils/auth"; |
| | | |
| | | import { getAuthorization } from '@/utils/auth'; |
| | | |
| | | const sessionDetailList = ref([]); //根据会话id出来的会话详情 |
| | | const sessionList = ref([]); //会话列表 |
| | | const modalObj = reactive({ add: false }); |
| | | const chatDis = ref(false); |
| | | const loading = ref(false); |
| | | |
| | | const currIndex = ref(0); |
| | | const displayedText = ref(''); // 正在显示的文字 |
| | |
| | | const sendMessage = async (event) => { |
| | | event.preventDefault(); |
| | | chatDis.value = true; |
| | | loading.value = true; |
| | | if (!activeSessionId.value) { |
| | | Message.warning('请选择会话'); |
| | | chatDis.value = false; |
| | | loading.value = false; |
| | | return; |
| | | } |
| | | |
| | | // if (displayedText.value) { |
| | | // querySessionList(); |
| | | // } |
| | | |
| | | if (inputMsg.value) { |
| | | sessionDetailList.value.push({ "content": inputMsg.value, "role": "user" }); |
| | | sessionDetailList.value.push({ "role": "last" }); |
| | | sessionDetailList.value.push({ content: inputMsg.value, role: 'user' }); |
| | | sessionDetailList.value.push({ role: 'last' }); |
| | | refreshScroll(); |
| | | const response = await fetch("/api/tech/cloudminds/query?modeltype=localragflow", { |
| | | const response = await fetch( |
| | | '/api/tech/cloudminds/query?modeltype=localragflow', |
| | | { |
| | | method: 'POST', |
| | | headers: { |
| | | 'Authorization': getAuthorization(), |
| | |
| | | conversation_id: activeSessionId.value, |
| | | messages: inputMsg.value, |
| | | }), |
| | | }); |
| | | } |
| | | ); |
| | | |
| | | const reader = response?.body |
| | | ?.pipeThrough(new TextDecoderStream()) |
| | |
| | | const x = await reader?.read(); |
| | | if (x) { |
| | | const { done, value } = x; |
| | | console.log(x, 999); |
| | | try { |
| | | const val = JSON.parse(value?.data || ''); |
| | | const d = val?.data; |
| | | if (typeof d !== "boolean") { |
| | | |
| | | console.info("data:", d); |
| | | if (typeof d !== 'boolean') { |
| | | console.info('data:', d); |
| | | streamStr.value = d.content; |
| | | startDisplayStr(); |
| | | } |
| | |
| | | } |
| | | if (done) { |
| | | console.info('done'); |
| | | displayedText.value = ''; |
| | | querySessionList(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | chatDis.value=false; |
| | | loading.value = false; |
| | | inputMsg.value = ''; |
| | | } else { |
| | | Message.warning('消息不能为空'); |
| | |
| | | const { code, data } = await sessionListApi(selectValue.value); |
| | | if (code === 200) { |
| | | sessionList.value = data; |
| | | activeSessionId.value = data[0].id; |
| | | querySessionDetail(data[0]); |
| | | } else { |
| | | Message.warning('查询失败'); |
| | | } |
| | |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .isLeftActive { |
| | | background-color: lightgrey; |
| | | background-color: #ededf5; |
| | | } |
| | | .left-list-item { |
| | | margin-bottom: 2px; |
| | | } |
| | | .left-list-item:hover { |
| | | background-color: #ededf5; |
| | | } |
| | | |
| | | .light { |
| | |
| | | border-radius: 10px; |
| | | margin-top: 10px; |
| | | padding: 10px; |
| | | height: 120px; |
| | | background-color: lightcyan; |
| | | |
| | | min-height: 120px; |
| | | background-color: #e9f3ff; |
| | | .item-content { |
| | | color: #666; |
| | | } |
| | | .item-title { |
| | | text-align: center; |
| | | line-height: 40px; |
| | | font-size: 20px; |
| | | font-family: 黑体; |
| | | color: black; |
| | | color: #333; |
| | | } |
| | | } |
| | | } |
| | |
| | | flex: 1 1; |
| | | flex-direction: column; |
| | | overflow: hidden; |
| | | position: relative; |
| | | :deep(.arco-textarea-wrapper) { |
| | | border-radius: 24px; |
| | | } |
| | | |
| | | .btn-send { |
| | | position: absolute !important; |
| | | right: 5px; |
| | | bottom: 5px; |
| | | z-index: 10; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | .right-tag { |
| | | margin-top: 20px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | flex-wrap: wrap; |
| | | :deep(.arco-btn-size-mini.arco-btn-shape-round) { |
| | | margin-bottom: 10px !important; |
| | | } |
| | | } |
| | | |
| | | .right-list { |
| | |
| | | border-radius: 10px; |
| | | margin-top: 10px; |
| | | padding: 10px; |
| | | height: 120px; |
| | | background-color: lightcyan; |
| | | min-height: 120px; |
| | | background-color: #e9f3ff; |
| | | |
| | | .item-title { |
| | | text-align: center; |
| | | line-height: 40px; |
| | | font-size: 20px; |
| | | font-family: 黑体; |
| | | color: black; |
| | | color: #333; |
| | | } |
| | | } |
| | | } |