Merge branch 'main' of http://47.97.125.165:8902/jiangs/lis8.0-vue3
This commit is contained in:
commit
b907c83aba
11
src/types/Object.d.ts
vendored
11
src/types/Object.d.ts
vendored
@ -116,3 +116,14 @@ export class XmValNew {
|
||||
jgbz?: string;
|
||||
|
||||
}
|
||||
|
||||
export class XmInfoVs {
|
||||
yq: string;
|
||||
xmid: number;
|
||||
xs?: number;
|
||||
zkxm?: string;
|
||||
cksx?: number;
|
||||
ckxx?: number;
|
||||
dyckz?: string;
|
||||
|
||||
}
|
||||
@ -6,22 +6,47 @@
|
||||
<el-button type="primary" @click="onClickDel">删除</el-button>
|
||||
</div>
|
||||
<CustomTable ref="tableRef" :data="yqList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||
:config="tableConfig"/>
|
||||
:config="tableConfig" @row-click="onRowClick">
|
||||
<template #yq="{row}">
|
||||
<YQSelectTable v-model:data="row.yq" placeholder="请输入仪器名称"/>
|
||||
</template>
|
||||
<template #xs="{row}">
|
||||
<el-input v-model="row.xs" class="full-width-input"/>
|
||||
</template>
|
||||
<template #zkxm="{row}">
|
||||
<el-checkbox v-model="row.zkxm" />
|
||||
</template>
|
||||
<template #cksx="{row}">
|
||||
<el-input v-model="row.cksx" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #ckxx="{row}">
|
||||
<el-input v-model="row.ckxx" class="full-width-input"></el-input>
|
||||
</template>
|
||||
<template #dyckz="{row}">
|
||||
<el-input v-model="row.dyckz" class="full-width-input"></el-input>
|
||||
</template>
|
||||
</CustomTable>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { LabInstr } from '@/types';
|
||||
import { ref } from 'vue'
|
||||
import { XmInfoVs } from '@/types';
|
||||
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
|
||||
import {ElMessageBox} from 'element-plus'
|
||||
|
||||
const props = defineProps({
|
||||
// 显示数据
|
||||
dataList: {
|
||||
type: Array,
|
||||
type: Array<XmInfoVs>,
|
||||
required: true,
|
||||
default: () => []
|
||||
},
|
||||
formData: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: {}
|
||||
}
|
||||
});
|
||||
|
||||
@ -29,13 +54,14 @@ const props = defineProps({
|
||||
|
||||
//const yq = ref<string>('');
|
||||
const tableRef = ref<any>();
|
||||
const yqList = ref<any>([]);
|
||||
const yqList = ref<Array<XmInfoVs>>([]);
|
||||
const columns = ref([
|
||||
{ prop: 'xz', label: '选择', visible: true, align: 'center', width: 50 },
|
||||
{ prop: 'yq', label: '仪器代号', visible: true, align: 'center', width: 150 },
|
||||
{ prop: 'yqmc', label: '仪器名称', visible: true, align: 'center', width: 200},
|
||||
{ prop: 'xs', label: '调整系数', visible: true, align: 'center', width: 100 },
|
||||
{ prop: 'zkxm', label: '质控', visible: true, align: 'center', width: 100 }
|
||||
{ prop: 'yq', label: '仪器代号', visible: true, align: 'center', slot: 'yq', width: 150 },
|
||||
{ prop: 'xs', label: '调整系数', visible: true, align: 'center', slot: 'xs', width: 100 },
|
||||
{ prop: 'zkxm', label: '质控', visible: true, align: 'center', slot: 'zkxm', width: 40 },
|
||||
{ prop: 'cksx', label: '参考上限', visible: true, align: 'center',slot: 'cksx', width: 100 },
|
||||
{ prop: 'ckxx', label: '参考下限', visible: true, align: 'center',slot: 'ckxx', width: 100 },
|
||||
{ prop: 'dyckz', label: '打印参考值', visible: true, align: 'center',slot: 'dyckz', width: 100 },
|
||||
]);
|
||||
const tableConfig = ref({
|
||||
border: true, // 边框
|
||||
@ -43,6 +69,10 @@ const tableConfig = ref({
|
||||
highlightCurrentRow: true, // 高亮当前行
|
||||
// cellStyle: cellStyleHd
|
||||
})
|
||||
const selectRow = ref<XmInfoVs>({
|
||||
yq: '',
|
||||
xmid: 0
|
||||
})
|
||||
|
||||
|
||||
//退拽属性
|
||||
@ -61,14 +91,30 @@ const handInputChange = () => {
|
||||
}
|
||||
|
||||
const onClickAdd = () => {
|
||||
|
||||
const newData: XmInfoVs = {
|
||||
yq: '',
|
||||
xmid: props.formData.xmid,
|
||||
}
|
||||
yqList.value.push(newData)
|
||||
}
|
||||
|
||||
const onClickDel = () => {
|
||||
const onClickDel = async () => {
|
||||
if(selectRow.value){
|
||||
await ElMessageBox.confirm('是否要删除选中的数据?','Warning',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
yqList.value = yqList.value.filter(item => item.yq != selectRow.value.yq);
|
||||
}
|
||||
}
|
||||
|
||||
const onRowClick = (row: any) => {
|
||||
selectRow.value = row
|
||||
}
|
||||
|
||||
onActivated(() =>{
|
||||
yqList.value = props.dataList;
|
||||
yqList.value = Array.isArray(props.dataList) ? props.dataList : [];
|
||||
})
|
||||
</script>
|
||||
Loading…
x
Reference in New Issue
Block a user