From 241590dedb9d7329a422dd1b00f9ae276a0481ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AF=9B=E9=B9=8F?= <729164035@qq.com> Date: Sun, 9 Nov 2025 13:36:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MangoServer/src/settings/__init__.py | 6 +- .../index/components/AutomationStats.vue | 68 ++++++---- mango-console/src/views/index/main.vue | 116 +----------------- .../src/views/uitest/case/details/index.vue | 10 +- 4 files changed, 56 insertions(+), 144 deletions(-) diff --git a/MangoServer/src/settings/__init__.py b/MangoServer/src/settings/__init__.py index 81704844..dc059004 100644 --- a/MangoServer/src/settings/__init__.py +++ b/MangoServer/src/settings/__init__.py @@ -126,10 +126,10 @@ if not IS_SQLITE: 'OPTIONS': { 'charset': 'utf8mb4', 'connect_timeout': 5, # 连接超时时间 - 'init_command': 'SET SESSION sort_buffer_size=8 * 1024 * 1024', # 会话级设置 - 'isolation_level': 'READ COMMITTED', # 可选:事务隔离级别 + 'init_command': "SET SESSION wait_timeout=60, interactive_timeout=60, sort_buffer_size=2 * 1024 * 1024", + 'isolation_level': 'READ COMMITTED', }, - 'CONN_MAX_AGE': 60, # 连接最大存活时间(秒) + 'CONN_MAX_AGE': 60, # 这个设置是正确的 } } else: diff --git a/mango-console/src/views/index/components/AutomationStats.vue b/mango-console/src/views/index/components/AutomationStats.vue index bf2a867e..a05d2f2e 100644 --- a/mango-console/src/views/index/components/AutomationStats.vue +++ b/mango-console/src/views/index/components/AutomationStats.vue @@ -57,33 +57,49 @@ diff --git a/mango-console/src/views/index/main.vue b/mango-console/src/views/index/main.vue index acafc87e..c8be1982 100644 --- a/mango-console/src/views/index/main.vue +++ b/mango-console/src/views/index/main.vue @@ -11,11 +11,7 @@
- <AutomationStats - :ui-stats="data.uiStats" - :api-stats="data.apiStats" - :pytest-stats="data.pytestStats" - /> + <AutomationStats /> </div> </div> <div class="center"> @@ -60,65 +56,34 @@ </template> <script lang="ts" setup> - import { computed, nextTick, onMounted, reactive, ref, unref, watch } from 'vue' - import useAppConfigStore from '@/store/modules/app-config' + import { nextTick, onMounted, reactive, ref } from 'vue' import FullYearSalesChart from './components/chart/FullYearSalesChart.vue' import HotProductChart from './components/chart/HotProductChart.vue' import Title from '@/views/index/components/Title.vue' - import { useRowKey, useRowSelection, useTable, useTableColumn } from '@/hooks/table' - import { useRouter } from 'vue-router' - import { getSystemTasks } from '@/api/system/tasks' - import { useEnum } from '@/store/modules/get-enum' import PieChart from '@/components/chart/PieChart.vue' import { getSystemCaseRunSum, getSystemCaseSum, getSystemIndexStatistics } from '@/api/system' - import { Message } from '@arco-design/web-vue' - // 导入新创建的组件 import ContactAuthor from './components/ContactAuthor.vue' import AutomationStats from './components/AutomationStats.vue' import PendingTasks from './components/PendingTasks.vue' import ResourceCenter from './components/ResourceCenter.vue' - const appStore = useAppConfigStore() - - // 联系作者弹窗相关状态 const contactVisible = ref(false) - const enumStore = useEnum() - const hotProductChart = ref() - const fullYearSalesChart = ref() - const onResize = () => { - setTimeout(() => { - unref(hotProductChart).updateChart() - unref(fullYearSalesChart).updateChart() - }, 500) - } - const collapse = computed(() => { - return appStore.isCollapse - }) - watch(collapse, () => { - onResize() - }) - - const { onSelectionChange } = useRowSelection() - const table = useTable() - const rowKey = useRowKey('id') const data: any = reactive({ caseSum: [], reportSum: [], onlineUsers: 0, - // UI自动化统计 uiStats: { + elementCount: 0, pageCount: 0, stepCount: 0, caseCount: 0, }, - // API自动化统计 apiStats: { interfaceCount: 0, caseCount: 0, headersCount: 0, }, - // Pytest自动化统计 pytestStats: { processObjects: 0, caseCount: 0, @@ -126,73 +91,6 @@ testFiles: 0, }, }) - const tableColumns = useTableColumn([ - table.indexColumn, - { - title: '任务名称', - key: 'name', - dataIndex: 'name', - align: 'left', - ellipsis: true, - tooltip: true, - }, - { - title: '定时策略', - key: 'timing_strategy', - dataIndex: 'timing_strategy', - align: 'left', - ellipsis: true, - tooltip: true, - }, - { - title: '测试对象', - key: 'test_env', - dataIndex: 'test_env', - width: 100, - }, - { - title: '负责人', - key: 'case_people', - dataIndex: 'case_people', - width: 120, - }, - ]) - const router = useRouter() - - function handleViewResult(record: any) { - router.push({ - path: '/index/report-details', - query: { - id: record.id, - name: record.name, - type: record.type, - }, - }) - } - - function goToCreateCase() { - router.push('/apitest/case/create') - } - - function goToTaskManagement() { - router.push('/system/tasks') - } - - function goToReportCenter() { - router.push('/index/report') - } - - function doRefresh() { - getSystemTasks({ - pageSize: 100, - page: 1, - }) - .then((res) => { - table.handleSuccess(res) - - }) - .catch(console.log) - } function caseSum() { getSystemCaseSum() @@ -210,7 +108,6 @@ .catch(console.log) } - // 获取系统统计数据 function getSystemStatistics() { getSystemIndexStatistics() .then((res) => { @@ -223,10 +120,9 @@ onMounted(() => { nextTick(async () => { - doRefresh() - caseSum() - getAllReportSum() - getSystemStatistics() + caseSum() + getAllReportSum() + getSystemStatistics() }) }) diff --git a/mango-console/src/views/uitest/case/details/index.vue b/mango-console/src/views/uitest/case/details/index.vue index 692af00a..3b519786 100644 --- a/mango-console/src/views/uitest/case/details/index.vue +++ b/mango-console/src/views/uitest/case/details/index.vue @@ -45,13 +45,13 @@ </div> </a-space> </template> - <a-tab-pane key="1" title="前置数据"> + <a-tab-pane key="1" title="用例前置"> <a-tabs :default-active-key="data.uiSonType" position="left" @tab-click="(key) => switchSonType(key)" > - <a-tab-pane key="11" title="自定义变量"> + <a-tab-pane key="11" title="自定义参数"> <a-space direction="vertical"> <a-space v-for="(item, index) of pageData.record.front_custom" @@ -79,7 +79,7 @@ </a-space> </a-space> </a-tab-pane> - <a-tab-pane key="12" title="sql变量"> + <a-tab-pane key="12" title="sql参数"> <a-space direction="vertical"> <a-space v-for="(item, index) of pageData.record.front_sql" :key="item.sql"> <span>sql语句</span> @@ -192,13 +192,13 @@ </template> </a-table> </a-tab-pane> - <a-tab-pane key="3" title="后置清除"> + <a-tab-pane key="3" title="用例后置"> <a-tabs :default-active-key="data.uiSonType" position="left" @tab-click="(key) => switchSonType(key)" > - <a-tab-pane key="31" title="sql清除"> + <a-tab-pane key="31" title="sql参数"> <a-space direction="vertical"> <a-space v-for="(item, index) of pageData.record.posterior_sql"