ezhizao_zx 5 mesi fa
parent
commit
7f01df5a2b
1 ha cambiato i file con 47 aggiunte e 7 eliminazioni
  1. 47 7
      src/views/index.vue

+ 47 - 7
src/views/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="page-container column-container">
-    <el-row :gutter="24">
-      <el-col :span="8">
+    <el-row :gutter="24" style="margin-left: 10px;">
+      <el-col :span="8" class="notifications-label">
         <!-- <div class="dashboard-total-item">
           <img :src="totalIcon2" />
           <div class="dashboard-total-item-label">
@@ -13,6 +13,20 @@
           </div>
           <div class="number-label">{{ totalCompanies }} 人</div>
         </div> -->
+        <div class="notifications-header">公告</div>
+        <el-card v-for="item in notifications" style="width: 100%;margin-bottom: 5px;" shadow="always">
+          <template #default>
+            <div style="display: flex; flex-direction: row;">
+              <i class="fa fa-bell-o" aria-hidden="true"
+                style="display: inline-block; height: 25px; line-height: 25px;" />
+              <div style="margin-left: 5px;display: inline-block; height: 25px; line-height: 25px;">{{ item.title }}
+              </div>
+            </div>
+          </template>
+        </el-card>
+        <!-- <el-row v-for="item in notifications" style="padding: 5px 10px;">
+          {{ item.title }}
+        </el-row> -->
       </el-col>
       <el-col :span="8">
         <!-- <div class="dashboard-total-item">
@@ -28,7 +42,7 @@
         </div> -->
       </el-col>
     </el-row>
-    <div class="statistic-container">
+    <!-- <div class="statistic-container">
       <el-row :gutter="16">
         <el-col :span="12">
           <div class="item-statistic-container" id="information-statistic"></div>
@@ -37,16 +51,14 @@
           <div class="item-statistic-container" id="appointment-statistic"></div>
         </el-col>
       </el-row>
-    </div>
+    </div> -->
   </div>
 </template>
 <script setup>
 // import totalIcon2 from '@/assets/images/dashboard-total-icon-2.png'
 // import totalIcon3 from '@/assets/images/dashboard-total-icon-3.png'
 import { parseTime } from '@/utils/tools.js'
-
-import {
-} from '@/api/business/productionTask'
+import { listNotification } from '@/api/business/notification'
 
 // import { index } from '@/api/business/production'
 
@@ -125,14 +137,22 @@ let identityMonthTotal = ref(0)
 
 let currentMonth = ref('')
 let statisticDom, statistic
+const notifications = ref([])
 
 onMounted(() => {
   currentMonth.value = parseTime(new Date(), '{y}-{m}')
   //statisticDom = document.getElementById('information-statistic')
   //statistic = echarts.init(statisticDom)
   //getCurrentMonthDayArr()
+  getList()
 })
 
+function getList() {
+  listNotification({}).then(res => {
+    notifications.value = res.rows
+  })
+}
+
 const getCurrentMonthDayArr = (dateStr) => {
   // 获取当前日期
   var currentDate = dateStr ? new Date(dateStr) : new Date()
@@ -168,6 +188,26 @@ const handleChangeMonth = (val) => {
 </script>
 
 <style scoped>
+.notifications-header {
+  height: 30px;
+  margin: 10px 5px;
+  font-size: 20px;
+  padding: 0 5px;
+}
+
+:deep(.notifications-label .el-card__body) {
+  padding: 5px 10px !important;
+}
+
+.notifications-label .el-card {
+  border: 1px solid #fdf1aa;
+  border-radius: 2px;
+}
+
+.notifications-label .el-card.is-always-shadow {
+  box-shadow: 0 0 5px #fdf1aa;
+}
+
 .dashboard-total-item {
   display: flex;
   align-items: center;