feat: 知识库开发

This commit is contained in:
kongbeiwu
2025-12-22 01:24:59 +08:00
parent 021b09768a
commit f134659a67
7 changed files with 147 additions and 18 deletions

View File

@@ -1,18 +1,26 @@
<!--
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-21 23:02:06
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2025-12-22 00:34:30
* @FilePath: /project/zn-ai/src/renderer/components/TaskList/Card.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div v-for="item in task" :key="item.id"
class="border border-solid border-[#E5E8EE] rounded-[12px] p-[12px] mb-[12px] task">
<div class="flex items-center pb-[12px]" style="border-bottom: 1px dashed #E5E8EE;">
<img class="w-[24px] h-[24px] rounded-[8px]] mr-[4px]" src="@assets/images/task/xc.png" />
<div class="text-[16px] text-[#171717] font-bold mr-[8px]">{{ item.name }}</div>
<div class="pl-[8px] pr-[8px] bg-[#FFC0C5] text-[12px] text-[#681219] font-bold rounded-[100px]">{{
<div class="pl-[8px] pr-[8px] text-[12px] rounded-[100px]" :class="item.statusColor">{{
item.statusText }}</div>
</div>
<div class="flex items-center mt-[12px]">
<component :is="item.desIcon" :color="item.color" class="w-[15px] mr-[4px]" />
<div class="text-[#FB3748] text-[14px]">{{ item.des }}</div>
<div class="text-[14px]" :class="`text-[${item.color}]`" :style="{ color: item.color }">{{ item.des }}</div>
</div>
<div v-if="item.button" class="mt-[24px]">
<button class="w-[100%] h-[40px] bg-[#2B7FFF] text-white text-[14px] font-bold rounded-[12px]">登录</button>
<div class="mt-[24px]">
<button class="w-[100%] h-[40px] bg-[#2B7FFF] text-white text-[14px] rounded-[12px]">{{ item.statusColor !== 'error' ? '查看' : '处理' }}</button>
</div>
</div>
</template>
@@ -28,6 +36,18 @@ import { task } from '@constant/task'
z-index: 1;
transition: all .2s linear;
}
.task .success {
background-color: #E0FAEC;
color: #1FC16B;
}
.task .error {
background-color: #FFEBEC;
color: #FB3748;
}
.task .warning {
background-color: #FFF3EB;
color: #FA7319;
}
.task:hover {
z-index: 2;

View File

@@ -1,4 +1,12 @@
import { RiHomeLine, RiFileListLine, RiHotelLine, RiChatQuoteLine, RiBarChartBoxAiLine, RiMoreLine, RiSettingsLine } from '@remixicon/vue'
/*
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-21 23:02:06
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2025-12-22 00:42:49
* @FilePath: /project/zn-ai/src/renderer/constant/menus.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { RiHomeLine, RiFileEditLine, RiFileListLine, RiHotelLine, RiChatQuoteLine, RiBarChartBoxAiLine, RiMoreLine, RiSettingsLine } from '@remixicon/vue'
// 菜单列表申明
export interface MenuItem {
@@ -18,6 +26,14 @@ export const menus: MenuItem[] = [
color: '#525866',
activeColor: '#2B7FFF',
url: '/home',
},
{
id: 8,
name: '知识库',
icon: RiFileEditLine,
color: '#525866',
activeColor: '#2B7FFF',
url: '/knowledge',
},
{
id: 2,

View File

@@ -2,7 +2,7 @@
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-21 23:02:06
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2025-12-22 00:00:19
* @LastEditTime: 2025-12-22 00:30:49
* @FilePath: /project/zn-ai/src/renderer/constant/task.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -17,6 +17,7 @@ export interface MenuItem {
color: string
des: string,
statusText: string,
statusColor: string,
button: Boolean,
type: number
}
@@ -27,42 +28,46 @@ export const task: MenuItem[] = [
name: '每日销售数据',
icon: '@assets/images/task/xc.png',
desIcon: RiErrorWarningFill,
color: '#FB3748',
color: '#FA7319',
des: '任务执行中,请勿关闭浏览器',
statusText: '过期',
statusText: '任务执行中',
statusColor: 'warning',
button: true,
type: 1,
},
{
id: 2,
name: '登录失败',
name: '每日销售数据',
icon: '@assets/images/task/xc.png',
desIcon: RiErrorWarningFill,
color: '#FB3748',
des: '请重新登录',
statusText: '失败',
des: '登录已过期',
statusText: '任务执行失败',
statusColor: 'error',
button: true,
type: 1,
},
{
id: 3,
name: '评价回复异常',
name: '每日销售数据',
icon: '@assets/images/task/xc.png',
desIcon: RiErrorWarningFill,
color: '#FB3748',
des: 'xxxxx接口报错',
statusText: '失败',
color: '#1FC16B',
des: '任务执行成功',
statusText: '任务执行成功',
statusColor: 'success',
button: false,
type: 2,
},
{
id: 4,
name: '库存同步异常',
name: '每日销售数据',
icon: '@assets/images/task/xc.png',
desIcon: RiErrorWarningFill,
color: '#FB3748',
des: 'xxxxx接口报错',
statusText: '同步失败',
des: '登录已过期',
statusText: '任务执行失败',
statusColor: 'error',
button: false,
type: 2,
},

View File

@@ -35,6 +35,12 @@ const routes = [
component: () => import("@renderer/views/rate/index.vue"),
meta: { requiresAuth: true },
},
{
path: "knowledge",
name: "Knowledge",
component: () => import("@renderer/views/knowledge/index.vue"),
meta: { requiresAuth: true },
},
{
path: "order",
name: "Order",

View File

@@ -0,0 +1,18 @@
<!--
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-22 01:11:57
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2025-12-22 01:20:51
* @FilePath: /project/zn-ai/src/renderer/views/knowledge/components/EventManagement/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>事件管理11</div>
</template>
<script setup lang="ts">
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,18 @@
<!--
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-22 01:11:57
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2025-12-22 01:24:19
* @FilePath: /project/zn-ai/src/renderer/views/knowledge/components/EventManagement/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>房型管理22</div>
</template>
<script setup lang="ts">
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,46 @@
<!--
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-21 23:02:06
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2025-12-22 01:24:00
* @FilePath: /project/zn-ai/src/renderer/views/knowledge/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="bg-white box-border w-full h-full rounded-[16px] p-[20px]">
<TitleSection title="知识库管理" desc="内容管理" />
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="事件管理" name="first">
<EventManager />
</el-tab-pane>
<el-tab-pane label="房型管理" name="second">
<RoomTypeManager />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="ts" name="Knowledge">
import TitleSection from '@renderer/components/TitleSection/index.vue'
import EventManager from './components/EventManager/index.vue'
import RoomTypeManager from './components/RoomTypeManager/index.vue'
import { ref } from 'vue';
import type { TabsPaneContext } from 'element-plus';
const activeName = ref('first');
const handleClick = (tab: TabsPaneContext, event: Event) => {
console.log(tab, event)
};
</script>
<style scoped>
:deep(.el-tabs__item) {
color: #99A0AE;
}
:deep(.el-tabs__item.is-active) {
color: #2B7FFF;
}
:deep(.el-tabs__active-bar) {
background-color: #2B7FFF;
}
</style>