Compare commits

..

No commits in common. "1e75be2bbe18d1486932d8625418395604f89f9f" and "2d2cbb28ba7d522578ebf17c84577cb93d23cc88" have entirely different histories.

2 changed files with 13 additions and 70 deletions

11
src/types/Object.d.ts vendored
View File

@ -116,14 +116,3 @@ export class XmValNew {
jgbz?: string;
}
export class XmInfoVs {
yq: string;
xmid: number;
xs?: number;
zkxm?: string;
cksx?: number;
ckxx?: number;
dyckz?: string;
}

View File

@ -6,47 +6,22 @@
<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" @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>
:config="tableConfig"/>
</div>
</template>
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue'
import { XmInfoVs } from '@/types';
import YQSelectTable from '@/components/SelectTable/YQSelectTable/index.vue'
import {ElMessageBox} from 'element-plus'
import { LabInstr } from '@/types';
import { ref } from 'vue'
const props = defineProps({
// 显示数据
dataList: {
type: Array<XmInfoVs>,
type: Array,
required: true,
default: () => []
},
formData: {
type: Object,
required: false,
default: {}
}
});
@ -54,14 +29,13 @@ const props = defineProps({
//const yq = ref<string>('');
const tableRef = ref<any>();
const yqList = ref<Array<XmInfoVs>>([]);
const yqList = ref<any>([]);
const columns = ref([
{ 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 },
{ 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 }
]);
const tableConfig = ref({
border: true, // 边框
@ -69,10 +43,6 @@ const tableConfig = ref({
highlightCurrentRow: true, // 高亮当前行
// cellStyle: cellStyleHd
})
const selectRow = ref<XmInfoVs>({
yq: '',
xmid: 0
})
//退拽属性
@ -91,30 +61,14 @@ const handInputChange = () => {
}
const onClickAdd = () => {
const newData: XmInfoVs = {
yq: '',
xmid: props.formData.xmid,
}
yqList.value.push(newData)
}
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 onClickDel = () => {
const onRowClick = (row: any) => {
selectRow.value = row
}
onActivated(() =>{
yqList.value = Array.isArray(props.dataList) ? props.dataList : [];
yqList.value = props.dataList;
})
</script>