From 1976c4cb68728fe417210cf80fb223473db42808 Mon Sep 17 00:00:00 2001 From: spllzh <28668817@qq.com> Date: Sat, 16 Aug 2025 06:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=95=E9=9F=B3=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/index.js | 6 +++- package.json | 4 ++- src/router/index.js | 51 +++++++++++++++++++++++++++++- src/views/video/index.vue | 66 ++++++++++++++++++++++++++++++++------- vue.config.js | 34 ++++++++++++++++++++ 5 files changed, 146 insertions(+), 15 deletions(-) diff --git a/mock/index.js b/mock/index.js index c514c13..315eda7 100644 --- a/mock/index.js +++ b/mock/index.js @@ -3,10 +3,14 @@ const { param2Obj } = require('./utils') const user = require('./user') const table = require('./table') +const stock = require('./stock') +const dealership = require('./dealership') const mocks = [ ...user, - ...table + ...table, + ...stock, + ...dealership ] // for front mock diff --git a/package.json b/package.json index 2413824..b1a8219 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", "author": "Pan ", "scripts": { - "dev": "vue-cli-service serve", + "dev": "set CHOKIDAR_USEPOLLING=true && set CHOKIDAR_INTERVAL=1000 && vue-cli-service serve", + "dev:no-watch": "vue-cli-service serve --watch false", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", @@ -16,6 +17,7 @@ "dependencies": { "axios": "0.18.1", "core-js": "3.6.5", + "echarts": "^5.4.3", "element-ui": "2.13.2", "js-cookie": "2.2.0", "normalize.css": "7.0.0", diff --git a/src/router/index.js b/src/router/index.js index 394c9d5..2797b69 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -50,7 +50,7 @@ export const constantRoutes = [ children: [{ path: 'dashboard', name: 'Dashboard', - component: () => import('@/views/dashboard/index'), + component: () => import('@/views/dashboard/data-dashboard'), meta: { title: '首页', icon: 'dashboard', affix: true } }] }, @@ -66,6 +66,18 @@ export const constantRoutes = [ } ] }, + { + path: '/audio-statistics', + component: Layout, + children: [ + { + path: 'index', + name: 'AudioStatistics', + component: () => import('@/views/audio-statistics/index'), + meta: { title: '录音统计', icon: 'el-icon-data-analysis' } + } + ] + }, { path: '/video', component: Layout, @@ -143,6 +155,43 @@ export const constantRoutes = [ } ] }, + { + path: '/knowledge', + component: Layout, + redirect: '/knowledge/index', + name: 'Knowledge', + meta: { + title: '知识中心', + icon: 'el-icon-document' + }, + children: [ + { + path: 'index', + name: 'KnowledgeCenter', + component: () => import('@/views/knowledge/index'), + meta: { title: '知识中心', icon: 'el-icon-document' } + }, + { + path: 'dialogue-mining', + name: 'DialogueMining', + component: () => import('@/views/knowledge/dialogue-mining'), + meta: { title: '对话挖掘', icon: 'el-icon-chat-dot-round' } + }, + { + path: 'knowledge-base', + name: 'KnowledgeBase', + component: () => import('@/views/knowledge/knowledge-base'), + meta: { title: '知识库', icon: 'el-icon-document' } + }, + { + path: 'terminology', + name: 'Terminology', + component: () => import('@/views/knowledge/terminology'), + meta: { title: '汽车术语库', icon: 'el-icon-collection' } + } + ] + }, + { path: '/nested', component: Layout, diff --git a/src/views/video/index.vue b/src/views/video/index.vue index 295e216..5001e5c 100644 --- a/src/views/video/index.vue +++ b/src/views/video/index.vue @@ -281,6 +281,8 @@ import { updateVideo, deleteVideo } from '@/api/video' +import { getDealershipList } from '@/api/dealership' +import { getSalesList } from '@/api/sales' export default { name: 'Video', @@ -342,23 +344,15 @@ export default { ] }, // 门店选项 - dealershipOptions: [ - { value: '1', label: '销售演示-上汽' }, - { value: '2', label: 'DCC演示' }, - { value: '3', label: '销售演示-奔驰' }, - { value: '4', label: '销售演示-比亚迪' } - ], + dealershipOptions: [], // 销售选项 - salesOptions: [ - { value: '1', label: '销冠【普通】' }, - { value: '2', label: '粤语销售' }, - { value: '3', label: '上海销售' }, - { value: '4', label: '四川销售' } - ] + salesOptions: [] } }, created() { this.getList() + this.getDealershipOptions() + this.getSalesOptions() }, methods: { // 获取列表数据 @@ -435,6 +429,54 @@ export default { }) }, + // 获取门店选项 + getDealershipOptions() { + getDealershipList({ size: 1000 }).then(response => { + if (response.code === 20000) { + const data = response.data.records || response.data.data || response.data || [] + this.dealershipOptions = data.map(item => ({ + value: item.id, + label: item.dealershipName || item.name + })) + } else { + console.error('获取门店选项失败:', response.message) + } + }).catch(error => { + console.error('获取门店选项错误:', error) + // 开发环境使用模拟数据 + this.dealershipOptions = [ + { value: '1', label: '销售演示-上汽' }, + { value: '2', label: 'DCC演示' }, + { value: '3', label: '销售演示-奔驰' }, + { value: '4', label: '销售演示-比亚迪' } + ] + }) + }, + + // 获取销售选项 + getSalesOptions() { + getSalesList({ size: 1000 }).then(response => { + if (response.code === 20000) { + const data = response.data.records || response.data.data || response.data || [] + this.salesOptions = data.map(item => ({ + value: item.id, + label: item.salesName || item.name + })) + } else { + console.error('获取销售选项失败:', response.message) + } + }).catch(error => { + console.error('获取销售选项错误:', error) + // 开发环境使用模拟数据 + this.salesOptions = [ + { value: '1', label: '销冠【普通】' }, + { value: '2', label: '粤语销售' }, + { value: '3', label: '上海销售' }, + { value: '4', label: '四川销售' } + ] + }) + }, + // 查询 handleQuery() { this.queryParams.current = 1 diff --git a/vue.config.js b/vue.config.js index 6211327..b858ee5 100644 --- a/vue.config.js +++ b/vue.config.js @@ -37,6 +37,23 @@ module.exports = { errors: true }, // before: require('./mock/mock-server.js'), // 注释掉 mock 服务器 + watchOptions: { + ignored: [ + '**/node_modules/**', + '**/DumpStack.log.tmp', + '**/DumpStack.log', + '**/System Volume Information/**', + '**/Windows/**', + '**/Program Files/**', + '**/Program Files (x86)/**', + '**/pagefile.sys', + '**/hiberfil.sys', + '**/swapfile.sys', + '**/D:/**' + ], + poll: 1000, + aggregateTimeout: 300 + }, proxy: { '/api': { target: 'http://localhost:9060', // 从环境变量获取后端服务器地址 @@ -56,6 +73,23 @@ module.exports = { alias: { '@': resolve('src') } + }, + // 解决 Windows 下 chokidar 文件监听问题 + watchOptions: { + ignored: [ + '**/node_modules/**', + '**/DumpStack.log.tmp', + '**/DumpStack.log', + '**/System Volume Information/**', + '**/Windows/**', + '**/Program Files/**', + '**/Program Files (x86)/**', + '**/pagefile.sys', + '**/hiberfil.sys', + '**/swapfile.sys' + ], + poll: 1000, + aggregateTimeout: 300 } }, chainWebpack(config) {