Compare commits
2 Commits
62eaf32b75
...
3af5775112
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3af5775112 | ||
|
|
3e040b6cea |
@ -75,7 +75,7 @@
|
|||||||
<el-col :span="10" :xs="24">
|
<el-col :span="10" :xs="24">
|
||||||
<tabView :tabList="tabList" v-model:activeTab="activeTab" />
|
<tabView :tabList="tabList" v-model:activeTab="activeTab" />
|
||||||
<KeepAlive>
|
<KeepAlive>
|
||||||
<component class="tabDiv" :is="activeTabN" :dataList="tabDataList"></component>
|
<component class="tabDiv" :is="activeTabN" :dataList="tabDataList" :formData="selectRow"></component>
|
||||||
</KeepAlive>
|
</KeepAlive>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -196,6 +196,8 @@ const yqdlFields = ref([
|
|||||||
|
|
||||||
//tab页数据
|
//tab页数据
|
||||||
const tabDataList = ref<any>();
|
const tabDataList = ref<any>();
|
||||||
|
//选中行数据
|
||||||
|
const selectRow = ref();
|
||||||
|
|
||||||
// 仪器
|
// 仪器
|
||||||
const getYqConfig = () => {
|
const getYqConfig = () => {
|
||||||
@ -259,6 +261,7 @@ const changeStauts = () => {
|
|||||||
|
|
||||||
// 选择行变化
|
// 选择行变化
|
||||||
const rowChange = (row: any) => {
|
const rowChange = (row: any) => {
|
||||||
|
selectRow.value = row;
|
||||||
queryXmInfoNewDetailService(row.xmid,row.yq,row.xmdh).then((res: any) => {
|
queryXmInfoNewDetailService(row.xmid,row.yq,row.xmdh).then((res: any) => {
|
||||||
switch(activeTab.value){
|
switch(activeTab.value){
|
||||||
case 'Basic':
|
case 'Basic':
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<el-button type="primary" @click="bClickDel">删除</el-button>
|
<el-button type="primary" @click="bClickDel">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
|
||||||
:config="tableConfig">
|
:config="tableConfig" @row-click="handRowClick">
|
||||||
<template #qz>
|
<template #qz>
|
||||||
<el-select v-model="selectValue" clearable>
|
<el-select v-model="selectValue" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
@ -25,8 +25,13 @@
|
|||||||
import CustomTable from '@/components/elTable/index.vue'
|
import CustomTable from '@/components/elTable/index.vue'
|
||||||
import { dictData,getDictData } from '@/hooks';
|
import { dictData,getDictData } from '@/hooks';
|
||||||
import { XmValNew } from '@/types';
|
import { XmValNew } from '@/types';
|
||||||
|
import { ElMessageBox } from 'element-plus';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
dataList: {
|
||||||
|
type: Object,
|
||||||
|
default: []
|
||||||
|
},
|
||||||
formData: {
|
formData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: {}
|
||||||
@ -34,7 +39,7 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const tableRef = ref<any>(null);
|
const tableRef = ref<any>(null);
|
||||||
const dataList = ref();
|
const dataList = ref<Array<XmValNew>>();
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{ prop: 'qz', label: '取值', visible: true, align: 'center', slot:'qz', width: 200 },
|
{ prop: 'qz', label: '取值', visible: true, align: 'center', slot:'qz', width: 200 },
|
||||||
{ prop: 'srm', label: '快速输入码', visible: true, align: 'center', width: 100 },
|
{ prop: 'srm', label: '快速输入码', visible: true, align: 'center', width: 100 },
|
||||||
@ -48,6 +53,7 @@ const tableConfig = ref({
|
|||||||
})
|
})
|
||||||
const options = ref()
|
const options = ref()
|
||||||
const selectValue = ref()
|
const selectValue = ref()
|
||||||
|
const selectRow = ref()
|
||||||
|
|
||||||
//退拽属性
|
//退拽属性
|
||||||
const handleColumnDragEnd = (data: any) => {
|
const handleColumnDragEnd = (data: any) => {
|
||||||
@ -62,20 +68,36 @@ const init = () => {
|
|||||||
const bClickAdd = () => {
|
const bClickAdd = () => {
|
||||||
const newData: XmValNew = {
|
const newData: XmValNew = {
|
||||||
xmid: props.formData.xmid,
|
xmid: props.formData.xmid,
|
||||||
qz: ''
|
qz: '',
|
||||||
|
srm: '',
|
||||||
|
jgbz: ''
|
||||||
}
|
}
|
||||||
|
console.log('@@新增行:',newData);
|
||||||
dataList.value.push(newData);
|
dataList.value?.push(newData);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bClickDel = () => {
|
const bClickDel = async () => {
|
||||||
|
await ElMessageBox.confirm('是否要删除选中的数据?','Warning',
|
||||||
|
{
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
//删掉界面上面的数据
|
||||||
|
dataList.value = dataList.value?.filter(item => item.xh != selectRow.value.xh );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const handRowClick = (row:any) => {
|
||||||
|
selectRow.value = row
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
//默认取值
|
//默认取值
|
||||||
getDictData('VA')
|
getDictData('VA')
|
||||||
init()
|
init()
|
||||||
|
console.log('常用取值:',props.formData);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user