|
@@ -2,10 +2,9 @@
|
|
|
<div class="report-template-page admin-page">
|
|
<div class="report-template-page admin-page">
|
|
|
<!-- Tab 1: 模板列表 -->
|
|
<!-- Tab 1: 模板列表 -->
|
|
|
<el-card v-show="activeTab === 'list'">
|
|
<el-card v-show="activeTab === 'list'">
|
|
|
- <div slot="header">
|
|
|
|
|
- <span>报告模板管理</span>
|
|
|
|
|
|
|
+ <PageHeader slot="header" title="报告模板管理">
|
|
|
<el-button size="small" type="primary" @click="openEditor(null)">+ 新增模板</el-button>
|
|
<el-button size="small" type="primary" @click="openEditor(null)">+ 新增模板</el-button>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </PageHeader>
|
|
|
<div class="adm-table-wrap">
|
|
<div class="adm-table-wrap">
|
|
|
<el-table :data="templates" v-loading="loading" border stripe height="100%">
|
|
<el-table :data="templates" v-loading="loading" border stripe height="100%">
|
|
|
<el-table-column prop="id" label="ID" width="60">
|
|
<el-table-column prop="id" label="ID" width="60">
|
|
@@ -23,9 +22,7 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="状态" width="80">
|
|
<el-table-column label="状态" width="80">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
- <el-tag :type="row.isActive === 1 ? 'success' : 'info'" size="small">
|
|
|
|
|
- {{ row.isActive === 1 ? '启用' : '停用' }}
|
|
|
|
|
- </el-tag>
|
|
|
|
|
|
|
+ <StatusTag :type="row.isActive === 1 ? 'success' : 'info'" :text="row.isActive === 1 ? '启用' : '停用'" size="small" />
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column prop="updatedAt" label="更新时间" width="170">
|
|
<el-table-column prop="updatedAt" label="更新时间" width="170">
|
|
@@ -46,10 +43,9 @@
|
|
|
|
|
|
|
|
<!-- Tab 2: 模板编辑器 -->
|
|
<!-- Tab 2: 模板编辑器 -->
|
|
|
<el-card v-show="activeTab === 'editor'">
|
|
<el-card v-show="activeTab === 'editor'">
|
|
|
- <div slot="header">
|
|
|
|
|
- <span>{{ isEdit ? '编辑模板' : '新增模板' }}</span>
|
|
|
|
|
|
|
+ <PageHeader slot="header" :title="isEdit ? '编辑模板' : '新增模板'">
|
|
|
<el-button size="small" @click="activeTab = 'list'">返回列表</el-button>
|
|
<el-button size="small" @click="activeTab = 'list'">返回列表</el-button>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </PageHeader>
|
|
|
|
|
|
|
|
<div class="report-template-form-wrap">
|
|
<div class="report-template-form-wrap">
|
|
|
<el-form ref="form" :model="form" label-width="110px" style="max-width:900px">
|
|
<el-form ref="form" :model="form" label-width="110px" style="max-width:900px">
|
|
@@ -72,7 +68,7 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
<!-- 固定块编辑区 -->
|
|
<!-- 固定块编辑区 -->
|
|
|
- <el-divider content-position="left">固定展示块(按顺序渲染)</el-divider>
|
|
|
|
|
|
|
+ <SectionTitle title="固定展示块(按顺序渲染)" />
|
|
|
<div class="block-list">
|
|
<div class="block-list">
|
|
|
<div v-for="(block, bIdx) in form.fixedBlocks" :key="bIdx" class="block-item">
|
|
<div v-for="(block, bIdx) in form.fixedBlocks" :key="bIdx" class="block-item">
|
|
|
<div class="block-header">
|
|
<div class="block-header">
|
|
@@ -138,7 +134,7 @@
|
|
|
<el-button size="small" type="dashed" @click="addBlock" style="margin-top:8px">+ 添加固定块</el-button>
|
|
<el-button size="small" type="dashed" @click="addBlock" style="margin-top:8px">+ 添加固定块</el-button>
|
|
|
|
|
|
|
|
<!-- 自由显示配置 -->
|
|
<!-- 自由显示配置 -->
|
|
|
- <el-divider content-position="left">自由显示配置</el-divider>
|
|
|
|
|
|
|
+ <SectionTitle title="自由显示配置" />
|
|
|
<el-form-item label="启用自由显示">
|
|
<el-form-item label="启用自由显示">
|
|
|
<el-switch v-model="form.freeDisplay.enabled" :active-value="true" :inactive-value="false" />
|
|
<el-switch v-model="form.freeDisplay.enabled" :active-value="true" :inactive-value="false" />
|
|
|
<span class="hint-text">开启后,未配置在固定块的指标将追加到末尾</span>
|
|
<span class="hint-text">开启后,未配置在固定块的指标将追加到末尾</span>
|
|
@@ -419,13 +415,6 @@ export default {
|
|
|
.block-title-display { color: #333; font-size: 14px; }
|
|
.block-title-display { color: #333; font-size: 14px; }
|
|
|
.block-del { margin-left: auto; }
|
|
.block-del { margin-left: auto; }
|
|
|
.hint-text { margin-left: 12px; color: var(--adm-text-45); font-size: 12px; }
|
|
.hint-text { margin-left: 12px; color: var(--adm-text-45); font-size: 12px; }
|
|
|
-.block-list { border: 1px solid #ebeef5; border-radius: 4px; margin-bottom: 12px; }
|
|
|
|
|
-.block-item { border-bottom: 1px solid var(--adm-border-split); padding: 12px 16px; }
|
|
|
|
|
-.block-item:last-child { border-bottom: none; }
|
|
|
|
|
-.block-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
|
|
|
|
|
-.block-type-tag { background: #f0f9ff; color: #2c7be5; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
|
|
|
|
|
-.block-title-display { color: #333; font-size: 14px; }
|
|
|
|
|
-.block-del { margin-left: auto; }
|
|
|
|
|
.block-move-up, .block-move-dn { color: var(--adm-text-45); }
|
|
.block-move-up, .block-move-dn { color: var(--adm-text-45); }
|
|
|
.preview-block { background: var(--adm-bg-container); border: 1px solid #eee; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
|
|
.preview-block { background: var(--adm-bg-container); border: 1px solid #eee; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
|
|
|
.preview-block-title { font-weight: bold; font-size: 15px; margin-bottom: 10px; color: var(--adm-text-88); }
|
|
.preview-block-title { font-weight: bold; font-size: 15px; margin-bottom: 10px; color: var(--adm-text-88); }
|