1
This commit is contained in:
parent
13d09216b1
commit
d2e810ad98
@ -124,7 +124,7 @@ aside {
|
|||||||
//main-container全局样式
|
//main-container全局样式
|
||||||
.app-container {
|
.app-container {
|
||||||
padding: 10px 10px 0 10px;
|
padding: 10px 10px 0 10px;
|
||||||
min-height: calc(100vh - 5.25rem);
|
height: calc(100vh - 5.25rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.components-container {
|
.components-container {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
|
||||||
<!-- 修改界面 -->
|
<!-- 修改界面 -->
|
||||||
|
<template>
|
||||||
<el-dialog v-model="visible" width="600px" @open="open">
|
<el-dialog v-model="visible" width="600px" @open="open">
|
||||||
<template #header>
|
<template #header>
|
||||||
{{ title }}
|
{{ title }}
|
||||||
@ -52,8 +52,8 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<span class="text-span">知识库条目:</span>
|
<span class="text-span">知识库条目:</span>
|
||||||
<el-divider style="margin: 5px 0;" />
|
<el-divider style="margin: 5px 0;" />
|
||||||
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true"
|
||||||
:config="tableConfig" :show-overflow-tooltip="true">
|
@column-drag-end="handleColumnDragEnd" :config="tableConfig" :show-overflow-tooltip="true">
|
||||||
<template #reserve="{ row }">
|
<template #reserve="{ row }">
|
||||||
{{ reserve(row.reserve) }}
|
{{ reserve(row.reserve) }}
|
||||||
</template>
|
</template>
|
||||||
@ -198,9 +198,11 @@ const open = () => {
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
.el-input {
|
.el-input {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
<CustomTable ref="tableRefRight" :data="dataList" :columns="columnsRight" :enable-column-drag="true"
|
||||||
:config="tableConfig">
|
@column-drag-end="handleColumnDragEnd" :config="tableConfig">
|
||||||
<template #reserve="{ row }">
|
<template #reserve="{ row }">
|
||||||
{{ reserve(row.reserve) }}
|
{{ reserve(row.reserve) }}
|
||||||
</template>
|
</template>
|
||||||
@ -23,7 +23,7 @@ const props = defineProps({
|
|||||||
reserveWidth: 50,
|
reserveWidth: 50,
|
||||||
textresultWidth: 200,
|
textresultWidth: 200,
|
||||||
zdWidth: 100,
|
zdWidth: 100,
|
||||||
tableHeight: '85vh'
|
tableHeight: '100%'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -31,9 +31,9 @@ const props = defineProps({
|
|||||||
|
|
||||||
//const dataListRight = ref([]);
|
//const dataListRight = ref([]);
|
||||||
const columnsRight = ref([
|
const columnsRight = ref([
|
||||||
{ prop: 'reserve', label: '类别', visible: true, align: 'center',slot: 'reserve', width: props.styleConfig.reserveWidth },
|
{ prop: 'reserve', label: '类别', visible: true, align: 'center', slot: 'reserve', },
|
||||||
{ prop: 'textresult', label: '说明', visible: true, align: 'center', width: props.styleConfig.textresultWidth ,showOverflowTooltip: false},
|
{ prop: 'textresult', label: '说明', visible: true, align: 'center', showOverflowTooltip: false },
|
||||||
{ prop: 'zd', label: '指导建议', visible: true, align: 'center', width: props.styleConfig.zdWidth,showOverflowTooltip: false },
|
{ prop: 'zd', label: '指导建议', visible: true, align: 'center', showOverflowTooltip: false },
|
||||||
])
|
])
|
||||||
|
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
@ -72,5 +72,4 @@ const reserve = (reserve:string) => {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss"></style>
|
||||||
</style>
|
|
||||||
|
|||||||
@ -1,31 +1,39 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
<div class="topForm">
|
<div class="topForm">
|
||||||
<el-form ref="formRef" :model="formData" inline label-width="80px" class="mb8" @submit.prevent="handleSubmit">
|
<el-form ref="formRef" :model="formData" inline label-width="80px" @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;" @keyup.enter="getList"></el-input>
|
<el-input placeholder="项目代号,名称,简拼" v-model="formData.js" style="width: 200px;"
|
||||||
|
@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="onQueryClick">查询</el-button>
|
|
||||||
<el-button type="primary" @click="onAddClick">新增</el-button>
|
<el-button type="primary" @click="onAddClick">新增</el-button>
|
||||||
<el-button type="primary" @click="onDelClick">删除</el-button>
|
<el-button type="danger" @click="onDelClick">删除</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row :gutter="20" class="table-row">
|
||||||
<el-col :span="17">
|
<el-col :span="17" class="table-col">
|
||||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true"
|
||||||
:config="tableConfig" @row-dblclick="onDBClick" @row-click="onClick" :pagination="pagination" @size-change="sizeChange" @page-change="currentChange">
|
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClick" @row-click="onClick"
|
||||||
|
:pagination="pagination" @size-change="sizeChange" @page-change="currentChange">
|
||||||
<template #xsbz="{ row }">
|
<template #xsbz="{ row }">
|
||||||
<el-checkbox :model-value="row.xsbz === '1'" />
|
<el-checkbox :model-value="row.xsbz === '1'" />
|
||||||
</template>
|
</template>
|
||||||
</CustomTable>
|
</CustomTable>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="7" class="table-col">
|
||||||
<TableRight :data-list="dataListRight" />
|
<TableRight :data-list="dataListRight" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<Modify ref="modifyRef" v-model="modifyVisible" :title="modifyTitle" :type="modifyType" @close-with-return="closeWithReturn"/>
|
<Modify ref="modifyRef" v-model="modifyVisible" :title="modifyTitle" :type="modifyType"
|
||||||
|
@close-with-return="closeWithReturn" />
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -57,7 +65,7 @@ const columnsLeft = ref([
|
|||||||
|
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '85vh', // 高度
|
height: '100%', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
// cellStyle: cellStyleHd
|
// cellStyle: cellStyleHd
|
||||||
})
|
})
|
||||||
@ -152,12 +160,12 @@ onMounted(()=>{
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.el-row {
|
.table-row {
|
||||||
margin-top: 5px;
|
height: calc(100% - 150px);
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.topForm {
|
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|
||||||
|
.table-col {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
108
src/views/liswork/xtwh/comopt-1/components/sysChannel/index.vue
Normal file
108
src/views/liswork/xtwh/comopt-1/components/sysChannel/index.vue
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 通道号配置 -->
|
||||||
|
<div class="table-container">
|
||||||
|
<el-row :gutter="10" class="table-toolbar">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Edit" @click="addItem">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="Delete" @click="delItem">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="Delete" @click="allClear">清除所有项目接口号</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="table-row">
|
||||||
|
<el-col :span="12" class="table-box">
|
||||||
|
<el-table :data="tableData" height="100%" border highlight-current-row>
|
||||||
|
<el-table-column label="通道号" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.channel" placeholder="请输入通道号" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="项目" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<SelectTable v-model:data="scope.row.xmid" :tableData="xmList" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="tips">
|
||||||
|
说明:
|
||||||
|
“通道号”又称“接口代号”,是指仪器向电脑传送结果时项目的
|
||||||
|
标识符
|
||||||
|
接口代号对于一个仪器不可重复。
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { queryXmInfoNewService } from '@/api/liswork/labItem/labItemApi';
|
||||||
|
const yq = defineModel<string>();
|
||||||
|
|
||||||
|
const tableData = ref<Array<{ channel: string }>>([]);
|
||||||
|
const handleSave = () => {
|
||||||
|
};
|
||||||
|
|
||||||
|
const addItem = () => {
|
||||||
|
tableData.value.push({ channel: '' })
|
||||||
|
};
|
||||||
|
|
||||||
|
const delItem = () => {
|
||||||
|
}
|
||||||
|
|
||||||
|
const allClear = () => {
|
||||||
|
}
|
||||||
|
const xmList = ref<Array<{ xmmc: string, xmid: string }>>([]);
|
||||||
|
const getXmList = () => {
|
||||||
|
queryXmInfoNewService({ yq: yq.value }).then((res: any) => {
|
||||||
|
xmList.value = res.rows.map((item: any) => {
|
||||||
|
return {
|
||||||
|
label: item.xmmc,
|
||||||
|
value: item.xmid.toString(),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(() => yq.value, (val) => {
|
||||||
|
if (val) {
|
||||||
|
getXmList();
|
||||||
|
}
|
||||||
|
}, { immediate: true });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.table-container {
|
||||||
|
height: calc(100% - 58px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-toolbar {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #409eff;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-row {
|
||||||
|
height: calc(100% - 45px);
|
||||||
|
|
||||||
|
.table-box {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
330
src/views/liswork/xtwh/comopt-1/components/sysGlobal/index.vue
Normal file
330
src/views/liswork/xtwh/comopt-1/components/sysGlobal/index.vue
Normal file
@ -0,0 +1,330 @@
|
|||||||
|
<!-- 系统全局选项 -->
|
||||||
|
<template>
|
||||||
|
<div class="sys_box">
|
||||||
|
<el-row :gutter="10" class="table-toolbar">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 三列表格容器 -->
|
||||||
|
<div class="triple-table-wrapper">
|
||||||
|
<!-- 第一列表格 -->
|
||||||
|
<div class="table-panel table-1">
|
||||||
|
<el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" class="config-table"
|
||||||
|
fit border height="100%" :cell-spacing="0">
|
||||||
|
<el-table-column label="序号" align="center" prop="configSort" width="50" />
|
||||||
|
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
|
||||||
|
min-width="150" />
|
||||||
|
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
|
||||||
|
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
|
||||||
|
min-width="100" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 第二列表格 -->
|
||||||
|
<div class="table-panel table-2">
|
||||||
|
<el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" class="config-table"
|
||||||
|
fit border height="100%" :cell-spacing="0">
|
||||||
|
<el-table-column label="序号" align="center" prop="configSort" width="50" />
|
||||||
|
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
|
||||||
|
min-width="150" />
|
||||||
|
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
|
||||||
|
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
|
||||||
|
min-width="100" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 第三列表格 -->
|
||||||
|
<div class="table-panel table-3">
|
||||||
|
<el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" class="config-table"
|
||||||
|
fit border height="100%" :cell-spacing="0">
|
||||||
|
<el-table-column label="序号" align="center" prop="configSort" width="50" />
|
||||||
|
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
|
||||||
|
min-width="150" />
|
||||||
|
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
|
||||||
|
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
|
||||||
|
min-width="100" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ElMessage, ElTree, TreeNode, ElMessageBox, ElBadge } from 'element-plus'
|
||||||
|
import { paramList, paramTree, getdef, updateParam } from '@/api/liswork/xtwh/ComOpt'
|
||||||
|
import { getFirstLetter } from '@/utils/pinyin'
|
||||||
|
// @ts-ignore
|
||||||
|
import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue"
|
||||||
|
const emits = defineEmits(['updateTree'])
|
||||||
|
const yq = defineModel<string>()
|
||||||
|
|
||||||
|
interface RegDictItem {
|
||||||
|
configId: string | number
|
||||||
|
configSort: number
|
||||||
|
configCode: string
|
||||||
|
configName: string
|
||||||
|
configDefvalue: string | number
|
||||||
|
configOptiontype: string
|
||||||
|
remark: string
|
||||||
|
}
|
||||||
|
// 列表相关
|
||||||
|
const optiontype = ref<string>("SYSTEM")
|
||||||
|
const menuname = ref<string>("系统全局")
|
||||||
|
const regdictList = ref<RegDictItem[]>([])
|
||||||
|
const originRegdictList = ref<RegDictItem[]>([])
|
||||||
|
const loading = ref<boolean>(false)
|
||||||
|
const total = ref<number>(0)
|
||||||
|
|
||||||
|
// 选择相关
|
||||||
|
const ids = ref<(string | number)[]>([])
|
||||||
|
const single = ref<boolean>(true)
|
||||||
|
const multiple = ref<boolean>(true)
|
||||||
|
|
||||||
|
// ========== 核心:拆分三列表格数据 ==========
|
||||||
|
const tableData1 = computed<RegDictItem[]>(() => {
|
||||||
|
const splitSize = Math.ceil(total.value / 3) // 每列基础行数
|
||||||
|
return regdictList.value.slice(0, splitSize)
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableData2 = computed<RegDictItem[]>(() => {
|
||||||
|
const splitSize = Math.ceil(total.value / 3)
|
||||||
|
return regdictList.value.slice(splitSize, splitSize * 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableData3 = computed<RegDictItem[]>(() => {
|
||||||
|
const splitSize = Math.ceil(total.value / 3)
|
||||||
|
return regdictList.value.slice(splitSize * 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const getList = async (): Promise<void> => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const response = await paramList({ yq: yq.value, optiontype: optiontype.value })
|
||||||
|
regdictList.value = JSON.parse(JSON.stringify(response.data))
|
||||||
|
originRegdictList.value = JSON.parse(JSON.stringify(response.data))
|
||||||
|
total.value = response.data.length
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(`获取列表异常:${(error as Error).message}`)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSelectionChange = (val: RegDictItem[]): void => {
|
||||||
|
ids.value = val.map(item => item.configId)
|
||||||
|
single.value = val.length === 1
|
||||||
|
multiple.value = val.length > 1
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSave = async (): Promise<void> => {
|
||||||
|
try {
|
||||||
|
loading.value = true
|
||||||
|
// 合并三列表格数据提交
|
||||||
|
const allData = [...tableData1.value, ...tableData2.value, ...tableData3.value]
|
||||||
|
const res = await updateParam(allData)
|
||||||
|
if (res.code == 0) {
|
||||||
|
ElMessage.success(res.msg || "保存成功")
|
||||||
|
originRegdictList.value = JSON.parse(JSON.stringify(allData))
|
||||||
|
// 更新树结构状态
|
||||||
|
emits('updateTree')
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(`保存失败:${(error as Error).message}`)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleCancelEdit = (): void => {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
"是否确认取消所有修改,恢复原始数据?",
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
regdictList.value = JSON.parse(JSON.stringify(originRegdictList.value))
|
||||||
|
ElMessage.success("已恢复原始数据!")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleRestoreDefault = async (): Promise<void> => {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
"是否确认还原所有默认值?此操作会覆盖当前修改!",
|
||||||
|
"警告",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error"
|
||||||
|
}
|
||||||
|
).then(async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const res = await getdef({ optiontype: optiontype.value })
|
||||||
|
regdictList.value = JSON.parse(JSON.stringify(res.data))
|
||||||
|
originRegdictList.value = JSON.parse(JSON.stringify(res.data))
|
||||||
|
total.value = res.data.length
|
||||||
|
ElMessage.success("还原默认值成功!")
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(`还原失败:${(error as Error).message}`)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
watch(yq, (newVal) => {
|
||||||
|
if (newVal !== undefined) {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.sys_box {
|
||||||
|
height: calc(100% - 58px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-toolbar {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 三列表格容器
|
||||||
|
.triple-table-wrapper {
|
||||||
|
flex: 1;
|
||||||
|
height: calc(100% - 45px); // 减去标题行+工具栏高度
|
||||||
|
display: flex;
|
||||||
|
gap: 0px; // 表格间间距
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
// 单个表格面板
|
||||||
|
.table-panel {
|
||||||
|
flex: 1; // 三列均等分
|
||||||
|
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>
|
||||||
330
src/views/liswork/xtwh/comopt-1/components/sysInput/index.vue
Normal file
330
src/views/liswork/xtwh/comopt-1/components/sysInput/index.vue
Normal file
@ -0,0 +1,330 @@
|
|||||||
|
<!-- 系统全局选项 -->
|
||||||
|
<template>
|
||||||
|
<div class="sys_box">
|
||||||
|
<el-row :gutter="10" class="table-toolbar">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 三列表格容器 -->
|
||||||
|
<div class="triple-table-wrapper">
|
||||||
|
<!-- 第一列表格 -->
|
||||||
|
<div class="table-panel table-1">
|
||||||
|
<el-table v-loading="loading" :data="tableData1" @selection-change="handleSelectionChange" class="config-table"
|
||||||
|
fit border height="100%" :cell-spacing="0">
|
||||||
|
<el-table-column label="序号" align="center" prop="configSort" width="50" />
|
||||||
|
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
|
||||||
|
min-width="150" />
|
||||||
|
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
|
||||||
|
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
|
||||||
|
min-width="100" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 第二列表格 -->
|
||||||
|
<div class="table-panel table-2">
|
||||||
|
<el-table v-loading="loading" :data="tableData2" @selection-change="handleSelectionChange" class="config-table"
|
||||||
|
fit border height="100%" :cell-spacing="0">
|
||||||
|
<el-table-column label="序号" align="center" prop="configSort" width="50" />
|
||||||
|
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
|
||||||
|
min-width="150" />
|
||||||
|
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
|
||||||
|
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
|
||||||
|
min-width="100" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 第三列表格 -->
|
||||||
|
<div class="table-panel table-3">
|
||||||
|
<el-table v-loading="loading" :data="tableData3" @selection-change="handleSelectionChange" class="config-table"
|
||||||
|
fit border height="100%" :cell-spacing="0">
|
||||||
|
<el-table-column label="序号" align="center" prop="configSort" width="50" />
|
||||||
|
<el-table-column :label="`${menuname}名称`" align="left" prop="configName" show-overflow-tooltip
|
||||||
|
min-width="150" />
|
||||||
|
<el-table-column label="参数值" align="center" prop="configDefvalue" show-overflow-tooltip min-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<DynamicInput :type="scope.row.configOptiontype" v-model="scope.row.configDefvalue"
|
||||||
|
:dict-data="scope.row.remark" :placeholder="`请输入${scope.row.configName}值`" class="edit-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="值码" align="center" prop="configDefvalue" v-if="false" show-overflow-tooltip
|
||||||
|
min-width="100" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ElMessage, ElTree, TreeNode, ElMessageBox, ElBadge } from 'element-plus'
|
||||||
|
import { paramList, paramTree, getdef, updateParam } from '@/api/liswork/xtwh/ComOpt'
|
||||||
|
import { getFirstLetter } from '@/utils/pinyin'
|
||||||
|
// @ts-ignore
|
||||||
|
import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue"
|
||||||
|
const emits = defineEmits(['updateTree'])
|
||||||
|
const yq = defineModel<string>()
|
||||||
|
|
||||||
|
interface RegDictItem {
|
||||||
|
configId: string | number
|
||||||
|
configSort: number
|
||||||
|
configCode: string
|
||||||
|
configName: string
|
||||||
|
configDefvalue: string | number
|
||||||
|
configOptiontype: string
|
||||||
|
remark: string
|
||||||
|
}
|
||||||
|
// 列表相关
|
||||||
|
const optiontype = ref<string>("INPUT")
|
||||||
|
const menuname = ref<string>("界面设定")
|
||||||
|
const regdictList = ref<RegDictItem[]>([])
|
||||||
|
const originRegdictList = ref<RegDictItem[]>([])
|
||||||
|
const loading = ref<boolean>(false)
|
||||||
|
const total = ref<number>(0)
|
||||||
|
|
||||||
|
// 选择相关
|
||||||
|
const ids = ref<(string | number)[]>([])
|
||||||
|
const single = ref<boolean>(true)
|
||||||
|
const multiple = ref<boolean>(true)
|
||||||
|
|
||||||
|
// ========== 核心:拆分三列表格数据 ==========
|
||||||
|
const tableData1 = computed<RegDictItem[]>(() => {
|
||||||
|
const splitSize = Math.ceil(total.value / 3) // 每列基础行数
|
||||||
|
return regdictList.value.slice(0, splitSize)
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableData2 = computed<RegDictItem[]>(() => {
|
||||||
|
const splitSize = Math.ceil(total.value / 3)
|
||||||
|
return regdictList.value.slice(splitSize, splitSize * 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableData3 = computed<RegDictItem[]>(() => {
|
||||||
|
const splitSize = Math.ceil(total.value / 3)
|
||||||
|
return regdictList.value.slice(splitSize * 2)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const getList = async (): Promise<void> => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const response = await paramList({ yq: yq.value, optiontype: optiontype.value })
|
||||||
|
regdictList.value = JSON.parse(JSON.stringify(response.data))
|
||||||
|
originRegdictList.value = JSON.parse(JSON.stringify(response.data))
|
||||||
|
total.value = response.data.length
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(`获取列表异常:${(error as Error).message}`)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSelectionChange = (val: RegDictItem[]): void => {
|
||||||
|
ids.value = val.map(item => item.configId)
|
||||||
|
single.value = val.length === 1
|
||||||
|
multiple.value = val.length > 1
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSave = async (): Promise<void> => {
|
||||||
|
try {
|
||||||
|
loading.value = true
|
||||||
|
// 合并三列表格数据提交
|
||||||
|
const allData = [...tableData1.value, ...tableData2.value, ...tableData3.value]
|
||||||
|
const res = await updateParam(allData)
|
||||||
|
if (res.code == 0) {
|
||||||
|
ElMessage.success(res.msg || "保存成功")
|
||||||
|
originRegdictList.value = JSON.parse(JSON.stringify(allData))
|
||||||
|
// 更新树结构状态
|
||||||
|
emits('updateTree')
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(`保存失败:${(error as Error).message}`)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleCancelEdit = (): void => {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
"是否确认取消所有修改,恢复原始数据?",
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
regdictList.value = JSON.parse(JSON.stringify(originRegdictList.value))
|
||||||
|
ElMessage.success("已恢复原始数据!")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleRestoreDefault = async (): Promise<void> => {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
"是否确认还原所有默认值?此操作会覆盖当前修改!",
|
||||||
|
"警告",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "error"
|
||||||
|
}
|
||||||
|
).then(async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const res = await getdef({ optiontype: optiontype.value })
|
||||||
|
regdictList.value = JSON.parse(JSON.stringify(res.data))
|
||||||
|
originRegdictList.value = JSON.parse(JSON.stringify(res.data))
|
||||||
|
total.value = res.data.length
|
||||||
|
ElMessage.success("还原默认值成功!")
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(`还原失败:${(error as Error).message}`)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
watch(yq, (newVal) => {
|
||||||
|
if (newVal !== undefined) {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.sys_box {
|
||||||
|
height: calc(100% - 58px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-toolbar {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 三列表格容器
|
||||||
|
.triple-table-wrapper {
|
||||||
|
flex: 1;
|
||||||
|
height: calc(100% - 45px); // 减去标题行+工具栏高度
|
||||||
|
display: flex;
|
||||||
|
gap: 0px; // 表格间间距
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
// 单个表格面板
|
||||||
|
.table-panel {
|
||||||
|
flex: 1; // 三列均等分
|
||||||
|
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>
|
||||||
@ -0,0 +1,389 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 参数列表 -->
|
||||||
|
<div>
|
||||||
|
<el-row :gutter="10" class="table-toolbar">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="Check" @click="handleSave">保存</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Edit" @click="handleCancelEdit">取消修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="RefreshRight" @click="handleRestoreDefault">还原默认</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-form ref="form" :model="formData" :rules="rules" label-width="120px" class="form-inline" inline>
|
||||||
|
<div class="title">说明:公式中阴阳对照请用NC,PC表示</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="测试波长" prop="csbc">
|
||||||
|
<el-select v-model="formData.csbc" style="width: 12rem;">
|
||||||
|
<el-option v-for="item in dzList" :key="item.lgph" :value="item.lgph" :label="item.bc" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" style="display: flex;">
|
||||||
|
<el-form-item label="参考波长" prop="ckbc">
|
||||||
|
<el-select v-model="formData.ckbc" style="width: 12rem;">
|
||||||
|
<el-option v-for="item in dzList" :key="item.lgph" :value="item.lgph" :label="item.bc" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button type="primary" @click="openDz">滤光片波长对照表</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="阳性判断公式" prop="yxgs">
|
||||||
|
<el-input v-model="formData.yxgs" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="上灰区" prop="shq">
|
||||||
|
<el-input v-model="formData.shq">
|
||||||
|
<template #append>% </template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="下灰区" prop="xhq">
|
||||||
|
<el-input v-model="formData.xhq">
|
||||||
|
<template #append>% </template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="阴性对照下限" prop="negxx">
|
||||||
|
<el-input v-model="formData.negxx" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="阳性对照下限" prop="posxx">
|
||||||
|
<el-input v-model="formData.posxx" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="阴性对照上限" prop="negsx">
|
||||||
|
<el-input v-model="formData.negsx" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="阳性对照上限" prop="possx">
|
||||||
|
<el-input v-model="formData.possx" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-divider></el-divider>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="项目性质" prop="xmxz">
|
||||||
|
<el-radio-group v-model="formData.xmxz">
|
||||||
|
<el-radio value="1">定性</el-radio>
|
||||||
|
<el-radio value="2">定量</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="移动模式" prop="ydfs">
|
||||||
|
<el-radio-group v-model="formData.ydfs">
|
||||||
|
<el-radio value="1">连续</el-radio>
|
||||||
|
<el-radio value="2">步进</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
|
||||||
|
<el-form-item label="测试模式" prop="csms">
|
||||||
|
<el-radio-group v-model="formData.csms">
|
||||||
|
<el-radio value="1">终点法</el-radio>
|
||||||
|
<el-radio value="2">两点法</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="振板频率" prop="zbpl">
|
||||||
|
<el-radio-group v-model="formData.zbpl">
|
||||||
|
<el-radio value="1">高</el-radio>
|
||||||
|
<el-radio value="2">中</el-radio>
|
||||||
|
<el-radio value="3">低</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="空白形式" prop="kbms">
|
||||||
|
<el-radio-group v-model="formData.kbms">
|
||||||
|
<el-radio value="1">空气</el-radio>
|
||||||
|
<el-radio value="2">试剂</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="振板时间" prop="zbsj">
|
||||||
|
<el-input v-model="formData.zbsj">
|
||||||
|
<template #append>秒</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="默认模板" prop="mrmb">
|
||||||
|
<el-select v-model="formData.mrmb" style="width: 12rem;">
|
||||||
|
<!-- <el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" /> -->
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" style="display: flex;">
|
||||||
|
<el-form-item label="默认试剂" prop="mrsjph">
|
||||||
|
<el-select v-model="formData.mrsjph" style="width: 12rem;">
|
||||||
|
<el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button type="primary" @click="sjHandle">试剂维护</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<!-- 波长对照表 -->
|
||||||
|
<el-dialog v-model="dialogVisible" title="滤光波长对照表" draggable :close-on-click-modal="false" width="500px">
|
||||||
|
<div class="mb5">
|
||||||
|
<el-button type="primary" @click="savaItem">保存</el-button>
|
||||||
|
<el-button type="primary" @click="addItem">新增</el-button>
|
||||||
|
<el-button type="danger" @click="delItem">删除</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table :data="dzList" style="width: 100%" height="450" border highlight-current-row
|
||||||
|
@row-click="handleRowClick">
|
||||||
|
<el-table-column type="index" width="50" label="No" align="center" />
|
||||||
|
<el-table-column label="滤光片号" prop="lgph">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.lgph" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="波长" prop="bc">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.bc" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 试剂维护 -->
|
||||||
|
<el-dialog v-model="sjShow" title="试剂维护" draggable :close-on-click-modal="false" width="700px">
|
||||||
|
<div class="mb5">
|
||||||
|
<el-button type="primary" @click="sjsavaItem">保存</el-button>
|
||||||
|
<el-button type="primary" @click="sjaddItem">新增</el-button>
|
||||||
|
<el-button type="danger" @click="sjdelItem">删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table :data="sjtableData" height="400px" border highlight-current-row @row-click="sjRowClick">
|
||||||
|
<el-table-column label="试剂批号" prop="sjph" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.sjph" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="厂商" prop="sjcs">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-select v-model="scope.row.sjcs" class="full-width-input" filterable allow-create>
|
||||||
|
<el-option v-for="item in cjList" :label="item.na" :value="item.no" />
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="有效期" prop="yxq">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-date-picker v-model="scope.row.yxq" type="datetime" placeholder="0000:00:00 00:00:00"
|
||||||
|
format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width:100%" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="方法" prop="csff">
|
||||||
|
<template #default="scope">
|
||||||
|
<SelectTable v-model:data="scope.row.csff" :tableData="dictData.MD" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { queryFilter, addXmFilter, delXmFilter, addXmLot, delXmLot, queryXmLot, querySjcs } from '@/api/liswork/xtwh/ComOpt'
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
import { formatDict, dictData } from '@/hooks'
|
||||||
|
import { get } from 'lodash';
|
||||||
|
|
||||||
|
const yq = defineModel<string>()
|
||||||
|
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const formData = ref({
|
||||||
|
csbc: '',
|
||||||
|
ckbc: '',
|
||||||
|
yxgs: '',
|
||||||
|
shq: '',
|
||||||
|
xhq: '',
|
||||||
|
negxx: '',
|
||||||
|
posxx: '',
|
||||||
|
negsx: '',
|
||||||
|
possx: '',
|
||||||
|
xmxz: '1',
|
||||||
|
ydfs: '1',
|
||||||
|
csms: '1',
|
||||||
|
zbpl: '1',
|
||||||
|
kbms: '1',
|
||||||
|
zbsj: '',
|
||||||
|
mrmb: '',
|
||||||
|
mrsjph: ''
|
||||||
|
});
|
||||||
|
const rules = ref({
|
||||||
|
csbc: [
|
||||||
|
{ required: true, message: '请选择测试波长', trigger: 'change' }
|
||||||
|
],
|
||||||
|
yxgs: [
|
||||||
|
{ required: true, message: '请输入阳性判断公式', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const form = ref();
|
||||||
|
const handleSave = () => {
|
||||||
|
form.value.validate((valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
console.log('submit!')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const handleCancelEdit = () => {
|
||||||
|
console.log('取消修改')
|
||||||
|
}
|
||||||
|
const handleRestoreDefault = () => {
|
||||||
|
console.log('还原默认')
|
||||||
|
}
|
||||||
|
const dzList = ref<Array<{ lgph: string, bc: string, yq?: string }>>([])
|
||||||
|
const getDzList = () => {
|
||||||
|
selectRow.value = null
|
||||||
|
queryFilter({ yq: yq.value }).then((res: any) => {
|
||||||
|
dzList.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectRow = ref()
|
||||||
|
const handleRowClick = (row: any) => {
|
||||||
|
selectRow.value = row
|
||||||
|
}
|
||||||
|
const openDz = () => {
|
||||||
|
getDzList()
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const savaItem = () => {
|
||||||
|
const flag = dzList.value.every(item => item.bc && item.lgph)
|
||||||
|
if (!flag) return ElMessage.warning('请检查滤光片号和波长填写!')
|
||||||
|
addXmFilter(dzList.value).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
ElMessage.success('保存成功!')
|
||||||
|
getDzList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const addItem = () => {
|
||||||
|
dzList.value.push({ lgph: '', bc: '', yq: yq.value })
|
||||||
|
}
|
||||||
|
const delItem = () => {
|
||||||
|
if (!selectRow.value) return ElMessage.warning('请选择要删除的行!')
|
||||||
|
if (selectRow.value.lgph) {
|
||||||
|
delXmFilter(selectRow.value)
|
||||||
|
}
|
||||||
|
dzList.value = dzList.value.filter(item => item.lgph != selectRow.value.lgph)
|
||||||
|
selectRow.value = null
|
||||||
|
}
|
||||||
|
|
||||||
|
interface sjList {
|
||||||
|
sjcs: string, sjph: string, yq: string, yxq: string, csff: string
|
||||||
|
}
|
||||||
|
const sjShow = ref(false)
|
||||||
|
const sjtableData = ref<sjList[]>([])
|
||||||
|
const sjHandle = () => {
|
||||||
|
getSjList()
|
||||||
|
getSjcjList()
|
||||||
|
sjShow.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const sjRowClick = (row: any) => {
|
||||||
|
selectRow.value = row
|
||||||
|
}
|
||||||
|
const getSjList = () => {
|
||||||
|
selectRow.value = null
|
||||||
|
queryXmLot({ yq: yq.value }).then((res: any) => {
|
||||||
|
sjtableData.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const sjsavaItem = () => {
|
||||||
|
sjtableData.value.forEach(item => {
|
||||||
|
item.yq = yq.value || ''
|
||||||
|
})
|
||||||
|
addXmLot(sjtableData.value).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
ElMessage.success('保存成功!')
|
||||||
|
getSjList()
|
||||||
|
getSjcjList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const sjaddItem = () => {
|
||||||
|
sjtableData.value.push({
|
||||||
|
sjcs: '',
|
||||||
|
sjph: '',
|
||||||
|
yxq: '',
|
||||||
|
csff: '',
|
||||||
|
yq: yq.value || '',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const sjdelItem = () => {
|
||||||
|
if (!selectRow.value) return ElMessage.warning('请选择要删除的行!')
|
||||||
|
if (selectRow.value.sjph) {
|
||||||
|
delXmLot(selectRow.value)
|
||||||
|
}
|
||||||
|
sjtableData.value = sjtableData.value.filter(item => item.sjph != selectRow.value.sjph)
|
||||||
|
selectRow.value = null
|
||||||
|
}
|
||||||
|
const cjList = ref<Array<{ no: string, na: string }>>([])
|
||||||
|
const getSjcjList = () => {
|
||||||
|
querySjcs({ yq: yq.value }).then((res: any) => {
|
||||||
|
cjList.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(yq, (newVal) => {
|
||||||
|
getDzList()
|
||||||
|
getSjList()
|
||||||
|
}, {
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.table-toolbar {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #409eff;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<!-- 报告界面参数 -->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
报告界面参数
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
164
src/views/liswork/xtwh/comopt-1/components/sysSort/index.vue
Normal file
164
src/views/liswork/xtwh/comopt-1/components/sysSort/index.vue
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 整体排序 -->
|
||||||
|
<div class="sort_box">
|
||||||
|
<el-row :gutter="10" class="table-row">
|
||||||
|
<el-col :span="20" class="table-box">
|
||||||
|
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :config="tableConfig"
|
||||||
|
@row-click="handleRowClick">
|
||||||
|
<template #sort="{ row }">
|
||||||
|
<el-input v-model="row.sort" class="full-width-input" />
|
||||||
|
</template>
|
||||||
|
</CustomTable>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<el-row :gutter="10" class="table-toolbar">
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
|
<el-radio-group v-model="radio" @change="radioChange">
|
||||||
|
<el-radio value="1">上下移动调整</el-radio>
|
||||||
|
<el-radio value="2">手工输入工号</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" @click="refresh">刷新</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" @click="cpHandle">存盘</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" :disabled="radio == '2'" @click="firstHandle">首位</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
|
<el-button type="primary" icon="top" :disabled="radio == '2'" @click="prevHandle">上移</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" icon="bottom" :disabled="radio == '2'" @click="nextHandle">下移</el-button>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" :disabled="radio == '2'" @click="lastHadnle">末位</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { formatDict, dictData } from '@/hooks';
|
||||||
|
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
dataList: {
|
||||||
|
type: Array,
|
||||||
|
default: []
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
interface DataItem {
|
||||||
|
xmid: string | number;
|
||||||
|
xmmc: string | number;
|
||||||
|
sort: string | number;
|
||||||
|
}
|
||||||
|
const currentIndex = ref(0);
|
||||||
|
const radio = ref('1');
|
||||||
|
const tableRef = ref();
|
||||||
|
const dataList = ref<DataItem[]>([]);
|
||||||
|
const columns = ref([
|
||||||
|
{ prop: 'xmid', label: '项目ID', visible: true, align: 'center', },
|
||||||
|
{ prop: 'xmmc', label: '项目名称', visible: true, align: 'center', },
|
||||||
|
{ prop: 'sort', label: '整体排序', visible: true, align: 'center', slot: "sort" },
|
||||||
|
]);
|
||||||
|
const tableConfig = ref({
|
||||||
|
border: true, // 边框
|
||||||
|
height: '100%', // 高度
|
||||||
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
|
key: 'xmid'
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
//退拽属性
|
||||||
|
const handleColumnDragEnd = (data: any) => {
|
||||||
|
// 更新列配置
|
||||||
|
dataList.value = data.list;
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleRowClick = (row: DataItem) => {
|
||||||
|
currentIndex.value = dataList.value.indexOf(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const getList = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const refresh = () => {
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
const cpHandle = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
const firstHandle = () => {
|
||||||
|
currentIndex.value = 0;
|
||||||
|
tableRef.value.setCurrentRow(dataList.value[0]);
|
||||||
|
tableRef.value.setScrollTop(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
const lastHadnle = () => {
|
||||||
|
currentIndex.value = dataList.value.length - 1;
|
||||||
|
tableRef.value.setCurrentRow(dataList.value[currentIndex.value]);
|
||||||
|
tableRef.value.setScrollTop(dataList.value.length)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
for (let index = 0; index < 20; index++) {
|
||||||
|
dataList.value.push(
|
||||||
|
{ xmid: 'ID' + index, xmmc: 'xmmc' + index, sort: '', }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.sort_box {
|
||||||
|
height: calc(100% - 58px);
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-toolbar {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.el-col {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
width: 80%;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.table-row {
|
||||||
|
height: 100%;
|
||||||
|
flex: 3;
|
||||||
|
|
||||||
|
.table-box {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 可拖拽表格行样式提示 */
|
||||||
|
:deep(.drag-table .el-table__row) {
|
||||||
|
cursor: move;
|
||||||
|
/* 鼠标移入行显示拖拽光标 */
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
352
src/views/liswork/xtwh/comopt-1/index.vue
Normal file
352
src/views/liswork/xtwh/comopt-1/index.vue
Normal file
@ -0,0 +1,352 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="20" class="main-row">
|
||||||
|
<!-- 左侧树区域 -->
|
||||||
|
<el-col :span="4" :xs="24" class="tree-col">
|
||||||
|
<el-input v-model="deptName" placeholder="请输入仪器名称" clearable prefix-icon="Search" class="tree-search-input" />
|
||||||
|
<el-radio-group v-model="radiotype" @change="radioChange">
|
||||||
|
<el-radio value="1" size="large">仪器组</el-radio>
|
||||||
|
<el-radio value="2" size="large">所有仪器</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
<div class="tree-container">
|
||||||
|
<el-tree :data="deptOptions" :props="treeProps" expand-on-click-node :filter-node-method="filterNode"
|
||||||
|
ref="deptTreeRef" node-key="id" highlight-current :expanded-keys="expandedKeys"
|
||||||
|
@node-click="handleNodeClick">
|
||||||
|
<!-- 自定义树节点模板:新增newflag徽章 -->
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span class="tree-node-content">
|
||||||
|
{{ node.label }}
|
||||||
|
<!-- 新节点徽章:newflag=1时显示黄色"新"标 -->
|
||||||
|
<el-badge v-if="data.newflag === '1'" value="new" class="new-node-badge" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<!-- 右侧列表区域 -->
|
||||||
|
<el-col :span="20" :xs="24" class="table-col">
|
||||||
|
<el-row :gutter="10" class="yq-title-row">
|
||||||
|
<h1 class="yq-title">仪器: {{ yqmc }}</h1>
|
||||||
|
</el-row>
|
||||||
|
<el-tabs v-model="activeName" type="card" class="tabs_box">
|
||||||
|
<el-tab-pane v-for="tab in tabList" :key="tab.key" :label="tab.label" :name="tab.key" />
|
||||||
|
</el-tabs>
|
||||||
|
<!-- 动态组件渲染 -->
|
||||||
|
<component :is="currentComponent" :key="activeName" v-model="queryParams.yq" @updateTree="getDeptTree" />
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="ComOpt" lang="ts">
|
||||||
|
import { ref, watch, nextTick, computed } from 'vue'
|
||||||
|
import { ElMessage, ElTree, TreeNode, ElMessageBox, ElBadge } from 'element-plus'
|
||||||
|
import { paramList, paramTree, getdef, updateParam } from '@/api/liswork/xtwh/ComOpt'
|
||||||
|
import { getFirstLetter } from '@/utils/pinyin'
|
||||||
|
import { formatDict, getDictData, dictData } from '@/hooks';
|
||||||
|
import SysGlobal from './components/sysGlobal/index.vue'
|
||||||
|
import SysInput from './components/sysInput/index.vue'
|
||||||
|
import SysReport from './components/sysReport/index.vue'
|
||||||
|
import SysParameter from './components/sysParameter/index.vue'
|
||||||
|
import SysChannel from './components/sysChannel/index.vue'
|
||||||
|
import SysSort from './components/sysSort/index.vue'
|
||||||
|
|
||||||
|
// ========== TypeScript 类型定义 ==========
|
||||||
|
interface InstrTreeNode {
|
||||||
|
id: string
|
||||||
|
label: string
|
||||||
|
lx: string
|
||||||
|
newflag: string // 新增newflag字段
|
||||||
|
children?: InstrTreeNode[]
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ParamTreeResponse {
|
||||||
|
code: string
|
||||||
|
msg: string
|
||||||
|
data: InstrTreeNode[]
|
||||||
|
url: null | string
|
||||||
|
method: null | string
|
||||||
|
params: null | any
|
||||||
|
problemId: null | string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface QueryParams {
|
||||||
|
yq?: string | undefined
|
||||||
|
xxdh?: string | undefined
|
||||||
|
xxqz?: string | undefined
|
||||||
|
groupId?: string | undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const radiotype = ref<string>("1")
|
||||||
|
// ========== 响应式变量 ==========
|
||||||
|
// 树相关
|
||||||
|
const deptTreeRef = ref<InstanceType<typeof ElTree>>()
|
||||||
|
const deptOptions = ref<InstrTreeNode[]>([])
|
||||||
|
const deptName = ref<string>("")
|
||||||
|
const yqmc = ref<string>("")
|
||||||
|
const expandedKeys = ref<string[]>([])
|
||||||
|
const isFiltering = ref<boolean>(false)
|
||||||
|
const treeProps = ref({
|
||||||
|
label: 'label',
|
||||||
|
children: 'children',
|
||||||
|
isLeaf: (data: Record<string, any>) => !data.children || data.children.length === 0
|
||||||
|
})
|
||||||
|
|
||||||
|
// 查询参数
|
||||||
|
const queryParams = ref<QueryParams>({
|
||||||
|
yq: undefined,
|
||||||
|
xxdh: undefined,
|
||||||
|
xxqz: undefined,
|
||||||
|
groupId: undefined
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const tabList = [
|
||||||
|
{ key: 'SysGlobal', label: '全局设定', component: SysGlobal },
|
||||||
|
{ key: 'SysInput', label: '界面设定', component: SysInput },
|
||||||
|
{ key: 'SysParameter', label: '参数', component: SysParameter },
|
||||||
|
{ key: 'SysChannel', label: '通道号', component: SysChannel },
|
||||||
|
{ key: 'SysSort', label: '项目排序', component: SysSort },
|
||||||
|
{ key: 'SysReport', label: '报告单设置', component: SysReport },
|
||||||
|
]
|
||||||
|
const activeName = ref('SysSort')
|
||||||
|
|
||||||
|
// 计算当前要渲染的组件
|
||||||
|
const currentComponent = computed(() => {
|
||||||
|
return tabList.find(tab => tab.key === activeName.value)?.component || 'SysGlobal'
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const treeData = ref<InstrTreeNode[]>([])
|
||||||
|
const radioChange = (val: string) => {
|
||||||
|
if (val == "1") {
|
||||||
|
deptOptions.value = treeData.value
|
||||||
|
} else {
|
||||||
|
const result = [];
|
||||||
|
// 遍历外层数组的每个分组
|
||||||
|
for (let i = 0; i < treeData.value.length; i++) {
|
||||||
|
const group = treeData.value[i];
|
||||||
|
if (group.children && Array.isArray(group.children)) {
|
||||||
|
for (let j = 0; j < group.children.length; j++) {
|
||||||
|
result.push(group.children[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
deptOptions.value = result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== 树操作核心方法 ==========
|
||||||
|
const forceExpandSingleNode = (nodeId: string): void => {
|
||||||
|
expandedKeys.value = []
|
||||||
|
nextTick(() => {
|
||||||
|
expandedKeys.value = [nodeId]
|
||||||
|
// deptTreeRef.value?.expand(nodeId, false)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleNodeClick = (data: InstrTreeNode): void => {
|
||||||
|
if (isFiltering.value) {
|
||||||
|
queryParams.value.groupId = data.id === "-1" ? undefined : data.id
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.children && data.children.length > 0) {
|
||||||
|
const isExpanded = expandedKeys.value.includes(data.id)
|
||||||
|
expandedKeys.value = isExpanded ? [] : [data.id]
|
||||||
|
!isExpanded && forceExpandSingleNode(data.id)
|
||||||
|
} else {
|
||||||
|
queryParams.value.yq = data.id
|
||||||
|
yqmc.value = data.label
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ========== 检索过滤逻辑 ==========
|
||||||
|
const filterNode = (value: string, data: any, _node: TreeNode): boolean => {
|
||||||
|
if (!value) return true
|
||||||
|
|
||||||
|
const keyword = value.trim().toUpperCase()
|
||||||
|
const nodeLabel = data.label?.toLowerCase() || ''
|
||||||
|
const nodePinyinFirst = data.label ? getFirstLetter(data.label).toUpperCase() : ''
|
||||||
|
|
||||||
|
const currentMatch = nodeLabel.includes(keyword.toLowerCase()) || nodePinyinFirst.includes(keyword)
|
||||||
|
const childrenMatch = (data.children || []).some((child: any) => filterNode(value, child, _node))
|
||||||
|
return currentMatch || childrenMatch
|
||||||
|
}
|
||||||
|
|
||||||
|
const debounceFilter = (() => {
|
||||||
|
let timer: number | undefined
|
||||||
|
return (val: string): void => {
|
||||||
|
clearTimeout(timer)
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
isFiltering.value = true
|
||||||
|
deptTreeRef.value?.filter(val)
|
||||||
|
|
||||||
|
if (val) {
|
||||||
|
expandedKeys.value = []
|
||||||
|
const expandMatched = (nodes: InstrTreeNode[]) => {
|
||||||
|
nodes.forEach(node => {
|
||||||
|
if (filterNode(val, node, {} as TreeNode) && node.children?.length) {
|
||||||
|
expandedKeys.value.push(node.id)
|
||||||
|
}
|
||||||
|
node.children && expandMatched(node.children)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
expandMatched(deptOptions.value)
|
||||||
|
} else {
|
||||||
|
expandedKeys.value = []
|
||||||
|
}
|
||||||
|
isFiltering.value = false
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
|
watch(deptName, debounceFilter, { immediate: false })
|
||||||
|
|
||||||
|
// ========== 业务逻辑 ==========
|
||||||
|
const getDeptTree = async (): Promise<void> => {
|
||||||
|
try {
|
||||||
|
const response = await paramTree() as ParamTreeResponse
|
||||||
|
if (response.code === "0" && response.data) {
|
||||||
|
treeData.value = response.data
|
||||||
|
radioChange('1')
|
||||||
|
if (!expandedKeys.value.length) {
|
||||||
|
// 默认展开第一个一级节点的子级
|
||||||
|
nextTick(() => {
|
||||||
|
if (deptOptions.value.length > 0) {
|
||||||
|
const firstLevelNode = deptOptions.value[0]
|
||||||
|
if (firstLevelNode && firstLevelNode.children && firstLevelNode.children.length > 0) {
|
||||||
|
expandedKeys.value = [firstLevelNode.id]
|
||||||
|
const firstChildNode = firstLevelNode.children[0]
|
||||||
|
queryParams.value.yq = firstChildNode.id
|
||||||
|
yqmc.value = firstChildNode.label
|
||||||
|
|
||||||
|
deptTreeRef.value?.setCurrentKey(firstChildNode.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(response.msg || "获取树数据失败")
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(`获取树数据异常:${(error as Error).message}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getDictData('XMGL', 'MD')
|
||||||
|
})
|
||||||
|
// ========== 初始化 ==========
|
||||||
|
getDeptTree()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
width: 100%;
|
||||||
|
height: 90vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 8px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-row {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-col {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
|
||||||
|
.tree-container {
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e6e6e6;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 8px;
|
||||||
|
|
||||||
|
// 核心:树选中节点样式
|
||||||
|
:deep(.el-tree) {
|
||||||
|
--el-tree-node-transition-duration: 0.2s;
|
||||||
|
|
||||||
|
.el-tree-node__children {
|
||||||
|
transition: all var(--el-tree-node-transition-duration) ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__expand-icon.is-leaf {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选中节点的背景色(蓝色)+ 文字白色
|
||||||
|
.el-tree-node.is-current>.el-tree-node__content {
|
||||||
|
background-color: #409eff !important;
|
||||||
|
color: #ffffff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选中节点hover样式(加深蓝色)
|
||||||
|
.el-tree-node.is-current>.el-tree-node__content:hover {
|
||||||
|
background-color: #1e88e5 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 树节点内容容器样式
|
||||||
|
.tree-node-content {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px; // 徽章和文字间距
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新节点徽章样式
|
||||||
|
.new-node-badge {
|
||||||
|
--el-badge-font-size: 10px !important;
|
||||||
|
--el-badge-height: 16px !important;
|
||||||
|
--el-badge-padding: 0 4px !important;
|
||||||
|
--el-badge-warning-color: #FFEC24 !important; // 黄色徽章
|
||||||
|
--el-badge-warning-bg-color: #fff7e6 !important; // 浅黄色背景
|
||||||
|
--el-badge-border-radius: 2px !important; // 圆角优化
|
||||||
|
|
||||||
|
// 徽章文字样式
|
||||||
|
.el-badge__content {
|
||||||
|
font-size: 10px !important;
|
||||||
|
line-height: 16px !important;
|
||||||
|
padding: 0 4px !important;
|
||||||
|
height: 16px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-col {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
// 仪器标题行样式
|
||||||
|
.yq-title-row {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
|
||||||
|
.yq-title {
|
||||||
|
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||||
|
font-size: 16px; // 缩小h1字体(默认24px→16px)
|
||||||
|
color: #409eff; // 蓝色(Element Plus主题色)
|
||||||
|
font-weight: 600;
|
||||||
|
margin: 0; // 清除默认margin
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -11,70 +11,114 @@
|
|||||||
<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>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="danger" plain icon="Delete" @click="allClear">清除所有项目接口号</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="10" class="table-row">
|
<div class="table-row">
|
||||||
<el-col :span="12" class="table-box">
|
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
||||||
<el-table :data="tableData" height="100%" border highlight-current-row>
|
@row-click="handleRowClick">
|
||||||
<el-table-column label="通道号" align="center">
|
<template #tdh="{ row }">
|
||||||
<template #default="scope">
|
<el-input v-model="row.tdh" placeholder="请输入通道号" class="full-width-input" />
|
||||||
<el-input v-model="scope.row.channel" placeholder="请输入通道号" class="full-width-input" />
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
<template #xmmc="{ row }">
|
||||||
<el-table-column label="项目" align="center">
|
<SelectTable v-model:data="row.xmdh" :tableData="xmList" class="full-width-input" />
|
||||||
<template #default="scope">
|
|
||||||
<SelectTable v-model:data="scope.row.xmid" :tableData="xmList" class="full-width-input" />
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</CustomTable>
|
||||||
</el-table>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<div class="tips">
|
|
||||||
说明:
|
|
||||||
“通道号”又称“接口代号”,是指仪器向电脑传送结果时项目的
|
|
||||||
标识符
|
|
||||||
接口代号对于一个仪器不可重复。
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { queryXmInfoNewService } from '@/api/liswork/labItem/labItemApi';
|
import { queryXmInfo, } from '@/api/liswork/work/LisWork';
|
||||||
|
import { getitemtdh, saveitemtdh, delitemtdh } from '@/api/liswork/xtwh/ComOpt';
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
const yq = defineModel<string>();
|
const yq = defineModel<string>();
|
||||||
|
const loading = ref(false);
|
||||||
const tableData = ref<Array<{ channel: string }>>([]);
|
const tableRef = ref();
|
||||||
|
const tableData = ref<Array<{ tdh: string, xmdh: string }>>([]);
|
||||||
|
const columns = [
|
||||||
|
{ label: '序号', type: 'index', visible: true, width: 50, align: 'center' },
|
||||||
|
{ label: '通道号', prop: 'tdh', visible: true, align: 'center', slot: 'tdh' },
|
||||||
|
{ label: '项目代号', prop: 'xmdh', visible: true, align: 'center' },
|
||||||
|
{ label: '项目', prop: 'xmmc', visible: true, align: 'center', slot: 'xmmc', showOverflowTooltip: false, width: 250 },
|
||||||
|
{ label: '项目id', prop: 'xmid', visible: true, align: 'center' },
|
||||||
|
];
|
||||||
|
const tableConfig = {
|
||||||
|
border: true,
|
||||||
|
height: '100%',
|
||||||
|
highlightCurrentRow: true,
|
||||||
|
}
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
};
|
const flag = tableData.value.every(item => item.tdh)
|
||||||
|
if (!flag) return ElMessage.error('请检查填写参数,通道号不能为空!')
|
||||||
|
let index = -1;
|
||||||
|
tableData.value.forEach((item, i) => {
|
||||||
|
const tdhLower = item.tdh.trim().toUpperCase();
|
||||||
|
index = tableData.value.findIndex(i => i.tdh.trim().toUpperCase() === tdhLower && i.tdh !== item.tdh);
|
||||||
|
if (index !== -1) {
|
||||||
|
return ElMessage.error(`通道号 ${item.tdh} ${i + 1}行已存在!`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (index !== -1) return
|
||||||
|
const arr = tableData.value.map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
tdh: item.tdh.trim().toUpperCase(),
|
||||||
|
yq: yq.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
saveitemtdh(arr).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
ElMessage.success('保存成功!')
|
||||||
|
getChannel()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
const selectedRow = ref<any>(null);
|
||||||
|
const handleRowClick = (row: any) => {
|
||||||
|
selectedRow.value = row;
|
||||||
|
};
|
||||||
const addItem = () => {
|
const addItem = () => {
|
||||||
tableData.value.push({ channel: '' })
|
tableData.value.push({ tdh: '', xmdh: '' })
|
||||||
|
nextTick(() => {
|
||||||
|
tableRef.value.setScrollTop(tableData.value.length)
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
const delItem = () => {
|
const delItem = () => {
|
||||||
|
if (!selectedRow.value) return ElMessage.error('请选择要删除的行!')
|
||||||
|
delitemtdh({ yq: yq.value, tdh: selectedRow.value.tdh })
|
||||||
|
tableData.value = tableData.value.filter(item => item.xmdh !== selectedRow.value.xmdh)
|
||||||
|
getChannel()
|
||||||
}
|
}
|
||||||
|
|
||||||
const allClear = () => {
|
const allClear = () => {
|
||||||
}
|
}
|
||||||
const xmList = ref<Array<{ xmmc: string, xmid: string }>>([]);
|
const xmList = ref<Array<{ xmmc: string, xmdh: string }>>([]);
|
||||||
const getXmList = () => {
|
const getXmList = () => {
|
||||||
queryXmInfoNewService({ yq: yq.value }).then((res: any) => {
|
loading.value = true;
|
||||||
xmList.value = res.rows.map((item: any) => {
|
queryXmInfo({ yq: yq.value }).then((res: any) => {
|
||||||
|
loading.value = false;
|
||||||
|
xmList.value = res.data.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
label: item.xmmc,
|
label: item.xmmc,
|
||||||
value: item.xmid.toString(),
|
value: item.xmdh,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(() => yq.value, (val) => {
|
const getChannel = () => {
|
||||||
|
getitemtdh({ yq: yq.value }).then((res: any) => {
|
||||||
|
tableData.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(yq, (val) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
getXmList();
|
getXmList();
|
||||||
|
getChannel();
|
||||||
}
|
}
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,20 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 参数列表 -->
|
<!-- 参数列表 -->
|
||||||
<div>
|
<div>
|
||||||
|
<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="primary" 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>
|
||||||
</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>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-form ref="form" :model="formData" :rules="rules" label-width="120px" class="form-inline" inline>
|
<el-form ref="form" :model="formData" :rules="rules" label-width="120px" class="form-inline" inline>
|
||||||
|
<div style="display: flex;">
|
||||||
|
<el-form-item label="项目" prop="xmdh">
|
||||||
|
<SelectTable v-model:data="xmdh" :tableData="xmList" style="width: 12rem;" @getDataValue='getXmInfo' />
|
||||||
|
</el-form-item>
|
||||||
<div class="title">说明:公式中阴阳对照请用NC,PC表示</div>
|
<div class="title">说明:公式中阴阳对照请用NC,PC表示</div>
|
||||||
|
</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="测试波长" prop="csbc">
|
<el-form-item label="测试波长" prop="csbc">
|
||||||
@ -140,7 +146,7 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="默认模板" prop="mrmb">
|
<el-form-item label="默认模板" prop="mrmb">
|
||||||
<el-select v-model="formData.mrmb" style="width: 12rem;">
|
<el-select v-model="formData.mrmb" style="width: 12rem;">
|
||||||
<!-- <el-option v-for="item in sjtableData" :key="item.sjph" :value="item.sjph" :label="item.sjph" /> -->
|
<el-option v-for="item in mbList" :key="item.no" :value="item.no" :label="item.na" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -154,6 +160,10 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-empty :image-size="200" description="暂无参数配置" />
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- 波长对照表 -->
|
<!-- 波长对照表 -->
|
||||||
<el-dialog v-model="dialogVisible" title="滤光波长对照表" draggable :close-on-click-modal="false" width="500px">
|
<el-dialog v-model="dialogVisible" title="滤光波长对照表" draggable :close-on-click-modal="false" width="500px">
|
||||||
@ -217,14 +227,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { queryFilter, addXmFilter, delXmFilter, addXmLot, delXmLot, queryXmLot, querySjcs } from '@/api/liswork/xtwh/ComOpt'
|
import { queryFilter, addXmFilter, delXmFilter, addXmLot, delXmLot, queryXmLot, querySjcs, querydouble, savedouble, querymbmc } from '@/api/liswork/xtwh/ComOpt'
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { formatDict, dictData } from '@/hooks'
|
import { formatDict, dictData } from '@/hooks'
|
||||||
import { get } from 'lodash';
|
import { queryXmInfo } from '@/api/liswork/work/LisWork';
|
||||||
|
|
||||||
|
|
||||||
const yq = defineModel<string>()
|
const yq = defineModel<string>()
|
||||||
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
|
const xmdh = ref('');
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
csbc: '',
|
csbc: '',
|
||||||
ckbc: '',
|
ckbc: '',
|
||||||
@ -242,7 +254,8 @@ const formData = ref({
|
|||||||
kbms: '1',
|
kbms: '1',
|
||||||
zbsj: '',
|
zbsj: '',
|
||||||
mrmb: '',
|
mrmb: '',
|
||||||
mrsjph: ''
|
mrsjph: '',
|
||||||
|
xmdh: '',
|
||||||
});
|
});
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
csbc: [
|
csbc: [
|
||||||
@ -253,11 +266,18 @@ const rules = ref({
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const paramsFlag = ref(true);
|
||||||
|
|
||||||
const form = ref();
|
const form = ref();
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
form.value.validate((valid: boolean) => {
|
form.value.validate((valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log('submit!')
|
savedouble(formData.value).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
ElMessage.success('保存成功!')
|
||||||
|
getXmInfo()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -310,6 +330,7 @@ interface sjList {
|
|||||||
sjcs: string, sjph: string, yq: string, yxq: string, csff: string
|
sjcs: string, sjph: string, yq: string, yxq: string, csff: string
|
||||||
}
|
}
|
||||||
const sjShow = ref(false)
|
const sjShow = ref(false)
|
||||||
|
const mbList = ref<Array<{ na: string, no: string }>>([])
|
||||||
const sjtableData = ref<sjList[]>([])
|
const sjtableData = ref<sjList[]>([])
|
||||||
const sjHandle = () => {
|
const sjHandle = () => {
|
||||||
getSjList()
|
getSjList()
|
||||||
@ -363,9 +384,38 @@ const getSjcjList = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getXmInfo = () => {
|
||||||
|
querydouble({ yq: yq.value, xmdh: xmdh.value }).then((res: any) => {
|
||||||
|
paramsFlag.value = res.code == 1 ? false : true;
|
||||||
|
formData.value = res.data || {}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const xmList = ref<Array<{ label: string, value: string }>>([])
|
||||||
|
const getXmList = () => {
|
||||||
|
queryXmInfo({ yq: yq.value }).then((res: any) => {
|
||||||
|
xmList.value = res.data.map((item: any) => {
|
||||||
|
return {
|
||||||
|
label: item.xmmc,
|
||||||
|
value: item.xmdh,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
querymbmc().then((res: any) => {
|
||||||
|
mbList.value = res.data || []
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
watch(yq, (newVal) => {
|
watch(yq, (newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
getXmInfo()
|
||||||
getDzList()
|
getDzList()
|
||||||
getSjList()
|
getSjList()
|
||||||
|
getXmList()
|
||||||
|
}
|
||||||
|
xmdh.value = ''
|
||||||
}, {
|
}, {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true
|
deep: true
|
||||||
|
|||||||
@ -1,23 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 整体排序 -->
|
<!-- 整体排序 -->
|
||||||
<div class="sort_box">
|
<div class="sort_box">
|
||||||
<el-row :gutter="10" class="table-row">
|
|
||||||
<el-col :span="20" class="table-box">
|
|
||||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :config="tableConfig"
|
|
||||||
@row-click="handleRowClick">
|
|
||||||
<template #sort="{ row }">
|
|
||||||
<el-input v-model="row.sort" class="full-width-input" />
|
|
||||||
</template>
|
|
||||||
</CustomTable>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-row :gutter="10" class="table-toolbar">
|
<el-row :gutter="10" class="table-toolbar">
|
||||||
<!-- <el-col :span="1.5">
|
|
||||||
<el-radio-group v-model="radio" @change="radioChange">
|
|
||||||
<el-radio value="1">上下移动调整</el-radio>
|
|
||||||
<el-radio value="2">手工输入工号</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-col> -->
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" @click="refresh">刷新</el-button>
|
<el-button type="primary" @click="refresh">刷新</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -25,20 +9,20 @@
|
|||||||
<el-button type="primary" @click="cpHandle">存盘</el-button>
|
<el-button type="primary" @click="cpHandle">存盘</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" :disabled="radio == '2'" @click="firstHandle">首位</el-button>
|
<el-button type="primary" @click="firstHandle">首位</el-button>
|
||||||
</el-col>
|
|
||||||
<!-- <el-col :span="1.5">
|
|
||||||
<el-button type="primary" icon="top" :disabled="radio == '2'" @click="prevHandle">上移</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" icon="bottom" :disabled="radio == '2'" @click="nextHandle">下移</el-button>
|
<el-button type="primary" @click="lastHadnle">末位</el-button>
|
||||||
</el-col> -->
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="primary" :disabled="radio == '2'" @click="lastHadnle">末位</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<div class="table-row">
|
||||||
|
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :config="tableConfig" :enableRowDrag="true"
|
||||||
|
@row-drag-end="handleRowDragEnd" @row-click="handleRowClick">
|
||||||
|
<!-- <template #dyxh="{ row }">
|
||||||
|
<el-input v-model="row.dyxh" class="full-width-input" />
|
||||||
|
</template> -->
|
||||||
|
</CustomTable>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -46,28 +30,21 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { formatDict, dictData } from '@/hooks';
|
import { formatDict, dictData } from '@/hooks';
|
||||||
|
import { getitemsort, saveitemsort } from '@/api/liswork/xtwh/ComOpt';
|
||||||
|
|
||||||
|
const yq = defineModel<string>()
|
||||||
const props = defineProps({
|
|
||||||
dataList: {
|
|
||||||
type: Array,
|
|
||||||
default: []
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
interface DataItem {
|
interface DataItem {
|
||||||
xmid: string | number;
|
xmid: string | number;
|
||||||
xmmc: string | number;
|
xmmc: string | number;
|
||||||
sort: string | number;
|
dyxh: string | number;
|
||||||
}
|
}
|
||||||
const currentIndex = ref(0);
|
const selectedRow = ref<DataItem | null>(null)
|
||||||
const radio = ref('1');
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const dataList = ref<DataItem[]>([]);
|
const dataList = ref<DataItem[]>([]);
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{ prop: 'xmid', label: '项目ID', visible: true, align: 'center', },
|
{ prop: 'xmid', label: '项目ID', visible: true, align: 'center' },
|
||||||
{ prop: 'xmmc', label: '项目名称', visible: true, align: 'center', },
|
{ prop: 'xmmc', label: '项目名称', visible: true, align: 'center' },
|
||||||
{ prop: 'sort', label: '整体排序', visible: true, align: 'center', slot: "sort" },
|
{ prop: 'dyxh', label: '排序', visible: true, align: 'center', },
|
||||||
]);
|
]);
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
@ -78,19 +55,26 @@ const tableConfig = ref({
|
|||||||
|
|
||||||
|
|
||||||
//退拽属性
|
//退拽属性
|
||||||
const handleColumnDragEnd = (data: any) => {
|
const handleRowDragEnd = (data: any) => {
|
||||||
// 更新列配置
|
// 更新行顺序
|
||||||
dataList.value = data.list;
|
dataList.value = data.list.map((item: any) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
dyxh: item.sort,
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleRowClick = (row: DataItem) => {
|
const handleRowClick = (row: DataItem) => {
|
||||||
currentIndex.value = dataList.value.indexOf(row);
|
selectedRow.value = row
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
|
getitemsort({ yq: yq.value }).then((res: any) => {
|
||||||
|
dataList.value = res.data;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const refresh = () => {
|
const refresh = () => {
|
||||||
@ -98,56 +82,59 @@ const refresh = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cpHandle = () => {
|
const cpHandle = () => {
|
||||||
|
saveitemsort(dataList.value).then(() => {
|
||||||
|
getList();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const firstHandle = () => {
|
const firstHandle = () => {
|
||||||
currentIndex.value = 0;
|
if (!selectedRow.value) return
|
||||||
tableRef.value.setCurrentRow(dataList.value[0]);
|
const currentIndex = dataList.value.findIndex(item => item.xmid === selectedRow.value!.xmid)
|
||||||
|
if (currentIndex === 0) return
|
||||||
|
const [movedRow] = dataList.value.splice(currentIndex, 1)
|
||||||
|
dataList.value.unshift(movedRow)
|
||||||
|
resetSortNumber()
|
||||||
tableRef.value.setScrollTop(0)
|
tableRef.value.setScrollTop(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
const lastHadnle = () => {
|
const lastHadnle = () => {
|
||||||
currentIndex.value = dataList.value.length - 1;
|
if (!selectedRow.value) return
|
||||||
tableRef.value.setCurrentRow(dataList.value[currentIndex.value]);
|
const currentIndex = dataList.value.findIndex(item => item.xmid === selectedRow.value!.xmid)
|
||||||
|
if (currentIndex === dataList.value.length - 1) return
|
||||||
|
const [movedRow] = dataList.value.splice(currentIndex, 1)
|
||||||
|
dataList.value.push(movedRow)
|
||||||
|
resetSortNumber()
|
||||||
tableRef.value.setScrollTop(dataList.value.length)
|
tableRef.value.setScrollTop(dataList.value.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
const resetSortNumber = () => {
|
||||||
for (let index = 0; index < 20; index++) {
|
dataList.value.forEach((item, index) => {
|
||||||
dataList.value.push(
|
item.dyxh = index + 1
|
||||||
{ xmid: 'ID' + index, xmmc: 'xmmc' + index, sort: '', }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
watch(yq, (newVal) => {
|
||||||
|
getList();
|
||||||
|
}, { immediate: true })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.sort_box {
|
.sort_box {
|
||||||
height: calc(100% - 58px);
|
height: calc(100% - 56px);
|
||||||
padding-top: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-toolbar {
|
.table-toolbar {
|
||||||
flex: 1;
|
margin-bottom: 8px;
|
||||||
display: flex;
|
height: 36px;
|
||||||
flex-direction: column;
|
line-height: 36px;
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.el-col {
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-button {
|
|
||||||
width: 80%;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.table-row {
|
.table-row {
|
||||||
height: 100%;
|
width: 50%;
|
||||||
flex: 3;
|
height: calc(100% - 45px);
|
||||||
|
|
||||||
|
|
||||||
.table-box {
|
.table-box {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@ -112,7 +112,7 @@ const tabList = [
|
|||||||
{ key: 'SysSort', label: '项目排序', component: SysSort },
|
{ key: 'SysSort', label: '项目排序', component: SysSort },
|
||||||
{ key: 'SysReport', label: '报告单设置', component: SysReport },
|
{ key: 'SysReport', label: '报告单设置', component: SysReport },
|
||||||
]
|
]
|
||||||
const activeName = ref('SysSort')
|
const activeName = ref('SysGlobal')
|
||||||
|
|
||||||
// 计算当前要渲染的组件
|
// 计算当前要渲染的组件
|
||||||
const currentComponent = computed(() => {
|
const currentComponent = computed(() => {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<template>
|
|
||||||
<!--仪器收费项目对照-->
|
<!--仪器收费项目对照-->
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form ref="form" :model="formData" label-width="80px" inline>
|
<el-form ref="form" :model="formData" label-width="80px" inline>
|
||||||
<el-form-item label="仪器" prop="yq">
|
<el-form-item label="仪器" prop="yq">
|
||||||
@ -12,21 +13,23 @@
|
|||||||
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
<el-button type="primary" @click="onQueryClick">查询</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span>说明:双击左侧列表,能删除对照数据,双击右边列表能新增数据到对照当中</span>
|
<span class="tips">说明:双击左侧列表,能删除对照数据,双击右边列表能新增数据到对照当中</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row :gutter="20" class="table-row">
|
||||||
<el-col :span="5">
|
<el-col :span="6" class="table-col">
|
||||||
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
<CustomTable ref="tableRefLeft" :data="dataListLeft" :columns="columnsLeft" :config="tableConfig"
|
||||||
:config="tableConfig" @row-dblclick="onDBClickLeft"/>
|
@row-dblclick="onDBClickLeft" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="19">
|
<el-col :span="18" class="table-col">
|
||||||
<CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
<CustomTable ref="tableRefRight" :data="dataListRight" :columns="columnsRight" :enable-column-drag="true"
|
||||||
:config="tableConfig" @row-dblclick="onDBClickRight"/>
|
@column-drag-end="handleColumnDragEnd" :config="tableConfig" @row-dblclick="onDBClickRight" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -39,36 +42,31 @@ import { ElMessage } from 'element-plus';
|
|||||||
|
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
border: true, // 边框
|
border: true, // 边框
|
||||||
height: '76vh', // 高度
|
height: '100%', // 高度
|
||||||
highlightCurrentRow: true, // 高亮当前行
|
highlightCurrentRow: true, // 高亮当前行
|
||||||
// cellStyle: cellStyleHd
|
|
||||||
})
|
})
|
||||||
|
|
||||||
//退拽属性
|
//退拽属性
|
||||||
const handleColumnDragEnd = (data: any) => {
|
const handleColumnDragEnd = (data: any) => {
|
||||||
// 更新列配置
|
|
||||||
columnsLeft.value = data.columns;
|
|
||||||
columnsRight.value = data.columns;
|
columnsRight.value = data.columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
const columnsLeft = ref([
|
const columnsLeft = ref([
|
||||||
{ prop: 'sfxmmc', label: '当前仪器对应的收费项目', visible: true, align: 'center', width: 300 },
|
{ prop: 'sfxmmc', label: '当前仪器对应的收费项目', visible: true, },
|
||||||
{ prop: 'yq', label: '仪器', visible: false, align: 'center', width: 100 },
|
{ prop: 'yq', label: '仪器', visible: false, align: 'center', width: 100 },
|
||||||
]);
|
]);
|
||||||
const columnsRight = ref([
|
const columnsRight = ref([
|
||||||
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', width: 100 },
|
{ prop: 'xmlb', label: '类别', visible: true, align: 'center', },
|
||||||
{ prop: 'sfxmdh', label: '收费项目代号', visible: true, align: 'center', width: 200 },
|
{ prop: 'sfxmdh', label: '收费项目代号', visible: true, align: 'center', },
|
||||||
{ prop: 'sfxmmc', label: '收费项目名称', visible: true, align: 'center', width: 300 },
|
{ prop: 'sfxmmc', label: '收费项目名称', visible: true, align: 'center', },
|
||||||
{ prop: 'dj', label: '单价', visible: true, align: 'center', width: 100 },
|
{ prop: 'dj', label: '单价', visible: true, align: 'center', },
|
||||||
{ prop: 'cp_yq', label: '分配了仪器', visible: true, align: 'center', width: 400 }
|
{ prop: 'cp_yq', label: '分配了仪器', visible: true, align: 'center', }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const dataListLeft = ref([
|
const dataListLeft = ref([])
|
||||||
{'sfxmdh':'','yq':''}
|
|
||||||
])
|
|
||||||
const dataListRight = ref([])
|
const dataListRight = ref([])
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
yq: '',
|
yq: '46',
|
||||||
item: ''
|
item: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -77,9 +75,10 @@ const getList = async () => {
|
|||||||
if (!formData.value.yq) formData.value.yq = ''
|
if (!formData.value.yq) formData.value.yq = ''
|
||||||
let res = await queryService({ yq: formData.value.yq });
|
let res = await queryService({ yq: formData.value.yq });
|
||||||
dataListLeft.value = res.data;
|
dataListLeft.value = res.data;
|
||||||
res = await queryOneService('HISOPT','sp_gyxmyljg')
|
// res = await queryOneService('HISOPT', 'sp_gyxmyljg')
|
||||||
let param = res.data.value
|
// let param = res.data.value
|
||||||
//先写固定值,后面再改
|
//先写固定值,后面再改
|
||||||
|
let param = '1'
|
||||||
if (param && param !== '') {
|
if (param && param !== '') {
|
||||||
param = '1'
|
param = '1'
|
||||||
} else {
|
} else {
|
||||||
@ -111,10 +110,23 @@ const onQueryClick = () => {
|
|||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getList()
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.tips {
|
||||||
|
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #409eff;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-row {
|
||||||
|
height: calc(100% - 58px);
|
||||||
|
|
||||||
|
.table-col {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user