- 更新 API 接口路径从 /steady/data-view/checksquare/* 到 /steady/checksquare/* - 修改校验任务状态枚举值 FAILED 为 FAIL 并更新相关处理逻辑 - 移除缺失率和最大连续缺失分钟数字段,简化数据完整性计算 - 添加新的创建结果面板组件 ChecksquareCreateResultPanel.vue - 调整创建对话框布局,采用两行搜索控件设计 - 更新任务表头部按钮文字为"新增"并调整搜索列配置为5列 - 修改详情面板显示开始时间和结束时间字段 - 重构工作台界面布局,使用 flex 布局替代 grid 布局 - 更新设备类型相关 API 接口和数据结构定义 - 添加设备类型字典常量并更新路由配置 - 优化搜索表单展开收起逻辑的计算方式 - 调整创建流程不再轮询获取任务详情,改为直接显示摘要信息 - 更新数据完整性格式化函数参数和调用方式 - 修改创建对话框样式类名和尺寸配置 - 添加设备类型管理相关的接口定义和实现方法
220 lines
4.9 KiB
Vue
220 lines
4.9 KiB
Vue
<template>
|
||
<section class="mapping-panel config-panel">
|
||
<div class="panel-header">
|
||
<div>
|
||
<div class="panel-title-tabs">
|
||
<span class="panel-title-tab">索引配置</span>
|
||
</div>
|
||
<p v-if="showDescription" class="panel-description">展示现有的索引配置,并允许继续编辑。</p>
|
||
</div>
|
||
<div class="panel-actions">
|
||
<el-button
|
||
v-if="showConfirmButton"
|
||
type="primary"
|
||
:icon="EditPen"
|
||
:disabled="!canConfirm"
|
||
@click="emit('confirm-config')"
|
||
>
|
||
{{ confirmButtonText }}
|
||
</el-button>
|
||
<el-button
|
||
v-if="showGenerateButton"
|
||
type="primary"
|
||
:icon="Connection"
|
||
:loading="isGenerating"
|
||
:disabled="!canGenerate"
|
||
@click="emit('generate')"
|
||
>
|
||
JSON映射
|
||
</el-button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="panel-content">
|
||
<div class="panel-section result-card">
|
||
<el-alert v-if="jsonError" :title="jsonError" type="error" :closable="false" class="json-alert" />
|
||
|
||
<el-input
|
||
type="textarea"
|
||
class="index-selection-textarea"
|
||
:model-value="indexSelectionJson"
|
||
:disabled="isSubmitting"
|
||
:rows="18"
|
||
resize="none"
|
||
placeholder="索引配置完成后,这里会自动回填索引配置,仍可继续直接编辑。"
|
||
@update:model-value="value => emit('update:indexSelectionJson', String(value || ''))"
|
||
/>
|
||
</div>
|
||
|
||
<el-empty v-if="!hasDefaultJson" :description="emptyDescription" />
|
||
</div>
|
||
</section>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import { Connection, EditPen } from '@element-plus/icons-vue'
|
||
|
||
defineOptions({
|
||
name: 'MappingConfigPanel'
|
||
})
|
||
|
||
withDefaults(defineProps<{
|
||
indexSelectionJson: string
|
||
isSubmitting: boolean
|
||
isGenerating: boolean
|
||
canGenerate: boolean
|
||
jsonError: string
|
||
showGenerateButton: boolean
|
||
showConfirmButton: boolean
|
||
confirmButtonText: string
|
||
canConfirm: boolean
|
||
hasDefaultJson: boolean
|
||
emptyDescription: string
|
||
showDescription?: boolean
|
||
}>(), {
|
||
showDescription: true
|
||
})
|
||
|
||
const emit = defineEmits<{
|
||
(event: 'update:indexSelectionJson', value: string): void
|
||
(event: 'confirm-config'): void
|
||
(event: 'generate'): void
|
||
}>()
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
.mapping-panel {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 16px;
|
||
min-height: 0;
|
||
padding: 24px;
|
||
border: 1px solid #e5e7eb;
|
||
border-radius: 12px;
|
||
background: #ffffff;
|
||
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
|
||
overflow: hidden;
|
||
}
|
||
|
||
.config-panel {
|
||
min-height: 0;
|
||
}
|
||
|
||
.panel-header {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
justify-content: space-between;
|
||
gap: 16px;
|
||
}
|
||
|
||
.panel-actions {
|
||
display: flex;
|
||
flex-wrap: nowrap;
|
||
align-items: center;
|
||
gap: 12px;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.panel-actions :deep(.el-button + .el-button) {
|
||
margin-left: 0;
|
||
}
|
||
|
||
.panel-title-tabs {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
border-bottom: 1px solid var(--el-border-color-light);
|
||
}
|
||
|
||
.panel-title-tab {
|
||
position: relative;
|
||
height: 36px;
|
||
padding: 0 2px;
|
||
font-size: 13px;
|
||
line-height: 36px;
|
||
color: var(--el-color-primary);
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.panel-title-tab::after {
|
||
position: absolute;
|
||
right: 0;
|
||
bottom: -1px;
|
||
left: 0;
|
||
height: 2px;
|
||
background-color: var(--el-color-primary);
|
||
content: '';
|
||
}
|
||
|
||
.panel-description {
|
||
margin: 8px 0 0;
|
||
font-size: 14px;
|
||
line-height: 1.7;
|
||
color: #4b5563;
|
||
}
|
||
|
||
.panel-content {
|
||
display: flex;
|
||
flex: 1;
|
||
flex-direction: column;
|
||
gap: 16px;
|
||
min-height: 0;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.panel-section {
|
||
border: none;
|
||
border-radius: 0;
|
||
background: transparent;
|
||
}
|
||
|
||
.result-card {
|
||
display: flex;
|
||
flex: 1;
|
||
flex-direction: column;
|
||
min-height: 0;
|
||
padding: 0;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.index-selection-textarea {
|
||
flex: 1;
|
||
min-height: 0;
|
||
margin-top: 0;
|
||
}
|
||
|
||
.json-alert + .index-selection-textarea {
|
||
margin-top: 16px;
|
||
}
|
||
|
||
.index-selection-textarea :deep(.el-textarea) {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.index-selection-textarea :deep(.el-textarea__inner) {
|
||
height: 100%;
|
||
font-family: Consolas, 'Courier New', monospace;
|
||
line-height: 1.6;
|
||
overflow-y: auto;
|
||
}
|
||
|
||
.json-alert {
|
||
margin: 16px 0 0;
|
||
}
|
||
|
||
@media (max-width: 768px) {
|
||
.mapping-panel {
|
||
padding: 20px;
|
||
}
|
||
|
||
.panel-header {
|
||
flex-direction: column;
|
||
align-items: flex-start;
|
||
}
|
||
|
||
.panel-actions {
|
||
width: 100%;
|
||
}
|
||
}
|
||
</style>
|