Compare commits
2 Commits
57e11ad63c
...
4bdd7e47f1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bdd7e47f1 | ||
|
|
107446a3cb |
@ -26,6 +26,8 @@ export const getDictData = async (...args: string[]) => {
|
||||
if(dictRefs.YQDL != undefined) dictData.value.YQDL = toRaw(dictRefs.YQDL.value) || []
|
||||
if(dictRefs.VA != undefined) dictData.value.VA = toRaw(dictRefs.VA.value) || []
|
||||
if(dictRefs.LF != undefined) dictData.value.LF = toRaw(dictRefs.LF.value) || []
|
||||
if(dictRefs.BT != undefined) dictData.value.BT = toRaw(dictRefs.BT.value) || []
|
||||
if(dictRefs.SLZQ != undefined) dictData.value.SLZQ = toRaw(dictRefs.SLZQ.value) || []
|
||||
}
|
||||
|
||||
//字典数据格式化方法
|
||||
|
||||
8
src/types/Object.d.ts
vendored
8
src/types/Object.d.ts
vendored
@ -17,6 +17,8 @@ export interface DictData {
|
||||
YQ?: Array<any>;
|
||||
VA?: Array<any>;
|
||||
LF?: Array<any>;
|
||||
BT?: Array<any>;
|
||||
SLZQ?: Array<any>;
|
||||
[key: string]: any[] | undefined; // 添加索引签名以支持动态访问
|
||||
}
|
||||
|
||||
@ -128,6 +130,12 @@ export class XmInfoVs {
|
||||
|
||||
}
|
||||
|
||||
export class XmTextresultNew {
|
||||
xmid?: string;
|
||||
xmdh?: string;
|
||||
xh?: number;
|
||||
textresult?: string;
|
||||
}
|
||||
|
||||
export class LabResultItem {
|
||||
xmdh: string;
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
</el-col>
|
||||
<!-- 右侧区域-->
|
||||
<el-col :span="10" :xs="24">
|
||||
<tabView :tabList="tabList" v-model:activeTab="activeTab" />
|
||||
<tabView :tabList="tabList" v-model:activeTab="activeTab" @update:active-tab="updateActive" />
|
||||
<KeepAlive>
|
||||
<component class="tabDiv" :is="activeTabN" :dataList="tabDataList" :formData="selectRow"></component>
|
||||
</KeepAlive>
|
||||
@ -134,7 +134,7 @@ const tabList = ref([
|
||||
{ label: '常用取值', value: 'CommonlyValues' },
|
||||
{ label: '使用仪器', value: 'UseInstr' },
|
||||
{ label: '知识库', value: 'Knowledge' },
|
||||
{ label: '整体排序', value: 'Sort' },
|
||||
//{ label: '整体排序', value: 'Sort' },
|
||||
{ label: '常见描述', value: 'CommonDescriptions' },
|
||||
// { label: '参数', value: 7 },
|
||||
// { label: '通道号', value: 8 },
|
||||
@ -198,6 +198,8 @@ const yqdlFields = ref([
|
||||
const tabDataList = ref<any>([]);
|
||||
//选中行数据
|
||||
const selectRow = ref();
|
||||
//明细数据
|
||||
const selectDetailRow = ref()
|
||||
|
||||
// 仪器
|
||||
const getYqConfig = () => {
|
||||
@ -260,33 +262,41 @@ const changeStauts = () => {
|
||||
}
|
||||
|
||||
// 选择行变化
|
||||
const rowChange = (row: any) => {
|
||||
const rowChange = async (row: any) => {
|
||||
selectRow.value = row;
|
||||
queryXmInfoNewDetailService(row.xmid,row.yq,row.xmdh).then((res: any) => {
|
||||
const res = await queryXmInfoNewDetailService(row.xmid,row.yq,row.xmdh)
|
||||
selectDetailRow.value = res.data
|
||||
console.log('明细数据:', res);
|
||||
changeActiveTab()
|
||||
}
|
||||
|
||||
//tab变化
|
||||
const updateActive = () => {
|
||||
changeActiveTab()
|
||||
}
|
||||
|
||||
|
||||
const changeActiveTab = () => {
|
||||
switch(activeTab.value){
|
||||
case 'Basic':
|
||||
tabDataList.value = res.data.xmInfoNewRows[0] || [];
|
||||
tabDataList.value = selectDetailRow.value.xmInfoNewRows[0] || [];
|
||||
break;
|
||||
case 'CommonlyValues':
|
||||
if(res.data.xmValNewRows){
|
||||
tabDataList.value = res.data.xmValNewRows[0] || [];
|
||||
}
|
||||
tabDataList.value = selectDetailRow.value.xmValNewRows[0] || [];
|
||||
break;
|
||||
case 'UseInstr':
|
||||
if(res.data.xmInfoVsRows){
|
||||
tabDataList.value = res.data.xmInfoVsRows[0] || [];
|
||||
}
|
||||
tabDataList.value = selectDetailRow.value.xmInfoVsRows[0] || [];
|
||||
break;
|
||||
case 'Knowledge':
|
||||
//tabDataList.value = res.data.xmInfoVsRows[0];
|
||||
case 'Sort':
|
||||
|
||||
case 'CommonDescriptions':
|
||||
tabDataList.value = selectDetailRow.value.xmTextresultNewRows[0] || [];
|
||||
break;
|
||||
case 'ReferenceValueDetails':
|
||||
|
||||
tabDataList.value = selectDetailRow.value.xmRefNewRows[0] || [];
|
||||
break;
|
||||
}
|
||||
console.log('明细数据:', res);
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@ -1,34 +1,42 @@
|
||||
<template>
|
||||
<!-- 常见描述 -->
|
||||
<div>
|
||||
<div>
|
||||
<div class="modifyClass">
|
||||
<el-button type="primary" @click="">增加</el-button>
|
||||
<el-button type="primary" @click="">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig"/>
|
||||
<el-button type="primary" @click="onAddClick">增加</el-button>
|
||||
<el-button type="primary" @click="onDelClick">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="tableList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig" @row-click="rowClick">
|
||||
<template #textresult="{row}">
|
||||
<el-input type="textarea" v-model="row.textresult" class="full-width-input" autosize></el-input>
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { XmTextresultNew } from '@/types';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
// 是否显示
|
||||
// visible: {
|
||||
// type: Boolean,
|
||||
// required: true,
|
||||
// default: false
|
||||
// }
|
||||
dataList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
formData: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
});
|
||||
|
||||
const tableRef = ref<any>(null);
|
||||
const dataList = ref();
|
||||
const tableRef = ref();
|
||||
const tableList = ref<Array<XmTextresultNew>>([])
|
||||
const columns = ref([
|
||||
{ prop: 'textresult', label: '文字描述', visible: true, align: 'center', width: 500 },
|
||||
{ prop: 'textresult', label: '文字描述', visible: true, align: 'center',slot: 'textresult', width: 500,showOverflowTooltip:false },
|
||||
]);
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
@ -43,4 +51,51 @@ const handleColumnDragEnd = (data: any) => {
|
||||
// 更新列配置
|
||||
columns.value = data.columns;
|
||||
}
|
||||
|
||||
const selectRow = ref()
|
||||
|
||||
//序号最大值
|
||||
const maxXh = computed(() => {
|
||||
return tableList.value.length > 0 ? Math.max(...tableList.value.map((item:any) => item.xh || 0)) : 0;
|
||||
});
|
||||
|
||||
const rowClick = (row:any) => {
|
||||
selectRow.value = row
|
||||
}
|
||||
|
||||
|
||||
const onAddClick = () => {
|
||||
const newData: XmTextresultNew = {
|
||||
xmid: props.formData.xmid,
|
||||
xmdh: props.formData.xmdh,
|
||||
xh: maxXh.value + 1
|
||||
}
|
||||
tableList.value.push(newData)
|
||||
}
|
||||
|
||||
const onDelClick = async ()=> {
|
||||
if(selectRow.value){
|
||||
await ElMessageBox.confirm('是否要删除选中的数据?','警告',
|
||||
{ confirmButtonText: 'OK',cancelButtonText: 'Cancel',type: 'warning',});
|
||||
tableList.value = tableList.value.filter((item:any) => item.xh != selectRow.value.xh)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
watch(
|
||||
() => props.dataList,
|
||||
(newVal:any) => {
|
||||
tableList.value = newVal;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-table .cell) {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
@ -2,11 +2,80 @@
|
||||
<!--参考值明细-->
|
||||
<div>
|
||||
<div class="modifyClass">
|
||||
<el-button type="primary" @click="">增加</el-button>
|
||||
<el-button type="primary" @click="">删除</el-button>
|
||||
<el-button type="primary" @click="onAddClick">增加</el-button>
|
||||
<el-button type="primary" @click="onDelClick">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig"/>
|
||||
<CustomTable ref="tableRefUp" :data="dataListUp" :columns="columnsUp" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig" @row-click="rowClick">
|
||||
<template #xb="{row}">
|
||||
<el-select v-model="row.xb" clearable>
|
||||
<el-option
|
||||
v-for="item in optionsXb"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #cp_nl1="{row}">
|
||||
<el-input v-model="row.cp_nl1" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #cp_nldw1="{row}">
|
||||
<el-select v-model="row.cp_nldw1" clearable>
|
||||
<el-option
|
||||
v-for="item in optionsNLDW"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #cp_nl2="{row}">
|
||||
<el-input v-model="row.cp_nl2" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #cp_nldw2="{row}">
|
||||
<el-select v-model="row.cp_nldw2" clearable>
|
||||
<el-option
|
||||
v-for="item in optionsNLDW"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #bblx="{row}">
|
||||
<SelectTable v-model:data="row.bblx" :fields="fields" :tableData="bblxOptions" label="label"
|
||||
value="label" objKey="label" :border="true" />
|
||||
</template>
|
||||
<template #slzq="{row}">
|
||||
<el-select v-model="row.slzq" clearable>
|
||||
<el-option
|
||||
v-for="item in optionsSLZQ"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #zd="{row}">
|
||||
<el-input v-model="row.zd" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #ckxx="{row}">
|
||||
<el-input v-model="row.ckxx" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #cksx="{row}">
|
||||
<el-input v-model="row.cksx" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #alterxx="{row}">
|
||||
<el-input v-model="row.alterxx" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #altersx="{row}">
|
||||
<el-input v-model="row.altersx" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #dyck="{row}">
|
||||
{{ row.ckxx + '--' + row.cksx }}
|
||||
</template>
|
||||
</CustomTable>
|
||||
<el-row>
|
||||
仪器特定参考值:
|
||||
</el-row>
|
||||
@ -14,7 +83,7 @@
|
||||
<el-button type="primary" @click="">增加</el-button>
|
||||
<el-button type="primary" @click="">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
<CustomTable ref="tableRefDown" :data="dataListDown" :columns="columnsDown" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig"/>
|
||||
</div>
|
||||
</template>
|
||||
@ -22,23 +91,61 @@
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { ref } from 'vue';
|
||||
import {getDictData,dictData} from '@/hooks'
|
||||
import SelectTable from '@/components/SelectTable/index.vue'
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
|
||||
const props = defineProps({
|
||||
// 是否显示
|
||||
// visible: {
|
||||
// type: Boolean,
|
||||
// required: true,
|
||||
// default: false
|
||||
// }
|
||||
dataList: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
});
|
||||
|
||||
const optionsXb = [
|
||||
{value: '1' ,label: '男'},
|
||||
{value: '2' ,label: '女'},
|
||||
]
|
||||
|
||||
const optionsNLDW = [
|
||||
{value: '1' ,label: '岁'},
|
||||
{value: '2' ,label: '月'},
|
||||
{value: '3' ,label: '天'},
|
||||
{value: '4' ,label: '时'},
|
||||
]
|
||||
|
||||
const tableRef = ref<any>(null);
|
||||
const dataList = ref();
|
||||
const yqDataList = ref();
|
||||
const columns = ref([
|
||||
{ prop: 'xb', label: '性别', visible: true, align: 'center', width: 200 },
|
||||
const optionsSLZQ = ref<any>([])
|
||||
|
||||
const fields = ref(
|
||||
[
|
||||
{ prop: 'value', label: '代号', width: 80, enablePinyinSearch: true },
|
||||
{ prop: 'label', label: '名称', width: 150, enablePinyinSearch: true },
|
||||
]
|
||||
)
|
||||
const bblxOptions = ref<Array<{ zddh: string; zdmc: string }>>([]);
|
||||
|
||||
const tableRefUp = ref<any>();
|
||||
const tableRefDown = ref<any>();
|
||||
const dataListUp = ref(props.dataList);
|
||||
const dataListDown = ref();
|
||||
const columnsUp = ref([
|
||||
{ prop: 'xh', label: '序号', visible: false, align: 'center', width: 70 },
|
||||
{ prop: 'xb', label: '性别', visible: true, align: 'center',slot: 'xb', width: 70 },
|
||||
{ prop: 'cp_nl1', label: '年龄下限', visible: true, align: 'center',slot:'cp_nl1', width: 100 },
|
||||
{ prop: 'cp_nldw1', label: '年龄单位', visible: true, align: 'center',slot:'cp_nldw1', width: 70 },
|
||||
{ prop: 'cp_nl2', label: '年龄上限', visible: true, align: 'center',slot: 'cp_nl2', width: 100 },
|
||||
{ prop: 'cp_nldw2', label: '年龄单位', visible: true, align: 'center',slot: 'cp_nldw2', width: 100 },
|
||||
{ prop: 'bblx', label: '标本类型', visible: true, align: 'center',slot: 'bblx', width: 100 },
|
||||
{ prop: 'slzq', label: '生理周期', visible: true, align: 'center',slot: 'slzq', width: 100 },
|
||||
{ prop: 'zd', label: '诊断', visible: true, align: 'center',slot:'zd', width: 100 },
|
||||
{ prop: 'ckxx', label: '参考下限', visible: true, align: 'center',slot:'ckxx', width: 100 },
|
||||
{ prop: 'cksx', label: '参考上限', visible: true, align: 'center',slot:'cksx', width: 100 },
|
||||
{ prop: 'alterxx', label: '危急值下限', visible: true, align: 'center',slot:'alterxx', width: 100 },
|
||||
{ prop: 'altersx', label: '危急值上限', visible: true, align: 'center',slot:'altersx', width: 100 },
|
||||
{ prop: 'dyck', label: '参考值', visible: true, align: 'center',slot:'dyck', width: 100 },
|
||||
]);
|
||||
const columnsDown = ref([
|
||||
{ prop: 'xb', label: '性别', visible: true, align: 'center',slot: 'xb', width: 100 },
|
||||
{ prop: 'cp_nl1', label: '年龄下限', visible: true, align: 'center', width: 100 },
|
||||
{ prop: 'cp_nldw1', label: '年龄单位', visible: true, align: 'center', width: 100 },
|
||||
{ prop: 'cp_nl2', label: '年龄上限', visible: true, align: 'center', width: 100 },
|
||||
@ -58,13 +165,54 @@ const tableConfig = ref({
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// cellStyle: cellStyleHd
|
||||
})
|
||||
const selectRow = ref()
|
||||
|
||||
|
||||
//退拽属性
|
||||
const handleColumnDragEnd = (data: any) => {
|
||||
// 更新列配置
|
||||
columns.value = data.columns;
|
||||
columnsUp.value = data.columns;
|
||||
columnsDown.value = data.columns;
|
||||
}
|
||||
|
||||
//序号最大值
|
||||
const maxXh = computed(() => {
|
||||
return dataListUp.value.length > 0 ? Math.max(...dataListUp.value.map((item:any) => item.xh || 0)) : 0;
|
||||
});
|
||||
|
||||
|
||||
const onAddClick = () => {
|
||||
const newData = {
|
||||
xh: maxXh.value + 1
|
||||
}
|
||||
dataListUp.value.push(newData)
|
||||
}
|
||||
|
||||
const onDelClick = async () => {
|
||||
console.log('删除',selectRow.value)
|
||||
if(selectRow.value){
|
||||
await ElMessageBox.confirm('是否要删除选中的数据?','警告',
|
||||
{ confirmButtonText: 'OK',cancelButtonText: 'Cancel',type: 'warning',});
|
||||
dataListUp.value = dataListUp.value.filter((item:any) => item.xh !== selectRow.value.xh)
|
||||
}
|
||||
}
|
||||
|
||||
const rowClick = (row:any) => {
|
||||
selectRow.value = row
|
||||
}
|
||||
|
||||
onActivated( async ()=>{
|
||||
//加载字典数据
|
||||
await getDictData('BT','SLZQ')
|
||||
bblxOptions.value = dictData.value.BT || []
|
||||
optionsSLZQ.value = dictData.value.SLZQ || []
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-input__inner {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@ -18,12 +18,10 @@ import CustomTable from '@/components/elTable/index.vue'
|
||||
import { ref } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
// 是否显示
|
||||
// visible: {
|
||||
// type: Boolean,
|
||||
// required: true,
|
||||
// default: false
|
||||
// }
|
||||
dataList: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user