修改测试查询的界面部分逻辑,修复bug
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"Vue.volar",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"EditorConfig.EditorConfig"
|
||||
]
|
||||
}
|
||||
16
auts_new_mobile.client/package-lock.json
generated
16
auts_new_mobile.client/package-lock.json
generated
@@ -95,6 +95,7 @@
|
||||
"integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@ampproject/remapping": "^2.2.0",
|
||||
"@babel/code-frame": "^7.27.1",
|
||||
@@ -1674,6 +1675,7 @@
|
||||
"resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz",
|
||||
"integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/lodash": "*"
|
||||
}
|
||||
@@ -1952,6 +1954,7 @@
|
||||
"resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-13.6.0.tgz",
|
||||
"integrity": "sha512-DJbD5fV86muVmBgS9QQPddVX7d9hWYswzlf4bIyUD2dj8GC46R1uNClZhVAmsdVts4xb2jwp1PbpuiA50Qee1A==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/web-bluetooth": "^0.0.21",
|
||||
"@vueuse/metadata": "13.6.0",
|
||||
@@ -1991,6 +1994,7 @@
|
||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -2188,6 +2192,7 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"caniuse-lite": "^1.0.30001733",
|
||||
"electron-to-chromium": "^1.5.199",
|
||||
@@ -2848,6 +2853,7 @@
|
||||
"integrity": "sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/regexpp": "^4.12.1",
|
||||
@@ -3783,13 +3789,15 @@
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"license": "MIT"
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/lodash-es": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz",
|
||||
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
|
||||
"license": "MIT"
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/lodash-unified": {
|
||||
"version": "1.0.3",
|
||||
@@ -4377,6 +4385,7 @@
|
||||
"integrity": "sha512-WMmLFI+Boh6xbop+OAGo9cQ3OgX9MIg7xOQjn+pTCwOkk+FNDAeAemXkJ3HzDJrVXleLOFVa1ipuc1AmEx1Dwg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/estree": "1.0.8"
|
||||
},
|
||||
@@ -5092,6 +5101,7 @@
|
||||
"integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.25.0",
|
||||
"fdir": "^6.4.4",
|
||||
@@ -5254,6 +5264,7 @@
|
||||
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.18.tgz",
|
||||
"integrity": "sha512-7W4Y4ZbMiQ3SEo+m9lnoNpV9xG7QVMLa+/0RFwwiAVkeYoyGXqWE85jabU4pllJNUzqfLShJ5YLptewhCWUgNA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.18",
|
||||
"@vue/compiler-sfc": "3.5.18",
|
||||
@@ -5365,6 +5376,7 @@
|
||||
"integrity": "sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==",
|
||||
"deprecated": "Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-sfc": "2.7.16",
|
||||
"csstype": "^3.1.0"
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
}
|
||||
|
||||
const disDbDrop = ref(true)
|
||||
const disDbDrop = ref(false)
|
||||
|
||||
|
||||
// 数据库变更处理
|
||||
@@ -292,16 +292,24 @@
|
||||
}
|
||||
$http.post('DataHandle/R_InfoCommon', requestBody)
|
||||
.then(rs => {
|
||||
//console.log(rs)
|
||||
console.log(rs)
|
||||
if (rs.data.isok) {
|
||||
product.options = []
|
||||
// 从localStorage获取auths权限列表
|
||||
const authsJson = localStorage.getItem('auths')
|
||||
const auths = authsJson ? JSON.parse(authsJson) : []
|
||||
console.log(auths)
|
||||
rs.data.response.forEach(item => {
|
||||
if (item.Database.slice(0, 3) == "uts" && item.Database != "uts_manage") {
|
||||
let dbname = {
|
||||
label: item.Database,
|
||||
value: item.Database
|
||||
// 检查用户是否有该数据库的权限(大小写不敏感)
|
||||
const hasPermission = auths.some(auth => auth.databaseName.toLowerCase() === item.Database.toLowerCase())
|
||||
if (hasPermission) {
|
||||
let dbname = {
|
||||
label: item.Database,
|
||||
value: item.Database
|
||||
}
|
||||
product.options.push(dbname)
|
||||
}
|
||||
product.options.push(dbname)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -329,7 +337,7 @@
|
||||
if (localStorage.getItem('selectdb')) {
|
||||
product.value = localStorage.getItem('selectdb')
|
||||
} else {
|
||||
product.value = "uts_blw"
|
||||
product.value = ""
|
||||
localStorage.setItem('selectdb', product.value)
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
direction: 'column',
|
||||
message: '登录成功!',
|
||||
});*/
|
||||
|
||||
|
||||
} else {
|
||||
Toast(rs.data.message)
|
||||
}
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
// 绘制噪点
|
||||
ctx.fillStyle = isDarkMode.value ? '#FFFFFF' : '#000000';
|
||||
for (let i = 0; i < 33; i++) {
|
||||
for (let i = 0; i < 33; i++) {
|
||||
const x = Math.random() * canvas.width;
|
||||
const y = Math.random() * canvas.height;
|
||||
ctx.beginPath();
|
||||
@@ -231,7 +231,7 @@
|
||||
// 添加5-10条干扰条纹
|
||||
ctx.strokeStyle = '#6F4A2F';
|
||||
const bug = Math.floor(Math.random() * 6) + 3
|
||||
for (let i = 0; i < bug; i++) {
|
||||
for (let i = 0; i < bug; i++) {
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(Math.random() * canvas.width, Math.random() * canvas.height);
|
||||
ctx.lineTo(Math.random() * canvas.width, Math.random() * canvas.height);
|
||||
@@ -286,6 +286,7 @@
|
||||
// 存储token
|
||||
localStorage.setItem('token', rs.data.response.accessToken)
|
||||
localStorage.setItem('username', rs.data.response.userName)
|
||||
localStorage.setItem('auths', JSON.stringify(rs.data.response.auths))
|
||||
localStorage.setItem('login', true)
|
||||
localStorage.setItem('uid', rs.data.response.id)
|
||||
|
||||
|
||||
@@ -190,6 +190,16 @@
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="action-buttons">
|
||||
<el-input v-model="queryForm.dutSnLike"
|
||||
size="small"
|
||||
clearable
|
||||
placeholder="筛选DUT_SN"
|
||||
class="action-input" />
|
||||
<el-input v-model="queryForm.failstepsLike"
|
||||
size="small"
|
||||
clearable
|
||||
placeholder="筛选Failsteps"
|
||||
class="action-input" />
|
||||
<el-button icon="Download"
|
||||
size="small"
|
||||
:disabled="!tableData.length > 0"
|
||||
@@ -232,7 +242,7 @@
|
||||
<template v-if="col.prop === 'DUT_SN'" #default="scope">
|
||||
<!-- SN号查整个生命周期 -->
|
||||
<el-button @click="snGetLog(scope.row)"
|
||||
:type="scope.row.TestResult === 'True' ? 'success' : 'danger'" size="small" text>
|
||||
:style="scope.row.TestResult === 'True' ? 'color: #336600' : 'color: #990000'" size="small" text>
|
||||
{{ scope.row.DUT_SN }}
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -247,10 +257,10 @@
|
||||
</template>
|
||||
<template v-else #default="scope">
|
||||
<el-text v-if="scope.row.TestResult === 'True'"
|
||||
type="success" size="small">
|
||||
style="color: #336600" size="small">
|
||||
{{ scope.row[col.prop] }}
|
||||
</el-text>
|
||||
<el-text v-else type="danger" size="small">
|
||||
<el-text v-else style="color: #990000" size="small">
|
||||
{{ scope.row[col.prop] }}
|
||||
</el-text>
|
||||
</template>
|
||||
@@ -275,42 +285,42 @@
|
||||
@row-click="showDetailDialog">
|
||||
<el-table-column prop="step" label="站" width="50">
|
||||
<template #default="scope">
|
||||
<el-text :type="scope.row.testResult === 'True' ? 'success' : 'danger'" size="small">
|
||||
<el-text :style="scope.row.testResult === 'True' ? 'color: #336600' : 'color: #990000'" size="small">
|
||||
{{ getStationName(scope.row.step) }}
|
||||
</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="id" label="ID" width="60">
|
||||
<template #default="scope">
|
||||
<el-text :type="scope.row.testResult === 'True' ? 'success' : 'danger'" size="small">
|
||||
<el-text :style="scope.row.testResult === 'True' ? 'color: #336600' : 'color: #990000'" size="small">
|
||||
{{ scope.row.id }}
|
||||
</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" label="开始时间" width="80">
|
||||
<template #default="scope">
|
||||
<el-text :type="scope.row.testResult === 'True' ? 'success' : 'danger'" size="small">
|
||||
<el-text :style="scope.row.testResult === 'True' ? 'color: #336600' : 'color: #990000'" size="small">
|
||||
{{ scope.row.startTime }}
|
||||
</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="usedTime" label="用时(秒)" width="70">
|
||||
<template #default="scope">
|
||||
<el-text :type="scope.row.testResult === 'True' ? 'success' : 'danger'" size="small">
|
||||
<el-text :style="scope.row.testResult === 'True' ? 'color: #336600' : 'color: #990000'" size="small">
|
||||
{{ scope.row.usedTime }}
|
||||
</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="failSteps" label="失败步骤" width="75">
|
||||
<template #default="scope">
|
||||
<el-text :type="scope.row.testResult === 'True' ? 'success' : 'danger'" size="small">
|
||||
<el-text :style="scope.row.testResult === 'True' ? 'color: #336600' : 'color: #990000'" size="small">
|
||||
{{ scope.row.failSteps }}
|
||||
</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="failMsg" label="失败信息" min-width="80">
|
||||
<template #default="scope">
|
||||
<el-text :type="scope.row.testResult === 'True' ? 'success' : 'danger'" size="small">
|
||||
<el-text :style="scope.row.testResult === 'True' ? 'color: #336600' : 'color: #990000'" size="small">
|
||||
{{ scope.row.failMsg }}
|
||||
</el-text>
|
||||
</template>
|
||||
@@ -329,7 +339,7 @@
|
||||
<el-descriptions-item v-for="(value, key) in currentDetail.rObj[0]"
|
||||
:key="key"
|
||||
:label="key">
|
||||
<el-text :type="currentDetail.testResult === 'True' ? 'success' : 'danger'">{{ value }}</el-text>
|
||||
<el-text :style="currentDetail.testResult === 'True' ? 'color: #336600' : 'color: #990000'">{{ value }}</el-text>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
@@ -380,6 +390,8 @@
|
||||
equipment: null, // 设备
|
||||
result: '', // 结果
|
||||
failSteps: [], // 失败步骤
|
||||
dutSnLike: '', // DUT_SN模糊筛选(支持逗号分隔)
|
||||
failstepsLike: '', // Failsteps模糊筛选(支持逗号分隔)
|
||||
distinct: 'None', // 去重方式,默认None(全部)
|
||||
startDate: dayjs().format('YYYY-MM-DD'), // 开始日期
|
||||
endDate: dayjs().format('YYYY-MM-DD') // 结束日期
|
||||
@@ -522,7 +534,7 @@
|
||||
}
|
||||
|
||||
const rs = await $http.post('DataHandle/R_InfoCommon', rqs);
|
||||
//console.log(rs);
|
||||
console.log(rs);
|
||||
|
||||
if (rs.data.isok) {
|
||||
machineModels.value = rs.data.response;
|
||||
@@ -675,7 +687,7 @@
|
||||
|
||||
if (rs.data.isok) {
|
||||
availableParams.value = rs.data.response;
|
||||
await nextTick();
|
||||
await nextTick();
|
||||
//console.log(availableParams.value)
|
||||
} else {
|
||||
Toast.error(rs.data.message);
|
||||
@@ -704,11 +716,17 @@
|
||||
const rs = await $http.post('TestLogs/GetLogListBySN', JSON.stringify(rqs))
|
||||
//console.log(rs.data)
|
||||
if (rs.data.isok) {
|
||||
snLogs.value = rs.data.response.map(log => ({
|
||||
// 先按原始 startTime 降序,然后格式化时间并设置到 snLogs
|
||||
const rawLogs = Array.isArray(rs.data.response) ? rs.data.response : [];
|
||||
rawLogs.sort((a, b) => {
|
||||
const aTime = a.startTime ? dayjs(a.startTime).valueOf() : 0;
|
||||
const bTime = b.startTime ? dayjs(b.startTime).valueOf() : 0;
|
||||
return bTime - aTime;
|
||||
});
|
||||
snLogs.value = rawLogs.map(log => ({
|
||||
...log,
|
||||
startTime: log.startTime ? formatDateTime(log.startTime) : '',
|
||||
}))
|
||||
//console.log(snLogs.value)
|
||||
}));
|
||||
snDialogVisible.value = true
|
||||
} else {
|
||||
Toast.error(rs.data.message)
|
||||
@@ -797,6 +815,8 @@
|
||||
queryForm.equipment = null;
|
||||
queryForm.result = null;
|
||||
queryForm.failSteps = null;
|
||||
queryForm.dutSnLike = '';
|
||||
queryForm.failstepsLike = '';
|
||||
queryForm.startDate = '';
|
||||
queryForm.endDate = '';
|
||||
|
||||
@@ -822,6 +842,8 @@
|
||||
EndTime: queryForm.endDate,
|
||||
TestResult: queryForm.result || '',
|
||||
FailSteps: queryForm.failSteps || [],
|
||||
DutSnLike: queryForm.dutSnLike || '',
|
||||
FailstepsLike: queryForm.failstepsLike || '',
|
||||
ColumnList: selectedParams.value.length > 0
|
||||
? ',' + selectedParams.value.join(',')
|
||||
: '',
|
||||
@@ -838,11 +860,16 @@
|
||||
}
|
||||
firstPassCount.value = rs.data.passCount;
|
||||
passRate.value = rs.data.passRate;
|
||||
tableData.value = rs.data.response.map(item => {
|
||||
return {
|
||||
...item,
|
||||
CreationTime: formatDateTime(item.CreationTime)
|
||||
}
|
||||
tableData.value = rs.data.response.map(item => ({
|
||||
...item,
|
||||
CreationTime: formatDateTime(item.CreationTime)
|
||||
}));
|
||||
|
||||
// 保证前端按 StartTime 做降序排序(最新时间在前)
|
||||
tableData.value.sort((a, b) => {
|
||||
const aTime = a.StartTime ? dayjs(a.StartTime).valueOf() : 0;
|
||||
const bTime = b.StartTime ? dayjs(b.StartTime).valueOf() : 0;
|
||||
return bTime - aTime;
|
||||
});
|
||||
//console.log(tableData.value)
|
||||
total.value = rs.data.total; // 设置总记录数
|
||||
@@ -1010,6 +1037,8 @@
|
||||
queryForm.equipment = settings.queryForm.equipment;
|
||||
queryForm.result = settings.queryForm.result;
|
||||
queryForm.failSteps = settings.queryForm.failSteps;
|
||||
queryForm.dutSnLike = settings.queryForm.dutSnLike || '';
|
||||
queryForm.failstepsLike = settings.queryForm.failstepsLike || '';
|
||||
queryForm.distinct = settings.queryForm.distinct || 'None'; // 恢复去重方式,默认None
|
||||
|
||||
// 加载辅助数据
|
||||
@@ -1041,6 +1070,8 @@
|
||||
equipment: queryForm.equipment,
|
||||
result: queryForm.result,
|
||||
failSteps: queryForm.failSteps,
|
||||
dutSnLike: queryForm.dutSnLike,
|
||||
failstepsLike: queryForm.failstepsLike,
|
||||
distinct: queryForm.distinct
|
||||
},
|
||||
selectedParams: selectedParams.value,
|
||||
@@ -1190,6 +1221,10 @@
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.action-input {
|
||||
width: 170px;
|
||||
}
|
||||
|
||||
.collapse-panel {
|
||||
margin-bottom: 1px;
|
||||
border: none;
|
||||
@@ -1313,10 +1348,10 @@
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
flex-shrink: 0;
|
||||
padding: 4px 6px;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
padding: 4px 6px;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user