Browse Source

前端样式

KawsFa 1 year ago
parent
commit
3965213489

File diff suppressed because it is too large
+ 98 - 569
vue_project/package-lock.json


+ 4 - 2
vue_project/package.json

@@ -10,6 +10,8 @@
   "dependencies": {
     "@element-plus/icons": "^0.0.11",
     "@element-plus/icons-vue": "^2.3.1",
+    "@fortawesome/fontawesome-free": "^6.5.2",
+    "@fullcalendar/bootstrap5": "^6.1.13",
     "@fullcalendar/core": "^6.1.13",
     "@fullcalendar/daygrid": "^6.1.13",
     "@fullcalendar/interaction": "^6.1.13",
@@ -19,15 +21,15 @@
     "@fullcalendar/vue3": "^6.1.13",
     "@headlessui/vue": "^1.7.22",
     "@heroicons/vue": "^2.1.3",
-    "@nextui-org/navbar": "^2.0.32",
     "@vue/babel-plugin-jsx": "^1.2.2",
     "@vueuse/components": "^10.10.0",
     "@vueuse/core": "^10.10.0",
     "axios": "^1.7.2",
+    "bootstrap": "^5.3.3",
+    "bootstrap-icons": "^1.11.3",
     "core-js": "^3.8.3",
     "element-plus": "^2.7.4",
     "js-cookie": "^3.0.5",
-    "mdb-ui-kit": "^7.3.0",
     "pinia": "^2.1.7",
     "vue": "^3.2.13",
     "vue-router": "^4.3.2",

+ 0 - 93
vue_project/src/components/demo.vue

@@ -1,93 +0,0 @@
-<template>
-  <FullCalendar ref="fullCalendar" :options="calendarOptions" class="calendar"></FullCalendar>
-  
-</template>
-
-<script>
-import FullCalendar from '@fullcalendar/vue3';
-import dayGridPlugin from '@fullcalendar/daygrid';
-
-export default {
-  components: {
-    FullCalendar
-  },
-  data() {
-    return {
-      calendarOptions: {
-        plugins: [dayGridPlugin],
-        initialView: 'dayGridYear',
-        locale: 'zh-cn', // 设置语言为中国简体中文
-        headerToolbar: {
-          left: 'prev,next today',
-          center: 'title',
-          right: 'dayGridYear,dayGridMonth,dayGridWeek,dayGridDay' // 更新按钮以匹配新的视图
-        },
-        views: {
-          customYearGrid: { // 创建一个新的自定义视图
-            type: 'dayGrid',
-            duration: { months: 12 }, // 覆盖一整年
-            slotDuration: '24:00:00', // 每天显示24小时
-            slotLabelInterval: { hours: 24 }, // 标签间隔为一天
-            slotLabelFormat: [
-              { weekday: 'short', day: 'numeric', omitCommas: true } // 显示星期和日期,去掉逗号
-            ],
-            titleFormat: { year: 'numeric' }, // 日历标题显示年份
-            buttonText: {
-              today: "今天",
-              year: "年",
-              month: "月",
-              week: "周",
-              day: "日",
-              list: "周列表",
-            },
-            dayMaxEvents: true, // 允许多行显示事件
-          },
-        },
-        firstDay: 1,
-        unselectAuto: true,
-        selectable: true,
-        buttonText: {
-          today: "今天",
-          year: "年",
-          month: "月",
-          week: "周",
-          day: "日",
-          list: "周列表",
-        },
-        height: 1150,
-        validRange: this.validRange,
-        events: [
-          {
-            start: '2024-11-10T10:00:00',
-            end: '2024-11-10T16:00:00',
-            display: 'background'
-          }
-        ],
-        datesSet: this.datesSet,
-        eventClick: this.handleEventClick,
-        dateClick: this.handleDateClick,
-        eventDrop: this.calendarEventDropOrResize,
-        eventResize: this.calendarEventResize,
-        displayEventTime: false,
-      },
-      validRange: {
-        start: "2021-01-01",
-        end: "2021-12-31",
-      },
-    };
-  },
-  methods: {
-    // ...(之前的methods内容保持不变)
-  },
-};
-</script>
-
-<style scoped>
-.calendar {
-  width: 70%;
-  height: 100%;
-  margin-left: 250px;
-  margin-top: 70px;
-  margin-bottom: 70px;
-}
-</style>

+ 3 - 3
vue_project/src/components/index.vue

@@ -6,20 +6,20 @@
   <!-- header -->
   <indexHeader/>
 </div>
-<demoVue/>
+<indexBody/>
 
 </template>
 
 <script>
 import indexNavVue from './indexNav.vue';
 import indexHeader from './indexHeader.vue';
-import demoVue from './demo.vue';
+import indexBody from './indexBody.vue';
 
 export default {
     components: {
         indexNavVue,
         indexHeader,
-        demoVue,
+        indexBody,
     }
 }
 </script>

+ 131 - 0
vue_project/src/components/indexBody.vue

@@ -0,0 +1,131 @@
+<template>
+  <FullCalendar ref="fullCalendar" :options="calendarOptions" class="calendar" id="calendar" />
+</template>
+<script>
+import FullCalendar from "@fullcalendar/vue3";
+import dayGridPlugin from "@fullcalendar/daygrid";
+import timeGridPlugin from "@fullcalendar/timegrid";
+import interactionPlugin from "@fullcalendar/interaction";
+import listPlugin from "@fullcalendar/list";
+import multiMonthPlugin from "@fullcalendar/multimonth";
+import bootstrap5Plugin from '@fullcalendar/bootstrap5';
+
+
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: { FullCalendar },
+  data() {
+    return {
+      calendarOptions: {
+        plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin, listPlugin, multiMonthPlugin, bootstrap5Plugin],
+        initialView: "dayGridYear",
+        locale: "zh",
+        firstDay: 1,
+        unselectAuto: true, //当点击页⾯⽇历以外的位置时,是否⾃动取消当前的选中状态。false是不取消
+        selectable: true, //是否可以选中日历格
+        editable: true,
+        
+        buttonText: {
+          prev:"上一页",
+          next:"下一页",
+          today: "今天",
+          month: "月",
+          week: "周",
+          day: "日",
+          list: "周列表",
+        },
+        headerToolbar: {
+          left: "prev,next today",
+          center: "title",
+          right: "dayGridYear,multiMonthYearGrid,multiMonthYearStack,dayGridMonth,timeGridWeek,timeGridDay listWeek",
+          themeSystem: "bootstrap5",
+        },
+        views: {
+          multiMonthYearGrid: {
+            type: 'multiMonthYear',
+            buttonText: '年(网格)'
+          },
+          multiMonthYearStack: {
+            type: 'multiMonthYear',
+            buttonText: '年(叠)',
+            multiMonthMaxColumns: 1
+          },
+          dayGridYear: {
+            buttonText: '年(连续的)'
+          }
+        },
+
+        height: 1150,
+        validRange: this.validRange, //设置可显示的总日期范围
+        events: [
+
+        {
+          id: 111,
+          title: "国庆节放假",
+          start: "2022-10-01",
+          end: "2022-10-08",
+          color: "#ffcc99",
+          editable: true, //允许拖动缩放,不写默认就是false
+          overlap: true, //允许时间重叠,即可以与其他事件并存,不写默认就是false
+        },
+        {
+          id: 222,
+          title: "五一劳动节放假",
+          start: "2022-05-01",
+          end: "2022-05-06",
+          color: "#ffcc99",
+          editable: true, //允许拖动缩放
+        },
+        {
+          id: 333,
+          title: "端午节放假",
+          start: "2024-06-08",
+          end: "2024-06-11",
+          color: "#ffcc99",
+          editable: true,
+        },
+        ], //背景色 (添加相同时间的背景色时颜色会重叠)
+        datesSet: this.datesSet, //日期渲染;修改日期范围后触发
+        eventMouseEnter: this.handleEventMouseEnter, //点击日程触发
+        dateClick: this.handleDateClick, //点击日期触发
+        eventDrop: this.calendarEventDropOrResize, //拖动事件触发
+        eventResize: this.calendarEventDropOrResize, //缩放事件触发
+        displayEventTime: false, //不显示具体时间
+        themeSystem: 'bootstrap5',
+        aspectRatio: 1.2, //宽高比
+
+
+      },
+      validRange: {
+        start: "2022-08-26",
+        end: "2023-02-16",
+      },
+    };
+  },
+  methods: {
+    datesSet(info) {
+      //注意:该方法在页面初始化时就会触发一次
+      console.log(info);
+      // this.search()  //请求本页数据
+      
+    },
+    handleEventClick(info) { },
+    handleDateClick(info) { },
+    calendarEventDropOrResize(info) { },
+  },
+};
+
+</script>
+
+<style scoped>
+.calendar {
+  width: 70%;
+  height: 100%;
+  margin-left: 250px;
+  margin-top: 70px;
+  margin-bottom: 70px;
+}
+
+
+</style>

+ 2 - 0
vue_project/src/main.js

@@ -12,6 +12,8 @@ import 'element-plus/theme-chalk/index.css';
 // 引入pinia
 import pinia from './stores'  ;//引入
 import './assets/css/Tailwind.css';
+// bootstrap
+import 'bootstrap/dist/css/bootstrap.min.css';
 
 
 

+ 1 - 1
vue_project/src/router/router.js

@@ -30,7 +30,7 @@ export const staticRoutes = [
     {
       //注册
       path: "/demo",
-      component: () => import("../components/demo.vue"),
+      component: () => import("../components/indexBody.vue"),
       name: "demo",
     }
     // {

Some files were not shown because too many files changed in this diff