diff --git a/src/assets/images/ai/icon-delet.png b/src/assets/images/ai/icon-delet.png new file mode 100644 index 0000000..15bfff0 Binary files /dev/null and b/src/assets/images/ai/icon-delet.png differ diff --git a/src/assets/images/ai/icon-edit.png b/src/assets/images/ai/icon-edit.png new file mode 100644 index 0000000..6b4b598 Binary files /dev/null and b/src/assets/images/ai/icon-edit.png differ diff --git a/src/enums/pageEnum.ts b/src/enums/pageEnum.ts index 147cb00..49dc792 100644 --- a/src/enums/pageEnum.ts +++ b/src/enums/pageEnum.ts @@ -20,8 +20,8 @@ export enum EditEnum { export enum PageEnum { // 登录 - BASE_LOGIN = '/chat/1745227092138', - BASE_LOGIN_NAME = 'chat', + BASE_LOGIN = '/ai', + BASE_LOGIN_NAME = 'ai', //重定向 REDIRECT = '/redirect', diff --git a/src/router/base.ts b/src/router/base.ts index 0f9c691..6dbccc8 100644 --- a/src/router/base.ts +++ b/src/router/base.ts @@ -5,7 +5,9 @@ import { PageEnum } from '@/enums/pageEnum' import { GoReload } from '@/components/GoReload' export const LoginRoute: RouteRecordRaw = { - path:'/ai', + // path: PageEnum.BASE_LOGIN, + // name: PageEnum.BASE_LOGIN_NAME, + path: '/ai', name: 'ai', component: () => import('@/views/AI/index.vue'), meta: { @@ -13,18 +15,19 @@ export const LoginRoute: RouteRecordRaw = { }, children: [ { - path: '/', - redirect: '/chat/1745227092138' - }, - { - path: '/chat/:id', - name: 'chat', - component: () => import('@/views/AI/chat/index.vue') + path: '', + redirect: '/myBoard' }, + { path: '/board/:id', name: 'board', component: () => import('@/views/chart/index.vue') + }, + { + path: '/myBoard', + name: 'myBoard', + component: () => import('@/views/AI/myBoard/index.vue') } ] } diff --git a/src/router/router-guards.ts b/src/router/router-guards.ts index a0897e3..044623a 100644 --- a/src/router/router-guards.ts +++ b/src/router/router-guards.ts @@ -8,7 +8,8 @@ const routerAllowList = [ PageEnum.BASE_LOGIN_NAME, // 预览 PreviewEnum.CHART_PREVIEW_NAME, - 'board' + 'board', + 'myBoard' ] export function createRouterGuards(router: Router) { @@ -27,10 +28,9 @@ export function createRouterGuards(router: Router) { if (isErrorPage === -1) { next({ name: PageEnum.ERROR_PAGE_NAME_404 }) } - // @ts-ignore if (!routerAllowList.includes(to.name) && !loginCheck()) { - next({ name: PageEnum.BASE_LOGIN_NAME }) + next({ name: 'myBoard' }) } next() }) diff --git a/src/styles/pages/font.css b/src/styles/pages/font.css new file mode 100644 index 0000000..946dc61 --- /dev/null +++ b/src/styles/pages/font.css @@ -0,0 +1,14 @@ +@font-face { + font-family: "DingTalk JinBuTi-Regular"; + src: url("./font/YouSheBiaoTiHei-2.ttf"); +} + +@font-face { + font-family: "AlibabaPuHuiTi-Regular"; + src: url("./font/AlibabaSans-Regular.otf"); + } + + @font-face { + font-family: "AlibabaPuHuiTi-Medium"; + src: url("./font/AlibabaSans-Medium.otf"); + } \ No newline at end of file diff --git a/src/styles/pages/font/AlibabaSans-Bold.otf b/src/styles/pages/font/AlibabaSans-Bold.otf new file mode 100644 index 0000000..1029756 Binary files /dev/null and b/src/styles/pages/font/AlibabaSans-Bold.otf differ diff --git a/src/styles/pages/font/AlibabaSans-Medium.otf b/src/styles/pages/font/AlibabaSans-Medium.otf new file mode 100644 index 0000000..71a2177 Binary files /dev/null and b/src/styles/pages/font/AlibabaSans-Medium.otf differ diff --git a/src/styles/pages/font/AlibabaSans-Regular.otf b/src/styles/pages/font/AlibabaSans-Regular.otf new file mode 100644 index 0000000..317ebe9 Binary files /dev/null and b/src/styles/pages/font/AlibabaSans-Regular.otf differ diff --git a/src/styles/pages/font/AlimamaShuHeiTi-Bold.ttf b/src/styles/pages/font/AlimamaShuHeiTi-Bold.ttf new file mode 100644 index 0000000..4c9f3cc Binary files /dev/null and b/src/styles/pages/font/AlimamaShuHeiTi-Bold.ttf differ diff --git a/src/styles/pages/font/DIN-Bold.otf b/src/styles/pages/font/DIN-Bold.otf new file mode 100644 index 0000000..782e68e Binary files /dev/null and b/src/styles/pages/font/DIN-Bold.otf differ diff --git a/src/styles/pages/font/DIN-Light.otf b/src/styles/pages/font/DIN-Light.otf new file mode 100644 index 0000000..349739e Binary files /dev/null and b/src/styles/pages/font/DIN-Light.otf differ diff --git a/src/styles/pages/font/DIN-Medium.otf b/src/styles/pages/font/DIN-Medium.otf new file mode 100644 index 0000000..3296d1e Binary files /dev/null and b/src/styles/pages/font/DIN-Medium.otf differ diff --git a/src/styles/pages/font/YouSheBiaoTiHei-2.ttf b/src/styles/pages/font/YouSheBiaoTiHei-2.ttf new file mode 100644 index 0000000..3729151 Binary files /dev/null and b/src/styles/pages/font/YouSheBiaoTiHei-2.ttf differ diff --git a/src/styles/pages/index.scss b/src/styles/pages/index.scss index 1ec6eaf..5c7289b 100644 --- a/src/styles/pages/index.scss +++ b/src/styles/pages/index.scss @@ -1,3 +1,6 @@ + +@import url('./font.css'); + // 页面全局样式 // 去除高德地图 logo .amap-logo { diff --git a/src/views/AI/components/history/index.vue b/src/views/AI/components/history/index.vue index bd72a0c..6e1a1ae 100644 --- a/src/views/AI/components/history/index.vue +++ b/src/views/AI/components/history/index.vue @@ -96,12 +96,12 @@ const getMessageInfo = id => { onMounted(() => { fetchList() - messageList() + // messageList() }) defineExpose({ fetchList, - messageList + // messageList }) diff --git a/src/views/AI/components/logo/index.vue b/src/views/AI/components/logo/index.vue index 28b6ce5..819b0af 100644 --- a/src/views/AI/components/logo/index.vue +++ b/src/views/AI/components/logo/index.vue @@ -1,7 +1,10 @@ @@ -13,15 +16,23 @@ align-items: center; justify-content: center; margin-bottom: 50px; + gap: 10px; .logo-img { - height: 36px; - width: 36px; - margin-right: 10px; + height: 42px; + width: 42px; } .logo-title { - font-size: 28px; + display: flex; + flex-direction: column; + align-items: flex-start; + font-size: 20px; color: #ffffff; font-weight: 400; + font-family: "DingTalk JinBuTi-Regular"; + span{ + display: inline-block; + line-height: 21px; + } } } diff --git a/src/views/AI/index.vue b/src/views/AI/index.vue index 9a7041b..49c7f73 100644 --- a/src/views/AI/index.vue +++ b/src/views/AI/index.vue @@ -11,16 +11,30 @@ :key="index" @click="handlerPath(item.path, index)" > - + - 新建{{ item.name }} + + + + + + + + + + + {{ item.name }} -
@@ -33,11 +47,11 @@ import { useRoute, useRouter } from 'vue-router' import { createProjectApi, historyMessageRoom, historyMessageRoomUpdata } from '@/api/path' import { getUUID } from '@/utils' import { ResultEnum } from '@/enums/httpEnum' -import { AiLogo, AiHistory } from './components' +import { AiLogo } from './components' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' const chartEditStore = useChartEditStore() -import { ref } from 'vue' +import { onMounted, ref } from 'vue' import useMessageRoomStore from '@/store/modules/messageRoom' import { useSystemStore } from '@/store/modules/systemStore/systemStore' @@ -48,45 +62,15 @@ const route = useRoute() const history = ref(null) const menuList = [ - { name: '聊天', path: '/chat' }, - { name: '数据看板', path: '/board' } + { id: 1, name: '新建数据看板', path: 'board' }, + { id: 2, name: '查看我的看板', path: 'myBoard' } ] -const ehcatrsType = ['pie', 'line', 'bar'] + const getCurrentRoute = path => { return route.path.includes(path) } -const saveMessage = async path => { - //聊天室存在聊天记录 - if (useMessageRoom.messageRoom.content.length > 0) { - useMessageRoom.messageRoom.content.forEach(instance => { - if (ehcatrsType.includes(instance.type) && instance.chartInstanceItem) { - instance.chartInstanceItem.dispose() - } - }) - const jsonData = JSON.stringify(useMessageRoom.messageRoom.content) - let res - try { - if (useMessageRoom.messageRoom.id) { - res = await historyMessageRoomUpdata({ content: jsonData, id: useMessageRoom.messageRoom.id }) - } else { - res = await historyMessageRoom({ content: jsonData, createUserId: systemStore.userInfo.userId || 1 }) - } - if (res && res.code == 200) { - useMessageRoom.resetList({ id: undefined, createUserId: undefined, content: [] }) //清空本地 - history.value.messageList() - router.push(path + '/' + Date.now()) - } - } catch { - console.log('保存出错') - router.push(path + '/' + Date.now()) - } - } else { - router.push(path + '/' + Date.now()) - } -} - -const handlerBoard = async path => { +const handlerBoard = async (path = 'board') => { try { // 新增项目 const res = await createProjectApi({ @@ -99,23 +83,23 @@ const handlerBoard = async path => { }) if (res && res.code === ResultEnum.SUCCESS) { const { id } = res.data - router.push(path + '/' + id) + router.push(`/${path}/` + id) } } catch (error) { window['$message'].error(window['$t']('project.create_failure')) } } -const handlerPath = (path, index) => { - history.value.fetchList() - chartEditStore.setComponentList() - chartEditStore.setEdit(false) +onMounted(() => { + // handlerBoard() + // router.push('/myBoard') +}) - saveMessage(path) - - if (index === 1) { - handlerBoard(path) - } +const handlerPath = (path, index) => { + history.value.fetchList() //获取看板历史记录 + chartEditStore.setComponentList() //清空看板本地数据 + chartEditStore.setEdit(false) //设置看板处于新增状态 + handlerBoard(path) //新建一个看板 } @@ -125,9 +109,9 @@ const handlerPath = (path, index) => { color: #fff; display: flex; .left-menu { - width: 12%; + width: 260px; box-sizing: border-box; - padding: 50px 20px; + padding: 41px 30px; background: url('../../assets/images/ai/menu-bg.png'); background-size: 100% 100%; .menu-list { @@ -136,15 +120,19 @@ const handlerPath = (path, index) => { gap: 20px; } .menu-item { + display: flex; + align-items: center; + gap: 5px; color: inherit; text-decoration: none; cursor: pointer; height: 38px; border-radius: 4px 4px 4px 4px; border: 1px solid #474d59; - letter-spacing: 2px; font-size: 14px; + font-weight: 400; + font-family: 'AlibabaPuHuiTi-Regular'; } .active-link, .menu-item:active { diff --git a/src/views/AI/myBoard/index.vue b/src/views/AI/myBoard/index.vue new file mode 100644 index 0000000..0fb88de --- /dev/null +++ b/src/views/AI/myBoard/index.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/src/views/AI/old.vue b/src/views/AI/old.vue new file mode 100644 index 0000000..ff121e3 --- /dev/null +++ b/src/views/AI/old.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/views/chart/ContentEdit/hooks/useDrag.hook.ts b/src/views/chart/ContentEdit/hooks/useDrag.hook.ts index 3da1925..f813a35 100644 --- a/src/views/chart/ContentEdit/hooks/useDrag.hook.ts +++ b/src/views/chart/ContentEdit/hooks/useDrag.hook.ts @@ -59,13 +59,13 @@ export const dragHandle = async (e: DragEvent) => { } //默认切换成动态请求 - if(chartsType.package === 'Charts'){ + if(chartsType.package === 'Charts' || chartsType.package === 'Tables'){ newComponent.request.requestDataType = 1 }else{ newComponent.request.requestDataType =0 } - console.log(newComponent,'创建新图表') + console.log(newComponent,'创建新图表',) //chartsType.package setComponentPosition(newComponent, e.offsetX - newComponent.attr.w / 2, e.offsetY - newComponent.attr.h / 2) chartEditStore.addComponentList(newComponent, false, true)