From 778914265f06262856d1521f40805281206eb677 Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期四, 29 二月 2024 10:45:47 +0800 Subject: [PATCH] feat:安全隐患数据统计 --- src/views/daoAnOffice/right/analysis/index.vue | 1 src/views/daoAnOffice/right/danger/dataTable.vue | 143 ++++++++++++++++++++++++++++++++++++++++------- src/views/daoAnOffice/right/danger/index.vue | 34 +++++++++- 3 files changed, 150 insertions(+), 28 deletions(-) diff --git a/src/views/daoAnOffice/right/analysis/index.vue b/src/views/daoAnOffice/right/analysis/index.vue index 2b282f2..08fc9bd 100644 --- a/src/views/daoAnOffice/right/analysis/index.vue +++ b/src/views/daoAnOffice/right/analysis/index.vue @@ -11,7 +11,6 @@ <template #content> <div class="charts-container"> <div id="analysisChart" ref="analysisChart"></div> - </div> </template> </RightTitle> diff --git a/src/views/daoAnOffice/right/danger/dataTable.vue b/src/views/daoAnOffice/right/danger/dataTable.vue index 0af8c9a..99fd020 100644 --- a/src/views/daoAnOffice/right/danger/dataTable.vue +++ b/src/views/daoAnOffice/right/danger/dataTable.vue @@ -1,16 +1,41 @@ <template> - <div class="container"> - <div class="table-top"> + <div class="container flex flex-col"> + <div class="table-top flex justify-between items-center"> <div class="top-title">瀹夊叏浜嬫晠鍒楄〃</div> <div class="table-select flex"> - <div class="select-item" v-for="selectItem in tableType" :key="selectItem.id">{{ selectItem.type }}</div> + <div class="select-item mr-2 ml-2 cursor-pointer flex items-center" + :class="{ 'item-active': selectItem.isActive }" v-for="selectItem in tableType" :key="selectItem.id">{{ + selectItem.type }}</div> </div> </div> - <div class="table-container"> - <el-table :data="tableData" style="width: 100%"> - <el-table-column prop="date" label="Date" width="180" /> - <el-table-column prop="name" label="Name" width="180" /> - <el-table-column prop="address" label="Address" /> + <div class="table-container flex-1"> + <el-table class="data-table" :data="tableData" :highlight-current-row="false" :stripe="true" + :header-cell-style="{ backgroundColor: 'transparent', color: '#79A5E9', borderColor: '#29466A' }" + :cell-style="{ color: '#79A5E9', borderColor: '#29466A', paddingTop: '10px', paddingBottom: '10px' }" + :row-style="{ backgroundColor: 'transparent' }"> + <el-table-column prop="street" label="闀�/琛楅亾" align="center" /> + <el-table-column label="鍙戠幇鏁伴噺" align="center"> + <template #default="scope"> + <div style="color: #6289E6;"> + {{ scope.row.num1 }} + </div> + </template> + </el-table-column> + + <el-table-column label="涓嬪彂閫氱煡涔�" align="center"> + <template #default="scope"> + <div style="color: #CFB249;"> + {{ scope.row.num2 }} + </div> + </template> + </el-table-column> + <el-table-column label="澶勭疆鏁伴噺" align="center"> + <template #default="scope"> + <div style="color: #2BB06D;"> + {{ scope.row.num3 }} + </div> + </template> + </el-table-column> </el-table> </div> </div> @@ -20,30 +45,46 @@ import { ref } from 'vue'; const tableType = ref([ - { id: 1, type: '鏈湀' }, - { id: 2, type: '鏈' }, + { id: 1, type: '鏈湀', isActive: true }, + { id: 2, type: '鏈', isActive: false }, ]); const tableData = [ { - date: '2016-05-03', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles', + street: '濂庡厜濉旇閬�', + num1: 12, + num2: 5, + num3: 2 }, { - date: '2016-05-02', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles', + street: '濂庡厜濉旇閬�', + num1: 12, + num2: 5, + num3: 2 }, { - date: '2016-05-04', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles', + street: '濂庡厜濉旇閬�', + num1: 12, + num2: 5, + num3: 2 }, { - date: '2016-05-01', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles', + street: '濂庡厜濉旇閬�', + num1: 12, + num2: 5, + num3: 2 + }, + { + street: '濂庡厜濉旇閬�', + num1: 12, + num2: 5, + num3: 2 + }, + { + street: '濂庡厜濉旇閬�', + num1: 12, + num2: 5, + num3: 2 }, ]; </script> @@ -52,4 +93,62 @@ .container { height: 360px; } + +.table-top { + height: 51px; + background-color: rgba(17, 34, 58, 0.6); + border: 1px solid #29466A; + border-bottom: none; +} + +.table-select { + height: 100%; +} + +.top-title { + font-size: 16px; + color: #447ED6; + margin-left: 20px; +} + +.select-item { + padding: 0 14px; + height: 100%; + border-bottom: 2px solid RGBA(98, 137, 230, 0); + color: rgba(94, 134, 194, 1); +} + +.item-active { + color: #fff; + border-color: RGBA(98, 137, 230, 1); +} + +.data-table { + font-size: 14px; + border: 1px solid #29466A; + width: 100%; + height: 100%; + background: transparent; +} + +.table-color1 {} + + + +::v-deep .el-table__inner-wrapper::before { + background-color: transparent; +} + +::v-deep .el-table thead tr { + background-color: rgba(36, 63, 103, 0.6); + +} + +::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td { + background-color: rgba(36, 63, 103, 0.6); +} + +.el-table__fixed-right { + height: 100% !important; +} </style> \ No newline at end of file diff --git a/src/views/daoAnOffice/right/danger/index.vue b/src/views/daoAnOffice/right/danger/index.vue index de7f11a..55bb4fa 100644 --- a/src/views/daoAnOffice/right/danger/index.vue +++ b/src/views/daoAnOffice/right/danger/index.vue @@ -4,34 +4,42 @@ <RightTitle title="瀹夊叏闅愭偅鎯呭喌"> <template #top> <div class="select-container flex"> - <div class="item whitespace-no-wrap cursor-pointer" v-for="item in selectItems" :key="item.itemIndex"> + <div class="item whitespace-no-wrap cursor-pointer" :class="{'select-active': item.isActive}" v-for="item in selectItems" :key="item.itemIndex" + @click="changeSelect(item)"> {{ item.name }} </div> </div> </template> <template #content> - <InfoView v-show="isActive"></InfoView> - <DataView v-show="!isActive"></DataView> + <InfoView :key="selectItems[0].itemIndex" v-show="selectItems[0].isActive"></InfoView> + <DataView :key="selectItems[1].itemIndex" v-show="selectItems[1].isActive"></DataView> + <!-- <TransitionGroup name="fade" mode="out-in"> + + </TransitionGroup> --> </template> </RightTitle> </template> -<script setup lang="ts"> +<script setup> import RightTitle from "@/components/right-title"; import DataView from './dataView.vue'; import InfoView from './infoView.vue'; import { ref } from 'vue'; -let isActive = ref(true); const selectItems = ref([ { itemIndex: 1, name: '瀹夊叏闅愭偅', isActive: false }, { itemIndex: 2, name: '鏁版嵁缁熻', isActive: true }, ]); + +const changeSelect = (selectItem) => { + selectItems.value.map(item => item.isActive = false); + selectItem.isActive = true; +} </script> @@ -47,10 +55,26 @@ background: rgba(67, 102, 155, 0.4); border: 1px solid rgba(47, 91, 157, 0.8); flex-shrink: 0; + color: #5B83BD; +} + +.select-active { + color: #fff; } .item:last-child { margin-right: 0; } +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.5s; +} + +.fade-enter, +.fade-leave-to { + opacity: 0; + transition: opacity 0.5s; + +} </style> \ No newline at end of file -- Gitblit v1.8.0