This commit is contained in:
duanxiaohai 2024-09-14 17:16:32 +08:00
parent 44c19272ba
commit f03b2b831c
2 changed files with 37 additions and 8 deletions

View File

@ -65,7 +65,7 @@
</div> </div>
<el-table <el-table
:data="data.tableData.tableData.yxs" :data="data.tableData"
height="100%" height="100%"
:key="tableKey" :key="tableKey"
:header-cell-style="{ background: 'rgba(0, 143, 205, 0.63)' }" :header-cell-style="{ background: 'rgba(0, 143, 205, 0.63)' }"
@ -131,6 +131,7 @@
<script setup> <script setup>
import { import {
onMounted, onMounted,
onBeforeMount,
reactive, reactive,
ref, ref,
onBeforeUnmount, onBeforeUnmount,
@ -167,6 +168,13 @@ const props = defineProps({
return []; return [];
}, },
}, },
typeId: {
type: String,
default: () => {
return [];
},
},
tableData: { tableData: {
type: Array, type: Array,
default: () => { default: () => {
@ -235,6 +243,7 @@ const cancelEvent = () => {
const dialogShow = ref(); const dialogShow = ref();
const data = reactive({ const data = reactive({
title: "", title: "",
typeId: "",
columns: [], columns: [],
tableData: [], tableData: [],
character: [], character: [],
@ -262,15 +271,23 @@ watch(
dialogShow.value = newVal; dialogShow.value = newVal;
// data.tableData = props.tableData; // data.tableData = props.tableData;
data.columns = props.columns; data.columns = props.columns;
console.log("状态5", props.columns);
}
);
watch(
() => props.typeId,
(newVal, oldVal) => {
dialogShow.value = newVal;
data.typeId = props.typeId;
console.log("状态6", props.typeId);
} }
); );
watch( watch(
() => props.tableData, () => props.tableData,
(newVal, oldVal) => { (newVal, oldVal) => {
data.tableData = props.tableData; data.tableData = props.tableData;
console.log("状态7", props.tableData);
console.log("状态1", data); // tableKey.value = Math.random();
tableKey.value = Math.random();
} }
); );
// watch( // watch(
@ -284,11 +301,21 @@ onMounted(() => {
dialogShow.value = props.dialogShow; dialogShow.value = props.dialogShow;
data.columns = props.columns; data.columns = props.columns;
data.title = props.title; data.title = props.title;
data.typeId = props.typeId;
data.tableData = props.tableData; data.tableData = props.tableData;
console.log("状态", data); console.log("状态", props.tableData);
// const paginationTotal = document.querySelector(".el-pagination__total"); // const paginationTotal = document.querySelector(".el-pagination__total");
// paginationTotal.innerText = ` ${props.pagination.total} `; // paginationTotal.innerText = ` ${props.pagination.total} `;
}); });
// onBeforeMount(() => {
// dialogShow.value = props.dialogShow;
// data.columns = props.columns;
// data.title = props.title;
// data.typeId = props.typeId;
// data.tableData = props.tableData;
// console.log("3", data);
// });
const closeDialog = () => { const closeDialog = () => {
dialogShow.value = false; dialogShow.value = false;

View File

@ -215,9 +215,9 @@
<DialogLamp <DialogLamp
:dialogShow="dialogShow" :dialogShow="dialogShow"
:title="tableType.title" :title="tableType.title"
:typeId="tableType.typeId"
:tableData="tableType.data" :tableData="tableType.data"
:columns="tableType.columns" :columns="tableType.columns"
:character="tableType.columns"
@close="closeJj" @close="closeJj"
> >
</DialogLamp> </DialogLamp>
@ -424,7 +424,7 @@ const tableType = reactive({
{ {
label: "姓名", label: "姓名",
property: "xm", property: "xm",
width: "90", width: "110",
}, },
{ {
label: "结果", label: "结果",
@ -475,7 +475,9 @@ const statusDetails = (val) => {
}); });
} else { } else {
getTable1(tableType); getTable1(tableType);
dialogShow.value = true; setTimeout(() => {
dialogShow.value = true;
}, 300);
} }
}; };
// //