This commit is contained in:
duanxiaohai 2024-09-05 16:31:52 +08:00
parent c9f0f539f1
commit b79bf26ca6
2 changed files with 117 additions and 67 deletions

BIN
dist.zip Normal file

Binary file not shown.

View File

@ -125,11 +125,43 @@
<div v-if="data.name == '老年人福利补贴'" class="lampState"> <div v-if="data.name == '老年人福利补贴'" class="lampState">
<div> <div>
<img <img
v-for="n in 9" :src="
:key="n" selectedLamp1.green
:src="lampImages[n]" ? lampImages[7]
@click="lampScreen(n)" : selectedLamp == 1
:class="{ selected: selectedLamp == n }" ? lampImages[1]
: lampImages[4]
"
:style="{
cursor: selectedLamp1.green ? 'not-allowed' : 'pointer',
}"
@click="selectedLamp1.green ? null : lampScreen(1)"
/>
<img
:src="
selectedLamp1.red
? lampImages[8]
: selectedLamp == 2
? lampImages[2]
: lampImages[5]
"
:style="{
cursor: selectedLamp1.red ? 'not-allowed' : 'pointer',
}"
@click="selectedLamp1.red ? null : lampScreen(2)"
/>
<img
:src="
selectedLamp1.yellow
? lampImages[9]
: selectedLamp == 3
? lampImages[3]
: lampImages[6]
"
:style="{
cursor: selectedLamp1.yellow ? 'not-allowed' : 'pointer',
}"
@click="selectedLamp1.yellow ? null : lampScreen(3)"
/> />
</div> </div>
</div> </div>
@ -175,7 +207,7 @@
<template #default="scope"> <template #default="scope">
<!-- 状态 --> <!-- 状态 -->
<div v-if="item.property == 'zt'"> <div v-if="item.property == 'zt'">
<div v-for="index in 9" :key="index"> <div v-for="index in 3" :key="index">
<img <img
style="width: 30px; height: 30px" style="width: 30px; height: 30px"
v-if="scope.row.zt == index" v-if="scope.row.zt == index"
@ -220,13 +252,13 @@ import { useRouter, useRoute } from "vue-router";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import tools from "@/utils/tools"; import tools from "@/utils/tools";
import lamp1 from "../assets/sy-table/lampGreen1.png"; import lamp1 from "../assets/sy-table/lampGreen1.png";
import lamp2 from "../assets/sy-table/lampGreen2.png"; import lamp2 from "../assets/sy-table/lampRed1.png";
import lamp3 from "../assets/sy-table/lampGreen3.png"; import lamp3 from "../assets/sy-table/lampYellow1.png";
import lamp4 from "../assets/sy-table/lampRed1.png"; import lamp4 from "../assets/sy-table/lampGreen2.png";
import lamp5 from "../assets/sy-table/lampRed2.png"; import lamp5 from "../assets/sy-table/lampRed2.png";
import lamp6 from "../assets/sy-table/lampRed3.png"; import lamp6 from "../assets/sy-table/lampYellow2.png";
import lamp7 from "../assets/sy-table/lampYellow1.png"; import lamp7 from "../assets/sy-table/lampGreen3.png";
import lamp8 from "../assets/sy-table/lampYellow2.png"; import lamp8 from "../assets/sy-table/lampRed3.png";
import lamp9 from "../assets/sy-table/lampYellow3.png"; import lamp9 from "../assets/sy-table/lampYellow3.png";
const router = useRouter(); const router = useRouter();
const routers = useRoute(); const routers = useRoute();
@ -906,57 +938,57 @@ const formData = reactive({
bzlx: "2", bzlx: "2",
}, },
{ // {
xm: "罗*华", // xm: "*",
zt: 3, // zt: 3,
dz: "浙江省龙游县龙*****号", // dz: "*****",
age: "87", // age: "87",
bzlx: "1", // bzlx: "1",
}, // },
{ // {
xm: "罗*华", // xm: "*",
zt: 3, // zt: 3,
dz: "浙江省龙游县龙*****号", // dz: "*****",
age: "87", // age: "87",
bzlx: "1", // bzlx: "1",
}, // },
{ // {
xm: "罗*华", // xm: "*",
zt: 3, // zt: 3,
dz: "浙江省龙游县龙*****号", // dz: "*****",
age: "87", // age: "87",
bzlx: "1", // bzlx: "1",
}, // },
{ // {
xm: "罗*华", // xm: "*",
zt: 3, // zt: 3,
dz: "浙江省龙游县龙*****号", // dz: "*****",
age: "87", // age: "87",
bzlx: "1", // bzlx: "1",
}, // },
{ // {
xm: "罗*华", // xm: "*",
zt: 3, // zt: 3,
dz: "浙江省龙游县龙*****号", // dz: "*****",
age: "87", // age: "87",
bzlx: "1", // bzlx: "1",
}, // },
{ // {
xm: "罗*华", // xm: "*",
zt: 3, // zt: 3,
dz: "浙江省龙游县龙*****号", // dz: "*****",
age: "87", // age: "87",
bzlx: "1", // bzlx: "1",
}, // },
{ // {
xm: "罗*华", // xm: "*",
zt: 3, // zt: 3,
dz: "浙江省龙游县龙*****号", // dz: "*****",
age: "87", // age: "87",
bzlx: "1", // bzlx: "1",
}, // },
{ {
xm: "周*田", xm: "周*田",
zt: 4, zt: 4,
@ -1901,13 +1933,31 @@ const lampImages = {
9: lamp9, 9: lamp9,
}; };
const selectedLamp = ref(null); const selectedLamp = ref(null);
const selectedLamp1 = reactive({
green: false,
red: false,
yellow: false,
});
const lampScreen = (val) => { const lampScreen = (val) => {
if (selectedLamp.value === val) {
return;
}
selectedLamp.value = val; selectedLamp.value = val;
const filteredData = formData.hjlnrTableData.tableData2.filter( const filteredData = formData.hjlnrTableData.tableData2.filter(
(element) => element.zt === val (element) => element.zt === val
); );
data.tableData2 = filteredData; data.tableData2 = filteredData;
// console.log(val, data.tableData2);
selectedLamp1.green = !formData.hjlnrTableData.tableData2.some(
(element) => element.zt === 1
);
selectedLamp1.red = !formData.hjlnrTableData.tableData2.some(
(element) => element.zt === 2
);
selectedLamp1.yellow = !formData.hjlnrTableData.tableData2.some(
(element) => element.zt === 3
);
console.log(111, selectedLamp1, val);
}; };
const getTable = (pagination) => { const getTable = (pagination) => {
@ -2528,11 +2578,11 @@ onMounted(() => {
margin-right: 20px; margin-right: 20px;
} }
} }
.selected { // .selected {
border-radius: 50%; // border-radius: 50%;
background-color: rgba(255, 255, 255, 0.3); // background-color: rgba(255, 255, 255, 0.3);
box-shadow: 0 0 8px rgba(0, 0, 0, 0.5); // box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
} // }
} }
.yd_title::before { .yd_title::before {
content: ""; content: "";