界面内容优化

This commit is contained in:
wyuu 2026-05-15 18:04:48 +08:00
parent 8b7b700017
commit 1e55a34574
24 changed files with 682 additions and 1259 deletions

View File

@ -121,6 +121,12 @@
<template #jgbz="{ row }"> <template #jgbz="{ row }">
{{ formatJgbz(row.jgbz) }} {{ formatJgbz(row.jgbz) }}
</template> </template>
<template #xmmc="{ row }">
<el-tooltip class="box-item" effect="dark" :content="row.clinicref" placement="top"
:disabled="!row.clinicref">
<span>{{ row.xmmc }}</span>
</el-tooltip>
</template>
</CustomTable> </CustomTable>
</div> </div>
<div class="mt10" v-if="bottomTableData.length > 0"></div> <div class="mt10" v-if="bottomTableData.length > 0"></div>
@ -520,7 +526,7 @@ const rightTableData = ref([])
// 配置项 // 配置项
const rightColumns = ref([ const rightColumns = ref([
{ prop: 'xmdh', label: '项目代号', align: 'center', visible: true, }, { prop: 'xmdh', label: '项目代号', align: 'center', visible: true, },
{ prop: 'xmmc', label: '项目名称', align: 'center', visible: true, }, { prop: 'xmmc', label: '项目名称', align: 'center', visible: true, slot: 'xmmc' },
{ prop: 'xmmc', label: '培养结果', align: 'center', visible: true, width: 150 }, { prop: 'xmmc', label: '培养结果', align: 'center', visible: true, width: 150 },
{ prop: 'csjg', label: '检验结果', align: 'center', visible: true, }, { prop: 'csjg', label: '检验结果', align: 'center', visible: true, },
{ prop: 'refs', label: '参考值', align: 'center', visible: true, }, { prop: 'refs', label: '参考值', align: 'center', visible: true, },

View File

@ -6,19 +6,18 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="queryParams" label-width="80px" inline> <el-form ref="form" :model="queryParams" inline class="query-form">
<el-form-item label="仪器" prop="yq"> <el-form-item label="仪器" prop="yq">
<YQSelectTable v-model:data="queryParams.rptunitid" width="200px" clearable @get-data-value="getList" /> <YQSelectTable v-model:data="queryParams.rptunitid" width="200px" :clearable="false"
@get-data-value="getList" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="mb10"> <div class="mb5">
<el-button type="primary" @click="handleAdd">新增</el-button> <el-button type="primary" icon="Plus" plain @click="handleAdd">新增</el-button>
<el-button type="primary" @click="handleSave">保存</el-button> <el-button type="success" icon="Check" @click="handleSave">保存</el-button>
<el-button type="danger" @click="handleDel">删除</el-button>
</div> </div>
<div style="height: calc(100% - 110px);"> <div style="height: calc(100% - 110px);">
<CustomTable ref="customTableRef" v-model:data="tableData" :columns="columns" :config="tableConfig" <CustomTable ref="customTableRef" v-model:data="tableData" :columns="columns" :config="tableConfig">
@row-click="selectedRows = $event">
<template #checktype="{ row }"> <template #checktype="{ row }">
<el-select v-model="row.checktype" placeholder="请选择" class="full-width-input"> <el-select v-model="row.checktype" placeholder="请选择" class="full-width-input">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
@ -39,6 +38,9 @@
<el-switch v-model="row.autocheck" active-value="1" inactive-value="0" <el-switch v-model="row.autocheck" active-value="1" inactive-value="0"
style="--el-switch-on-color: #13ce66; " /> style="--el-switch-on-color: #13ce66; " />
</template> </template>
<template #action="{ row }">
<el-button type="primary" icon="Delete" link @click="handleDel(row)">删除</el-button>
</template>
</CustomTable> </CustomTable>
</div> </div>
<el-dialog v-model="dialogVisible" title="组合审核条件生成导向" width="38vw" :close-on-click-modal="false" :draggable="true"> <el-dialog v-model="dialogVisible" title="组合审核条件生成导向" width="38vw" :close-on-click-modal="false" :draggable="true">
@ -116,7 +118,8 @@ import { queryList, updateRules, deleteRules } from '@/api/liswork/advancedRevie
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import { getFirstLetter } from '@/utils/pinyin'; import { getFirstLetter } from '@/utils/pinyin';
import { queryOldxminfo } from '@/api/liswork/xtwh/xmReqItemVsApi' import { queryOldxminfo } from '@/api/liswork/xtwh/xmReqItemVsApi'
import { template } from 'lodash';
const queryParams = ref({ const queryParams = ref({
rptunitid: '46', rptunitid: '46',
}); });
@ -130,16 +133,17 @@ const columns = ref([
{ label: '规则ID', prop: 'ruleid', visible: true, align: 'center', width: '60' }, { label: '规则ID', prop: 'ruleid', visible: true, align: 'center', width: '60' },
{ label: '条件类型', prop: 'checktype', visible: true, align: 'center', width: '150', slot: 'checktype', showOverflowTooltip: false }, { label: '条件类型', prop: 'checktype', visible: true, align: 'center', width: '150', slot: 'checktype', showOverflowTooltip: false },
{ label: '审核启用', prop: 'logflag', visible: true, align: 'center', width: '80', slot: 'logflag', showOverflowTooltip: false }, { label: '审核启用', prop: 'logflag', visible: true, align: 'center', width: '80', slot: 'logflag', showOverflowTooltip: false },
{ label: '组合条件(双击弹窗编辑)', prop: 'ruledisplay', visible: true, align: 'center', slot: 'ruledisplay', }, { label: '组合条件(双击弹窗编辑)', prop: 'ruledisplay', visible: true, align: 'center', slot: 'ruledisplay', showOverflowTooltip: false },
{ label: '记录备注信息', prop: 'logcontent', visible: true, align: 'center', width: '300', slot: 'logcontent', }, { label: '记录备注信息', prop: 'logcontent', visible: true, align: 'center', width: '300', slot: 'logcontent', showOverflowTooltip: false },
{ label: '组合条件', prop: 'checkrules', visible: true, }, { label: '组合条件', prop: 'checkrules', visible: true, showOverflowTooltip: false },
{ label: '自动审核', prop: 'autocheck', visible: true, align: 'center', width: '80', slot: 'autocheck', showOverflowTooltip: false }, { label: '自动审核', prop: 'autocheck', visible: true, align: 'center', width: '80', slot: 'autocheck', showOverflowTooltip: false },
]); ]);
const tableConfig = ref({ const tableConfig = ref({
highlightCurrentRow: true, highlightCurrentRow: true,
border: true, border: true,
height: '100%' height: '100%',
actionWidth: 120,
}); });
const options = [ const options = [
@ -257,24 +261,16 @@ const handleSave = () => {
} }
}); });
}; };
const handleDel = () => { const handleDel = (row) => {
if (!selectedRows.value) return ElMessage.warning('请选择要删除的行');
ElMessageBox.confirm('是否确认删除选中数据?', '提示', { ElMessageBox.confirm('是否确认删除选中数据?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
if (selectedRows.value.ruleid) { deleteRules({ id: row.ruleid }).then((res: any) => {
deleteRules({ id: selectedRows.value.ruleid }).then((res: any) => { if (res.code == 0) {
if (res.code == 0) { ElMessage.success('删除成功');
ElMessage.success('删除成功'); getList();
getList(); }
selectedRows.value = null });
}
});
} else {
tableData.value = tableData.value.filter(item => item.ruleid !== selectedRows.value.ruleid)
selectedRows.value = null
}
}) })
}; };

View File

@ -105,7 +105,9 @@ const formData = reactive({
const testItems: any = ref([]) const testItems: any = ref([])
const handleAdd = () => { const handleAdd = () => {
testItems.value.push({ xmmczh: '', mrz: '' }) rowIndex.value = -1
itemDictRef.value?.openDictSelector();
// testItems.value.push({ xmmczh: '', mrz: '' })
} }
const handleSave = () => { const handleSave = () => {
const flag = testItems.value.every(item => item.xmmczh && item.mrz) const flag = testItems.value.every(item => item.xmmczh && item.mrz)
@ -208,8 +210,15 @@ const getDetails = () => {
}; };
const handleItemSelect = (selectedItem) => { const handleItemSelect = (selectedItem) => {
testItems.value[rowIndex.value] = { xmdh: selectedItem.value, xmmc: selectedItem.label } const flag = testItems.value.some(item => item.xmdh == selectedItem.value);
testItems.value[rowIndex.value].xmmczh = selectedItem.value + ' ' + selectedItem.label if (flag) return ElMessage.warning(`项目【${selectedItem.label}】已存在`);
if (rowIndex.value > -1) {
testItems.value[rowIndex.value] = { xmdh: selectedItem.value, xmmc: selectedItem.label }
testItems.value[rowIndex.value].xmmczh = selectedItem.value + ' ' + selectedItem.label
} else {
testItems.value.push({ xmdh: selectedItem.value, xmmc: selectedItem.label, xmmczh: selectedItem.value + ' ' + selectedItem.label, mrz: '' })
}
}; };
</script> </script>

View File

@ -270,7 +270,7 @@ onMounted(() => {
<!-- 字典明细--> <!-- 字典明细-->
<el-col :span="20" :xs="24"> <el-col :span="20" :xs="24">
<!-- 表单区域--> <!-- 表单区域-->
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryRef" inline class="query-form">
<el-form-item class="cus-el-form-item" label="名称" prop="dictName"> <el-form-item class="cus-el-form-item" label="名称" prop="dictName">
<el-input v-model="queryParams.zdmc" placeholder="请输入名称" clearable style="width: 240px" <el-input v-model="queryParams.zdmc" placeholder="请输入名称" clearable style="width: 240px"
@keyup.enter="handleQuery" /> @keyup.enter="handleQuery" />
@ -279,19 +279,21 @@ onMounted(() => {
<el-input v-model="queryParams.zddh" placeholder="请输入明细代号" clearable style="width: 240px" <el-input v-model="queryParams.zddh" placeholder="请输入明细代号" clearable style="width: 240px"
@keyup.enter="handleQuery" /> @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb5">
<el-col :span="1.5">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
</el-col>
<el-col :span="1.5">
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" <el-button type="primary" plain icon="Plus" @click="handleAdd"
v-hasPermi="['system:dict:add']">新增</el-button> v-hasPermi="['system:dict:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" <el-button type="info" plain icon="Edit" :disabled="single" @click="handleUpdate"
v-hasPermi="['system:dict:edit']">修改</el-button> v-hasPermi="['system:dict:edit']">修改</el-button>
</el-col> </el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
@ -299,7 +301,7 @@ onMounted(() => {
v-hasPermi="['system:dict:remove']">删除</el-button> v-hasPermi="['system:dict:remove']">删除</el-button>
</el-col> --> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="info" plain icon="Upload" @click="handleImport" <el-button type="warning" plain icon="Upload" @click="handleImport"
v-hasPermi="['system:dict:import']">导入</el-button> v-hasPermi="['system:dict:import']">导入</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">

View File

@ -2,8 +2,8 @@
<div class="app-container"> <div class="app-container">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="14"> <el-col :span="14">
<!-- 表单区域--> <!-- 表单区域 -->
<el-form inline :model="queryParams" class="search-form " size="small" label-width="85px"> <el-form inline :model="queryParams" class="query-form" size="small" label-width="90px">
<el-form-item label="项目类别:"> <el-form-item label="项目类别:">
<SelectTable v-model:data="queryParams.xmgl" :fields="xmglFields" :tableData="dictData.XMGL" label="label" <SelectTable v-model:data="queryParams.xmgl" :fields="xmglFields" :tableData="dictData.XMGL" label="label"
value="value" objKey="value" width="8.75rem" size="small" @getDataValue="getList" /> value="value" objKey="value" width="8.75rem" size="small" @getDataValue="getList" />
@ -14,8 +14,7 @@
</el-form-item> </el-form-item>
<el-form-item label="仪器代号:"> <el-form-item label="仪器代号:">
<SelectTable v-model:data="queryParams.yq" :fields="yqFields" :tableData="instrOptions" label="yqmc" <SelectTable v-model:data="queryParams.yq" :fields="yqFields" :tableData="instrOptions" label="yqmc"
value="yq" objKey="yq" :border="true" width="8.75rem" placeholder="请选择仪器" size="small" value="yq" objKey="yq" width="8.75rem" placeholder="请选择仪器" size="small" @getDataValue="getList" />
@getDataValue="getList" />
</el-form-item> </el-form-item>
<el-form-item label="快速查找:"> <el-form-item label="快速查找:">
<el-input clearable v-model="queryParams.inputcode" prefix-icon="Search" style="width: 8.75rem" <el-input clearable v-model="queryParams.inputcode" prefix-icon="Search" style="width: 8.75rem"
@ -23,7 +22,7 @@
</el-form-item> </el-form-item>
<el-form-item label="仪器大类:"> <el-form-item label="仪器大类:">
<SelectTable v-model:data="queryParams.yqdl" :fields="yqdlFields" :tableData="dictData.YQDL" label="label" <SelectTable v-model:data="queryParams.yqdl" :fields="yqdlFields" :tableData="dictData.YQDL" label="label"
value="value" objKey="value" :border="true" width="8.75rem" size="small" @getDataValue="getList" /> value="value" objKey="value" width="8.75rem" size="small" @getDataValue="getList" />
</el-form-item> </el-form-item>
<el-form-item label="项目ID:"> <el-form-item label="项目ID:">
<el-input clearable placeholder="项目ID" prefix-icon="Search" v-model="queryParams.xmid" @input="(val) => { <el-input clearable placeholder="项目ID" prefix-icon="Search" v-model="queryParams.xmid" @input="(val) => {
@ -42,15 +41,16 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="24">
<el-button type="primary" plain icon="Refresh" :size="autoSize" @click="handleRefresh">刷新</el-button> <el-button type="primary" plain icon="Refresh" :size="autoSize" @click="handleRefresh">刷新</el-button>
<el-button type="primary" plain icon="Plus" :size="autoSize" @click="handleAdd">新增</el-button> <el-button type="primary" plain icon="Plus" :size="autoSize" @click="openAddDialog">新增</el-button>
<el-button type="danger" plain icon="Delete" :size="autoSize" @click="handleDel">删除</el-button> <el-button type="danger" plain icon="Delete" :size="autoSize" @click="handleDel">删除</el-button>
<el-button type="primary" plain :size="autoSize" @click="handleBatchVs">批量项目对应</el-button> <el-button type="primary" plain :size="autoSize" @click="handleBatchVs">批量项目对应</el-button>
<el-button type="primary" plain :size="autoSize" @click="handleSave">保存</el-button> <el-button type="primary" plain :size="autoSize" @click="handleSave">保存</el-button>
</el-col> </el-col>
</el-row> </el-row>
<!-- 表格区域-->
<!-- 表格区域 -->
<div> <div>
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" <CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowChange"> @column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowChange">
@ -70,7 +70,6 @@
{{ formatDict(row.yqdl, 'YQDL') }} {{ formatDict(row.yqdl, 'YQDL') }}
</template> </template>
</CustomTable> </CustomTable>
<div class="page-box"> <div class="page-box">
<el-pagination v-model:current-page="queryParams.pageNum" v-model:page-size="queryParams.pageSize" <el-pagination v-model:current-page="queryParams.pageNum" v-model:page-size="queryParams.pageSize"
:page-sizes="[30, 60, 100]" background layout="total, sizes, prev, pager, next,jumper" :total="total" :page-sizes="[30, 60, 100]" background layout="total, sizes, prev, pager, next,jumper" :total="total"
@ -78,21 +77,36 @@
</div> </div>
</div> </div>
</el-col> </el-col>
<!-- 右侧区域-->
<!-- 原有右侧区域 完全不动 -->
<el-col :span="10"> <el-col :span="10">
<tabView :tabList="tabList" v-model:activeTab="activeTab" @update:active-tab="updateActive" /> <tabView :tabList="tabList" v-model:activeTab="activeTab" @update:active-tab="updateActive" />
<!-- <KeepAlive> -->
<component class="tabDiv" ref="tableTabRef" :is="activeTabN" :formData="selectRow" v-model="modelParam" <component class="tabDiv" ref="tableTabRef" :is="activeTabN" :formData="selectRow" v-model="modelParam"
@refreshTabData="rowChange"></component> @refreshTabData="rowChange"></component>
<!-- </KeepAlive> -->
<BatchInstrVs v-model="batchInstrVsModel" /> <BatchInstrVs v-model="batchInstrVsModel" />
</el-col> </el-col>
</el-row> </el-row>
<!-- ====================== 新增弹窗(独立复制版) ====================== -->
<el-dialog v-model="addDialogVisible" title="新增项目" width="70%" top="10px" :close-on-click-modal="false"
destroy-on-close>
<el-tabs v-model="addActiveTab" type="card" class="tabs_box" @tab-click="updateAddActive">
<el-tab-pane v-for="item in tabList" :key="item.value" :label="item.label" :name="item.value">
</el-tab-pane>
</el-tabs>
<component class="tabDiv" ref="addTableTabRef" :is="addActiveTabN" :formData="addFormData" v-model="addModelParam"
@refreshTabData="refreshAddTab" />
<template #footer>
<el-button @click="addDialogVisible = false">取消</el-button>
<el-button type="primary" @click="handleAddSave">保存</el-button>
</template>
</el-dialog>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, toRaw, computed } from 'vue'; import { onMounted, ref, toRaw, computed, watch } from 'vue';
import Basic from './tab/base/Basic.vue' import Basic from './tab/base/Basic.vue'
import CommonlyValues from './tab/commonlyValues.vue' import CommonlyValues from './tab/commonlyValues.vue'
import UseInstr from './tab/useInstr.vue' import UseInstr from './tab/useInstr.vue'
@ -110,62 +124,31 @@ import { ElMessage, ElMessageBox } from 'element-plus';
import BatchInstrVs from './BatchInstrVs.vue'; import BatchInstrVs from './BatchInstrVs.vue';
import _ from 'lodash'; import _ from 'lodash';
import { classCom } from '@/utils/classCom'; import { classCom } from '@/utils/classCom';
const autoSize = classCom.useAutoSize()
const autoSize = classCom.useAutoSize()
const xmlbObj: any = { const xmlbObj: any = {
1: '数值型', 1: '数值型',
2: '文字型', 2: '文字型',
3: '阴阳性型', 3: '阴阳性型',
4: '数值文字混合型' 4: '数值文字混合型'
} }
// 原有数据
const dataList = ref<Array<any>>([]) const dataList = ref<Array<any>>([])
const queryParams = ref({ const queryParams = ref({
xmgl: '', //项目归类 xmgl: '',
itemclass: '', //细菌标志 itemclass: '',
yq: '', //仪器代号 yq: '',
inputcode: '', //快速查找 inputcode: '',
yqdl: '', //仪器大类 yqdl: '',
xmid: '', //项目ID xmid: '',
uflag: '0', //状态 uflag: '0',
isMIC: false || null, //是否隐藏微生物项目 isMIC: null,
pageSize: 30, pageSize: 30,
pageNum: 1 pageNum: 1
}) })
const total = ref(0) const total = ref(0)
//字典数据
const tableRef = ref() const tableRef = ref()
const xmglFields = ref([
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', enablePinyinSearch: true },
])
const itemclassFields = ref([
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', enablePinyinSearch: true },
])
const instrOptions = ref<LabInstr[]>([])
const tabList = ref([
{ label: '基本资料', value: 'Basic' },
{ label: '常用取值', value: 'CommonlyValues' },
{ label: '使用仪器', value: 'UseInstr' },
{ label: '知识库', value: 'Knowledge' },
{ label: '常见描述', value: 'CommonDescriptions' },
{ label: '参考值明细', value: 'ReferenceValueDetails' },
]);
const activeTab = ref('Basic')
const activeTabMap = {
Basic,
CommonlyValues,
UseInstr,
Knowledge,
CommonDescriptions,
ReferenceValueDetails
}
const activeTabN = computed(() => activeTabMap[activeTab.value as keyof typeof activeTabMap] || "Basic");
//table表格列
const columns = ref([ const columns = ref([
{ prop: 'xmgl', label: '项目归类', visible: true, align: 'center', slot: 'xmgl', width: 100 }, { prop: 'xmgl', label: '项目归类', visible: true, align: 'center', slot: 'xmgl', width: 100 },
{ prop: 'xmdh', label: '英文缩写', visible: true, align: 'center' }, { prop: 'xmdh', label: '英文缩写', visible: true, align: 'center' },
@ -188,31 +171,49 @@ const columns = ref([
{ prop: 'yymc', label: '英文名称', visible: true, align: 'center', width: 100 }, { prop: 'yymc', label: '英文名称', visible: true, align: 'center', width: 100 },
{ prop: 'qccv', label: '允许CA(%)', visible: true, align: 'center', width: 100 }, { prop: 'qccv', label: '允许CA(%)', visible: true, align: 'center', width: 100 },
]) ])
const tableConfig = ref({ const tableConfig = ref({
border: true, // 边框 border: true,
height: '70vh', // 高度 height: '70vh',
highlightCurrentRow: true, // 高亮当前行 highlightCurrentRow: true
// cellStyle: cellStyleHd
}) })
//仪器 const xmglFields = ref([
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', enablePinyinSearch: true },
])
const itemclassFields = ref([
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', enablePinyinSearch: true },
])
const yqFields = ref([ const yqFields = ref([
{ prop: 'yq', label: '代号', width: 80, enablePinyinSearch: true }, { prop: 'yq', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'yqmc', label: '名称', width: 150, enablePinyinSearch: true }, { prop: 'yqmc', label: '名称', width: 150, enablePinyinSearch: true },
]) ])
//仪器大类
const yqdlFields = ref([ const yqdlFields = ref([
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true }, { prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true }, { prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
]) ])
const instrOptions = ref<LabInstr[]>([])
const tabList = ref([
//选中行数据 { label: '基本资料', value: 'Basic' },
const selectRow = ref(); { label: '常用取值', value: 'CommonlyValues' },
//明细数据 { label: '使用仪器', value: 'UseInstr' },
{ label: '知识库', value: 'Knowledge' },
{ label: '常见描述', value: 'CommonDescriptions' },
{ label: '参考值明细', value: 'ReferenceValueDetails' },
]);
const activeTab = ref('Basic')
const activeTabMap = {
Basic,
CommonlyValues,
UseInstr,
Knowledge,
CommonDescriptions,
ReferenceValueDetails
}
const activeTabN = computed(() => activeTabMap[activeTab.value as keyof typeof activeTabMap] || Basic)
const selectRow = ref()
const selectDetailRow = ref() const selectDetailRow = ref()
const tableTabRef = ref() const tableTabRef = ref()
//tab页数据
const modelParam = ref<any>({ const modelParam = ref<any>({
basicData: {}, basicData: {},
commonlyValuesData: [], commonlyValuesData: [],
@ -220,253 +221,195 @@ const modelParam = ref<any>({
commonDescriptionsData: [], commonDescriptionsData: [],
referenceValueDetailsData: [] referenceValueDetailsData: []
}) })
// 1. 定义变量跟踪是否有未保存的修改
const hasUnsavedChanges = ref(false); const hasUnsavedChanges = ref(false);
// 保存初始数据快照用于比较
const initialModelParam = ref<any>(null); const initialModelParam = ref<any>(null);
const batchInstrVsModel = ref<any>({ const batchInstrVsModel = ref<any>({ visible: false })
visible: false
// ====================== 弹窗新增专用(独立) ======================
const addDialogVisible = ref(false)
const addActiveTab = ref('Basic')
const addActiveTabN = computed(() => activeTabMap[addActiveTab.value as keyof typeof activeTabMap] || Basic)
const addTableTabRef = ref()
const addFormData = ref({})
const addModelParam = ref({
basicData: { uflag: '0', xsbs: 1, xsws: '-1', jsxm: 'N' },
commonlyValuesData: [],
userInstrData: [],
commonDescriptionsData: [],
referenceValueDetailsData: []
}) })
const openAddDialog = () => {
addModelParam.value = {
// 2. 深度监视modelParam的所有属性变化 basicData: { uflag: '0', xsbs: 1, xsws: '-1', jsxm: 'N' },
watch(
modelParam,
(newVal, oldVal) => {
// 初始加载时不判断
if (initialModelParam.value) {
// 使用lodash的isEqual进行深度比较
hasUnsavedChanges.value = !_.isEqual(newVal, initialModelParam.value);
}
},
{ deep: true }
);
// 仪器
const getYqConfig = () => {
getGroupInstrdList()
.then((res: any) => {
if (res.code == 0) {
instrOptions.value = res.data.map((item: any) => ({
yq: item.yq.trim(),
yqmc: item.yqmc
}))
}
})
}
const handleSizeChange = (val: number) => {
queryParams.value.pageSize = val;
getList();
}
const handleCurrentChange = (val: number) => {
queryParams.value.pageNum = val;
getList();
}
//获取表格数据
const getList = () => {
queryXmInfoNewService(queryParams.value).then((res: any) => {
dataList.value = res.rows || [];
total.value = res.total;
hasUnsavedChanges.value = false;
if (res.rows.length) {
tableRef.value.setCurrentRow(res.rows[0]);
rowChange(res.rows[0]);
} else {
selectRow.value = '';
selectDetailRow.value = '';
changeActiveTab()
}
})
}
//新增
const handleAdd = () => {
selectRow.value = '';
modelParam.value = {
basicData: {
yq: '',
xmdh: '',
xmmc: '',
zhbdh: '',
bgdh: '',
cksx: null,
ckxx: null,
dyckz: '',
dylx: '1',
zjf: '',
xmlb: '',
xs: null,
xsws: '-1',
mrz: '',
jg: null,
cb: null,
dw: '',
jsxm: 'N',
jsgs: '',
zkxm: 'N',
sjx: null,
xjx: null,
ygxb: 'N',
ygnl: 'N',
ygbb: 'N',
lcyy: '',
jgbz: '',
uflag: '0',
xsbs: 1
},
commonlyValuesData: [], commonlyValuesData: [],
userInstrData: [], userInstrData: [],
commonDescriptionsData: [], commonDescriptionsData: [],
referenceValueDetailsData: [] referenceValueDetailsData: []
}; }
tableConfig.value.highlightCurrentRow = false addActiveTab.value = 'Basic'
// 重置快照 addDialogVisible.value = true
initialModelParam.value = _.cloneDeep(modelParam.value);
hasUnsavedChanges.value = false;
} }
//删除 const updateAddActive = () => {
const handleDel = () => { addActiveTab.value = addActiveTab.value
if (selectRow.value.xmid) { }
ElMessageBox.confirm('是否删除选中的数据?', '提示',
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' } const refreshAddTab = () => { }
).then(() => {
deleteXmInfoService({ xmid: selectRow.value.xmid }).then((res: any) => { const handleAddSave = async () => {
if (res.code == 0) { try {
ElMessage.success('删除成功!') if (addActiveTab.value === 'Basic') {
getList(); const valid = await addTableTabRef.value?.validate()
selectRow.value = null; if (!valid) return ElMessage.warning('请完善基本资料')
} }
}) const params = {
}) xmInfoNew: addModelParam.value.basicData,
xmValNewRows: addModelParam.value.commonlyValuesData,
xmInfoVsRows: addModelParam.value.userInstrData,
xmTextresultNewRows: addModelParam.value.commonDescriptionsData,
xmRefNewRows: addModelParam.value.referenceValueDetailsData,
xmDoubleRows: [], xmValRows: [], xmInterRows: [], xmRefRows: [], xmTextResultRows: []
}
const res = await saveDataService(params)
if (res.code === 0) {
ElMessage.success('新增成功')
addDialogVisible.value = false
getList()
}
} catch (e) {
ElMessage.error('新增失败')
} }
} }
//批量对应 // ====================== 原有方法 ======================
const handleBatchVs = () => { const getYqConfig = () => {
batchInstrVsModel.value.visible = true; getGroupInstrdList().then(res => {
}
//保存
const handleSave = async (flag: any) => {
//验证表单
if (activeTab.value == 'Basic') {
const valid = await tableTabRef.value.validate(); // 调用基本资料子组件的验证方法
if (!valid) return ElMessage.error('表单验证失败,请检查输入项!');
}
const flagCommon = modelParam.value.commonlyValuesData.every((item: any) => item.qz && item.srm && item.jgbz)
if (!flagCommon) return ElMessage.warning('请完整填写常用取值项!');
const flagUserInstr = modelParam.value.userInstrData.every((item: any) => item.yq)
if (!flagUserInstr) return ElMessage.warning('请完整选择对应的仪器!');
saveDataService({
xmInfoNew: modelParam.value.basicData,
xmDoubleRows: [],
xmValRows: [],
xmInterRows: [],
xmRefRows: [],
xmTextResultRows: [],
xmValNewRows: modelParam.value.commonlyValuesData,
xmRefNewRows: modelParam.value.referenceValueDetailsData,
xmInfoVsRows: modelParam.value.userInstrData,
xmTextresultNewRows: modelParam.value.commonDescriptionsData
}).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
ElMessage.success('保存成功!') instrOptions.value = res.data.map(item => ({ yq: item.yq.trim(), yqmc: item.yqmc }))
getList();
// 保存后更新快照
initialModelParam.value = _.cloneDeep(modelParam.value);
hasUnsavedChanges.value = false;
tableConfig.value.highlightCurrentRow = true
} }
}) })
if (!flag) {
rowChange(selectRow.value)
}
} }
const handleRefresh = () => { const handleSizeChange = (val) => {
getList(); queryParams.value.pageSize = val; getList()
} }
//退拽属性 const handleCurrentChange = (val) => {
const handleColumnDragEnd = (data: any) => { queryParams.value.pageNum = val; getList()
// 更新列配置
columns.value = data.columns;
} }
//状态改变 const getList = () => {
const changeStauts = () => { queryXmInfoNewService(queryParams.value).then(res => {
if (!queryParams.value.isMIC) { dataList.value = res.rows || []; total.value = res.total
queryParams.value.isMIC = null; if (res.rows.length) { tableRef.value.setCurrentRow(res.rows[0]); rowChange(res.rows[0]) }
} })
getList();
} }
// 选择行变化 const updateActive = () => { }
const rowChange = async (row: any) => {
// 如果有未保存的修改,显示提示 const rowChange = async (row) => {
if (hasUnsavedChanges.value) { if (hasUnsavedChanges.value) {
ElMessageBox.confirm( ElMessageBox.confirm('当前数据有未保存的修改,是否保存?', '提示', {
'当前数据有未保存的修改,是否保存?', confirmButtonText: '保存', cancelButtonText: '不保存', type: 'warning'
'提示', }).then(() => { handleSave("1") }).catch(() => { getInfo(row) })
{ } else { getInfo(row) }
confirmButtonText: '保存',
cancelButtonText: '不保存',
type: 'warning',
}
).then(() => {
// 用户选择保存
handleSave("1");
}).catch(() => {
// 用户选择不保存
getInfo(row)
})
} else {
getInfo(row)
}
} }
const getInfo = async (row: any) => { const getInfo = async (row) => {
tableConfig.value.highlightCurrentRow = true tableConfig.value.highlightCurrentRow = true
selectRow.value = row; selectRow.value = row
const res = await queryXmInfoNewDetailService(row.xmid, row.yq, row.xmdh) const res = await queryXmInfoNewDetailService(row.xmid, row.yq, row.xmdh)
res.data.xmInfoNew.xsws = res.data.xmInfoNew.xsws.toString() res.data.xmInfoNew.xsws = res.data.xmInfoNew.xsws.toString()
selectDetailRow.value = res.data selectDetailRow.value = res.data
changeActiveTab() changeActiveTab()
initialModelParam.value = _.cloneDeep(modelParam.value); initialModelParam.value = _.cloneDeep(modelParam.value)
hasUnsavedChanges.value = false; hasUnsavedChanges.value = false
//重置表单状态
if (typeof tableTabRef.value.resetField === 'function') {
tableTabRef.value.resetField();
}
} }
//tab变化
const updateActive = () => {
changeActiveTab()
}
const changeActiveTab = () => { const changeActiveTab = () => {
modelParam.value.basicData = toRaw(selectDetailRow.value.xmInfoNew || {}); modelParam.value.basicData = toRaw(selectDetailRow.value.xmInfoNew || {})
modelParam.value.commonlyValuesData = toRaw(selectDetailRow.value.xmValNewRows || []); modelParam.value.commonlyValuesData = toRaw(selectDetailRow.value.xmValNewRows || [])
modelParam.value.userInstrData = toRaw(selectDetailRow.value.xmInfoVsRows || []); modelParam.value.userInstrData = toRaw(selectDetailRow.value.xmInfoVsRows || [])
modelParam.value.commonDescriptionsData = toRaw(selectDetailRow.value.xmTextresultNewRows || []); modelParam.value.commonDescriptionsData = toRaw(selectDetailRow.value.xmTextresultNewRows || [])
modelParam.value.referenceValueDetailsData = toRaw(selectDetailRow.value.xmRefNewRows || []); modelParam.value.referenceValueDetailsData = toRaw(selectDetailRow.value.xmRefNewRows || [])
} }
onMounted(async () => { const handleAdd = () => { }
getDictData('XMGL', 'ITEMCLASS', 'YQDL', 'UT', 'MD', 'GBDM', 'YQ', 'VA', 'LF', 'BT', 'SLZQ');
const handleDel = () => {
if (!selectRow.value?.xmid) return
ElMessageBox.confirm('是否删除选中的数据?', '提示', { type: 'warning' }).then(() => {
deleteXmInfoService({ xmid: selectRow.value.xmid }).then(res => {
if (res.code == 0) { ElMessage.success('删除成功'); getList(); selectRow.value = null }
})
})
}
const handleBatchVs = () => {
batchInstrVsModel.value.visible = true
}
const handleSave = async (flag) => {
if (activeTab.value == 'Basic') {
const valid = await tableTabRef.value.validate()
if (!valid) return ElMessage.error('表单验证失败')
}
const flag1 = modelParam.value.commonlyValuesData.every(item => item.qz && item.srm && item.jgbz)
if (!flag1) return ElMessage.warning('请完整填写常用取值项')
const flag2 = modelParam.value.userInstrData.every(item => item.yq)
if (!flag2) return ElMessage.warning('请完整选择仪器')
saveDataService({
xmInfoNew: modelParam.value.basicData,
xmValNewRows: modelParam.value.commonlyValuesData,
xmInfoVsRows: modelParam.value.userInstrData,
xmTextresultNewRows: modelParam.value.commonDescriptionsData,
xmRefNewRows: modelParam.value.referenceValueDetailsData,
xmDoubleRows: [], xmValRows: [], xmInterRows: [], xmRefRows: [], xmTextResultRows: []
}).then(res => {
if (res.code == 0) {
ElMessage.success('保存成功')
getList()
initialModelParam.value = _.cloneDeep(modelParam.value)
hasUnsavedChanges.value = false
}
})
}
const handleRefresh = () => getList()
const handleColumnDragEnd = (data) => columns.value = data.columns
const changeStauts = () => getList()
watch(modelParam, (n, o) => {
if (initialModelParam.value) hasUnsavedChanges.value = !_.isEqual(n, o)
}, { deep: true })
onMounted(() => {
getDictData('XMGL', 'ITEMCLASS', 'YQDL', 'UT', 'MD', 'GBDM', 'YQ', 'VA', 'LF', 'BT', 'SLZQ')
getList() getList()
getYqConfig(); getYqConfig()
}) })
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.query-form .el-form-item {
margin-bottom: 5px;
}
.page-box {
margin-top: 10px;
text-align: right;
}
.mb8 {
margin-bottom: 8px;
}
.tabDiv {
padding: 10px;
border: 1px solid #e6e6e6;
border-radius: 4px;
min-height: 70vh;
}
</style>

View File

@ -25,8 +25,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div> <div>
<el-button type="primary" plain @click="printHandle">打印</el-button> <el-button type="warning" icon="Printer" plain @click="printHandle">打印</el-button>
<el-button type="primary" plain @click="viewHandle">预览</el-button> <el-button type="info" icon="View" plain @click="viewHandle">预览</el-button>
<el-button type="primary" plain @click="skHandle">失控总结</el-button> <el-button type="primary" plain @click="skHandle">失控总结</el-button>
<el-button type="primary" plain @click="byHandle">本月总结</el-button> <el-button type="primary" plain @click="byHandle">本月总结</el-button>
</div> </div>
@ -244,4 +244,8 @@ onMounted(() => {
.table-container { .table-container {
height: calc(100% - 200px); height: calc(100% - 200px);
} }
:deep(.el-table--border th.el-table__cell) {
border-right: 1px solid #fff !important;
}
</style> </style>

View File

@ -1,10 +1,10 @@
<!-- 修改界面 --> <!-- 修改界面 -->
<template> <template>
<el-dialog v-model="visible" :title="title" width="35vw" @open="open"> <el-dialog v-model="visible" :title="title" width="40vw" @open="open" :close-on-click-modal="false" :draggable="true">
<span class="text-span">项目信息:</span> <span class="text-span">项目信息:</span>
<el-divider style="margin: 5px 0;" /> <el-divider style="margin: 5px 0;" />
<el-form ref="form" :model="formData" class="form-inline" inline label-width="70px"> <el-form ref="form" :model="formData" inline label-width="100px" class="query-form">
<el-form-item label="项目代号" prop="xmdh"> <el-form-item label="项目代号" prop="xmdh">
<el-input placeholder="项目代号" v-model="formData.xmdh"></el-input> <el-input placeholder="项目代号" v-model="formData.xmdh"></el-input>
</el-form-item> </el-form-item>
@ -197,17 +197,4 @@ const open = () => {
font-weight: bold; font-weight: bold;
color: #1f6dd3; color: #1f6dd3;
} }
.form-inline {
padding: 10px;
background-color: #f5f7fa;
height: auto;
.el-form-item {
margin-right: 10px;
margin-bottom: 2px;
}
}
</style> </style>

View File

@ -1,19 +1,16 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="topForm"> <div class="query-form">
<el-form ref="formRef" :model="formData" inline label-width="80px" @submit.prevent="handleSubmit"> <el-form ref="formRef" :model="formData" inline @submit.prevent="handleSubmit">
<el-form-item label="检索" prop="js"> <el-form-item label="检索:" prop="js">
<el-input placeholder="项目代号,名称,简拼" v-model="formData.js" style="width: 200px;" <el-input placeholder="项目代号,名称,简拼" v-model="formData.js" @keyup.enter="getList"></el-input>
@keyup.enter="getList"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onQueryClick">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-row> <el-row>
<el-button type="primary" @click="onAddClick">新增</el-button> <el-button type="primary" icon="Search" @click="onQueryClick">查询</el-button>
<el-button type="danger" @click="onDelClick">删除</el-button> <el-button type="primary" icon="Plus" plain @click="onAddClick">新增</el-button>
</el-row> </el-row>
<el-row :gutter="20" class="table-row"> <el-row :gutter="20" class="table-row">
<el-col :span="17" class="table-col"> <el-col :span="17" class="table-col">
@ -23,6 +20,10 @@
<template #xsbz="{ row }"> <template #xsbz="{ row }">
<el-checkbox :model-value="row.xsbz === '1'" /> <el-checkbox :model-value="row.xsbz === '1'" />
</template> </template>
<template #action="{ row }">
<el-button type="primary" link icon="Edit" @click="onEditClick(row)">编辑</el-button>
<el-button type="primary" link icon="Delete" @click="onDelClick(row)">删除</el-button>
</template>
</CustomTable> </CustomTable>
</el-col> </el-col>
<el-col :span="7" class="table-col"> <el-col :span="7" class="table-col">
@ -68,13 +69,13 @@ const tableConfig = ref({
height: '100%', // 高度 height: '100%', // 高度
highlightCurrentRow: true, // 高亮当前行 highlightCurrentRow: true, // 高亮当前行
// cellStyle: cellStyleHd // cellStyle: cellStyleHd
actionWidth: 180
}) })
const modifyVisible = ref(false) const modifyVisible = ref(false)
const modifyTitle = ref('') const modifyTitle = ref('')
const modifyType = ref('') const modifyType = ref('')
const modifyRef = ref() const modifyRef = ref()
const selectRow: any = ref(null)
//退拽属性 //退拽属性
const handleColumnDragEnd = (data: any) => { const handleColumnDragEnd = (data: any) => {
@ -115,7 +116,6 @@ const handleSubmit = (event: any) => {
const onClick = async (row: any) => { const onClick = async (row: any) => {
const res = await queryDetailService(row.xmid); const res = await queryDetailService(row.xmid);
dataListRight.value = res.data dataListRight.value = res.data
selectRow.value = row
} }
const onDBClick = (info) => { const onDBClick = (info) => {
@ -130,14 +130,16 @@ const onAddClick = () => {
} }
const onDelClick = () => { const onEditClick = (row) => {
if (!selectRow.value) return ElMessage.warning('请先选择要删除的数据!') modifyVisible.value = true
ElMessageBox.confirm('是否要删除选中的数据?', '警告', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(() => { }
delService(selectRow.value.xmid).then((res) => {
const onDelClick = (row) => {
ElMessageBox.confirm('是否要删除选中的数据?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', }).then(() => {
delService(row.xmid).then((res) => {
if (res.code == 0) { if (res.code == 0) {
ElMessage.success('删除成功!') ElMessage.success('删除成功!')
getList() getList()
selectRow.value = null
} }
}) })
}) })

View File

@ -6,7 +6,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="queryParams" label-width="80px" inline> <el-form ref="form" :model="queryParams" inline class="query-form">
<el-form-item label="仪器" prop="yq"> <el-form-item label="仪器" prop="yq">
<YQSelectTable v-model:data="queryParams.yq" width="200px" clearable @get-data-value="getList" /> <YQSelectTable v-model:data="queryParams.yq" width="200px" clearable @get-data-value="getList" />
</el-form-item> </el-form-item>
@ -14,20 +14,17 @@
<el-input placeholder="请输入模板名称" v-model="queryParams.mbmc" style="width: 200px;" clearable <el-input placeholder="请输入模板名称" v-model="queryParams.mbmc" style="width: 200px;" clearable
@keyup.enter="getList" /> @keyup.enter="getList" />
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" @click="getList">查询</el-button>
</el-form-item>
</el-form> </el-form>
<el-row> <div class="mb5">
<el-col :span="12"> <el-button type="primary" icon="Search" @click="getList">查询</el-button>
<el-button type="primary" @click="handleAdd">新增</el-button> <el-button type="primary" icon="Plus" plain @click="handleAdd">新增</el-button>
<el-button type="danger" @click="handleDel">删除</el-button> </div>
</el-col>
</el-row>
<el-row class="table-row" style="margin-top: 10px;"> <el-row class="table-row" style="margin-top: 10px;">
<el-col :span="24" class="table-col"> <el-col :span="24" class="table-col">
<CustomTable ref="tableRef" v-model:data="tableData" :columns="columns" :config="tableConfig" <CustomTable ref="tableRef" v-model:data="tableData" :columns="columns" :config="tableConfig"
@row-dblclick="handleRowDblclick" @row-click="selectedRows = $event"> @row-dblclick="handleRowDblclick">
<template #yq="{ row }"> <template #yq="{ row }">
{{ formatInstr(row.yq) }} {{ formatInstr(row.yq) }}
</template> </template>
@ -37,6 +34,9 @@
<template #zdsr="{ row }"> <template #zdsr="{ row }">
<el-checkbox :model-value="row.zdsr == 'Y'" /> <el-checkbox :model-value="row.zdsr == 'Y'" />
</template> </template>
<template #action="{ row }">
<el-button type="primary" icon="Delete" link @click="handleDel(row)">删除</el-button>
</template>
</CustomTable> </CustomTable>
</el-col> </el-col>
<el-dialog :title="title" v-model="visible" width="50vw" :close-on-click-modal="false" :draggable="true"> <el-dialog :title="title" v-model="visible" width="50vw" :close-on-click-modal="false" :draggable="true">
@ -134,8 +134,8 @@ const tableConfig = ref({
height: '100%', // 高度 height: '100%', // 高度
border: true, // 边框 border: true, // 边框
highlightCurrentRow: true, // 当前行高亮 highlightCurrentRow: true, // 当前行高亮
actionWidth: 150,
}) })
const selectedRows: any = ref(null)
const regdictList = ref<Array<{ value: string, label: string }>>([]) const regdictList = ref<Array<{ value: string, label: string }>>([])
const rightTableData = ref<Array<{ xmdh: string, mrz: string }>>([]) const rightTableData = ref<Array<{ xmdh: string, mrz: string }>>([])
const rightColumns = ref([ const rightColumns = ref([
@ -244,15 +244,13 @@ const delItem = () => {
} }
xmInfo.value = null xmInfo.value = null
} }
const handleDel = () => { const handleDel = (row) => {
if (!selectedRows.value) return ElMessage.warning('请选择要删除的记录')
ElMessageBox.confirm('确定要删除选中的数据吗?', '提示', { ElMessageBox.confirm('确定要删除选中的数据吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteXmInfo(selectedRows.value).then(() => { deleteXmInfo(row).then(() => {
ElMessage.success('删除成功') ElMessage.success('删除成功')
getList() getList()
selectedRows.value = null
}) })
}) })
} }

View File

@ -3,10 +3,10 @@
<div class="table-container"> <div class="table-container">
<el-row :gutter="10" class="table-toolbar"> <el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button> <el-button type="success" plain icon="Check" @click="handleSave">保存</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" @click="addItem">新增</el-button> <el-button type="primary" plain icon="Plus" @click="addItem">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="Delete" @click="delItem">删除</el-button> <el-button type="danger" plain icon="Delete" @click="delItem">删除</el-button>

View File

@ -8,7 +8,7 @@
<div class="params-box"> <div class="params-box">
<el-row :gutter="10" class="table-toolbar"> <el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button> <el-button type="success" plain icon="Check" @click="handleSave">保存</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div class="table-box"> <div class="table-box">

View File

@ -3,10 +3,10 @@
<div class="sys_box"> <div class="sys_box">
<el-row :gutter="10" class="table-toolbar"> <el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button> <el-button type="success" plain icon="Check" @click="handleSave">保存</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button> <el-button type="info" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button> <el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
@ -17,8 +17,7 @@
<div class="triple-table-wrapper"> <div class="triple-table-wrapper">
<!-- 第一列表格 --> <!-- 第一列表格 -->
<div class="table-panel table-1"> <div class="table-panel table-1">
<el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" border height="100%">
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" /> <el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" /> min-width="150" />
@ -35,8 +34,7 @@
<!-- 第二列表格 --> <!-- 第二列表格 -->
<div class="table-panel table-2"> <div class="table-panel table-2">
<el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" border height="100%">
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" /> <el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" /> min-width="150" />
@ -53,8 +51,7 @@
<!-- 第三列表格 --> <!-- 第三列表格 -->
<div class="table-panel table-3"> <div class="table-panel table-3">
<el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" border height="100%">
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" /> <el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" /> min-width="150" />
@ -226,105 +223,13 @@ watch(yq, (newVal) => {
flex: 1; flex: 1;
height: calc(100% - 45px); // 减去标题行+工具栏高度 height: calc(100% - 45px); // 减去标题行+工具栏高度
display: flex; display: flex;
gap: 0px; // 表格间间距 gap: 5px; // 表格间间距
overflow: hidden; overflow: hidden;
// 单个表格面板 // 单个表格面板
.table-panel { .table-panel {
flex: 1; // 三列均等分 flex: 1; // 三列均等分
height: 100%; height: 100%;
overflow: hidden;
background: #fff;
border: 1px solid #e6e6e6;
border-radius: 4px;
// 细微间距优化
&.table-1 {
margin-right: 0px;
}
&.table-2 {
margin: 0 0px;
}
&.table-3 {
margin-left: 0px;
}
}
}
// 核心:清除表格内上下间隙
:deep(.config-table) {
// 清除表格整体的边框间距
border-collapse: collapse !important;
border-spacing: 0 !important;
// 清除表格头部间距
.el-table__header {
padding: 0 !important;
th {
padding: 0 !important;
border-bottom: 1px solid #e6e6e6 !important;
line-height: 25px !important;
height: 25px !important;
}
}
// 清除表格内容区间距
.el-table__body {
padding: 0 !important;
// 清除行间距
.el-table__row {
height: 25px !important;
line-height: 25px !important;
margin: 0 !important;
padding: 0 !important;
}
// 清除单元格内边距和间距
.el-table__cell {
padding: 0 4px !important; // 仅保留左右内边距,上下清零
height: 25px !important;
line-height: 25px !important;
vertical-align: middle !important;
font-size: 12px;
border-bottom: 1px solid #e6e6e6 !important;
border-right: 1px solid #e6e6e6 !important;
}
// 最后一列清除右侧边框
.el-table__cell:last-child {
border-right: none !important;
}
}
// 清除表格底部间距
.el-table__footer {
padding: 0 !important;
}
// 编辑输入框适配紧凑布局
.edit-input {
width: 95%;
margin: 0 !important;
padding: 0 !important;
:deep(.el-input__inner) {
padding: 0 5px;
height: 25px !important; // 缩小输入框高度适配紧凑行高
line-height: 25px !important;
font-size: 12px;
border: 1px solid #dcdfe6;
margin: 0 !important;
&:focus {
border-color: #409eff;
outline: none;
}
}
} }
} }
</style> </style>

View File

@ -3,10 +3,10 @@
<div class="sys_box"> <div class="sys_box">
<el-row :gutter="10" class="table-toolbar"> <el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button> <el-button type="success" plain icon="Check" @click="handleSave">保存</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button> <el-button type="info" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button> <el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
@ -17,8 +17,7 @@
<div class="triple-table-wrapper"> <div class="triple-table-wrapper">
<!-- 第一列表格 --> <!-- 第一列表格 -->
<div class="table-panel table-1"> <div class="table-panel table-1">
<el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" border height="100%">
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" /> <el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" /> min-width="150" />
@ -35,8 +34,7 @@
<!-- 第二列表格 --> <!-- 第二列表格 -->
<div class="table-panel table-2"> <div class="table-panel table-2">
<el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" border height="100%">
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" /> <el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" /> min-width="150" />
@ -53,8 +51,7 @@
<!-- 第三列表格 --> <!-- 第三列表格 -->
<div class="table-panel table-3"> <div class="table-panel table-3">
<el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" border height="100%">
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" /> <el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" /> min-width="150" />
@ -226,7 +223,7 @@ watch(yq, (newVal) => {
flex: 1; flex: 1;
height: calc(100% - 45px); // 减去标题行+工具栏高度 height: calc(100% - 45px); // 减去标题行+工具栏高度
display: flex; display: flex;
gap: 0px; // 表格间间距 gap: 5px; // 表格间间距
overflow: hidden; overflow: hidden;
// 单个表格面板 // 单个表格面板
@ -234,97 +231,7 @@ watch(yq, (newVal) => {
flex: 1; // 三列均等分 flex: 1; // 三列均等分
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background: #fff;
border: 1px solid #e6e6e6;
border-radius: 4px;
// 细微间距优化
&.table-1 {
margin-right: 0px;
}
&.table-2 {
margin: 0 0px;
}
&.table-3 {
margin-left: 0px;
}
}
}
// 核心:清除表格内上下间隙
:deep(.config-table) {
// 清除表格整体的边框间距
border-collapse: collapse !important;
border-spacing: 0 !important;
// 清除表格头部间距
.el-table__header {
padding: 0 !important;
th {
padding: 0 !important;
border-bottom: 1px solid #e6e6e6 !important;
line-height: 25px !important;
height: 25px !important;
}
}
// 清除表格内容区间距
.el-table__body {
padding: 0 !important;
// 清除行间距
.el-table__row {
height: 25px !important;
line-height: 25px !important;
margin: 0 !important;
padding: 0 !important;
}
// 清除单元格内边距和间距
.el-table__cell {
padding: 0 4px !important; // 仅保留左右内边距,上下清零
height: 25px !important;
line-height: 25px !important;
vertical-align: middle !important;
font-size: 12px;
border-bottom: 1px solid #e6e6e6 !important;
border-right: 1px solid #e6e6e6 !important;
}
// 最后一列清除右侧边框
.el-table__cell:last-child {
border-right: none !important;
}
}
// 清除表格底部间距
.el-table__footer {
padding: 0 !important;
}
// 编辑输入框适配紧凑布局
.edit-input {
width: 95%;
margin: 0 !important;
padding: 0 !important;
:deep(.el-input__inner) {
padding: 0 5px;
height: 25px !important; // 缩小输入框高度适配紧凑行高
line-height: 25px !important;
font-size: 12px;
border: 1px solid #dcdfe6;
margin: 0 !important;
&:focus {
border-color: #409eff;
outline: none;
}
}
} }
} }
</style> </style>

View File

@ -4,7 +4,7 @@
<template v-if="paramsFlag"> <template v-if="paramsFlag">
<el-row :gutter="10" class="table-toolbar"> <el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button> <el-button type="success" plain icon="Check" @click="handleSave">保存</el-button>
</el-col> </el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button> <el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>

View File

@ -8,43 +8,38 @@
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDeleteBatch">删除</el-button> <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDeleteBatch">删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="Edit" @click="router.push('/liswork/reportdict')">编辑模板 <el-button type="info" plain icon="Edit" @click="router.push('/systeminfo/reportdict')">编辑模板
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" icon="Refresh" @click="handleQuery">刷新</el-button> <el-button type="primary" icon="Refresh" @click="handleQuery">刷新</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="5" class="table-container"> <el-row :gutter="5" class="table-container">
<el-table <el-table v-loading="loading" :data="reportinstrList" @selection-change="handleSelectionChange"
v-loading="loading" class="report-table" height="100%">
:data="reportinstrList"
@selection-change="handleSelectionChange"
class="report-table"
height="100%"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="编号" align="center" prop="reportId" v-if="false"/> <el-table-column label="编号" align="center" prop="reportId" v-if="false" />
<el-table-column label="仪器" align="center" prop="reportYq" v-if="false" show-overflow-tooltip /> <el-table-column label="仪器" align="center" prop="reportYq" v-if="false" show-overflow-tooltip />
<el-table-column label="模板ID" align="left" prop="reportBgdh" width="50" show-overflow-tooltip /> <el-table-column label="模板ID" align="left" prop="reportBgdh" width="50" show-overflow-tooltip />
<el-table-column label="模板名称" align="left" prop="reportName" show-overflow-tooltip /> <el-table-column label="模板名称" align="left" prop="reportName" show-overflow-tooltip />
<el-table-column label="类别" align="center" prop="reportType" width="50" show-overflow-tooltip> <el-table-column label="类别" align="center" prop="reportType" width="50" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<span> <span>
{{ reportTypeOptions.find(item => item.value === scope.row.reportType)?.label || scope.row.reportType }} {{reportTypeOptions.find(item => item.value === scope.row.reportType)?.label || scope.row.reportType}}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="纸张" align="center" prop="reportSize" width="50"> <el-table-column label="纸张" align="center" prop="reportSize" width="50">
<template #default="scope"> <template #default="scope">
<span> <span>
{{ reportSizeOptions.find(item => item.value === scope.row.reportSize)?.label || scope.row.reportSize }} {{reportSizeOptions.find(item => item.value === scope.row.reportSize)?.label || scope.row.reportSize}}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="固定行数" align="center" prop="reportRows" width="80"show-overflow-tooltip /> <el-table-column label="固定行数" align="center" prop="reportRows" width="80" show-overflow-tooltip />
<el-table-column label="最小行数" align="center" prop="reportMinrows" width="80"show-overflow-tooltip /> <el-table-column label="最小行数" align="center" prop="reportMinrows" width="80" show-overflow-tooltip />
<el-table-column label="最大行数" align="center" prop="reportMaxrows" width="80"show-overflow-tooltip /> <el-table-column label="最大行数" align="center" prop="reportMaxrows" width="80" show-overflow-tooltip />
<el-table-column label="指定项目" align="center" prop="reportItems" show-overflow-tooltip /> <el-table-column label="指定项目" align="center" prop="reportItems" show-overflow-tooltip />
<el-table-column label="排序" align="center" prop="reportSort" width="80" /> <el-table-column label="排序" align="center" prop="reportSort" width="80" />
<el-table-column label="状态" align="center" prop="status" width="80"> <el-table-column label="状态" align="center" prop="status" width="80">
@ -63,7 +58,7 @@
<el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" width="180" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button> <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button> <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -74,58 +69,35 @@
<el-form ref="reportinstrRef" :model="form" :rules="rules" label-width="120px"> <el-form ref="reportinstrRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="模板编码" prop="reportBgdh"> <el-form-item label="模板编码" prop="reportBgdh">
<el-select <el-select v-model="form.reportBgdh" placeholder="请选择模板" style="width: 70%">
v-model="form.reportBgdh" <el-option v-for="item in dictOptions" :key="item.value" :label="item.label" :value="item.value" />
placeholder="请选择模板"
style="width: 70%"
>
<el-option
v-for="item in dictOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="类别" prop="reportType"> <el-form-item label="类别" prop="reportType">
<el-select <el-select v-model="form.reportType" placeholder="请选择类别" style="width: 50%">
v-model="form.reportType" <el-option v-for="item in reportTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
placeholder="请选择类别"
style="width: 50%"
>
<el-option
v-for="item in reportTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select><span class="static-text blue-text">细菌仪必选</span> </el-select><span class="static-text blue-text">细菌仪必选</span>
</el-form-item> </el-form-item>
<el-form-item label="纸张类型" prop="reportSize"> <el-form-item label="纸张类型" prop="reportSize">
<el-select <el-select v-model="form.reportSize" placeholder="请选择纸张类型" style="width: 50%">
v-model="form.reportSize" <el-option v-for="item in reportSizeOptions" :key="item.value" :label="item.label" :value="item.value" />
placeholder="请选择纸张类型"
style="width: 50%"
>
<el-option
v-for="item in reportSizeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="固定行数" prop="reportRows"> <el-form-item label="固定行数" prop="reportRows">
<el-input v-model.number="form.reportRows" placeholder="请输入固定行数" style="width: 50%"/><span class="static-text blue-text">用于固定报告单高度</span> <el-input v-model.number="form.reportRows" placeholder="请输入固定行数" style="width: 50%" /><span
class="static-text blue-text">用于固定报告单高度</span>
</el-form-item> </el-form-item>
<el-form-item label="最小行数" prop="reportMinrows"> <el-form-item label="最小行数" prop="reportMinrows">
<el-input v-model.number="form.reportMinrows" placeholder="请输入最小行数" style="width: 50%"/><span class="static-text blue-text">超过此行数使用该报告</span> <el-input v-model.number="form.reportMinrows" placeholder="请输入最小行数" style="width: 50%" /><span
class="static-text blue-text">超过此行数使用该报告</span>
</el-form-item> </el-form-item>
<el-form-item label="最大行数" prop="reportMaxrows"> <el-form-item label="最大行数" prop="reportMaxrows">
<el-input v-model.number="form.reportMaxrows" placeholder="请输入最大行数" style="width: 50%"/><span class="static-text blue-text">不超过此行数使用该报告</span> <el-input v-model.number="form.reportMaxrows" placeholder="请输入最大行数" style="width: 50%" /><span
class="static-text blue-text">不超过此行数使用该报告</span>
</el-form-item> </el-form-item>
<el-form-item label="指定项目" prop="reportItems"> <el-form-item label="指定项目" prop="reportItems">
<DynamicInput type="3" v-model="form.reportItems" :dict-data="`item:${form.reportYq}`" placeholder="请输入指定项目" class="edit-input" style="width: 70%"/><span class="static-text blue-text">项目专用报告单</span> <DynamicInput type="3" v-model="form.reportItems" :dict-data="`item:${form.reportYq}`" placeholder="请输入指定项目"
class="edit-input" style="width: 70%" /><span class="static-text blue-text">项目专用报告单</span>
</el-form-item> </el-form-item>
<el-form-item label="顺序" prop="reportSort"> <el-form-item label="顺序" prop="reportSort">
<el-input-number v-model="form.reportSort" controls-position="right" :min="0" /> <el-input-number v-model="form.reportSort" controls-position="right" :min="0" />
@ -162,7 +134,7 @@ import {
listreportinstr, listreportinstr,
updatereportinstr updatereportinstr
} from "@/api/liswork/xtwh/reportinstrApi"; } from "@/api/liswork/xtwh/reportinstrApi";
import {optionselect} from "@/api/liswork/xtwh/reportdictApi"; import { optionselect } from "@/api/liswork/xtwh/reportdictApi";
// 导入时间格式化工具(确保存在) // 导入时间格式化工具(确保存在)
import { parseTime } from "@/utils/ruoyi.js"; import { parseTime } from "@/utils/ruoyi.js";
import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue" import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue"
@ -265,7 +237,7 @@ const queryRef = ref<InstanceType<typeof ElForm>>();
const dictOptions = ref<SelectOption[]>([]); // 下拉/字典选项列表 const dictOptions = ref<SelectOption[]>([]); // 下拉/字典选项列表
const dictLoading = ref(false); // 字典加载状态 const dictLoading = ref(false); // 字典加载状态
async function loadApiDict() { async function loadApiDict() {
const dictType ="0"; const dictType = "0";
try { try {
dictLoading.value = true; dictLoading.value = true;
const response = await optionselect({ reportType: dictType }) const response = await optionselect({ reportType: dictType })
@ -290,7 +262,7 @@ const getList = async (): Promise<void> => {
loading.value = true; loading.value = true;
try { try {
// 修正:API入参格式(确保和后端一致) // 修正:API入参格式(确保和后端一致)
queryParams.value.reportYq=yq.value queryParams.value.reportYq = yq.value
const response = await listreportinstr(queryParams.value) const response = await listreportinstr(queryParams.value)
reportinstrList.value = JSON.parse(JSON.stringify(response.data)); reportinstrList.value = JSON.parse(JSON.stringify(response.data));
total.value = response.data.length; total.value = response.data.length;
@ -311,7 +283,7 @@ const cancel = () => {
const reset = () => { const reset = () => {
form.value = { form.value = {
reportId: undefined, reportId: undefined,
reportYq: yq.value||"", reportYq: yq.value || "",
reportBgdh: "", reportBgdh: "",
reportType: "", reportType: "",
reportSize: "2", reportSize: "2",
@ -414,13 +386,13 @@ const handleDelete = async (row: ReportItem) => {
const reportIds = Array.isArray(row.reportId) ? row.reportId : [row.reportId]; const reportIds = Array.isArray(row.reportId) ? row.reportId : [row.reportId];
try { try {
await ElMessageBox.confirm( await ElMessageBox.confirm(
`是否确认删除${menuname.value}编号为${reportIds.join(",")}的数据项?`, `是否确认删除${menuname.value}编号为${reportIds.join(",")}的数据项?`,
"确认删除", "确认删除",
{ {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
} }
); );
await delreportinstr(reportIds); await delreportinstr(reportIds);
ElMessage.success("删除成功"); ElMessage.success("删除成功");
@ -454,66 +426,81 @@ onMounted(() => {
height: 90vh; height: 90vh;
overflow: hidden; overflow: hidden;
} }
.mb8 { .mb8 {
height: 30px; height: 30px;
margin-bottom: 8px; /* 补充margin,避免按钮重叠 */ margin-bottom: 8px;
/* 补充margin,避免按钮重叠 */
} }
.table-container { .table-container {
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
} }
/* 状态样式(替换dict-tag) */ /* 状态样式(替换dict-tag) */
.status-normal { .status-normal {
color: #67c23a; color: #67c23a;
font-weight: 500; font-weight: 500;
} }
.status-disable { .status-disable {
color: #f56c6c; color: #f56c6c;
font-weight: 500; font-weight: 500;
} }
/* 减小表格行高 */ /* 减小表格行高 */
:deep(.report-table .el-table__row) { :deep(.report-table .el-table__row) {
height: 30px !important; height: 30px !important;
line-height: 30px !important; line-height: 30px !important;
} }
/* 减小单元格内边距 */ /* 减小单元格内边距 */
:deep(.report-table .el-table__cell) { :deep(.report-table .el-table__cell) {
padding: 2px 4px !important; padding: 2px 4px !important;
height: 30px !important; height: 30px !important;
line-height: 1.2 !important; line-height: 1.2 !important;
vertical-align: middle !important; vertical-align: middle !important;
font-size: 12px; /* 补充字体大小,适配矮行 */ font-size: 12px;
/* 补充字体大小,适配矮行 */
} }
/* 优化操作列按钮 */ /* 优化操作列按钮 */
:deep(.report-table .el-button--link) { :deep(.report-table .el-button--link) {
padding: 0 4px !important; padding: 0 4px !important;
font-size: 12px !important; font-size: 12px !important;
} }
/* 对话框按钮间距 */ /* 对话框按钮间距 */
.dialog-footer { .dialog-footer {
text-align: center; text-align: center;
} }
/* 输入框+静态文本的容器布局 */ /* 输入框+静态文本的容器布局 */
.input-with-text { .input-with-text {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; /* 输入框和文本的间距 */ gap: 8px;
/* 输入框和文本的间距 */
width: 100%; width: 100%;
} }
/* 静态文本通用样式 */ /* 静态文本通用样式 */
.static-text { .static-text {
font-size: 12px; font-size: 12px;
white-space: nowrap; /* 防止文本换行 */ white-space: nowrap;
/* 防止文本换行 */
} }
/* 红色文本 */ /* 红色文本 */
.red-text { .red-text {
color: #ff4949; /* 适配Element Plus危险色,和开关关闭色一致 */ color: #ff4949;
/* 适配Element Plus危险色,和开关关闭色一致 */
} }
/* 蓝色文本 */ /* 蓝色文本 */
.blue-text { .blue-text {
color: #1989fa; /* 适配Element Plus主要色,也可改用#409eff */ color: #1989fa;
/* 适配Element Plus主要色,也可改用#409eff */
} }
</style> </style>

View File

@ -3,7 +3,7 @@
<div class="sort_box"> <div class="sort_box">
<el-row :gutter="10" class="table-toolbar"> <el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" @click="refresh">刷新</el-button> <el-button type="primary" icon="Refresh" @click="refresh">刷新</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" @click="cpHandle">存盘</el-button> <el-button type="primary" @click="cpHandle">存盘</el-button>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> <el-form :model="queryParams" ref="queryRef" inline v-show="showSearch" class="query-form">
<el-form-item :label="menuname + '类别'" prop="configType"> <el-form-item :label="menuname + '类别'" prop="configType">
<el-select v-model="queryParams.configType" :placeholder="`请选择${menuname}类别`" clearable style="width: 200px" <el-select v-model="queryParams.configType" :placeholder="`请选择${menuname}类别`" clearable style="width: 200px"
@change="handleQuery"> @change="handleQuery">
@ -20,30 +20,19 @@
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" /> <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <div class="mb5">
<el-col :span="1.5"> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-col> <el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
<el-col :span="1.5"> <el-button type="info" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button> <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
</el-col> <el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-col :span="1.5"> </div>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<div class="table-container"> <div class="table-container">
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" border height="100%">
height="100%">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column :label="`${menuname}编号`" align="center" prop="configId" v-if="false" /> <el-table-column :label="`${menuname}编号`" align="center" prop="configId" v-if="false" />
<el-table-column :label="`${menuname}类别`" align="center" prop="configType" width="100" show-overflow-tooltip> <el-table-column :label="`${menuname}类别`" align="center" prop="configType" width="100" show-overflow-tooltip>
@ -325,24 +314,6 @@ getList();
height: calc(100% - 150px); height: calc(100% - 150px);
} }
/* 1. 减小表格行高(核心) */
:deep(.config-table .el-table__row) {
height: 30px !important;
/* 原默认行高约40px,按需调整(建议28-35px) */
line-height: 30px !important;
/* 行高与height一致,保证垂直居中 */
}
/* 2. 减小单元格内边距(配合行高优化) */
:deep(.config-table .el-table__cell) {
padding: 2px 4px !important;
height: 30px !important;
/* 单元格高度与行高一致 */
line-height: 1.2 !important;
/* 文字行高适配矮行 */
vertical-align: middle !important;
/* 强制垂直居中 */
}
/* 3. 类别单元格适配矮行高 */ /* 3. 类别单元格适配矮行高 */
.config-type-cell { .config-type-cell {
@ -356,10 +327,4 @@ getList();
padding: 0; padding: 0;
font-size: 12px; font-size: 12px;
} }
/* 可选:优化操作列按钮大小,适配矮行 */
:deep(.config-table .el-button--link) {
padding: 0 4px !important;
font-size: 12px !important;
}
</style> </style>

View File

@ -1,12 +1,12 @@
<!-- 系统全局选项 --> <!-- 系统全局选项 -->
<template> <template>
<div class="sys_box"> <div class="app-container">
<el-row :gutter="10" class="table-toolbar"> <el-row :gutter="10" class="table-toolbar">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button> <el-button type="success" plain icon="Check" @click="handleSave">保存</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button> <el-button type="info" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button> <el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
@ -17,8 +17,7 @@
<div class="triple-table-wrapper"> <div class="triple-table-wrapper">
<!-- 第一列表格 --> <!-- 第一列表格 -->
<div class="table-panel table-1"> <div class="table-panel table-1">
<el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" border height="100%">
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" /> <el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" /> min-width="150" />
@ -35,8 +34,7 @@
<!-- 第二列表格 --> <!-- 第二列表格 -->
<div class="table-panel table-2"> <div class="table-panel table-2">
<el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" border height="100%">
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" /> <el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" /> min-width="150" />
@ -53,8 +51,7 @@
<!-- 第三列表格 --> <!-- 第三列表格 -->
<div class="table-panel table-3"> <div class="table-panel table-3">
<el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" class="config-table" <el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" border height="100%">
fit border height="100%" :cell-spacing="0">
<el-table-column label="序号" align="center" prop="configSort" width="50" /> <el-table-column label="序号" align="center" prop="configSort" width="50" />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
min-width="150" /> min-width="150" />
@ -79,7 +76,7 @@ import { getFirstLetter } from '@/utils/pinyin'
// @ts-ignore // @ts-ignore
import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue" import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue"
const yq = ref<string>("HISOPT") const yq = ref<string>("HISOPT")
interface RegDictItem { interface RegDictItem {
configId: string | number configId: string | number
@ -213,9 +210,9 @@ getList()
// 三列表格容器 // 三列表格容器
.triple-table-wrapper { .triple-table-wrapper {
flex: 1; flex: 1;
height: calc(100% - 45px); // 减去标题行+工具栏高度 height: calc(100% - 70px); // 减去标题行+工具栏高度
display: flex; display: flex;
gap: 0px; // 表格间间距 gap: 5px; // 表格间间距
overflow: hidden; overflow: hidden;
// 单个表格面板 // 单个表格面板
@ -223,97 +220,6 @@ getList()
flex: 1; // 三列均等分 flex: 1; // 三列均等分
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background: #fff;
border: 1px solid #e6e6e6;
border-radius: 4px;
// 细微间距优化
&.table-1 {
margin-right: 0px;
}
&.table-2 {
margin: 0 0px;
}
&.table-3 {
margin-left: 0px;
}
}
}
// 核心:清除表格内上下间隙
:deep(.config-table) {
// 清除表格整体的边框间距
border-collapse: collapse !important;
border-spacing: 0 !important;
// 清除表格头部间距
.el-table__header {
padding: 0 !important;
th {
padding: 0 !important;
border-bottom: 1px solid #e6e6e6 !important;
line-height: 25px !important;
height: 25px !important;
}
}
// 清除表格内容区间距
.el-table__body {
padding: 0 !important;
// 清除行间距
.el-table__row {
height: 25px !important;
line-height: 25px !important;
margin: 0 !important;
padding: 0 !important;
}
// 清除单元格内边距和间距
.el-table__cell {
padding: 0 4px !important; // 仅保留左右内边距,上下清零
height: 25px !important;
line-height: 25px !important;
vertical-align: middle !important;
font-size: 12px;
border-bottom: 1px solid #e6e6e6 !important;
border-right: 1px solid #e6e6e6 !important;
}
// 最后一列清除右侧边框
.el-table__cell:last-child {
border-right: none !important;
}
}
// 清除表格底部间距
.el-table__footer {
padding: 0 !important;
}
// 编辑输入框适配紧凑布局
.edit-input {
width: 95%;
margin: 0 !important;
padding: 0 !important;
:deep(.el-input__inner) {
padding: 0 5px;
height: 25px !important; // 缩小输入框高度适配紧凑行高
line-height: 25px !important;
font-size: 12px;
border: 1px solid #dcdfe6;
margin: 0 !important;
&:focus {
border-color: #409eff;
outline: none;
}
}
} }
} }
</style> </style>

View File

@ -5,54 +5,30 @@
<!-- 操作按钮栏:改为保存/取消/还原默认 --> <!-- 操作按钮栏:改为保存/取消/还原默认 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" plain icon="Check" @click="handleSave">保存</el-button>
type="primary"
plain
icon="Plus"
@click="handleSave"
>保存</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="info" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
type="success"
plain
icon="Edit"
@click="handleCancelEdit"
>取消修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" plain icon="Download" @click="handleRestoreDefault">还原默认</el-button>
type="danger"
plain
icon="Download"
@click="handleRestoreDefault"
>还原默认</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="5" class="table-container"> <el-row :gutter="5" class="table-container">
<el-table <el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" class="config-table"
v-loading="loading" border height="100%">
:data="regdictList" <el-table-column label="序号" align="center" prop="configSort" />
@selection-change="handleSelectionChange" <el-table-column :label="`${menuname}编码`" align="center" prop="configCode" show-overflow-tooltip />
class="config-table" <el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip />
height="100%"
>
<el-table-column label="序号" align="center" prop="configSort" />
<el-table-column :label="`${menuname}编码`" align="center" prop="configCode" show-overflow-tooltip />
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip />
<!-- 核心:默认值列改为持久化可编辑输入框 --> <!-- 核心:默认值列改为持久化可编辑输入框 -->
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip> <el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<DynamicInput <DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
:type="scope.row.configOptiontype" :dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" />
v-model="scope.row.configDefvalue" </template>
:dict-data="scope.row.remark"
:placeholder="`请输入${scope.row.configName}值`"
/>
</template>
</el-table-column> </el-table-column>
<el-table-column label="值码" align="center" prop="configDefvalue" show-overflow-tooltip /> <el-table-column label="值码" align="center" prop="configDefvalue" show-overflow-tooltip />
</el-table> </el-table>
</el-row> </el-row>
</div> </div>
@ -130,8 +106,8 @@ async function handleSave() {
//const emptyRows = regdictList.value.filter(item => !item.configDefvalue?.trim()); //const emptyRows = regdictList.value.filter(item => !item.configDefvalue?.trim());
//if (emptyRows.length > 0) { //if (emptyRows.length > 0) {
// ElMessage.warning(`有${emptyRows.length}行默认值为空,请补充后再保存!`); // ElMessage.warning(`有${emptyRows.length}行默认值为空,请补充后再保存!`);
// return; // return;
// } // }
try { try {
loading.value = true; loading.value = true;
@ -155,13 +131,13 @@ async function handleSave() {
/** 取消修改:恢复原始数据 */ /** 取消修改:恢复原始数据 */
function handleCancelEdit() { function handleCancelEdit() {
ElMessageBox.confirm( ElMessageBox.confirm(
"是否确认取消所有修改,恢复到原始数据?", "是否确认取消所有修改,恢复到原始数据?",
"提示", "提示",
{ {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
} }
).then(() => { ).then(() => {
// 恢复原始数据 // 恢复原始数据
regdictList.value = JSON.parse(JSON.stringify(originRegdictList.value)); regdictList.value = JSON.parse(JSON.stringify(originRegdictList.value));
@ -172,13 +148,13 @@ function handleCancelEdit() {
/** 还原默认值:调用接口获取默认值并刷新 */ /** 还原默认值:调用接口获取默认值并刷新 */
async function handleRestoreDefault() { async function handleRestoreDefault() {
ElMessageBox.confirm( ElMessageBox.confirm(
"是否确认还原所有默认值?此操作会覆盖当前修改!", "是否确认还原所有默认值?此操作会覆盖当前修改!",
"警告", "警告",
{ {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "danger" type: "danger"
} }
).then(async () => { ).then(async () => {
try { try {
loading.value = true; loading.value = true;
@ -224,23 +200,13 @@ getList();
overflow: hidden; overflow: hidden;
} }
/* 表格样式优化 */
:deep(.config-table .el-table__row) {
height: 30px !important;
line-height: 30px !important;
}
:deep(.config-table .el-table__cell) {
padding: 2px 4px !important;
height: 30px !important;
line-height: 1.2 !important;
vertical-align: middle !important;
}
/* 编辑输入框样式适配 */ /* 编辑输入框样式适配 */
:deep(.config-table .edit-input) { :deep(.config-table .edit-input) {
width: 100%; width: 100%;
} }
:deep(.config-table .edit-input .el-input__inner) { :deep(.config-table .edit-input .el-input__inner) {
padding: 0 5px; padding: 0 5px;
height: 24px; height: 24px;
@ -248,6 +214,7 @@ getList();
font-size: 12px; font-size: 12px;
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
} }
:deep(.config-table .edit-input .el-input__inner:focus) { :deep(.config-table .edit-input .el-input__inner:focus) {
border-color: #409eff; border-color: #409eff;
outline: none; outline: none;

View File

@ -1,166 +1,106 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" class="query-form">
<el-form-item :label="menuname + '类别'" prop="reportType"> <el-form-item :label="menuname + '类别'" prop="reportType">
<el-select <el-select v-model="queryParams.reportType" :placeholder="`请选择${menuname}类别`" clearable style="width: 200px"
v-model="queryParams.reportType" @change="handleQuery">
:placeholder="`请选择${menuname}类别`" <el-option v-for="item in reportTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
clearable
style="width: 200px"
@change="handleQuery"
>
<el-option
v-for="item in reportTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模板文件名(.jrxml)" prop="reportCode"> <el-form-item label="模板文件名(.jrxml)" prop="reportCode">
<el-input <el-input v-model="queryParams.reportCode" :placeholder="`请输入${menuname}编码`" clearable style="width: 200px"
v-model="queryParams.reportCode" @keyup.enter="handleQuery" />
:placeholder="`请输入${menuname}编码`"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item :label="`${menuname}名称`" prop="reportName"> <el-form-item :label="`${menuname}名称`" prop="reportName">
<el-input <el-input v-model="queryParams.reportName" :placeholder="`请输入${menuname}名称`" clearable style="width: 200px"
v-model="queryParams.reportName" @keyup.enter="handleQuery" />
:placeholder="`请输入${menuname}名称`"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 200px"> <el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 200px">
<el-option <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="Plus" @click="handleAdd">新增模板</el-button>
type="primary"
plain
icon="Plus"
@click="handleAdd"
>新增模板</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除模板</el-button>
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
>删除模板</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain icon="Download" @click="autoloading">自动加载</el-button>
type="warning"
plain
icon="Download"
@click="autoloading"
>自动加载</el-button>
</el-col> </el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-row :gutter="5" class="table-container"> <el-row :gutter="5" class="table-container">
<el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" class="report-table" height="100%"> <el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" class="report-table"
<el-table-column type="selection" width="55" align="center" /> height="100%">
<el-table-column :label="`${menuname}类别`" align="center" prop="reportType" width="100" show-overflow-tooltip> <el-table-column type="selection" width="55" align="center" />
<template #default="scope"> <el-table-column :label="`${menuname}类别`" align="center" prop="reportType" width="100" show-overflow-tooltip>
<span <template #default="scope">
class="report-type-cell" <span class="report-type-cell" :style="{
:style="{
backgroundColor: getreportTypeColor(scope.row.reportType), backgroundColor: getreportTypeColor(scope.row.reportType),
color: '#fff' // 文字白色,保证对比 color: '#fff' // 文字白色,保证对比
}" }">
> {{reportTypeOptions.find(item => item.value === scope.row.reportType)?.label || scope.row.reportType}}
{{ reportTypeOptions.find(item => item.value === scope.row.reportType)?.label || scope.row.reportType }} </span>
</span> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="编号" align="center" prop="reportBgdh" width="50" show-overflow-tooltip />
<el-table-column label="编号" align="center" prop="reportBgdh" width="50" show-overflow-tooltip/> <el-table-column label="模板文件名" align="center" prop="reportCode" width="150" show-overflow-tooltip />
<el-table-column label="模板文件名" align="center" prop="reportCode" width="150" show-overflow-tooltip /> <el-table-column :label="`${menuname}名称`" align="left" prop="reportName" show-overflow-tooltip />
<el-table-column :label="`${menuname}名称`" align="left" prop="reportName" show-overflow-tooltip /> <el-table-column label="排版类别" align="center" prop="reportOptiontype" width="80">
<el-table-column label="排版类别" align="center" prop="reportOptiontype"width="80"> <template #default="scope">
<template #default="scope"> <span>
<span> {{reportOptiontypeOptions.find(item => item.value === scope.row.reportOptiontype)?.label ||
{{ reportOptiontypeOptions.find(item => item.value === scope.row.reportOptiontype)?.label || scope.row.reportOptiontype }} scope.row.reportOptiontype}}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="参数" align="center" prop="reportDefvalue" show-overflow-tooltip /> <el-table-column label="参数" align="center" prop="reportDefvalue" show-overflow-tooltip />
<el-table-column label="备注" align="left" prop="remark" show-overflow-tooltip /> <el-table-column label="备注" align="left" prop="remark" show-overflow-tooltip />
<el-table-column label="排序" align="center" prop="reportSort" width="80" /> <el-table-column label="排序" align="center" prop="reportSort" width="80" />
<el-table-column label="状态" align="center" prop="status" width="80"> <el-table-column label="状态" align="center" prop="status" width="80">
<template #default="scope"> <template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.status" /> <dict-tag :options="sys_normal_disable" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="150" show-overflow-tooltip> <el-table-column label="创建时间" align="center" prop="createTime" width="150" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="400" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" width="400" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" >修改</el-button> <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button link type="primary" icon="Link" @click="handleDelete(scope.row)" >预览模板</el-button> <el-button link type="primary" icon="Link" @click="handleDelete(scope.row)">预览模板</el-button>
<el-button link type="primary" icon="Upload" @click="uploadfile(scope.row)" >更替模板</el-button> <el-button link type="primary" icon="Upload" @click="uploadfile(scope.row)">更替模板</el-button>
<el-button link type="primary" icon="Download" @click="downloadfile(scope.row)" >下载模板</el-button> <el-button link type="primary" icon="Download" @click="downloadfile(scope.row)">下载模板</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-row> </el-row>
<!-- 添加或修改模板对话框 --> <!-- 添加或修改模板对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body> <el-dialog :title="title" v-model="open" width="500px" :close-on-click-modal="false" :draggable="true">
<el-form ref="reportdictRef" :model="form" :rules="rules" label-width="150px"> <el-form ref="reportdictRef" :model="form" :rules="rules" label-width="150px">
<el-form-item :label="`${menuname}类别`" prop="reportType"> <el-form-item :label="`${menuname}类别`" prop="reportType">
<el-select <el-select v-model="form.reportType" :placeholder="`请选择${menuname}类别`" style="width: 100%">
v-model="form.reportType" <el-option v-for="item in reportTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
:placeholder="`请选择${menuname}类别`"
style="width: 100%"
>
<el-option
v-for="item in reportTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="模板文件名(.jrxml)" prop="reportCode"> <el-form-item label="模板文件名(.jrxml)" prop="reportCode">
<el-input v-model="form.reportCode" :placeholder="`请输入${menuname}编码`" disabled class="disabled-input-gray"/> <el-input v-model="form.reportCode" :placeholder="`请输入${menuname}编码`" disabled class="disabled-input-gray" />
</el-form-item> </el-form-item>
<el-form-item :label="`${menuname}名称`" prop="reportName"> <el-form-item :label="`${menuname}名称`" prop="reportName">
<el-input v-model="form.reportName" :placeholder="`请输入${menuname}名称`" /> <el-input v-model="form.reportName" :placeholder="`请输入${menuname}名称`" />
</el-form-item> </el-form-item>
<el-form-item :label="`${menuname}排版类别`" prop="reportOptiontype"> <el-form-item :label="`${menuname}排版类别`" prop="reportOptiontype">
<el-select <el-select v-model="form.reportOptiontype" :placeholder="`请选择${menuname}排版类别`" style="width: 100%">
v-model="form.reportOptiontype" <el-option v-for="item in reportOptiontypeOptions" :key="item.value" :label="item.label"
:placeholder="`请选择${menuname}排版类别`" :value="item.value" />
style="width: 100%"
>
<el-option
v-for="item in reportOptiontypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="`${menuname}参数`" prop="reportDefvalue"> <el-form-item :label="`${menuname}参数`" prop="reportDefvalue">
@ -172,11 +112,8 @@
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
<el-radio <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label
v-for="dict in sys_normal_disable" }}</el-radio>
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
@ -191,10 +128,11 @@
</template> </template>
</el-dialog> </el-dialog>
<!-- 用户导入对话框 --> <!-- 用户导入对话框 -->
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body> <el-dialog :title="upload.title" v-model="upload.open" width="400px" :close-on-click-modal="false"
:draggable="true">
<el-upload ref="uploadRef" :limit="1" accept=".jrxml" :headers="upload.headers" <el-upload ref="uploadRef" :limit="1" accept=".jrxml" :headers="upload.headers"
:action="upload.url + '?reportBgdh=' + upload.reportBgdh" :disabled="upload.isUploading" :action="upload.url + '?reportBgdh=' + upload.reportBgdh" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag> :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<el-icon class="el-icon--upload"><upload-filled /></el-icon> <el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<template #tip> <template #tip>
@ -219,15 +157,15 @@ import {
addreportdict, delreportdict, addreportdict, delreportdict,
getreportdict, getreportdict,
listreportdict, listreportdict,
updatereportdict,autoload updatereportdict, autoload
} from "@/api/liswork/xtwh/reportdictApi.ts"; } from "@/api/liswork/xtwh/reportdictApi.ts";
// 1. 定义类别下拉选项(根据实际业务调整) // 1. 定义类别下拉选项(根据实际业务调整)
const reportTypeOptions = ref([ const reportTypeOptions = ref([
{ label: "检验报告", value: "0",color: "#56BBBD" }, { label: "检验报告", value: "0", color: "#56BBBD" },
{ label: "条码标签", value: "1",color: "#67C23A" }, { label: "条码标签", value: "1", color: "#67C23A" },
{ label: "回单标签", value: "2",color: "#7E84F7" }, { label: "回单标签", value: "2", color: "#7E84F7" },
{ label: "统计报表", value: "3",color: "#F08784" }, { label: "统计报表", value: "3", color: "#F08784" },
{ label: "其他报表", value: "4",color: "#909399" }, { label: "其他报表", value: "4", color: "#909399" },
]); ]);
// 2. 定义获取类别对应颜色的方法 // 2. 定义获取类别对应颜色的方法
function getreportTypeColor(type) { function getreportTypeColor(type) {
@ -237,15 +175,15 @@ function getreportTypeColor(type) {
} }
// 2. 定义参数类别下拉选项(根据实际业务调整) // 2. 定义参数类别下拉选项(根据实际业务调整)
const reportOptiontypeOptions = ref([ const reportOptiontypeOptions = ref([
{ label: "默认", value: "0",color: "#56BBBD" }, { label: "默认", value: "0", color: "#56BBBD" },
{ label: "单列", value: "1",color: "#67C23A" }, { label: "单列", value: "1", color: "#67C23A" },
{ label: "双列", value: "2",color: "#FF443F" }, { label: "双列", value: "2", color: "#FF443F" },
{ label: "单列带图", value: "3",color: "#F08784" }, { label: "单列带图", value: "3", color: "#F08784" },
{ label: "双列带图", value: "4",color: "#909399" }, { label: "双列带图", value: "4", color: "#909399" },
{ label: "细菌阳性", value: "5",color: "#3282F6" }, { label: "细菌阳性", value: "5", color: "#3282F6" },
{ label: "细菌阴性", value: "6",color: "#507F80" }, { label: "细菌阴性", value: "6", color: "#507F80" },
{ label: "标签", value: "7",color: "#7E84F7" }, { label: "标签", value: "7", color: "#7E84F7" },
{ label: "回单", value: "8",color: "#377D22" }, { label: "回单", value: "8", color: "#377D22" },
]); ]);
function getreportOptionTypeColor(type) { function getreportOptionTypeColor(type) {
// 匹配对应类别的颜色,无匹配时用默认色 // 匹配对应类别的颜色,无匹配时用默认色
@ -284,14 +222,14 @@ const data = reactive({
queryParams: { queryParams: {
reportCode: undefined, reportCode: undefined,
reportName: undefined, reportName: undefined,
reportType:"0", reportType: "0",
status: undefined status: undefined
}, },
rules: { rules: {
reportType: [{ required: true, message: menuname.value+"类别不能为空", trigger: "blur" }], reportType: [{ required: true, message: menuname.value + "类别不能为空", trigger: "blur" }],
reportName: [{ required: true, message: menuname.value+"名称不能为空", trigger: "blur" }], reportName: [{ required: true, message: menuname.value + "名称不能为空", trigger: "blur" }],
reportCode: [{ required: true, message: menuname.value+"编码不能为空", trigger: "blur" }], reportCode: [{ required: true, message: menuname.value + "编码不能为空", trigger: "blur" }],
reportSort: [{ required: true, message: menuname.value+"顺序不能为空", trigger: "blur" }], reportSort: [{ required: true, message: menuname.value + "顺序不能为空", trigger: "blur" }],
} }
}); });
@ -320,7 +258,7 @@ function reset() {
reportName: undefined, reportName: undefined,
reportType: reportTypeOptions.value[0]?.value || "", reportType: reportTypeOptions.value[0]?.value || "",
reportOptiontype: reportOptiontypeOptions.value[0]?.value || "", reportOptiontype: reportOptiontypeOptions.value[0]?.value || "",
reportDefvalue:undefined, reportDefvalue: undefined,
reportSort: 0, reportSort: 0,
status: "0", status: "0",
remark: undefined remark: undefined
@ -345,7 +283,7 @@ function handleSelectionChange(selection) {
} }
/** 新增按钮操作 */ /** 新增按钮操作 */
function handleAdd() { function handleAdd() {
upload.reportBgdh=0; upload.reportBgdh = 0;
upload.title = "新增模板"; upload.title = "新增模板";
upload.open = true; upload.open = true;
} }
@ -356,7 +294,7 @@ function handleUpdate(row) {
getreportdict(reportBgdh).then(response => { getreportdict(reportBgdh).then(response => {
form.value = response.data; form.value = response.data;
open.value = true; open.value = true;
title.value = "修改"+menuname.value; title.value = "修改" + menuname.value;
}); });
} }
/** 提交按钮 */ /** 提交按钮 */
@ -398,7 +336,7 @@ function submitFileForm() {
}; };
/** 导入按钮操作 */ /** 导入按钮操作 */
function uploadfile(row) { function uploadfile(row) {
upload.reportBgdh= row.reportBgdh; upload.reportBgdh = row.reportBgdh;
upload.title = "模板上传"; upload.title = "模板上传";
upload.open = true; upload.open = true;
}; };
@ -412,13 +350,13 @@ function downloadfile(row) {
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDelete(row) { function handleDelete(row) {
const reportBgdhs = row.reportBgdh || ids.value; const reportBgdhs = row.reportBgdh || ids.value;
proxy.$modal.confirm('是否确认删除"' + menuname.value + '"编号为"' + reportBgdhs + '"的数据项?').then(function() { proxy.$modal.confirm('是否确认删除"' + menuname.value + '"编号为"' + reportBgdhs + '"的数据项?').then(function () {
return delreportdict(reportBgdhs); return delreportdict(reportBgdhs);
}).then(() => { }).then(() => {
getList(); getList();
proxy.$modal.msgSuccess("删除成功"); proxy.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => { });
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
function handleExport() { function handleExport() {
@ -427,9 +365,9 @@ function handleExport() {
}, `dict_${new Date().getTime()}.xlsx`); }, `dict_${new Date().getTime()}.xlsx`);
} }
function autoloading(){ function autoloading() {
loading.value = true; loading.value = true;
autoload().then(response => { autoload().then(response => {
getList(); getList();
loading.value = false; loading.value = false;
}); });
@ -444,35 +382,44 @@ getList();
/* 容器高度等于窗口高度 */ /* 容器高度等于窗口高度 */
overflow: hidden; overflow: hidden;
} }
.mb8 { .mb8 {
height: 30px; height: 30px;
/* 固定高度 */ /* 固定高度 */
} }
.table-container { .table-container {
flex: 1; flex: 1;
/* 占满剩余高度 */ /* 占满剩余高度 */
overflow: hidden; overflow: hidden;
/* 避免表格超出容器 */ /* 避免表格超出容器 */
} }
/* 1. 减小表格行高(核心) */ /* 1. 减小表格行高(核心) */
:deep(.report-table .el-table__row) { :deep(.report-table .el-table__row) {
height: 30px !important; /* 原默认行高约40px,按需调整(建议28-35px) */ height: 30px !important;
line-height: 30px !important; /* 行高与height一致,保证垂直居中 */ /* 原默认行高约40px,按需调整(建议28-35px) */
line-height: 30px !important;
/* 行高与height一致,保证垂直居中 */
} }
/* 2. 减小单元格内边距(配合行高优化) */ /* 2. 减小单元格内边距(配合行高优化) */
:deep(.report-table .el-table__cell) { :deep(.report-table .el-table__cell) {
padding: 2px 4px !important; padding: 2px 4px !important;
height: 30px !important; /* 单元格高度与行高一致 */ height: 30px !important;
line-height: 1.2 !important; /* 文字行高适配矮行 */ /* 单元格高度与行高一致 */
vertical-align: middle !important; /* 强制垂直居中 */ line-height: 1.2 !important;
/* 文字行高适配矮行 */
vertical-align: middle !important;
/* 强制垂直居中 */
} }
/* 3. 类别单元格适配矮行高 */ /* 3. 类别单元格适配矮行高 */
.report-type-cell { .report-type-cell {
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 26px; /* 适配30px行高,略小一点 */ min-height: 26px;
/* 适配30px行高,略小一点 */
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -485,9 +432,13 @@ getList();
padding: 0 4px !important; padding: 0 4px !important;
font-size: 12px !important; font-size: 12px !important;
} }
.disabled-input-gray :deep(.el-input__inner){
background-color: #e9e9e9 !important; /* 灰色底色(可根据需求调整色值) */ .disabled-input-gray :deep(.el-input__inner) {
color: #666 !important; /* 文字颜色加深,提升可读性 */ background-color: #e9e9e9 !important;
cursor: not-allowed !important; /* 鼠标悬浮显示禁止图标 */ /* 灰色底色(可根据需求调整色值) */
color: #666 !important;
/* 文字颜色加深,提升可读性 */
cursor: not-allowed !important;
/* 鼠标悬浮显示禁止图标 */
} }
</style> </style>

View File

@ -1,118 +1,68 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索表单 --> <!-- 搜索表单 -->
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> <el-form :model="queryParams" ref="queryRef" inline v-show="showSearch" class="query-form">
<el-form-item :label="menuname + '类别'" prop="statsType"> <el-form-item :label="menuname + '类别'" prop="statsType">
<el-select <el-select v-model="queryParams.statsType" :placeholder="`请选择${menuname}类别`" clearable style="width: 200px"
v-model="queryParams.statsType" @change="handleQuery">
:placeholder="`请选择${menuname}类别`" <el-option v-for="item in statsTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
clearable
style="width: 200px"
@change="handleQuery"
>
<el-option
v-for="item in statsTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="menuname + '编码'" prop="statsCode"> <el-form-item :label="menuname + '编码'" prop="statsCode">
<el-input <el-input v-model="queryParams.statsCode" :placeholder="`请输入${menuname}编码`" clearable style="width: 200px"
v-model="queryParams.statsCode" @keyup.enter="handleQuery" />
:placeholder="`请输入${menuname}编码`"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item :label="`${menuname}名称`" prop="statsName"> <el-form-item :label="`${menuname}名称`" prop="statsName">
<el-input <el-input v-model="queryParams.statsName" :placeholder="`请输入${menuname}名称`" clearable style="width: 200px"
v-model="queryParams.statsName" @keyup.enter="handleQuery" />
:placeholder="`请输入${menuname}名称`"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select <el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 200px">
v-model="queryParams.status" <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
placeholder="状态"
clearable
style="width: 200px"
>
<el-option
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> </el-form>
<!-- 操作按钮栏 --> <!-- 操作按钮栏 -->
<el-row :gutter="10" class="mb8"> <div class="mb5">
<el-col :span="1.5"> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-col> <el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
<el-col :span="1.5"> <el-button type="info" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button>
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate">修改</el-button> <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
</el-col> <el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
<el-col :span="1.5"> </div>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 数据表格 --> <!-- 数据表格 -->
<div class="table-container"> <div class="table-container">
<el-table <el-table v-loading="loading" :data="regdictList" @selection-change="handleSelectionChange" border height="100%">
v-loading="loading"
:data="regdictList"
@selection-change="handleSelectionChange"
class="stats-table"
height="100%"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column :label="`${menuname}编号`" align="center" prop="statsId" v-if="false" /> <el-table-column :label="`${menuname}编号`" align="center" prop="statsId" v-if="false" />
<el-table-column :label="`${menuname}类别`" align="center" prop="statsType" width="100" show-overflow-tooltip> <el-table-column :label="`${menuname}类别`" align="center" prop="statsType" width="100" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<span <span class="stats-type-cell" :style="{
class="stats-type-cell" backgroundColor: getstatsTypeColor(scope.row.statsType),
:style="{ color: '#fff'
backgroundColor: getstatsTypeColor(scope.row.statsType), }">
color: '#fff' {{statsTypeOptions.find(item => item.value === scope.row.statsType)?.label || scope.row.statsType}}
}"
>
{{ statsTypeOptions.find(item => item.value === scope.row.statsType)?.label || scope.row.statsType }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="`${menuname}编码`" align="center" prop="statsCode" show-overflow-tooltip > <el-table-column :label="`${menuname}编码`" align="center" prop="statsCode" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<router-link :to="`/liswork/xtwh/statstemplate/data?statsCode=${scope.row.statsCode}`" class="link-type"> <router-link :to="`/liswork/xtwh/statstemplate/data?statsCode=${scope.row.statsCode}`" class="link-type">
<span>{{ scope.row.statsCode }}</span> <span>{{ scope.row.statsCode }}</span>
</router-link> </router-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="`${menuname}名称`" align="left" prop="statsName" show-overflow-tooltip /> <el-table-column :label="`${menuname}名称`" align="left" prop="statsName" show-overflow-tooltip />
<el-table-column label="表头" align="left" prop="statsTitle" width="150" show-overflow-tooltip /> <el-table-column label="表头" align="left" prop="statsTitle" width="150" show-overflow-tooltip />
<el-table-column label="图表类型" align="left" prop="statsGraph" width="80" show-overflow-tooltip > <el-table-column label="图表类型" align="left" prop="statsGraph" width="80" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<span> <span>
{{ statsGraphOptions.find(item => item.value === scope.row.statsGraph)?.label || scope.row.statsGraph }} {{statsGraphOptions.find(item => item.value === scope.row.statsGraph)?.label || scope.row.statsGraph}}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="left" prop="remark" width="100" show-overflow-tooltip /> <el-table-column label="备注" align="left" prop="remark" width="100" show-overflow-tooltip />
<el-table-column label="排序" align="center" prop="statsSort" width="80" /> <el-table-column label="排序" align="center" prop="statsSort" width="80" />
@ -136,29 +86,15 @@
</div> </div>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-show="total > 0" v-model:limit="queryParams.pageSize" @pagination="getList" />
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 新增/修改对话框 --> <!-- 新增/修改对话框 -->
<el-dialog :title="title" v-model="open" width="700px" class="compact-dialog"> <el-dialog :title="title" v-model="open" width="700px" :close-on-click-modal="false" :draggable="true">
<el-form ref="statstempRef" :model="form" :rules="rules" label-width="150px" class="compact-form"> <el-form ref="statstempRef" :model="form" :rules="rules" label-width="150px">
<el-form-item :label="`${menuname}类别`" prop="statsType"> <el-form-item :label="`${menuname}类别`" prop="statsType">
<el-select <el-select v-model="form.statsType" :placeholder="`请选择${menuname}类别`" style="width: 100%">
v-model="form.statsType" <el-option v-for="item in statsTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
:placeholder="`请选择${menuname}类别`"
style="width: 100%"
>
<el-option
v-for="item in statsTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="`${menuname}编码`" prop="statsCode"> <el-form-item :label="`${menuname}编码`" prop="statsCode">
@ -171,23 +107,14 @@
<el-input v-model="form.statsTitle" :placeholder="`请输入${menuname}表头`" /> <el-input v-model="form.statsTitle" :placeholder="`请输入${menuname}表头`" />
</el-form-item> </el-form-item>
<el-form-item :label="`${menuname}图形类型`" prop="statsOptiontype"> <el-form-item :label="`${menuname}图形类型`" prop="statsOptiontype">
<el-select <el-select v-model="form.statsGraph" :placeholder="`请选择${menuname}图形类型`" style="width: 100%">
v-model="form.statsGraph" <el-option v-for="item in statsGraphOptions" :key="item.value" :label="item.label" :value="item.value" />
:placeholder="`请选择${menuname}图形类型`"
style="width: 100%"
>
<el-option
v-for="item in statsGraphOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 集成封装好的SQL高亮输入框组件 --> <!-- 集成封装好的SQL高亮输入框组件 -->
<el-form-item :label="`${menuname}查询语句`" prop="statsSql"> <el-form-item :label="`${menuname}查询语句`" prop="statsSql">
<el-input v-model="form.statsSql" type="textarea" placeholder="请输入查询语句" :rows="10" /> <el-input v-model="form.statsSql" type="textarea" placeholder="请输入查询语句" :rows="8" />
</el-form-item> </el-form-item>
<el-form-item label="顺序" prop="statsSort"> <el-form-item label="顺序" prop="statsSort">
@ -195,11 +122,7 @@
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
<el-radio <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.value"
>
{{ dict.label }} {{ dict.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
@ -333,18 +256,18 @@ function getList() {
loading.value = true; loading.value = true;
const params = queryParams.value || { pageNum: 1, pageSize: 30 }; const params = queryParams.value || { pageNum: 1, pageSize: 30 };
liststatstemp(params) liststatstemp(params)
.then(response => { .then(response => {
regdictList.value = response?.rows || []; regdictList.value = response?.rows || [];
total.value = response?.total || 0; total.value = response?.total || 0;
}) })
.catch(() => { .catch(() => {
regdictList.value = []; regdictList.value = [];
total.value = 0; total.value = 0;
proxy && proxy.$modal.msgError("数据加载失败"); proxy && proxy.$modal.msgError("数据加载失败");
}) })
.finally(() => { .finally(() => {
loading.value = false; loading.value = false;
}); });
} }
// 搜索 // 搜索
@ -475,18 +398,6 @@ getList();
margin-bottom: 10px; margin-bottom: 10px;
} }
/* 表格样式优化 */
:deep(.stats-table .el-table__row) {
height: 30px !important;
line-height: 30px !important;
}
:deep(.stats-table .el-table__cell) {
padding: 2px 4px !important;
height: 30px !important;
line-height: 1.2 !important;
vertical-align: middle !important;
}
.stats-type-cell { .stats-type-cell {
width: 100%; width: 100%;
@ -499,39 +410,4 @@ getList();
font-size: 12px; font-size: 12px;
border-radius: 2px; border-radius: 2px;
} }
:deep(.stats-table .el-button--link) {
padding: 0 4px !important;
font-size: 12px !important;
}
/* 对话框紧凑样式 */
:deep(.compact-dialog) {
--el-dialog-padding-primary: 15px;
}
.compact-form {
--el-form-item-margin-bottom: 8px;
line-height: 1.4;
}
:deep(.compact-form .el-form-item__label) {
padding: 0 8px 0 0;
line-height: 1.4;
}
:deep(.compact-form .el-form-item__content) {
line-height: 1.4;
}
/* 对话框底部按钮区 */
:deep(.compact-dialog .dialog-footer) {
padding: 10px 15px;
text-align: right;
}
/* 备注文本域 */
:deep(.compact-form .el-form-item:last-of-type .el-textarea__inner) {
min-height: 60px;
}
</style> </style>

View File

@ -1,7 +1,7 @@
<!-- 收费项目,报告项目对照 --> <!-- 收费项目,报告项目对照 -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="formData" label-width="80px" inline> <el-form ref="form" :model="formData" label-width="80px" inline class="query-form">
<el-form-item label="仪器" prop="yq"> <el-form-item label="仪器" prop="yq">
<YQSelectTable v-model:data="formData.yq" width="200px" placeholder="请输入仪器名称" @get-data-value="getDataValue" /> <YQSelectTable v-model:data="formData.yq" width="200px" placeholder="请输入仪器名称" @get-data-value="getDataValue" />
</el-form-item> </el-form-item>
@ -13,11 +13,14 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row> <el-row :gutter="20">
<el-button type="primary" icon="Plus" @click="onClickAdd">新增</el-button> <el-col :span="8">
<el-button type="danger" icon="Delete" @click="onClickDel">删除</el-button> <el-button type="primary" icon="Edit" @click="searchHandle">搜索申请项目</el-button>
<el-button type="primary" icon="Edit" @click="searchHandle">搜索申请项目</el-button> </el-col>
<el-button type="primary" icon="Edit" @click="onClickSave">保存</el-button> <el-col :span="16">
<el-button type="primary" icon="Plus" @click="onClickAdd">新增</el-button>
<el-button type="success" icon="Check" @click="onClickSave">保存</el-button>
</el-col>
</el-row> </el-row>
<el-row :gutter="20" class="table-row"> <el-row :gutter="20" class="table-row">
@ -27,9 +30,10 @@
</el-col> </el-col>
<el-col :span="16" class="table-col"> <el-col :span="16" class="table-col">
<CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true" <CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-click="rowHandle"> @column-drag-end="handleColumnDragEnd" :config="tableConfig">
<template #xmdh="{ row }"> <template #xmdh="{ row }">
<SelectTable v-model:data="row.xmdh" :tableData="xmList" class="full-width-input" :keyValue="true" /> <SelectTable v-model:data="row.xmdh" :tableData="xmList" class="full-width-input" :keyValue="true"
:clearable="false" />
</template> </template>
<template #tdh="{ row }"> <template #tdh="{ row }">
<el-input placeholder="" v-model="row.tdh" class="full-width-input"></el-input> <el-input placeholder="" v-model="row.tdh" class="full-width-input"></el-input>
@ -43,6 +47,9 @@
<template #def="{ row }"> <template #def="{ row }">
<el-checkbox v-model="row.def" true-value="1" false-value="0" /> <el-checkbox v-model="row.def" true-value="1" false-value="0" />
</template> </template>
<template #action="{ row }">
<el-button type="primary" icon="Delete" link @click="onClickDel(row)">删除</el-button>
</template>
</CustomTable> </CustomTable>
</el-col> </el-col>
</el-row> </el-row>
@ -55,9 +62,12 @@ import { queryListService, queryDetailService, queryOldxminfo, addXminfo, delXmi
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'; import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue';
import CustomTable from '@/components/elTable/index.vue' import CustomTable from '@/components/elTable/index.vue'
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { useCommonStore } from '@/store/modules/commonStore'
const mbStore = useCommonStore();
const formData = ref({ const formData = ref({
yq: '46', yq: mbStore.defaultConfig.defaultinstr || '1',
sqxmmc: '', sqxmmc: '',
sl: '' sl: ''
}) })
@ -72,7 +82,6 @@ interface tableItem {
const dataListLeft = ref([]) const dataListLeft = ref([])
const dataListRight = ref<tableItem[]>([]) const dataListRight = ref<tableItem[]>([])
const xmList = ref([]) const xmList = ref([])
const selectRow = ref<any>(null)
//退拽属性 //退拽属性
const handleColumnDragEnd = (data: any) => { const handleColumnDragEnd = (data: any) => {
@ -93,10 +102,10 @@ const columnsLeft = ref([
const columnsRight = ref([ const columnsRight = ref([
{ prop: 'xmdh', label: '报告项目', visible: true, align: 'center', width: 250, slot: 'xmdh', showOverflowTooltip: false }, { prop: 'xmdh', label: '报告项目', visible: true, align: 'center', width: 250, slot: 'xmdh', showOverflowTooltip: false },
{ prop: 'tdh', label: '双工代号', visible: true, align: 'center', slot: 'tdh' }, { prop: 'tdh', label: '双工代号', visible: true, align: 'center', slot: 'tdh', showOverflowTooltip: false },
{ prop: 'mrz', label: '默认值', visible: true, align: 'center', slot: 'mrz' }, { prop: 'mrz', label: '默认值', visible: true, align: 'center', slot: 'mrz', showOverflowTooltip: false },
{ prop: 'seq', label: '序号', visible: true, align: 'center', slot: 'seq' }, { prop: 'seq', label: '序号', visible: true, align: 'center', slot: 'seq', showOverflowTooltip: false },
{ prop: 'def', label: '非必做', visible: true, align: 'center', slot: 'def' }, { prop: 'def', label: '非必做', visible: true, align: 'center', slot: 'def', showOverflowTooltip: false },
]); ]);
const tableRefLeft = ref() const tableRefLeft = ref()
// 获取数据列表 // 获取数据列表
@ -108,13 +117,10 @@ const getList = async () => {
tableRefLeft.value?.setCurrentRow(dataListLeft.value[0]) tableRefLeft.value?.setCurrentRow(dataListLeft.value[0])
} else { } else {
dataListRight.value = [] dataListRight.value = []
selectRow.value = null
} }
} }
const rowHandle = (row: any) => {
selectRow.value = row
}
const onClickAdd = () => { const onClickAdd = () => {
dataListRight.value.push({ dataListRight.value.push({
@ -126,16 +132,17 @@ const onClickAdd = () => {
}) })
} }
const onClickDel = () => { const onClickDel = (row) => {
if (!selectRow.value) return ElMessage.warning('请选择要删除的行!') if (row.sqxmdh) {
delXminfo(row).then((res) => {
if (selectRow.value.sqxmdh) { if (res.code == 0) {
delXminfo(selectRow.value) ElMessage.success('删除成功')
rowClickLeft(xmInfo.value) }
rowClickLeft(xmInfo.value)
})
} else { } else {
dataListRight.value = dataListRight.value.filter(item => item.xmdh != selectRow.value.xmdh) dataListRight.value = dataListRight.value.filter(item => item.xmdh != row.xmdh)
} }
selectRow.value = null
} }
const onClickSave = () => { const onClickSave = () => {
@ -156,7 +163,11 @@ const onClickSave = () => {
} }
const searchHandle = () => { const searchHandle = () => {
searchxminfo({ yq: formData.value.yq }) searchxminfo({ yq: formData.value.yq }).then((res) => {
if (res.code == 0) {
ElMessage.success(res.msg)
}
})
} }
const getDataValue = (value: any) => { const getDataValue = (value: any) => {
getOldXminfoList() getOldXminfoList()
@ -166,7 +177,6 @@ const getDataValue = (value: any) => {
const xmInfo: any = ref({}) const xmInfo: any = ref({})
//点击事件 //点击事件
const rowClickLeft = async (row: any) => { const rowClickLeft = async (row: any) => {
selectRow.value = null
xmInfo.value = row xmInfo.value = row
const res = await queryDetailService({ sqxmdh: row.sqxmdh, sqxmmc: row.sqxmmc, yq: formData.value.yq }) const res = await queryDetailService({ sqxmdh: row.sqxmdh, sqxmmc: row.sqxmmc, yq: formData.value.yq })
dataListRight.value = res.rows dataListRight.value = res.rows

View File

@ -1,35 +1,35 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryRef" inline v-show="showSearch" class="query-form">
<el-form-item label="参数名称" prop="configName"> <el-form-item label="参数名称" prop="configName">
<el-input v-model="queryParams.configName" placeholder="请输入参数名称" clearable style="width: 240px" <el-input v-model="queryParams.configName" placeholder="请输入参数名称" clearable @keyup.enter="handleQuery" />
@keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="参数键名" prop="configKey"> <el-form-item label="参数键名" prop="configKey">
<el-input v-model="queryParams.configKey" placeholder="请输入参数键名" clearable style="width: 240px" <el-input v-model="queryParams.configKey" placeholder="请输入参数键名" clearable @keyup.enter="handleQuery" />
@keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="系统内置" prop="configType"> <el-form-item label="系统内置" prop="configType">
<el-select v-model="queryParams.configType" placeholder="系统内置" clearable> <el-select v-model="queryParams.configType" placeholder="" clearable style="width: 80px">
<el-option v-for="dict in sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" /> <el-option v-for="dict in sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" style="width: 308px;"> <el-form-item label="创建时间">
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-" <el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb5">
<el-col :span="1.5">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
</el-col>
<el-col :span="1.5">
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:config:add']">新增</el-button> <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:config:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" <el-button type="info" plain icon="Edit" :disabled="single" @click="handleUpdate"
v-hasPermi="['system:config:edit']">修改</el-button> v-hasPermi="['system:config:edit']">修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -41,7 +41,7 @@
v-hasPermi="['system:config:export']">导出</el-button> v-hasPermi="['system:config:export']">导出</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="Refresh" @click="handleRefreshCache" <el-button type="primary" plain icon="Refresh" @click="handleRefreshCache"
v-hasPermi="['system:config:remove']">刷新缓存</el-button> v-hasPermi="['system:config:remove']">刷新缓存</el-button>
</el-col> </el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
@ -79,7 +79,7 @@
v-model:limit="queryParams.pageSize" @pagination="getList" /> v-model:limit="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body> <el-dialog :title="title" v-model="open" width="500px" :draggable="true" :close-on-click-modal="false">
<el-form ref="configRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="configRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="参数名称" prop="configName"> <el-form-item label="参数名称" prop="configName">
<el-input v-model="form.configName" placeholder="请输入参数名称" /> <el-input v-model="form.configName" placeholder="请输入参数名称" />

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryRef" inline v-show="showSearch" class="query-form">
<el-form-item class="cus-el-form-item" label="字典名称" prop="dictName"> <el-form-item class="cus-el-form-item" label="字典名称" prop="dictName">
<el-input v-model="queryParams.dictName" placeholder="请输入字典名称" clearable style="width: 240px" <el-input v-model="queryParams.dictName" placeholder="请输入字典名称" clearable style="width: 240px"
@keyup.enter="handleQuery" /> @keyup.enter="handleQuery" />
@ -18,18 +18,20 @@
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-" <el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
</el-col>
<el-col :span="1.5">
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:dict:add']">新增</el-button> <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:dict:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" <el-button type="info" plain icon="Edit" :disabled="single" @click="handleUpdate"
v-hasPermi="['system:dict:edit']">修改</el-button> v-hasPermi="['system:dict:edit']">修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -41,7 +43,7 @@
v-hasPermi="['system:dict:export']">导出</el-button> v-hasPermi="['system:dict:export']">导出</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="Refresh" @click="handleRefreshCache" <el-button type="primary" plain icon="Refresh" @click="handleRefreshCache"
v-hasPermi="['system:dict:remove']">刷新缓存</el-button> v-hasPermi="['system:dict:remove']">刷新缓存</el-button>
</el-col> </el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>