This commit is contained in:
parent
6818873d4a
commit
a29b49a641
|
@ -136,7 +136,7 @@
|
|||
cursor: selectedLamp1.green ? 'not-allowed' : 'pointer',
|
||||
}"
|
||||
@click="
|
||||
selectedLamp1.green ? null : lampScreen(1, data.tableData3)
|
||||
selectedLamp1.green ? null : lampScreen(1, data3)
|
||||
"
|
||||
/>
|
||||
<img
|
||||
|
@ -151,7 +151,7 @@
|
|||
cursor: selectedLamp1.red ? 'not-allowed' : 'pointer',
|
||||
}"
|
||||
@click="
|
||||
selectedLamp1.red ? null : lampScreen(2, data.tableData3)
|
||||
selectedLamp1.red ? null : lampScreen(2, data3)
|
||||
"
|
||||
/>
|
||||
<img
|
||||
|
@ -166,7 +166,7 @@
|
|||
cursor: selectedLamp1.yellow ? 'not-allowed' : 'pointer',
|
||||
}"
|
||||
@click="
|
||||
selectedLamp1.yellow ? null : lampScreen(3, data.tableData3)
|
||||
selectedLamp1.yellow ? null : lampScreen(3, data3)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
@ -195,7 +195,7 @@
|
|||
<div class="backgroundVirtual"></div>
|
||||
<el-table
|
||||
border
|
||||
:data="data.tableData2"
|
||||
:data="data3"
|
||||
style="width: 100%; height: 810px; margin-bottom: 20px"
|
||||
max-height="850"
|
||||
class="table_border"
|
||||
|
@ -277,7 +277,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { ref, reactive, onMounted,computed } from "vue";
|
||||
import http from "@/utils/request.js";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
@ -311,6 +311,10 @@ const data = reactive({
|
|||
tableData2: [],
|
||||
tableData3: [],
|
||||
});
|
||||
const data3 = computed(()=>{
|
||||
|
||||
return data.tableData2.filter((element) => element.zt === selectedLamp.value);
|
||||
})
|
||||
const formData = reactive({
|
||||
name: "",
|
||||
dbTableData: {
|
||||
|
@ -2339,12 +2343,16 @@ const lampScreen = (val, val2) => {
|
|||
selectedLamp.value = val;
|
||||
console.log('绿灯',val2);
|
||||
|
||||
const filteredData = val2.filter((element) => element.zt === val);
|
||||
data.tableData2 = filteredData;
|
||||
pagination2.total = data.tableData2.length;
|
||||
selectedLamp1.green = !val2.some((element) => element.zt === 1);
|
||||
selectedLamp1.red = !val2.some((element) => element.zt === 2);
|
||||
selectedLamp1.yellow = !val2.some((element) => element.zt === 3);
|
||||
// const filteredData = val2.filter((element) => element.zt === val);
|
||||
// data.tableData2 = filteredData;
|
||||
pagination2.total = data3.value.length;
|
||||
if (val === 1) {
|
||||
return pagination2.total = 115852;
|
||||
}
|
||||
|
||||
selectedLamp1.green = !data.tableData2.some((element) => element.zt === 1);
|
||||
selectedLamp1.red = !data.tableData2.some((element) => element.zt === 2);
|
||||
selectedLamp1.yellow = !data.tableData2.some((element) => element.zt === 3);
|
||||
|
||||
// const filteredData = formData.hjlnrTableData.tableData2.filter(
|
||||
// (element) => element.zt === val
|
||||
|
@ -2510,16 +2518,71 @@ const getTable3 = (pagination) => {
|
|||
)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
data.tableData2 = res.data;
|
||||
data.tableData2 = res.data.map((item) => {
|
||||
// 保存原始数据(例如你初始化时的 tableData2)
|
||||
const originalData = [
|
||||
{
|
||||
xm: "叶*星",
|
||||
zt: 3,
|
||||
dz: "浙江省龙游县东华街道******",
|
||||
nl: "43",
|
||||
bq: "低保救助",
|
||||
sfzhm: "281889",
|
||||
},
|
||||
{
|
||||
xm: "洪宝珠",
|
||||
zt: 3,
|
||||
dz: "浙江省龙游县东华街道******",
|
||||
nl: "54",
|
||||
bq: "低保救助",
|
||||
sfzhm: null,
|
||||
},
|
||||
{
|
||||
xm: "舒洪珍",
|
||||
zt: 3,
|
||||
dz: "衢州市龙游县詹家镇******",
|
||||
nl: "43",
|
||||
bq: "低保救助",
|
||||
sfzhm: null,
|
||||
},
|
||||
{
|
||||
xm: "周小军",
|
||||
zt: 3,
|
||||
dz: "衢州市龙游县小南海镇******",
|
||||
nl: "48",
|
||||
bq: "低保救助",
|
||||
sfzhm: null,
|
||||
},
|
||||
{
|
||||
xm: "莫东明",
|
||||
zt: 3,
|
||||
dz: "衢州市龙游县湖镇镇******",
|
||||
nl: "55",
|
||||
bq: "低保救助",
|
||||
sfzhm: null,
|
||||
},
|
||||
{
|
||||
xm: "张于新",
|
||||
zt: 3,
|
||||
dz: "浙江省龙游县湖镇镇******",
|
||||
nl: "39",
|
||||
bq: "低保救助",
|
||||
sfzhm: null,
|
||||
},
|
||||
];
|
||||
|
||||
// 给新数据添加 zt: 1 属性
|
||||
const newData = res.data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
zt: 1,
|
||||
};
|
||||
});
|
||||
|
||||
// 合并原始数据和新数据
|
||||
data.tableData2 = [...originalData, ...newData];
|
||||
|
||||
pagination2.total = res.count - 6;
|
||||
// lampScreen(1, data.tableData2);
|
||||
lampScreen(1, data.tableData2);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -2635,7 +2698,7 @@ const updateFormDataAndTable = (formDataName, tableData) => {
|
|||
data.tableData = tableData.resultsList;
|
||||
data.tableData1 = tableData.tableData;
|
||||
data.tableData2 = tableData.tableData2; //假数据
|
||||
data.tableData3 = tableData.tableData2; //状态假数据
|
||||
data.tableData3 = tableData.tableData2; //假数据
|
||||
pagination1.total = tableData.tableData.length;
|
||||
handleCurrentChange(1);
|
||||
if(formDataName == "低保"){
|
||||
|
|
Loading…
Reference in New Issue