修改测试用例1

This commit is contained in:
guanj
2026-01-12 11:06:54 +08:00
parent 08afdddc51
commit e9d7231a75
16 changed files with 923 additions and 822 deletions

View File

@@ -646,7 +646,8 @@
:controls="false"
:min="1"
style="width: 48%"
v-model="lineItem.ptRatio"
oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.ptRatio"
:disabled="
!(
(nodeLevel == 4 && pageStatus == 3) ||
@@ -670,7 +671,8 @@
:controls="false"
:min="1"
style="width: 48%"
v-model="lineItem.pt2Ratio"
oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.pt2Ratio"
:disabled="
!(
(nodeLevel == 4 && pageStatus == 3) ||
@@ -694,7 +696,8 @@
:controls="false"
:min="1"
style="width: 48%"
v-model="lineItem.ctRatio"
oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.ctRatio"
:disabled="
!(
(nodeLevel == 4 && pageStatus == 3) ||
@@ -718,7 +721,8 @@
:controls="false"
:min="1"
style="width: 48%"
v-model="lineItem.ct2Ratio"
oninput="value=value.replace(/[^\d]/g,'')"
v-model.number="lineItem.ct2Ratio"
:disabled="
!(
(nodeLevel == 4 && pageStatus == 3) ||
@@ -1037,8 +1041,8 @@
<Loading />
</el-icon>
<p style="margin-top: 15px; font-size: 16px">正在推送台账信息,请稍候...</p>
<p style="margin-top: 10px; color: #999">预计需要30秒左右</p>
<p style="margin-top: 10px; color: #999">已等待: {{ countdown }}秒</p>
<!-- <p style="margin-top: 10px; color: #999">预计需要30秒左右</p>
<p style="margin-top: 10px; color: #999">已等待: {{ countdown }}秒</p> -->
</div>
</el-dialog>
</div>
@@ -1360,7 +1364,7 @@ const onAdd = async () => {
if (timer.value) clearInterval(timer.value)
timer.value = window.setInterval(() => {
countdown.value++
if (countdown.value >= 30) {
if (countdown.value >= 5) {
clearInterval(timer.value!)
timer.value = null
}
@@ -1388,7 +1392,7 @@ const onAdd = async () => {
// 如果data不是"暂无需要推送的数据",则继续执行
if (pushLogResponse.data === '成功') {
// 等待30秒
await new Promise(resolve => setTimeout(resolve, 30000))
await new Promise(resolve => setTimeout(resolve, 5000))
// 30秒后调用查询推送结果接口
const result = await queryPushResult()

File diff suppressed because it is too large Load Diff

View File

@@ -51,7 +51,7 @@
</template>
</TableHeader>
<Table ref="tableRef" />
<PopupDictionary ref="popupDictionary" v-if="show" @close="show=false"></PopupDictionary>
<PopupDictionary ref="popupDictionary" v-if="show" @close="show = false"></PopupDictionary>
</div>
</template>
<script setup lang="ts">
@@ -90,7 +90,20 @@ const tableStore = new TableStore({
{ title: '别名', field: 'otherName', minWidth: 220 },
{ title: '展示名称', field: 'showName', minWidth: 170 },
{ title: '告警码', field: 'defaultValue', minWidth: 170 },
{ title: '相别', field: 'phaseName', minWidth: 80 },
{
title: '相别',
field: 'phase',
minWidth: 80,
formatter: (row: any) => {
return row.cellValue
? row.cellValue == '/'
? '/'
: row.cellValue == 'M'
? '无相别'
: row.cellValue + '相'
: '/'
}
},
{ title: '单位', field: 'unit', minWidth: 80 },
{ title: '基础数据类型', field: 'type', minWidth: 170 },
{ title: '数据谐波次数', field: 'harmStartEnd', minWidth: 170 },
@@ -143,7 +156,7 @@ const tableStore = new TableStore({
tableStore.table.data.forEach((item: any) => {
item.classIdName = DataSelect.find((child: any) => child.id == item.classId)?.name || '/'
item.resourcesIdName = ResourcesIdSelect.find((child: any) => child.id == item.resourcesId)?.name || '/'
item.phaseName = item.phase === 'M' ? '/' : item.phase || '/'
// item.phaseName = item.phase === 'M' ? '无相别' : item.phase || '/'
item.harmStartEnd = item.harmEnd ? item.harmStart + '-' + item.harmEnd : '/'
for (let key in item) {
if (typeof item[key] !== 'number') {

View File

@@ -61,7 +61,7 @@
placeholder="请输入单位"
></el-input>
</el-form-item>
<el-form-item label="基础数据类型:" >
<el-form-item label="基础数据类型:">
<el-input
maxlength="32"
show-word-limit
@@ -284,7 +284,23 @@ const phaseSelect = [
{
name: 'T相',
id: 'T'
}
},
{
name: 'AB相',
id: 'AB'
},
{
name: 'BC相',
id: 'BC'
},
{
name: 'CA相',
id: 'CA'
},
{
name: '无相别',
id: 'M'
},
]
const StatMethodSelect = [
{
@@ -372,8 +388,8 @@ const open = (text: string, data?: anyObj) => {
if (data) {
for (let key in form) {
if (key == 'statMethod') {
form[key] = data[key].split(',')
} else {
form[key] = data[key] == '/' ? [] : data[key].split(',')
} else {
form[key] = data[key] === '/' ? null : data[key]
}
}

View File

@@ -88,7 +88,7 @@
></el-input>
</el-form-item>
</el-form>
<el-form :model="form" label-width="100px" class="mt10 form-one" >
<el-form :model="form" label-width="100px" class="mt10 form-one">
<el-form-item label="描述:" prop="description">
<el-input
maxlength="300"
@@ -103,6 +103,7 @@
<el-form-item label="升级文件:" prop="file">
<el-upload
:limit="1"
accept=".bin"
:auto-upload="false"
:on-change="fileChange"
:on-exceed="fileExceed"
@@ -212,12 +213,27 @@ const formDevModelOptionsFilter = computed(() => {
})
})
const fileChange = (e: any) => {
if (!beforeUpload(e.raw)) return
form.file = e.raw
fileList.value = [e.raw]
}
const fileExceed = (e: any) => {
ElMessage.error('只能上传一个文件')
}
// 处理上传前检查
const beforeUpload = (file: any) => {
const isWord = file.name.endsWith('.bin')
if (!isWord) {
ElMessage.error('请上传(.bin)格式文件!')
fileList.value = []
return false
}
// 校验通过后允许上传,交由 http-request 处理
return true
}
const fileRemove = (e: any) => {
form.file = null
fileList.value = []

View File

@@ -33,7 +33,7 @@ import { useDictData } from '@/stores/dictData'
import PopupVersion from '@/views/govern/manage/basic/popupVersion.vue'
import { Plus } from '@element-plus/icons-vue'
import { auditEdData } from '@/api/cs-device-boot/edData'
import { getFileUrl, downLoadFile } from '@/api/cs-system-boot/manage'
defineOptions({
name: 'govern/manage/basic/version'
})
@@ -72,6 +72,16 @@ const tableStore = new TableStore({
width: '180',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '下载文件',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
downloadTheReport(row.filePath)
}
},
{
name: 'edit',
title: '编辑',
@@ -151,11 +161,30 @@ queryByCode('Device_Type').then(res => {
res1.data.splice(index, 1)
}
})
console.log('🚀 ~ res1.data.map ~ res1.data:', res1.data)
DevTypeOptions.value = res1.data
})
})
// 下载报告
const downloadTheReport = (name: string) => {
getFileUrl(name).then((res: any) => {
downLoadFile(res.data).then(res => {
let blob = new Blob([res], {
type: 'application/octet-stream'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = name.split('/').pop() || '升级文件' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
ElMessage.success('下载成功')
})
})
}
tableStore.table.params.devType = ''
provide('tableStore', tableStore)
onMounted(() => {

View File

@@ -1,21 +1,19 @@
<template>
<div class="view" style="height: 100%">
<TableHeader
datePicker
ref="headerRef"
>
<TableHeader datePicker ref="headerRef">
<template v-slot:operation>
<el-button type="primary" :icon="Setting" @click="exportTab">补召</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<Table ref="tableRef" />
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, provide, nextTick, defineEmits, watch } from 'vue'
import { ref, onMounted, provide, nextTick, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { ElMessage, ElTree } from 'element-plus'
import TableHeader from '@/components/table/header/index.vue'
import { Setting } from '@element-plus/icons-vue'
@@ -24,7 +22,7 @@ const props = defineProps({
type: Array,
default: () => []
}
});
})
const tableParams: any = ref({})
const headerRef = ref()
@@ -35,7 +33,9 @@ const tableStore: any = new TableStore({
method: 'POST',
column: [
{
title: '序号', width: 80, formatter: (row: any) => {
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
@@ -49,7 +49,7 @@ const tableStore: any = new TableStore({
},
{ field: 'successCount', title: '成功解析数', minWidth: 150 },
{ field: 'startTime', title: '导入开始时间', minWidth: 170, sortable: true },
{ field: 'endTime', title: '导入结束时间', minWidth: 170 , sortable: true},
{ field: 'endTime', title: '导入结束时间', minWidth: 170, sortable: true },
{
title: '解析状态',
field: 'status',
@@ -79,30 +79,27 @@ const tableStore: any = new TableStore({
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
}
click: row => {}
}
]
}
],
beforeSearchFun: () => {
},
loadCallback: () => {
}
beforeSearchFun: () => {},
loadCallback: () => {}
})
provide('tableStore', tableStore)
const exportTab = () => {
ElMessage.info('稳态补召功能暂未开发!')
}
//获取请求参数
const getTableParams = (val: any) => {
tableParams.value = val
tableStore.index()
}
defineExpose({
defineExpose({
getTableParams
})
@@ -129,4 +126,4 @@ onMounted(() => {
.view :deep(.el-table) {
height: calc(100% - 56px);
}
</style>
</style>

View File

@@ -28,7 +28,13 @@
<span style="display: flex; align-items: center">
{{ item.name }}
<el-tooltip class="item" effect="dark" content="修改项目" placement="top" v-if="hasAdmin || item.createBy == adminInfo.id">
<el-tooltip
class="item"
effect="dark"
content="修改项目"
placement="top"
v-if="hasAdmin || item.createBy == adminInfo.id"
>
<Edit
style="margin-left: 5px; width: 16px"
class="xiaoshou color"
@@ -121,7 +127,9 @@ defineOptions({
})
const adminInfo = useAdminInfo()
const hasAdmin = adminInfo.roleCode.some(item => item.includes('operation_manager')|| item.includes('root'))
const hasAdmin =
adminInfo.userType.some(item => item.includes('operation_manager') || item.includes('root')) ||
adminInfo.userType == 1
const tableRef = ref()
const popupRef = ref()
let DOMIN = window.location.origin