From 449d1191ff8212555fc9851ac9611f1da5d1b1d4 Mon Sep 17 00:00:00 2001 From: scholar <1145227973@qq.com> Date: Sat, 4 May 2024 22:28:37 +0800 Subject: [PATCH 01/53] =?UTF-8?q?fix=E5=90=8C=E6=AF=94=E7=8E=AF=E6=AF=94?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=AE=A1=E7=AE=97=E7=9A=84bug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ContractCountPerformance.vue | 14 +++++++------- .../components/ContractPricePerformance.vue | 14 +++++++------- .../components/ReceivablePricePerformance.vue | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/views/crm/statistics/performance/components/ContractCountPerformance.vue b/src/views/crm/statistics/performance/components/ContractCountPerformance.vue index f135caa8..5dc4d9e7 100644 --- a/src/views/crm/statistics/performance/components/ContractCountPerformance.vue +++ b/src/views/crm/statistics/performance/components/ContractCountPerformance.vue @@ -57,13 +57,13 @@ const echartsOption = reactive({ data: [] }, { - name: '同比增长率(%)', + name: '环比增长率(%)', type: 'line', yAxisIndex: 1, data: [] }, { - name: '环比增长率(%)', + name: '同比增长率(%)', type: 'line', yAxisIndex: 1, data: [] @@ -166,7 +166,7 @@ const loadData = async () => { (s: StatisticsPerformanceRespVO) => s.lastMonthCount ) echartsOption.series[3]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastMonthCount !== 0 ? (s.currentMonthCount / s.lastMonthCount*100).toFixed(2) : 'NULL' + (s: StatisticsPerformanceRespVO) => s.lastMonthCount !== 0 ? ((s.currentMonthCount - s.lastMonthCount) / s.lastMonthCount*100).toFixed(2) : 'NULL' ) } if (echartsOption.series && echartsOption.series[2] && echartsOption.series[2]['data']) { @@ -174,7 +174,7 @@ const loadData = async () => { (s: StatisticsPerformanceRespVO) => s.lastYearCount ) echartsOption.series[4]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastYearCount !== 0 ? (s.currentMonthCount / s.lastYearCount*100).toFixed(2) : 'NULL' + (s: StatisticsPerformanceRespVO) => s.lastYearCount !== 0 ? ((s.currentMonthCount - s.lastYearCount) / s.lastYearCount*100).toFixed(2) : 'NULL' ) } @@ -188,7 +188,7 @@ const loadData = async () => { // 初始化数据 const columnsData = reactive([]); const tableData = reactive([{title: '当月合同数量统计(个)'}, {title: '上月合同数量统计(个)'}, - {title: '去年当月合同数量统计(个)'}, {title: '同比增长率(%)'}, {title: '环比增长率(%)'}]) + {title: '去年当月合同数量统计(个)'}, {title: '环比增长率(%)'}, {title: '同比增长率(%)'}]) // 定义 convertListData 方法,数据行列转置,展示每月数据 const convertListData = () => { @@ -202,8 +202,8 @@ const convertListData = () => { tableData[0]['prop' + index] = item.currentMonthCount tableData[1]['prop' + index] = item.lastMonthCount tableData[2]['prop' + index] = item.lastYearCount - tableData[3]['prop' + index] = item.lastMonthCount !== 0 ? (item.currentMonthCount / item.lastMonthCount).toFixed(2) : 'NULL' - tableData[4]['prop' + index] = item.lastYearCount !== 0 ? (item.currentMonthCount / item.lastYearCount).toFixed(2) : 'NULL' + tableData[3]['prop' + index] = item.lastMonthCount !== 0 ? ((item.currentMonthCount - item.lastMonthCount) / item.lastMonthCount * 100).toFixed(2) : 'NULL' + tableData[4]['prop' + index] = item.lastYearCount !== 0 ? ((item.currentMonthCount - item.lastYearCount) / item.lastYearCount * 100).toFixed(2) : 'NULL' }) } diff --git a/src/views/crm/statistics/performance/components/ContractPricePerformance.vue b/src/views/crm/statistics/performance/components/ContractPricePerformance.vue index 41228a22..0c33dc22 100644 --- a/src/views/crm/statistics/performance/components/ContractPricePerformance.vue +++ b/src/views/crm/statistics/performance/components/ContractPricePerformance.vue @@ -57,13 +57,13 @@ const echartsOption = reactive({ data: [] }, { - name: '同比增长率(%)', + name: '环比增长率(%)', type: 'line', yAxisIndex: 1, data: [] }, { - name: '环比增长率(%)', + name: '同比增长率(%)', type: 'line', yAxisIndex: 1, data: [] @@ -166,7 +166,7 @@ const loadData = async () => { (s: StatisticsPerformanceRespVO) => s.lastMonthCount ) echartsOption.series[3]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastMonthCount !== 0 ? (s.currentMonthCount / s.lastMonthCount*100).toFixed(2) : 'NULL' + (s: StatisticsPerformanceRespVO) => s.lastMonthCount !== 0 ? ((s.currentMonthCount - s.lastMonthCount) / s.lastMonthCount*100).toFixed(2) : 'NULL' ) } if (echartsOption.series && echartsOption.series[2] && echartsOption.series[2]['data']) { @@ -174,7 +174,7 @@ const loadData = async () => { (s: StatisticsPerformanceRespVO) => s.lastYearCount ) echartsOption.series[4]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastYearCount !== 0 ? (s.currentMonthCount / s.lastYearCount*100).toFixed(2) : 'NULL' + (s: StatisticsPerformanceRespVO) => s.lastYearCount !== 0 ? ((s.currentMonthCount - s.lastYearCount) / s.lastYearCount*100).toFixed(2) : 'NULL' ) } @@ -188,7 +188,7 @@ const loadData = async () => { // 初始化数据 const columnsData = reactive([]); const tableData = reactive([{title: '当月合同金额统计(元)'}, {title: '上月合同金额统计(元)'}, {title: '去年当月合同金额统计(元)'}, - {title: '同比增长率(%)'}, {title: '环比增长率(%)'}]) + {title: '环比增长率(%)'}, {title: '同比增长率(%)'}]) // 定义 init 方法 const convertListData = () => { @@ -202,8 +202,8 @@ const convertListData = () => { tableData[0]['prop' + index] = item.currentMonthCount tableData[1]['prop' + index] = item.lastMonthCount tableData[2]['prop' + index] = item.lastYearCount - tableData[3]['prop' + index] = item.lastMonthCount !== 0 ? (item.currentMonthCount / item.lastMonthCount).toFixed(2) : 'NULL' - tableData[4]['prop' + index] = item.lastYearCount !== 0 ? (item.currentMonthCount / item.lastYearCount).toFixed(2) : 'NULL' + tableData[3]['prop' + index] = item.lastMonthCount !== 0 ? ((item.currentMonthCount - item.lastMonthCount) / item.lastMonthCount*100).toFixed(2) : 'NULL' + tableData[4]['prop' + index] = item.lastYearCount !== 0 ? ((item.currentMonthCount - item.lastYearCount) / item.lastYearCount*100).toFixed(2) : 'NULL' }) } diff --git a/src/views/crm/statistics/performance/components/ReceivablePricePerformance.vue b/src/views/crm/statistics/performance/components/ReceivablePricePerformance.vue index 1efcf920..aa3f5b19 100644 --- a/src/views/crm/statistics/performance/components/ReceivablePricePerformance.vue +++ b/src/views/crm/statistics/performance/components/ReceivablePricePerformance.vue @@ -57,13 +57,13 @@ const echartsOption = reactive({ data: [] }, { - name: '同比增长率(%)', + name: '环比增长率(%)', type: 'line', yAxisIndex: 1, data: [] }, { - name: '环比增长率(%)', + name: '同比增长率(%)', type: 'line', yAxisIndex: 1, data: [] @@ -166,7 +166,7 @@ const loadData = async () => { (s: StatisticsPerformanceRespVO) => s.lastMonthCount ) echartsOption.series[3]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastMonthCount !== 0 ? (s.currentMonthCount / s.lastMonthCount*100).toFixed(2) : 'NULL' + (s: StatisticsPerformanceRespVO) => s.lastMonthCount !== 0 ? ((s.currentMonthCount - s.lastMonthCount) / s.lastMonthCount*100).toFixed(2) : 'NULL' ) } if (echartsOption.series && echartsOption.series[2] && echartsOption.series[1]['data']) { @@ -174,7 +174,7 @@ const loadData = async () => { (s: StatisticsPerformanceRespVO) => s.lastYearCount ) echartsOption.series[4]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastYearCount !== 0 ? (s.currentMonthCount / s.lastYearCount*100).toFixed(2) : 'NULL' + (s: StatisticsPerformanceRespVO) => s.lastYearCount !== 0 ? ((s.currentMonthCount - s.lastYearCount) / s.lastYearCount*100).toFixed(2) : 'NULL' ) } @@ -188,7 +188,7 @@ const loadData = async () => { // 初始化数据 const columnsData = reactive([]); const tableData = reactive([{title: '当月回款金额统计(元)'}, {title: '上月回款金额统计(元)'}, - {title: '去年当月回款金额统计(元)'}, {title: '同比增长率(%)'}, {title: '环比增长率(%)'}]); + {title: '去年当月回款金额统计(元)'}, {title: '环比增长率(%)'}, {title: '同比增长率(%)'}]); // 定义 init 方法 const convertListData = () => { @@ -202,8 +202,8 @@ const convertListData = () => { tableData[0]['prop' + index] = item.currentMonthCount tableData[1]['prop' + index] = item.lastMonthCount tableData[2]['prop' + index] = item.lastYearCount - tableData[3]['prop' + index] = item.lastMonthCount !== 0 ? (item.currentMonthCount / item.lastMonthCount).toFixed(2) : 'NULL' - tableData[4]['prop' + index] = item.lastYearCount !== 0 ? (item.currentMonthCount / item.lastYearCount).toFixed(2) : 'NULL' + tableData[3]['prop' + index] = item.lastMonthCount !== 0 ? ((item.currentMonthCount - item.lastMonthCount) / item.lastMonthCount*100).toFixed(2) : 'NULL' + tableData[4]['prop' + index] = item.lastYearCount !== 0 ? ((item.currentMonthCount - item.lastYearCount) / item.lastYearCount*100).toFixed(2) : 'NULL' }) } From ccd56f2ddaac7993f5429b0feed600e4083cf9bc Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Tue, 7 May 2024 15:31:01 +0800 Subject: [PATCH 02/53] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=B1?= =?UTF-8?q?=E4=BA=8E=20.env.local-dev=20=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E6=9E=84=E5=BB=BA=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b450bf69..1fa88646 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,13 @@ "dev-server": "vite --mode dev", "ts:check": "vue-tsc --noEmit", "build:local": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build", - "build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode local-dev", + "build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode dev", "build:test": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode test", "build:stage": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode stage", "build:prod": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode prod", "serve:dev": "vite preview --mode dev", "serve:prod": "vite preview --mode prod", - "preview": "pnpm build:local-dev && vite preview", + "preview": "pnpm build:local && vite preview", "clean": "npx rimraf node_modules", "clean:cache": "npx rimraf node_modules/.cache", "lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src", From eeae01e661833b57d74128d0c74448f1ad991fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E7=97=95?= <614891294@qq.com> Date: Tue, 7 May 2024 09:08:28 +0000 Subject: [PATCH 03/53] =?UTF-8?q?update=20src/views/Login/SocialLogin.vue.?= =?UTF-8?q?=20=E8=BF=99=E9=87=8C=E5=B7=B2=E7=BB=8F=E6=98=AF=E5=B8=83?= =?UTF-8?q?=E5=B0=94=E5=80=BC=E4=BA=86=EF=BC=8C=E4=B8=8D=E7=94=A8=E5=9C=A8?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=B8=BA=E5=B8=83=E5=B0=94=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 天痕 <614891294@qq.com> --- src/views/Login/SocialLogin.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Login/SocialLogin.vue b/src/views/Login/SocialLogin.vue index 1eb9293c..5d0db475 100644 --- a/src/views/Login/SocialLogin.vue +++ b/src/views/Login/SocialLogin.vue @@ -64,7 +64,7 @@ - + Date: Tue, 7 May 2024 09:10:43 +0000 Subject: [PATCH 04/53] =?UTF-8?q?update=20src/views/Login/SocialLogin.vue.?= =?UTF-8?q?=20=E8=BF=99=E9=87=8C=E5=BA=94=E8=AF=A5=E5=8F=96=E5=8F=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 天痕 <614891294@qq.com> --- src/views/Login/SocialLogin.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Login/SocialLogin.vue b/src/views/Login/SocialLogin.vue index 1eb9293c..af77d889 100644 --- a/src/views/Login/SocialLogin.vue +++ b/src/views/Login/SocialLogin.vue @@ -207,7 +207,7 @@ const loginData = reactive({ // 获取验证码 const getCode = async () => { // 情况一,未开启:则直接登录 - if (loginData.captchaEnable) { + if (!loginData.captchaEnable) { await handleLogin({}) } else { // 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录 From 657ad506a41dd83f06954261e05461d79bc4640b Mon Sep 17 00:00:00 2001 From: syubun Date: Wed, 8 May 2024 09:44:47 +0800 Subject: [PATCH 05/53] =?UTF-8?q?oa=E8=AF=B7=E5=81=87=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA=E7=9A=84=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=AD=97=E6=AE=B5=E5=8F=96=E5=80=BC=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bpm/oa/leave/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/bpm/oa/leave/index.vue b/src/views/bpm/oa/leave/index.vue index bd41104a..2cb53247 100644 --- a/src/views/bpm/oa/leave/index.vue +++ b/src/views/bpm/oa/leave/index.vue @@ -83,7 +83,7 @@ Date: Wed, 8 May 2024 06:14:01 +0000 Subject: [PATCH 06/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E4=B8=AD=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E6=8C=89=E9=92=AE=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20=E9=83=A8=E9=97=A8=E5=90=8D=E7=A7=B0=E4=B8=AD=E7=9A=84prop?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=80=BC=E5=86=99=E9=94=99=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4=E9=87=8D=E7=BD=AE=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=EF=BC=8C=E5=B7=B2=E5=81=9A=E7=9B=B8?= =?UTF-8?q?=E5=BA=94=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘岩Tony <345006662@qq.com> --- src/views/system/dept/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index e99d7f8a..4757e5c0 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -8,7 +8,7 @@ :inline="true" label-width="68px" > - + Date: Wed, 8 May 2024 15:13:51 +0800 Subject: [PATCH 07/53] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=B5=81=E8=BD=AC=E7=B1=BB=E5=9E=8B=E5=88=A4=E6=96=AD=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../package/penal/flow-condition/FlowCondition.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue b/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue index 345670ae..1715d73b 100644 --- a/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue +++ b/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue @@ -79,13 +79,13 @@ const resetFlowCondition = () => { bpmnElement.value = bpmnInstances().bpmnElement bpmnElementSource.value = bpmnElement.value.source bpmnElementSourceRef.value = bpmnElement.value.businessObject.sourceRef + // 初始化默认type为default + flowConditionForm.value = { type: 'default' } if ( bpmnElementSourceRef.value && bpmnElementSourceRef.value.default && - bpmnElementSourceRef.value.default.id === bpmnElement.value.id && - flowConditionForm.value.type == 'default' + bpmnElementSourceRef.value.default.id === bpmnElement.value.id ) { - // 默认 flowConditionForm.value = { type: 'default' } } else if (!bpmnElement.value.businessObject.conditionExpression) { // 普通 From 1776217f1c861c65e15f3c48ff8b14c489b6d70f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 10 May 2024 22:48:33 +0800 Subject: [PATCH 08/53] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91AI?= =?UTF-8?q?=EF=BC=9AAPI=20=E6=A8=A1=E5=9E=8B=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/model/apiKey/index.ts | 10 +- src/api/ai/model/chatModel/index.ts | 43 +++++ .../ai/model/chatModel/ChatModelForm.vue | 140 ++++++++++++++ src/views/ai/model/chatModel/index.vue | 179 ++++++++++++++++++ 4 files changed, 367 insertions(+), 5 deletions(-) create mode 100644 src/api/ai/model/chatModel/index.ts create mode 100644 src/views/ai/model/chatModel/ChatModelForm.vue create mode 100644 src/views/ai/model/chatModel/index.vue diff --git a/src/api/ai/model/apiKey/index.ts b/src/api/ai/model/apiKey/index.ts index 47e415e4..c96f2a66 100644 --- a/src/api/ai/model/apiKey/index.ts +++ b/src/api/ai/model/apiKey/index.ts @@ -12,27 +12,27 @@ export interface ApiKeyVO { // AI API 密钥 API export const ApiKeyApi = { - // 查询AI API 密钥分页 + // 查询 API 密钥分页 getApiKeyPage: async (params: any) => { return await request.get({ url: `/ai/api-key/page`, params }) }, - // 查询AI API 密钥详情 + // 查询 API 密钥详情 getApiKey: async (id: number) => { return await request.get({ url: `/ai/api-key/get?id=` + id }) }, - // 新增AI API 密钥 + // 新增 API 密钥 createApiKey: async (data: ApiKeyVO) => { return await request.post({ url: `/ai/api-key/create`, data }) }, - // 修改AI API 密钥 + // 修改 API 密钥 updateApiKey: async (data: ApiKeyVO) => { return await request.put({ url: `/ai/api-key/update`, data }) }, - // 删除AI API 密钥 + // 删除 API 密钥 deleteApiKey: async (id: number) => { return await request.delete({ url: `/ai/api-key/delete?id=` + id }) } diff --git a/src/api/ai/model/chatModel/index.ts b/src/api/ai/model/chatModel/index.ts new file mode 100644 index 00000000..09f8d66b --- /dev/null +++ b/src/api/ai/model/chatModel/index.ts @@ -0,0 +1,43 @@ +import request from '@/config/axios' + +// AI 聊天模型 VO +export interface ChatModelVO { + id: number // 编号 + keyId: number // API 秘钥编号 + name: string // 模型名字 + model: string // 模型标识 + platform: string // 模型平台 + sort: number // 排序 + status: number // 状态 + temperature: number // 温度参数 + maxTokens: number // 单条回复的最大 Token 数量 + maxContexts: number // 上下文的最大 Message 数量 +} + +// AI 聊天模型 API +export const ChatModelApi = { + // 查询聊天模型分页 + getChatModelPage: async (params: any) => { + return await request.get({ url: `/ai/chat-model/page`, params }) + }, + + // 查询聊天模型详情 + getChatModel: async (id: number) => { + return await request.get({ url: `/ai/chat-model/get?id=` + id }) + }, + + // 新增聊天模型 + createChatModel: async (data: ChatModelVO) => { + return await request.post({ url: `/ai/chat-model/create`, data }) + }, + + // 修改聊天模型 + updateChatModel: async (data: ChatModelVO) => { + return await request.put({ url: `/ai/chat-model/update`, data }) + }, + + // 删除聊天模型 + deleteChatModel: async (id: number) => { + return await request.delete({ url: `/ai/chat-model/delete?id=` + id }) + } +} diff --git a/src/views/ai/model/chatModel/ChatModelForm.vue b/src/views/ai/model/chatModel/ChatModelForm.vue new file mode 100644 index 00000000..65374291 --- /dev/null +++ b/src/views/ai/model/chatModel/ChatModelForm.vue @@ -0,0 +1,140 @@ + + diff --git a/src/views/ai/model/chatModel/index.vue b/src/views/ai/model/chatModel/index.vue new file mode 100644 index 00000000..d43051aa --- /dev/null +++ b/src/views/ai/model/chatModel/index.vue @@ -0,0 +1,179 @@ + + + From 9d322c3a94616d00bd1511828f3f581dd33c938e Mon Sep 17 00:00:00 2001 From: cherishsince Date: Fri, 10 May 2024 23:35:47 +0800 Subject: [PATCH 09/53] =?UTF-8?q?=E3=80=90=E6=B7=BB=E5=8A=A0=E3=80=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4ui=20=E5=A2=9E=E5=8A=A0=20chat=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E5=92=8C=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/assets/ai/copy.svg | 1 + src/assets/ai/delete.svg | 1 + src/views/ai/chat/index.vue | 254 ++++++++++++++++++++++++++++++++---- 4 files changed, 235 insertions(+), 23 deletions(-) create mode 100644 src/assets/ai/copy.svg create mode 100644 src/assets/ai/delete.svg diff --git a/package.json b/package.json index b450bf69..db819026 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "private": false, "scripts": { "i": "pnpm install", - "dev": "vite", + "dev": "vite --mode env.local", "dev-server": "vite --mode dev", "ts:check": "vue-tsc --noEmit", "build:local": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build", diff --git a/src/assets/ai/copy.svg b/src/assets/ai/copy.svg new file mode 100644 index 00000000..f51f8d81 --- /dev/null +++ b/src/assets/ai/copy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/ai/delete.svg b/src/assets/ai/delete.svg new file mode 100644 index 00000000..d2ee18ed --- /dev/null +++ b/src/assets/ai/delete.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index ec49b774..116f0e34 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -5,7 +5,7 @@
- + 新建对话 @@ -17,11 +17,11 @@ @keyup="searchConversation" > -
+
置顶 @@ -32,15 +32,15 @@ @click="changeConversation(conversation)" >
- + {{ conversation.title }}
- + - +
@@ -50,12 +50,12 @@
- + 角色仓库
- - 清空未置顶对话 + + 清空未置顶对话
@@ -67,25 +67,96 @@ 标题......
- 3.5-turbo-0125 - - + 3.5-turbo-0125 + - + - + + + +
- 对话列表 - - + + +
+ +
+
+ +
+
+
+ 2024-05-10 22:38 +
+
+ + 如果您想获取某个网页或程序的截图,可以使用浏览器自带的截图功能,或者使用第三方截图工具,如Snipping + Tool、FastStone Capture等。如果您想将屏幕上的某个区域截取下来,可以使用键盘上的“Prt + Sc”键(或“Print Screen”键)来获取整个屏幕的截图,并将其粘贴到图像编辑软件中进行编辑和保存。 + 如果您需要更具体的帮助,例如如何使用特定的截图工具或如何编辑截图,请提供更多详细信息,我将尽力为您提供帮助。 + + +
+
+
+ + 复制 +
+
+ + 删除 +
+
+
+
+ +
+
+ +
+
+
+ 2024-05-10 22:38 +
+
+ + 今天天气 + +
+
+
+ + 复制 +
+
+ + 删除 +
+
+
+ +
+
+ + +
+ + +
+ + 发送 +
@@ -172,8 +243,10 @@ const searchConversation = () => { border-radius: 5px; align-items: center; line-height: 30px; + &.active { background-color: #e6e6e6; + .button { display: inline-block; } @@ -184,6 +257,7 @@ const searchConversation = () => { flex-direction: row; align-items: center; } + .title { padding: 5px 10px; max-width: 220px; @@ -192,6 +266,7 @@ const searchConversation = () => { white-space: nowrap; text-overflow: ellipsis; } + .avatar { width: 28px; height: 28px; @@ -199,6 +274,7 @@ const searchConversation = () => { flex-direction: row; justify-items: center; } + // 对话编辑、删除 .button-wrapper { right: 2px; @@ -206,6 +282,7 @@ const searchConversation = () => { flex-direction: row; justify-items: center; color: #606266; + .el-icon { margin-right: 5px; } @@ -227,6 +304,7 @@ const searchConversation = () => { color: #606266; padding: 0; margin: 0; + > span { margin-left: 5px; } @@ -234,6 +312,7 @@ const searchConversation = () => { } } +// 头部 .detail-container { background: #ffffff; @@ -243,16 +322,147 @@ const searchConversation = () => { align-items: center; justify-content: space-between; background: #fbfbfb; + box-shadow: 0 0 0 0 #dcdfe6; .title { - font-size: 23px; + font-size: 18px; font-weight: bold; } } +} +// 中间 +.chat-list { + display: flex; + flex-direction: column; + + .message-item { + margin-top: 50px; + } + + .left-message { + display: flex; + flex-direction: row; + + } + + .right-message { + display: flex; + flex-direction: row-reverse; + justify-content: flex-start; + } + + .avatar { + //height: 170px; + //width: 170px; + } + + .message { + display: flex; + flex-direction: column; + text-align: left; + margin-left: 15px; + + .time { + text-align: left; + line-height: 30px; + } + + .left-text-container { + display: flex; + flex-direction: column; + overflow-wrap: break-word; + background-color: #e4e4e4; + box-shadow: 0 0 0 1px #e4e4e4; + border-radius: 10px; + padding: 10px 10px 5px 10px; + + .left-text { + color: #393939; + } + } + + .right-text-container { + display: flex; + flex-direction: column; + overflow-wrap: break-word; + background-color: #267fff; + color: #FFF; + box-shadow: 0 0 0 1px #267fff; + border-radius: 10px; + padding: 10px; + + .right-text { + color: #FFF; + } + } + + .left-btns, .right-btns { + display: flex; + flex-direction: row; + margin-top: 8px; + } + + + } + + // 复制、删除按钮 + .btn-cus { + display: flex; + background-color: transparent; + align-items: center; + + .btn-image { + height: 20px; + margin-right: 5px; + } + + .btn-cus-text { + color: #757575; + } + } + + .btn-cus:hover { + cursor: pointer; + } + + .btn-cus:focus { + background-color: #8c939d; + } +} + + +// 底部 +.footer-container { + display: flex; + flex-direction: column; + height: auto; + border: 1px solid #e3e3e3; + border-radius: 10px; + margin: 20px 20px; + padding: 9px 10px; .prompt-input { + height: 80px; + //box-shadow: none; + border: none; + box-sizing: border-box; + resize: none; + padding: 0px 2px; + //padding: 5px 5px; + overflow: hidden; + } + + .prompt-input:focus { + outline: none; + } + + .prompt-btns { + display: flex; + justify-content: space-between; + padding-bottom: 0px; + padding-top: 5px; } } From b19d56ad026f705e09505ed40413c18f47de893f Mon Sep 17 00:00:00 2001 From: cherishsince Date: Fri, 10 May 2024 23:38:44 +0800 Subject: [PATCH 10/53] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4=20right=20=E5=AF=B9=E8=AF=9D=20=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E8=B7=9D=E7=A6=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index 116f0e34..4b4bee22 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -361,7 +361,7 @@ const searchConversation = () => { display: flex; flex-direction: column; text-align: left; - margin-left: 15px; + margin: 0 15px; .time { text-align: left; From f01dc0a539d7e52229bd64b5ac5b9afef86a308a Mon Sep 17 00:00:00 2001 From: scholar <1145227973@qq.com> Date: Sat, 11 May 2024 11:26:47 +0800 Subject: [PATCH 11/53] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/crm/statistics/performance/index.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/crm/statistics/performance/index.vue b/src/views/crm/statistics/performance/index.vue index ea43ed4d..469569af 100644 --- a/src/views/crm/statistics/performance/index.vue +++ b/src/views/crm/statistics/performance/index.vue @@ -75,6 +75,7 @@ import { defaultProps, handleTree } from '@/utils/tree' import ContractCountPerformance from './components/ContractCountPerformance.vue' import ContractPricePerformance from './components/ContractPricePerformance.vue' import ReceivablePricePerformance from './components/ReceivablePricePerformance.vue' +import dayjs from "dayjs" defineOptions({ name: 'CrmStatisticsCustomer' }) @@ -82,8 +83,8 @@ const queryParams = reactive({ deptId: useUserStore().getUser.deptId, userId: undefined, times: [ - // 默认显示当年的数据 - formatDate(beginOfDay(new Date(new Date().getTime() - 3600 * 1000 * 24 * 7))) + formatDate(beginOfDay(new Date(new Date().getFullYear(),0, 1, 0, 0, 0))), // 默认查询当年的数据,比如2024年,起始时间2024-01-01 00:00:00 + formatDate(beginOfDay(new Date(new Date().getFullYear()+1,0, 1, 0, 0, 0))) //查询时间范围结束时间,2025-01-01 00:00:00 ] }) @@ -111,13 +112,13 @@ const handleQuery = () => { // 从 queryParams.times[0] 中获取到了年份 const selectYear = parseInt(queryParams.times[0]) - // 创建一个新的 Date 对象,设置为指定的年份的第一天 - const fullDate = new Date(selectYear, 0, 1, 0, 0, 0) + // 创建一个新的 Date 对象,设置为指定的年份的第一天,以及第二年的第一天,以时间段的方式,将查询时间传递给后端 + const fullDate = new Date(selectYear, 0, 1, 0, 0, 0) //比如2024年,起始时间2024-01-01 00:00:00 + const nextFullDate = new Date(selectYear+1, 0, 1, 0, 0, 0) //查询时间范围结束时间,2025-01-01 00:00:00 // 将完整的日期时间格式化为需要的字符串形式,比如 2004-01-01 00:00:00 - queryParams.times[0] = `${fullDate.getFullYear()}-${ - String(fullDate.getMonth() + 1).padStart(2, '0') - }-${String(fullDate.getDate()).padStart(2, '0')} ${String(fullDate.getHours()).padStart(2, '0')}:${String(fullDate.getMinutes()).padStart(2, '0')}:${String(fullDate.getSeconds()).padStart(2, '0')}` + queryParams.times[0] = dayjs(fullDate).format('YYYY-MM-DD HH:mm:ss') + queryParams.times[1] = dayjs(nextFullDate).format('YYYY-MM-DD HH:mm:ss') switch (activeTab.value) { case 'ContractCountPerformance': From dd2c4b6b3ca8a3992b11535d1a12f2fe875fb4e7 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 11 May 2024 19:46:33 +0800 Subject: [PATCH 12/53] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91AI?= =?UTF-8?q?=EF=BC=9AAPI=20=E6=A8=A1=E5=9E=8B=E7=AE=A1=E7=90=86=EF=BC=88?= =?UTF-8?q?=E5=AE=8C=E5=96=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/model/apiKey/index.ts | 5 +++ src/views/ai/model/apiKey/ApiKeyForm.vue | 18 ++++---- src/views/ai/model/apiKey/index.vue | 9 ++-- .../ai/model/chatModel/ChatModelForm.vue | 41 +++++++++++++++---- src/views/ai/model/chatModel/index.vue | 37 ++++++++++------- 5 files changed, 73 insertions(+), 37 deletions(-) diff --git a/src/api/ai/model/apiKey/index.ts b/src/api/ai/model/apiKey/index.ts index c96f2a66..60d8a46c 100644 --- a/src/api/ai/model/apiKey/index.ts +++ b/src/api/ai/model/apiKey/index.ts @@ -17,6 +17,11 @@ export const ApiKeyApi = { return await request.get({ url: `/ai/api-key/page`, params }) }, + // 获得 API 密钥列表 + getApiKeyList: async () => { + return await request.get({ url: `/ai/api-key/simple-list` }) + }, + // 查询 API 密钥详情 getApiKey: async (id: number) => { return await request.get({ url: `/ai/api-key/get?id=` + id }) diff --git a/src/views/ai/model/apiKey/ApiKeyForm.vue b/src/views/ai/model/apiKey/ApiKeyForm.vue index 2f9ba580..a8fc0128 100644 --- a/src/views/ai/model/apiKey/ApiKeyForm.vue +++ b/src/views/ai/model/apiKey/ApiKeyForm.vue @@ -7,13 +7,7 @@ label-width="120px" v-loading="formLoading" > - - - - - - - + - - + + + + + + + + diff --git a/src/views/ai/model/apiKey/index.vue b/src/views/ai/model/apiKey/index.vue index fcafc463..6daf6a7d 100644 --- a/src/views/ai/model/apiKey/index.vue +++ b/src/views/ai/model/apiKey/index.vue @@ -60,15 +60,14 @@ - - - - + - + + + From 73e851602420bac1dbf34103ecce0c1de3b5b1a6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 11 May 2024 22:30:44 +0800 Subject: [PATCH 13/53] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84?= =?UTF-8?q?=E5=AE=A1=E3=80=91CRM=EF=BC=9A=E4=BC=98=E5=8C=96=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E4=B8=9A=E7=BB=A9=E7=BB=9F=E8=AE=A1=E7=9A=84=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ContractCountPerformance.vue | 102 +++++++++++------- .../components/ContractPricePerformance.vue | 102 +++++++++++------- .../components/ReceivablePricePerformance.vue | 102 +++++++++++------- .../crm/statistics/performance/index.vue | 34 +++--- 4 files changed, 197 insertions(+), 143 deletions(-) diff --git a/src/views/crm/statistics/performance/components/ContractCountPerformance.vue b/src/views/crm/statistics/performance/components/ContractCountPerformance.vue index 5dc4d9e7..fa5a897b 100644 --- a/src/views/crm/statistics/performance/components/ContractCountPerformance.vue +++ b/src/views/crm/statistics/performance/components/ContractCountPerformance.vue @@ -10,9 +10,15 @@ - + @@ -23,7 +29,7 @@ import { EChartsOption } from 'echarts' import { StatisticsPerformanceApi, StatisticsPerformanceRespVO -} from "@/api/crm/statistics/performance" +} from '@/api/crm/statistics/performance' defineOptions({ name: 'ContractCountPerformance' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 @@ -86,29 +92,30 @@ const echartsOption = reactive({ type: 'shadow' } }, - yAxis: [{ - type: 'value', - name: '数量(个)', - axisTick: { - show: false - }, - axisLabel: { - color: '#BDBDBD', - formatter: '{value}' - }, - /** 坐标轴轴线相关设置 */ - axisLine: { - lineStyle: { - color: '#BDBDBD' + yAxis: [ + { + type: 'value', + name: '数量(个)', + axisTick: { + show: false + }, + axisLabel: { + color: '#BDBDBD', + formatter: '{value}' + }, + /** 坐标轴轴线相关设置 */ + axisLine: { + lineStyle: { + color: '#BDBDBD' + } + }, + splitLine: { + show: true, + lineStyle: { + color: '#e6e6e6' + } } }, - splitLine: { - show: true, - lineStyle: { - color: '#e6e6e6' - } - } - }, { type: 'value', name: '', @@ -134,7 +141,8 @@ const echartsOption = reactive({ color: '#e6e6e6' } } - }], + } + ], xAxis: { type: 'category', name: '日期', @@ -152,9 +160,7 @@ const loadData = async () => { // 2.1 更新 Echarts 数据 if (echartsOption.xAxis && echartsOption.xAxis['data']) { - echartsOption.xAxis['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.time - ) + echartsOption.xAxis['data'] = performanceList.map((s: StatisticsPerformanceRespVO) => s.time) } if (echartsOption.series && echartsOption.series[0] && echartsOption.series[0]['data']) { echartsOption.series[0]['data'] = performanceList.map( @@ -165,16 +171,20 @@ const loadData = async () => { echartsOption.series[1]['data'] = performanceList.map( (s: StatisticsPerformanceRespVO) => s.lastMonthCount ) - echartsOption.series[3]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastMonthCount !== 0 ? ((s.currentMonthCount - s.lastMonthCount) / s.lastMonthCount*100).toFixed(2) : 'NULL' + echartsOption.series[3]['data'] = performanceList.map((s: StatisticsPerformanceRespVO) => + s.lastMonthCount !== 0 + ? (((s.currentMonthCount - s.lastMonthCount) / s.lastMonthCount) * 100).toFixed(2) + : 'NULL' ) } if (echartsOption.series && echartsOption.series[2] && echartsOption.series[2]['data']) { echartsOption.series[2]['data'] = performanceList.map( (s: StatisticsPerformanceRespVO) => s.lastYearCount ) - echartsOption.series[4]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastYearCount !== 0 ? ((s.currentMonthCount - s.lastYearCount) / s.lastYearCount*100).toFixed(2) : 'NULL' + echartsOption.series[4]['data'] = performanceList.map((s: StatisticsPerformanceRespVO) => + s.lastYearCount !== 0 + ? (((s.currentMonthCount - s.lastYearCount) / s.lastYearCount) * 100).toFixed(2) + : 'NULL' ) } @@ -182,28 +192,38 @@ const loadData = async () => { list.value = performanceList convertListData() loading.value = false - } // 初始化数据 -const columnsData = reactive([]); -const tableData = reactive([{title: '当月合同数量统计(个)'}, {title: '上月合同数量统计(个)'}, - {title: '去年当月合同数量统计(个)'}, {title: '环比增长率(%)'}, {title: '同比增长率(%)'}]) +const columnsData = reactive([]) +const tableData = reactive([ + { title: '当月合同数量统计(个)' }, + { title: '上月合同数量统计(个)' }, + { title: '去年当月合同数量统计(个)' }, + { title: '环比增长率(%)' }, + { title: '同比增长率(%)' } +]) // 定义 convertListData 方法,数据行列转置,展示每月数据 const convertListData = () => { - const columnObj = {label: '日期', prop: 'title'} - columnsData.splice(0, columnsData.length);//清空数组 + const columnObj = { label: '日期', prop: 'title' } + columnsData.splice(0, columnsData.length) //清空数组 columnsData.push(columnObj) list.value.forEach((item, index) => { - const columnObj = {label: item.time, prop: 'prop' + index} + const columnObj = { label: item.time, prop: 'prop' + index } columnsData.push(columnObj) tableData[0]['prop' + index] = item.currentMonthCount tableData[1]['prop' + index] = item.lastMonthCount tableData[2]['prop' + index] = item.lastYearCount - tableData[3]['prop' + index] = item.lastMonthCount !== 0 ? ((item.currentMonthCount - item.lastMonthCount) / item.lastMonthCount * 100).toFixed(2) : 'NULL' - tableData[4]['prop' + index] = item.lastYearCount !== 0 ? ((item.currentMonthCount - item.lastYearCount) / item.lastYearCount * 100).toFixed(2) : 'NULL' + tableData[3]['prop' + index] = + item.lastMonthCount !== 0 + ? (((item.currentMonthCount - item.lastMonthCount) / item.lastMonthCount) * 100).toFixed(2) + : 'NULL' + tableData[4]['prop' + index] = + item.lastYearCount !== 0 + ? (((item.currentMonthCount - item.lastYearCount) / item.lastYearCount) * 100).toFixed(2) + : 'NULL' }) } diff --git a/src/views/crm/statistics/performance/components/ContractPricePerformance.vue b/src/views/crm/statistics/performance/components/ContractPricePerformance.vue index 0c33dc22..dd52d9fb 100644 --- a/src/views/crm/statistics/performance/components/ContractPricePerformance.vue +++ b/src/views/crm/statistics/performance/components/ContractPricePerformance.vue @@ -10,9 +10,15 @@ - + @@ -23,7 +29,7 @@ import { EChartsOption } from 'echarts' import { StatisticsPerformanceApi, StatisticsPerformanceRespVO -} from "@/api/crm/statistics/performance" +} from '@/api/crm/statistics/performance' defineOptions({ name: 'ContractPricePerformance' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 @@ -86,29 +92,30 @@ const echartsOption = reactive({ type: 'shadow' } }, - yAxis: [{ - type: 'value', - name: '金额(元)', - axisTick: { - show: false - }, - axisLabel: { - color: '#BDBDBD', - formatter: '{value}' - }, - /** 坐标轴轴线相关设置 */ - axisLine: { - lineStyle: { - color: '#BDBDBD' + yAxis: [ + { + type: 'value', + name: '金额(元)', + axisTick: { + show: false + }, + axisLabel: { + color: '#BDBDBD', + formatter: '{value}' + }, + /** 坐标轴轴线相关设置 */ + axisLine: { + lineStyle: { + color: '#BDBDBD' + } + }, + splitLine: { + show: true, + lineStyle: { + color: '#e6e6e6' + } } }, - splitLine: { - show: true, - lineStyle: { - color: '#e6e6e6' - } - } - }, { type: 'value', name: '', @@ -134,7 +141,8 @@ const echartsOption = reactive({ color: '#e6e6e6' } } - }], + } + ], xAxis: { type: 'category', name: '日期', @@ -152,9 +160,7 @@ const loadData = async () => { // 2.1 更新 Echarts 数据 if (echartsOption.xAxis && echartsOption.xAxis['data']) { - echartsOption.xAxis['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.time - ) + echartsOption.xAxis['data'] = performanceList.map((s: StatisticsPerformanceRespVO) => s.time) } if (echartsOption.series && echartsOption.series[0] && echartsOption.series[0]['data']) { echartsOption.series[0]['data'] = performanceList.map( @@ -165,16 +171,20 @@ const loadData = async () => { echartsOption.series[1]['data'] = performanceList.map( (s: StatisticsPerformanceRespVO) => s.lastMonthCount ) - echartsOption.series[3]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastMonthCount !== 0 ? ((s.currentMonthCount - s.lastMonthCount) / s.lastMonthCount*100).toFixed(2) : 'NULL' + echartsOption.series[3]['data'] = performanceList.map((s: StatisticsPerformanceRespVO) => + s.lastMonthCount !== 0 + ? (((s.currentMonthCount - s.lastMonthCount) / s.lastMonthCount) * 100).toFixed(2) + : 'NULL' ) } if (echartsOption.series && echartsOption.series[2] && echartsOption.series[2]['data']) { echartsOption.series[2]['data'] = performanceList.map( (s: StatisticsPerformanceRespVO) => s.lastYearCount ) - echartsOption.series[4]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastYearCount !== 0 ? ((s.currentMonthCount - s.lastYearCount) / s.lastYearCount*100).toFixed(2) : 'NULL' + echartsOption.series[4]['data'] = performanceList.map((s: StatisticsPerformanceRespVO) => + s.lastYearCount !== 0 + ? (((s.currentMonthCount - s.lastYearCount) / s.lastYearCount) * 100).toFixed(2) + : 'NULL' ) } @@ -182,28 +192,38 @@ const loadData = async () => { list.value = performanceList convertListData() loading.value = false - } // 初始化数据 -const columnsData = reactive([]); -const tableData = reactive([{title: '当月合同金额统计(元)'}, {title: '上月合同金额统计(元)'}, {title: '去年当月合同金额统计(元)'}, - {title: '环比增长率(%)'}, {title: '同比增长率(%)'}]) +const columnsData = reactive([]) +const tableData = reactive([ + { title: '当月合同金额统计(元)' }, + { title: '上月合同金额统计(元)' }, + { title: '去年当月合同金额统计(元)' }, + { title: '环比增长率(%)' }, + { title: '同比增长率(%)' } +]) // 定义 init 方法 const convertListData = () => { - const columnObj = {label: '日期', prop: 'title'} - columnsData.splice(0, columnsData.length)//清空数组 + const columnObj = { label: '日期', prop: 'title' } + columnsData.splice(0, columnsData.length) //清空数组 columnsData.push(columnObj) list.value.forEach((item, index) => { - const columnObj = {label: item.time, prop: 'prop' + index} + const columnObj = { label: item.time, prop: 'prop' + index } columnsData.push(columnObj) tableData[0]['prop' + index] = item.currentMonthCount tableData[1]['prop' + index] = item.lastMonthCount tableData[2]['prop' + index] = item.lastYearCount - tableData[3]['prop' + index] = item.lastMonthCount !== 0 ? ((item.currentMonthCount - item.lastMonthCount) / item.lastMonthCount*100).toFixed(2) : 'NULL' - tableData[4]['prop' + index] = item.lastYearCount !== 0 ? ((item.currentMonthCount - item.lastYearCount) / item.lastYearCount*100).toFixed(2) : 'NULL' + tableData[3]['prop' + index] = + item.lastMonthCount !== 0 + ? (((item.currentMonthCount - item.lastMonthCount) / item.lastMonthCount) * 100).toFixed(2) + : 'NULL' + tableData[4]['prop' + index] = + item.lastYearCount !== 0 + ? (((item.currentMonthCount - item.lastYearCount) / item.lastYearCount) * 100).toFixed(2) + : 'NULL' }) } diff --git a/src/views/crm/statistics/performance/components/ReceivablePricePerformance.vue b/src/views/crm/statistics/performance/components/ReceivablePricePerformance.vue index aa3f5b19..169f074b 100644 --- a/src/views/crm/statistics/performance/components/ReceivablePricePerformance.vue +++ b/src/views/crm/statistics/performance/components/ReceivablePricePerformance.vue @@ -10,9 +10,15 @@ - + @@ -23,7 +29,7 @@ import { EChartsOption } from 'echarts' import { StatisticsPerformanceApi, StatisticsPerformanceRespVO -} from "@/api/crm/statistics/performance" +} from '@/api/crm/statistics/performance' defineOptions({ name: 'ContractPricePerformance' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 @@ -86,29 +92,30 @@ const echartsOption = reactive({ type: 'shadow' } }, - yAxis: [{ - type: 'value', - name: '金额(元)', - axisTick: { - show: false - }, - axisLabel: { - color: '#BDBDBD', - formatter: '{value}' - }, - /** 坐标轴轴线相关设置 */ - axisLine: { - lineStyle: { - color: '#BDBDBD' + yAxis: [ + { + type: 'value', + name: '金额(元)', + axisTick: { + show: false + }, + axisLabel: { + color: '#BDBDBD', + formatter: '{value}' + }, + /** 坐标轴轴线相关设置 */ + axisLine: { + lineStyle: { + color: '#BDBDBD' + } + }, + splitLine: { + show: true, + lineStyle: { + color: '#e6e6e6' + } } }, - splitLine: { - show: true, - lineStyle: { - color: '#e6e6e6' - } - } - }, { type: 'value', name: '', @@ -134,7 +141,8 @@ const echartsOption = reactive({ color: '#e6e6e6' } } - }], + } + ], xAxis: { type: 'category', name: '日期', @@ -152,9 +160,7 @@ const loadData = async () => { // 2.1 更新 Echarts 数据 if (echartsOption.xAxis && echartsOption.xAxis['data']) { - echartsOption.xAxis['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.time - ) + echartsOption.xAxis['data'] = performanceList.map((s: StatisticsPerformanceRespVO) => s.time) } if (echartsOption.series && echartsOption.series[0] && echartsOption.series[0]['data']) { echartsOption.series[0]['data'] = performanceList.map( @@ -165,16 +171,20 @@ const loadData = async () => { echartsOption.series[1]['data'] = performanceList.map( (s: StatisticsPerformanceRespVO) => s.lastMonthCount ) - echartsOption.series[3]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastMonthCount !== 0 ? ((s.currentMonthCount - s.lastMonthCount) / s.lastMonthCount*100).toFixed(2) : 'NULL' + echartsOption.series[3]['data'] = performanceList.map((s: StatisticsPerformanceRespVO) => + s.lastMonthCount !== 0 + ? (((s.currentMonthCount - s.lastMonthCount) / s.lastMonthCount) * 100).toFixed(2) + : 'NULL' ) } if (echartsOption.series && echartsOption.series[2] && echartsOption.series[1]['data']) { echartsOption.series[2]['data'] = performanceList.map( (s: StatisticsPerformanceRespVO) => s.lastYearCount ) - echartsOption.series[4]['data'] = performanceList.map( - (s: StatisticsPerformanceRespVO) => s.lastYearCount !== 0 ? ((s.currentMonthCount - s.lastYearCount) / s.lastYearCount*100).toFixed(2) : 'NULL' + echartsOption.series[4]['data'] = performanceList.map((s: StatisticsPerformanceRespVO) => + s.lastYearCount !== 0 + ? (((s.currentMonthCount - s.lastYearCount) / s.lastYearCount) * 100).toFixed(2) + : 'NULL' ) } @@ -182,28 +192,38 @@ const loadData = async () => { list.value = performanceList convertListData() loading.value = false - } // 初始化数据 -const columnsData = reactive([]); -const tableData = reactive([{title: '当月回款金额统计(元)'}, {title: '上月回款金额统计(元)'}, - {title: '去年当月回款金额统计(元)'}, {title: '环比增长率(%)'}, {title: '同比增长率(%)'}]); +const columnsData = reactive([]) +const tableData = reactive([ + { title: '当月回款金额统计(元)' }, + { title: '上月回款金额统计(元)' }, + { title: '去年当月回款金额统计(元)' }, + { title: '环比增长率(%)' }, + { title: '同比增长率(%)' } +]) // 定义 init 方法 const convertListData = () => { - const columnObj = {label: '日期', prop: 'title'} - columnsData.splice(0, columnsData.length)//清空数组 + const columnObj = { label: '日期', prop: 'title' } + columnsData.splice(0, columnsData.length) //清空数组 columnsData.push(columnObj) list.value.forEach((item, index) => { - const columnObj = {label: item.time, prop: 'prop' + index} + const columnObj = { label: item.time, prop: 'prop' + index } columnsData.push(columnObj) tableData[0]['prop' + index] = item.currentMonthCount tableData[1]['prop' + index] = item.lastMonthCount tableData[2]['prop' + index] = item.lastYearCount - tableData[3]['prop' + index] = item.lastMonthCount !== 0 ? ((item.currentMonthCount - item.lastMonthCount) / item.lastMonthCount*100).toFixed(2) : 'NULL' - tableData[4]['prop' + index] = item.lastYearCount !== 0 ? ((item.currentMonthCount - item.lastYearCount) / item.lastYearCount*100).toFixed(2) : 'NULL' + tableData[3]['prop' + index] = + item.lastMonthCount !== 0 + ? (((item.currentMonthCount - item.lastMonthCount) / item.lastMonthCount) * 100).toFixed(2) + : 'NULL' + tableData[4]['prop' + index] = + item.lastYearCount !== 0 + ? (((item.currentMonthCount - item.lastYearCount) / item.lastYearCount) * 100).toFixed(2) + : 'NULL' }) } diff --git a/src/views/crm/statistics/performance/index.vue b/src/views/crm/statistics/performance/index.vue index 469569af..822afec9 100644 --- a/src/views/crm/statistics/performance/index.vue +++ b/src/views/crm/statistics/performance/index.vue @@ -60,7 +60,10 @@ - + @@ -70,12 +73,11 @@ import * as DeptApi from '@/api/system/dept' import * as UserApi from '@/api/system/user' import { useUserStore } from '@/store/modules/user' -import { beginOfDay, defaultShortcuts, endOfDay, formatDate } from '@/utils/formatTime' +import { beginOfDay, endOfDay, formatDate } from '@/utils/formatTime' import { defaultProps, handleTree } from '@/utils/tree' import ContractCountPerformance from './components/ContractCountPerformance.vue' import ContractPricePerformance from './components/ContractPricePerformance.vue' import ReceivablePricePerformance from './components/ReceivablePricePerformance.vue' -import dayjs from "dayjs" defineOptions({ name: 'CrmStatisticsCustomer' }) @@ -83,8 +85,8 @@ const queryParams = reactive({ deptId: useUserStore().getUser.deptId, userId: undefined, times: [ - formatDate(beginOfDay(new Date(new Date().getFullYear(),0, 1, 0, 0, 0))), // 默认查询当年的数据,比如2024年,起始时间2024-01-01 00:00:00 - formatDate(beginOfDay(new Date(new Date().getFullYear()+1,0, 1, 0, 0, 0))) //查询时间范围结束时间,2025-01-01 00:00:00 + formatDate(beginOfDay(new Date(new Date().getFullYear(), 0, 1))), + formatDate(endOfDay(new Date(new Date().getFullYear(), 11, 31))) ] }) @@ -100,26 +102,18 @@ const userListByDeptId = computed(() => // 活跃标签 const activeTab = ref('ContractCountPerformance') -// 1.员工合同数量统计 -const ContractCountPerformanceRef = ref() -// 2.员工合同金额统计 -const ContractPricePerformanceRef = ref() -// 3.员工回款金额统计 -const ReceivablePricePerformanceRef = ref() +const ContractCountPerformanceRef = ref() // 员工合同数量统计 +const ContractPricePerformanceRef = ref() // 员工合同金额统计 +const ReceivablePricePerformanceRef = ref() // 员工回款金额统计 /** 搜索按钮操作 */ -const handleQuery = () => { +const handleQuery = () => { // 从 queryParams.times[0] 中获取到了年份 const selectYear = parseInt(queryParams.times[0]) + queryParams.times[0] = formatDate(beginOfDay(new Date(selectYear, 0, 1))) + queryParams.times[1] = formatDate(endOfDay(new Date(selectYear, 11, 31))) - // 创建一个新的 Date 对象,设置为指定的年份的第一天,以及第二年的第一天,以时间段的方式,将查询时间传递给后端 - const fullDate = new Date(selectYear, 0, 1, 0, 0, 0) //比如2024年,起始时间2024-01-01 00:00:00 - const nextFullDate = new Date(selectYear+1, 0, 1, 0, 0, 0) //查询时间范围结束时间,2025-01-01 00:00:00 - - // 将完整的日期时间格式化为需要的字符串形式,比如 2004-01-01 00:00:00 - queryParams.times[0] = dayjs(fullDate).format('YYYY-MM-DD HH:mm:ss') - queryParams.times[1] = dayjs(nextFullDate).format('YYYY-MM-DD HH:mm:ss') - + // 执行查询 switch (activeTab.value) { case 'ContractCountPerformance': ContractCountPerformanceRef.value?.loadData?.() From b116d82376119753924a39332ddca3c9a4f4acb7 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Sun, 12 May 2024 14:28:27 +0800 Subject: [PATCH 14/53] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20chat=20=E8=81=8A=E5=A4=A9=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=81=E5=88=A0=E9=99=A4=E3=80=81=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E5=88=B0=E7=B2=98=E8=B4=B4=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/chat/message/index.ts | 41 +++ src/views/ai/chat/components/MessageList.vue | 276 +++++++++++++++++++ src/views/ai/chat/index.vue | 180 +----------- 3 files changed, 332 insertions(+), 165 deletions(-) create mode 100644 src/api/ai/chat/message/index.ts create mode 100644 src/views/ai/chat/components/MessageList.vue diff --git a/src/api/ai/chat/message/index.ts b/src/api/ai/chat/message/index.ts new file mode 100644 index 00000000..3dc1ea0f --- /dev/null +++ b/src/api/ai/chat/message/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +// 聊天VO +export interface ChatMessageVO { + id: number // 编号 + conversationId: string // 会话编号 + type: string // 消息类型 + userId: string // 用户编号 + roleId: string // 角色编号 + model: number // 模型标志 + modelId: number // 模型编号 + content: number // 聊天内容 + tokens: number // 消耗 Token 数量 + createTime: Date // 创建时间 +} + +export interface ChatMessageSendVO { + conversationId: string // 会话编号 + content: number // 聊天内容 +} + +// AI chat 聊天 +export const ChatMessageApi = { + + // 消息列表 + messageList: async (conversationId: string) => { + return await request.get({ url: `/ai/chat/message/list-by-conversation-id?conversationId=${conversationId}`}) + }, + + // 发送 send 消息 + send: async (data: ChatMessageSendVO) => { + return await request.post({ url: `/ai/chat/message/send`, data }) + }, + + + // 发送 send 消息 + delete: async (id: string) => { + return await request.delete({ url: `/ai/chat/message/delete?id=${id}` }) + }, + +} diff --git a/src/views/ai/chat/components/MessageList.vue b/src/views/ai/chat/components/MessageList.vue new file mode 100644 index 00000000..3038f886 --- /dev/null +++ b/src/views/ai/chat/components/MessageList.vue @@ -0,0 +1,276 @@ + + + + + + diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index 4b4bee22..f3dc471f 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -81,73 +81,10 @@
- - -
- -
-
- -
-
-
- 2024-05-10 22:38 -
-
- - 如果您想获取某个网页或程序的截图,可以使用浏览器自带的截图功能,或者使用第三方截图工具,如Snipping - Tool、FastStone Capture等。如果您想将屏幕上的某个区域截取下来,可以使用键盘上的“Prt - Sc”键(或“Print Screen”键)来获取整个屏幕的截图,并将其粘贴到图像编辑软件中进行编辑和保存。 - 如果您需要更具体的帮助,例如如何使用特定的截图工具或如何编辑截图,请提供更多详细信息,我将尽力为您提供帮助。 - - -
-
-
- - 复制 -
-
- - 删除 -
-
-
-
- -
-
- -
-
-
- 2024-05-10 22:38 -
-
- - 今天天气 - -
-
-
- - 复制 -
-
- - 删除 -
-
-
- -
-
- + + + +
- 发送 + 发送
@@ -100,25 +158,15 @@ diff --git a/src/components/MdPreview/md.ts b/src/components/MdPreview/md.ts new file mode 100644 index 00000000..81aa7b65 --- /dev/null +++ b/src/components/MdPreview/md.ts @@ -0,0 +1,30 @@ + +// @ts-ignore +import markdownit from 'markdown-it'; +import hljs from 'highlight.js'; // https://highlightjs.org +import katexPlugin from '@iktakahiro/markdown-it-katex'; +const codeTool = (text: string) => ``; + +const md = markdownit({ + html: true, + linkfy: true, + highlight: function (str: string, lang: string) { + const baseText = str + if (lang && hljs.getLanguage(lang)) { + try { + return '
' +
+                    hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
+                    '' + codeTool(baseText) + '
'; + } catch (__) { } + } + return '
' + md.utils.escapeHtml(str) + '' + codeTool(baseText) + '
'; + } +}); + +md.use(katexPlugin); + +export default md; diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index 2e5cead6..317f6838 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -98,11 +98,12 @@ {{formatDate(item.createTime)}}
-
+ +
- + 复制
@@ -124,7 +125,7 @@ {{formatDate(item.createTime)}}
-
+
{{item.content}}
@@ -161,21 +162,30 @@ diff --git a/src/views/ai/model/chatRole/ChatRoleForm.vue b/src/views/ai/model/chatRole/ChatRoleForm.vue index 1e184bff..b83dea51 100644 --- a/src/views/ai/model/chatRole/ChatRoleForm.vue +++ b/src/views/ai/model/chatRole/ChatRoleForm.vue @@ -7,29 +7,37 @@ label-width="100px" v-loading="formLoading" > - - - - + + + + + + - - - - + - + - + @@ -42,7 +50,10 @@ - + + + + import { getIntDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict' import { ChatRoleApi, ChatRoleVO } from '@/api/ai/model/chatRole' +import { CommonStatusEnum } from '@/utils/constants' +import { ChatModelApi, ChatModelVO } from '@/api/ai/model/chatModel' /** AI 聊天角色 表单 */ defineOptions({ name: 'ChatRoleForm' }) @@ -84,8 +97,8 @@ const formData = ref({ description: undefined, welcomeMessage: undefined, systemMessage: undefined, - publicStatus: undefined, - status: undefined + publicStatus: true, + status: CommonStatusEnum.ENABLE }) const formRules = reactive({ name: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }], @@ -98,6 +111,7 @@ const formRules = reactive({ publicStatus: [{ required: true, message: '是否公开不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref +const chatModelList = ref([] as ChatModelVO[]) // 聊天模型列表 /** 打开弹窗 */ const open = async (type: string, id?: number) => { @@ -114,6 +128,8 @@ const open = async (type: string, id?: number) => { formLoading.value = false } } + // 获得下拉数据 + chatModelList.value = await ChatModelApi.getChatModelSimpleList(CommonStatusEnum.ENABLE) } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 @@ -153,8 +169,8 @@ const resetForm = () => { description: undefined, welcomeMessage: undefined, systemMessage: undefined, - publicStatus: undefined, - status: undefined + publicStatus: true, + status: CommonStatusEnum.ENABLE } formRef.value?.resetFields() } diff --git a/src/views/ai/model/chatRole/index.vue b/src/views/ai/model/chatRole/index.vue index 40759e87..552d9a68 100644 --- a/src/views/ai/model/chatRole/index.vue +++ b/src/views/ai/model/chatRole/index.vue @@ -59,13 +59,14 @@ - - - - + + + + - @@ -79,13 +80,7 @@ - +