大屏和环林卡口管理
This commit is contained in:
27
src/views/home/components/Checkpoint.vue
Normal file
27
src/views/home/components/Checkpoint.vue
Normal file
@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div class="mian_box">
|
||||
<div class="item">检查站:<span @click="openDialog('jcz')">2</span></div>
|
||||
<div class="item">卡口:<span @click="openDialog('kk')">8</span></div>
|
||||
</div>
|
||||
<pointList v-model="pointListShow" :lxType="lxType" />
|
||||
</template>
|
||||
<script setup>
|
||||
import pointList from "./pointList.vue";
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
const lxType = ref();
|
||||
const pointListShow = ref(false);
|
||||
const openDialog = (val) => {
|
||||
lxType.value = val;
|
||||
pointListShow.value = true;
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mian_box {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@ -9,7 +9,7 @@
|
||||
<span class="checkpoint-count">{{ item.personSl }} 人</span>
|
||||
</div>
|
||||
</div>
|
||||
<Empty :show="checkpoints.length == 0" />
|
||||
<Empty :show="checkpoints.length == 0" :imgSize="100" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
169
src/views/home/components/pointList.vue
Normal file
169
src/views/home/components/pointList.vue
Normal file
@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="modelValue"
|
||||
width="60%"
|
||||
custom-class="container"
|
||||
@close="close"
|
||||
:title="title"
|
||||
align-center
|
||||
append-to-body
|
||||
>
|
||||
<MyTable
|
||||
:tableData="pageData.tableData"
|
||||
:tableColumn="pageData.tableColumn"
|
||||
:tableHeight="pageData.tableHeight"
|
||||
:key="pageData.keyCount"
|
||||
:tableConfiger="pageData.tableConfiger"
|
||||
:controlsWidth="pageData.controlsWidth"
|
||||
@chooseData="chooseData"
|
||||
>
|
||||
<template #sblx="{ row }">
|
||||
<dict-tag :options="D_BZ_SBLX" :value="row.sblx" :tag="false" />
|
||||
</template>
|
||||
<template #sblxdm="{ row }">
|
||||
<dict-tag :options="D_BZ_GZSBLX" :value="row.sblxdm" :tag="false" />
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
<el-link type="primary" @click="enterLevel(row)">详情</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
<div class="footInfoBtn flex just-between align-center">
|
||||
<Pages
|
||||
@changeNo="changeNo"
|
||||
@changeSize="changeSize"
|
||||
:tableHeight="550"
|
||||
:pageConfiger="{ ...pageData.pageConfiger, total: pageData.total }"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, watch, getCurrentInstance } from "vue";
|
||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import Pages from "@/components/aboutTable/Pages.vue";
|
||||
import { ysSxtgetPageList } from "@/api/yszx";
|
||||
import { useRouter } from "vue-router";
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BZ_SBLX, D_BZ_GZSBLX } = proxy.$dict("D_BZ_SBLX", "D_BZ_GZSBLX");
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
lxType: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
});
|
||||
const emit = defineEmits(["update:modelValue", "choose"]);
|
||||
const dataLsit = ref();
|
||||
const title = ref();
|
||||
const pageData = reactive({
|
||||
tableData: [{ ssbm: "测试" }], //表格数据
|
||||
keyCount: 0,
|
||||
tableHeight: 500,
|
||||
tableConfiger: {
|
||||
rowHieght: 61,
|
||||
showSelectType: "radio",
|
||||
loading: false
|
||||
},
|
||||
total: 0,
|
||||
pageConfiger: {
|
||||
pageSize: 20,
|
||||
pageCurrent: 1
|
||||
}, //分页
|
||||
controlsWidth: 180, //操作栏宽度
|
||||
tableColumn: [
|
||||
{ label: "所属部门", prop: "ssbm", showOverflowTooltip: true },
|
||||
{ label: "检查站名称", prop: "sbmc", showOverflowTooltip: true },
|
||||
{ label: "环林检查站类型", prop: "sbbh", showOverflowTooltip: true },
|
||||
{ label: "执勤类型", prop: "csmc", showOverflowTooltip: true },
|
||||
{ label: "检查站地址", prop: "dzmc", showOverflowTooltip: true }
|
||||
]
|
||||
});
|
||||
watch(
|
||||
() => props.lxType,
|
||||
(val) => {
|
||||
if (val == "jcz") {
|
||||
title.value = "检查站";
|
||||
pageData.tableColumn = [
|
||||
{ label: "所属部门", prop: "ssbm", showOverflowTooltip: true },
|
||||
{ label: "检查站名称", prop: "sbmc", showOverflowTooltip: true },
|
||||
{ label: "环林检查站类型", prop: "sbbh", showOverflowTooltip: true },
|
||||
{ label: "执勤类型", prop: "csmc", showOverflowTooltip: true },
|
||||
{ label: "检查站地址", prop: "dzmc", showOverflowTooltip: true }
|
||||
];
|
||||
} else {
|
||||
title.value = "卡口信息";
|
||||
pageData.tableColumn = [
|
||||
{ label: "所属部门", prop: "ssbm", showOverflowTooltip: true },
|
||||
{ label: "卡口名称", prop: "sbmc", showOverflowTooltip: true },
|
||||
{ label: "环林卡口类型", prop: "sbbh", showOverflowTooltip: true },
|
||||
{ label: "执勤类型", prop: "csmc", showOverflowTooltip: true },
|
||||
{ label: "卡口地址", prop: "dzmc", showOverflowTooltip: true }
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
const getList = () => {
|
||||
pageData.tableConfiger.loading = true;
|
||||
const promes = {
|
||||
// ssbm: propsGzyList.ssbm,
|
||||
pageSize: pageData.pageConfiger.pageSize,
|
||||
pageCurrent: pageData.pageConfiger.pageCurrent
|
||||
};
|
||||
ysSxtgetPageList(promes)
|
||||
.then((res) => {
|
||||
pageData.tableData = res.records || [];
|
||||
pageData.total = res.total || 0;
|
||||
})
|
||||
.finally(() => {
|
||||
pageData.tableConfiger.loading = false;
|
||||
});
|
||||
};
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newVal) => {
|
||||
// getList();
|
||||
}
|
||||
);
|
||||
const changeNo = (val) => {
|
||||
pageData.pageConfiger.pageCurrent = val;
|
||||
getList();
|
||||
};
|
||||
const changeSize = (val) => {
|
||||
pageData.pageConfiger.pageSize = val;
|
||||
getList();
|
||||
};
|
||||
const chooseData = (val) => {
|
||||
if (pageData.tableConfiger.showSelectType === "radio") {
|
||||
dataLsit.value = val[0];
|
||||
} else {
|
||||
dataLsit.value = val;
|
||||
}
|
||||
};
|
||||
const close = () => {
|
||||
emit("update:modelValue", false);
|
||||
};
|
||||
const submitDate = () => {
|
||||
emit("choose", dataLsit.value);
|
||||
close();
|
||||
};
|
||||
const enterLevel = (val) => {
|
||||
const hrefs = router.resolve({
|
||||
name: "StationLevel",
|
||||
path: "/StationLevel",
|
||||
query: { id: val.id, name: val.jczmc }
|
||||
});
|
||||
window.open(hrefs.href, "_blank");
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
color: #000000;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user