index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978
  1. <template>
  2. <view class="page_workspace"
  3. :style="{ paddingTop: statusBarHeight + 160 + 'rpx', paddingBottom: safeAreaBottom + 150 + 'rpx' }">
  4. <page-header></page-header>
  5. <scroll-view scroll-y class="workspace_content">
  6. <!-- 系统列表 -->
  7. <view class="system_list">
  8. <template v-if="largeCard?.visible">
  9. <view class="system_grid_with_large">
  10. <view class="large_card" @click="handleSystemClick(largeCard)">
  11. <image :src="largeCard.image" class="large_icon" mode="aspectFit"></image>
  12. <text class="large_name">{{ largeCard.name }}</text>
  13. </view>
  14. <view class="right_top_grid">
  15. <view v-for="(item, index) in rightTopCards" :key="index" class="small_item"
  16. @click="handleSystemClick(item)">
  17. <image :src="item.image" class="small_icon" mode="aspectFit"></image>
  18. <text class="small_name">{{ item.name }}</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="bottom_grid">
  23. <view v-for="(item, index) in bottomCards" :key="index" class="small_item"
  24. @click="handleSystemClick(item)">
  25. <image :src="item.image" class="small_icon" mode="aspectFit"></image>
  26. <text class="small_name">{{ item.name }}</text>
  27. </view>
  28. </view>
  29. </template>
  30. <template v-else>
  31. <view class="system_grid_full">
  32. <view v-for="(item, index) in allSmallCards" :key="index" class="small_item"
  33. @click="handleSystemClick(item)">
  34. <image :src="item.image" class="small_icon" mode="aspectFit"></image>
  35. <text class="small_name">{{ item.name }}</text>
  36. </view>
  37. </view>
  38. </template>
  39. </view>
  40. <!-- 校历安排 -->
  41. <view class="calendar_section">
  42. <view class="calendar_header">
  43. <text class="section_title">校历安排</text>
  44. <text class="view_schedule" @click="handleViewSchedule">查看日程</text>
  45. </view>
  46. <!-- 日历工具栏 -->
  47. <view class="calendar_toolbar">
  48. <view class="year_month_select">
  49. <picker :value="yearIndex" :range="yearList" @change="handleYearChange" class="select_item">
  50. <view class="select_content">
  51. <text class="select_text">{{ yearList[yearIndex] }}</text>
  52. <uni-icons type="down" size="20" color="#999999"></uni-icons>
  53. </view>
  54. </picker>
  55. <picker :value="monthIndex" :range="monthList" @change="handleMonthChange" class="select_item">
  56. <view class="select_content">
  57. <text class="select_text">{{ monthList[monthIndex] }}</text>
  58. <uni-icons type="down" size="20" color="#999999"></uni-icons>
  59. </view>
  60. </picker>
  61. </view>
  62. <view class="week_nav">
  63. <view class="nav_btn" @click="handlePrevWeek">
  64. <text class="nav_text">上一周</text>
  65. </view>
  66. <view class="nav_btn" @click="handleNextWeek">
  67. <text class="nav_text">下一周</text>
  68. </view>
  69. </view>
  70. </view>
  71. <!-- 日历网格 -->
  72. <view v-if="isLoading" class="loading-container">
  73. <view class="loading-spinner"></view>
  74. <text class="loading-text">加载中...</text>
  75. </view>
  76. <view v-else class="calendar_grid">
  77. <view class="calendar_weekday">
  78. <text v-for="day in weekdays" :key="day" class="weekday_text">{{ day }}</text>
  79. </view>
  80. <view class="calendar_days">
  81. <view v-for="day in calendarDays" :key="day.fullDate" class="day_item"
  82. :class="{ active: day.isActive, weekend: day.isWeekend, today: day.isToday }"
  83. @click="handleDayClick(day)">
  84. <text class="day_text">{{ day.date }}</text>
  85. <view class="schedule_dot" :class="{ visible: day.hasSchedule }"></view>
  86. </view>
  87. </view>
  88. </view>
  89. <!-- 日程列表 -->
  90. <view class="schedule_list">
  91. <view class="schedule_title">当日日程</view>
  92. <no-data v-if="scheduleList.length === 0" text="暂无日程安排" />
  93. <view v-else v-for="item in scheduleList" :key="item.id" class="schedule_item">
  94. <view class="schedule_dot"></view>
  95. <view class="schedule_text_container">
  96. <text class="schedule_text" :class="{ expanded: expandedItems[item.id] }">{{ item.title
  97. }}</text>
  98. </view>
  99. </view>
  100. </view>
  101. <view class="add_schedule_btn" @click="handleAddSchedule">
  102. <image src="/static/image/workspace/add_icon.png" class="add_icon" mode="aspectFit"></image>
  103. <text class="btn_text">新增日程</text>
  104. </view>
  105. </view>
  106. </scroll-view>
  107. <view v-if="showAddScheduleModal" class="modal-overlay" @click="handleCloseModal">
  108. <view class="modal-content" @click.stop>
  109. <view class="modal-header">
  110. <text class="modal-title">新增日程</text>
  111. <view class="modal-close" @click="handleCloseModal">
  112. <image src="/static/image/workspace/close.png" class="close-icon" mode="aspectFit"></image>
  113. </view>
  114. </view>
  115. <view class="modal-body">
  116. <text class="modal-date">{{ currentYear }}-{{ String(currentMonth).padStart(2, '0') }}-{{
  117. String(currentDay).padStart(2, '0') }}日程</text>
  118. <textarea class="schedule-textarea" v-model="scheduleContent" placeholder="请输入日程内容"
  119. placeholder-class="textarea-placeholder"></textarea>
  120. </view>
  121. <view class="modal-footer">
  122. <view class="modal-btn cancel-btn" @click="handleCloseModal">
  123. <text>取消</text>
  124. </view>
  125. <view class="modal-btn confirm-btn" @click="handleConfirmSchedule">
  126. <text>确定</text>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. <common-tabbar></common-tabbar>
  133. </template>
  134. <script setup>
  135. import { ref, onMounted, computed } from 'vue';
  136. import { onShow } from '@dcloudio/uni-app';
  137. import { useStore } from 'vuex';
  138. import workspaceApi from '@/reqApi/workspace.js';
  139. import PageHeader from '@/components/page-header.vue';
  140. import NoData from '@/components/no-data.vue';
  141. import CommonTabbar from '@/components/commonTabbar.vue';
  142. import { useSafeArea } from '@/common/safeArea';
  143. const store = useStore();
  144. const { statusBarHeight, safeAreaBottom, initSafeArea } = useSafeArea();
  145. const systemItems = ref([
  146. { name: '大数据精准教学诊断平台', key: '', image: '/static/image/workspace/iconLeft.png', isLarge: true, visible: true },
  147. { name: '选择题判分', key: '', image: '/static/image/workspace/icon1.png', isLarge: false, visible: true },
  148. { name: '材料采集', key: 'materialCollection', image: '/static/image/workspace/icon2.png', isLarge: false, visible: true },
  149. { name: '教师研修', key: 'teacherStudy', image: '/static/image/workspace/icon3.png', isLarge: false, visible: true },
  150. { name: '学生学习', key: 'studentStudy', image: '/static/image/workspace/icon4.png', isLarge: false, visible: true },
  151. { name: '智能选课', key: '', image: '/static/image/workspace/icon5.png', isLarge: false, visible: true },
  152. { name: '教师发展', key: '', image: '/static/image/workspace/icon6.png', isLarge: false, visible: true },
  153. { name: '协同备课', key: '', image: '/static/image/workspace/icon7.png', isLarge: false, visible: true },
  154. { name: '校内通知', key: 'notice', image: '/static/image/workspace/icon8.png', isLarge: false, visible: true },
  155. { name: '评教评学', key: '', image: '/static/image/workspace/icon9.png', isLarge: false, visible: true },
  156. { name: '考场编排', key: '', image: '/static/image/workspace/icon10.png', isLarge: false, visible: true },
  157. { name: '听课评课', key: '', image: '/static/image/workspace/icon11.png', isLarge: false, visible: true },
  158. { name: '基础数据', key: '', image: '/static/image/workspace/icon12.png', isLarge: false, visible: true }
  159. ]);
  160. const largeCard = computed(() => systemItems.value.find(item => item.isLarge));
  161. const smallCards = computed(() => systemItems.value.filter(item => !item.isLarge));
  162. const rightTopCards = computed(() => smallCards.value.slice(0, 4));
  163. const bottomCards = computed(() => smallCards.value.slice(4));
  164. const allSmallCards = computed(() => smallCards.value);
  165. const weekdays = ['日', '一', '二', '三', '四', '五', '六'];
  166. const calendarDays = ref([]);
  167. const scheduleEvents = ref({});
  168. const isLoading = ref(false);
  169. const today = new Date();
  170. const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`;
  171. const currentYear = ref(new Date().getFullYear());
  172. const currentMonth = ref(new Date().getMonth() + 1);
  173. const currentDay = ref(new Date().getDate());
  174. const weekStartDate = ref(null);
  175. const weekEndDate = ref(null);
  176. const yearList = ref([]);
  177. const monthList = ref([]);
  178. const yearIndex = ref(0);
  179. const monthIndex = ref(0);
  180. const expandedItems = ref({});
  181. const toggleExpand = (id) => {
  182. expandedItems.value[id] = !expandedItems.value[id];
  183. };
  184. const scheduleList = computed(() => {
  185. const dateKey = `${currentYear.value}-${String(currentMonth.value).padStart(2, '0')}-${String(currentDay.value).padStart(2, '0')}`;
  186. return scheduleEvents.value[dateKey] || [];
  187. });
  188. const weekDateRange = computed(() => {
  189. if (!weekStartDate.value || !weekEndDate.value) return '';
  190. return `${weekStartDate.value.getFullYear()}年${weekStartDate.value.getMonth() + 1}月${weekStartDate.value.getDate()}日 - ${weekEndDate.value.getFullYear()}年${weekEndDate.value.getMonth() + 1}月${weekEndDate.value.getDate()}日`;
  191. });
  192. const generateYearList = () => {
  193. const years = [];
  194. for (let i = currentYear.value - 5; i <= currentYear.value + 5; i++) {
  195. years.push(`${i}年`);
  196. }
  197. yearList.value = years;
  198. };
  199. const generateMonthList = () => {
  200. const months = [];
  201. for (let i = 1; i <= 12; i++) {
  202. months.push(`${i}月`);
  203. }
  204. monthList.value = months;
  205. };
  206. const getWeekRange = (date) => {
  207. const d = new Date(date);
  208. const day = d.getDay();
  209. const diff = day === 0 ? -6 : 1 - day;
  210. const monday = new Date(d);
  211. monday.setDate(d.getDate() + diff);
  212. monday.setHours(0, 0, 0, 0);
  213. const sunday = new Date(monday);
  214. sunday.setDate(monday.getDate() + 6);
  215. sunday.setHours(23, 59, 59, 999);
  216. return { monday, sunday };
  217. };
  218. const updateCalendarDays = () => {
  219. const days = [];
  220. const { monday } = getWeekRange(new Date(currentYear.value, currentMonth.value - 1, currentDay.value));
  221. weekStartDate.value = monday;
  222. const sunday = new Date(monday);
  223. sunday.setDate(monday.getDate() + 6);
  224. weekEndDate.value = sunday;
  225. for (let i = 0; i < 7; i++) {
  226. const date = new Date(monday);
  227. date.setDate(monday.getDate() + i);
  228. const dayOfWeek = date.getDay();
  229. const dateKey = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
  230. days.push({
  231. date: date.getDate(),
  232. fullDate: dateKey,
  233. year: date.getFullYear(),
  234. month: date.getMonth() + 1,
  235. isActive: date.getDate() === currentDay.value && date.getMonth() + 1 === currentMonth.value && date.getFullYear() === currentYear.value,
  236. isWeekend: dayOfWeek === 0 || dayOfWeek === 6,
  237. isToday: dateKey === todayStr,
  238. hasSchedule: !!scheduleEvents.value[dateKey] && scheduleEvents.value[dateKey].length > 0
  239. });
  240. }
  241. calendarDays.value = days;
  242. };
  243. const fetchScheduleList = async () => {
  244. const { monday, sunday } = getWeekRange(new Date(currentYear.value, currentMonth.value - 1, currentDay.value));
  245. const startDate = `${monday.getFullYear()}-${String(monday.getMonth() + 1).padStart(2, '0')}-${String(monday.getDate()).padStart(2, '0')}`;
  246. const endDate = `${sunday.getFullYear()}-${String(sunday.getMonth() + 1).padStart(2, '0')}-${String(sunday.getDate()).padStart(2, '0')}`;
  247. isLoading.value = true;
  248. try {
  249. const res = await workspaceApi.getSchedule({ startDate, endDate });
  250. updateScheduleEvents(res.data);
  251. } catch (error) {
  252. console.error('获取日程列表失败:', error);
  253. uni.showToast({ title: '获取日程失败,请稍后重试', icon: 'none', duration: 3000 });
  254. } finally {
  255. isLoading.value = false;
  256. }
  257. };
  258. const updateScheduleEvents = (data) => {
  259. Object.keys(scheduleEvents.value).forEach(key => {
  260. delete scheduleEvents.value[key];
  261. });
  262. Object.keys(data).forEach(dateKey => {
  263. const list = data[dateKey] || [];
  264. scheduleEvents.value[dateKey] = list.map(item => ({
  265. id: String(item.id),
  266. title: item.content || ''
  267. }));
  268. });
  269. updateCalendarDays();
  270. };
  271. const updateYearMonthIndex = () => {
  272. yearIndex.value = yearList.value.indexOf(`${currentYear.value}年`);
  273. monthIndex.value = monthList.value.indexOf(`${currentMonth.value}月`);
  274. };
  275. onMounted(() => {
  276. initSafeArea();
  277. generateYearList();
  278. generateMonthList();
  279. updateYearMonthIndex();
  280. updateCalendarDays();
  281. });
  282. onShow(() => {
  283. fetchScheduleList();
  284. });
  285. const handleSystemClick = (item) => {
  286. if (item.key === 'notice') {
  287. const userInfo = store.state.userStore.userInfo || uni.getStorageSync('userInfo') || {};
  288. const roleCodes = userInfo.roleCodes || [];
  289. const isSchoolManager = Array.isArray(roleCodes) && roleCodes.includes('SCHOOL_MANAGER');
  290. if (isSchoolManager) {
  291. uni.navigateTo({
  292. url: '/pages/notice/overview/index'
  293. });
  294. } else {
  295. uni.navigateTo({
  296. url: '/pages/notice/mine/index?hideTabbar=true'
  297. });
  298. }
  299. } else if (item.key === 'materialCollection') {
  300. uni.navigateTo({
  301. url: '/pages/materialCollection/taskOverview/index'
  302. });
  303. } else if (item.key == 'teacherStudy') {//教师研修
  304. uni.navigateTo({
  305. url: '/pages/teacherStudy/index'
  306. });
  307. } else if (item.key == 'studentStudy') {//学生学习
  308. uni.navigateTo({
  309. url: '/pages/studentStudy/index'
  310. });
  311. } else {
  312. uni.showToast({ title: `即将打开:${item.name}`, icon: 'none' });
  313. }
  314. };
  315. const handleViewSchedule = () => {
  316. uni.navigateTo({
  317. url: '/pages/workspace/schedule'
  318. });
  319. };
  320. const handlePrevWeek = () => {
  321. const currentDate = new Date(currentYear.value, currentMonth.value - 1, currentDay.value);
  322. currentDate.setDate(currentDate.getDate() - 7);
  323. currentYear.value = currentDate.getFullYear();
  324. currentMonth.value = currentDate.getMonth() + 1;
  325. currentDay.value = currentDate.getDate();
  326. updateYearMonthIndex();
  327. updateCalendarDays();
  328. fetchScheduleList();
  329. };
  330. const handleNextWeek = () => {
  331. const currentDate = new Date(currentYear.value, currentMonth.value - 1, currentDay.value);
  332. currentDate.setDate(currentDate.getDate() + 7);
  333. currentYear.value = currentDate.getFullYear();
  334. currentMonth.value = currentDate.getMonth() + 1;
  335. currentDay.value = currentDate.getDate();
  336. updateYearMonthIndex();
  337. updateCalendarDays();
  338. fetchScheduleList();
  339. };
  340. const handleDayClick = (day) => {
  341. calendarDays.value.forEach(d => d.isActive = false);
  342. day.isActive = true;
  343. currentYear.value = day.year;
  344. currentMonth.value = day.month;
  345. currentDay.value = day.date;
  346. updateYearMonthIndex();
  347. };
  348. const handleYearChange = (e) => {
  349. yearIndex.value = e.detail.value;
  350. currentYear.value = parseInt(yearList.value[e.detail.value].replace('年', ''));
  351. updateCalendarDays();
  352. fetchScheduleList();
  353. };
  354. const handleMonthChange = (e) => {
  355. monthIndex.value = e.detail.value;
  356. currentMonth.value = parseInt(monthList.value[e.detail.value].replace('月', ''));
  357. updateCalendarDays();
  358. fetchScheduleList();
  359. };
  360. const showAddScheduleModal = ref(false);
  361. const scheduleContent = ref('');
  362. const handleAddSchedule = () => {
  363. showAddScheduleModal.value = true;
  364. scheduleContent.value = '';
  365. };
  366. const handleCloseModal = () => {
  367. showAddScheduleModal.value = false;
  368. scheduleContent.value = '';
  369. };
  370. const handleConfirmSchedule = async () => {
  371. if (!scheduleContent.value.trim()) {
  372. uni.showToast({ title: '请输入日程内容', icon: 'none' });
  373. return;
  374. }
  375. const scheduleDate = `${currentYear.value}-${String(currentMonth.value).padStart(2, '0')}-${String(currentDay.value).padStart(2, '0')}`;
  376. try {
  377. await workspaceApi.saveSchedule({
  378. content: scheduleContent.value.trim(),
  379. scheduleDate
  380. });
  381. uni.showToast({ title: '添加成功', icon: 'success' });
  382. showAddScheduleModal.value = false;
  383. scheduleContent.value = '';
  384. fetchScheduleList();
  385. } catch (error) {
  386. console.error('添加日程失败:', error);
  387. uni.showToast({ title: '添加日程失败,请稍后重试', icon: 'none', duration: 3000 });
  388. }
  389. };
  390. </script>
  391. <style lang="scss">
  392. $primary-color: #2E64FA;
  393. $text-primary: #333333;
  394. $text-secondary: #666666;
  395. $text-tertiary: #999999;
  396. $bg-color: #F5F7FA;
  397. $bg-white: #FFFFFF;
  398. $border-color: #F0F0F0;
  399. $header-border: #EEEEEE;
  400. $font-lg: 44rpx;
  401. $font-md: 34rpx;
  402. $font-sm: 32rpx;
  403. $font-xs: 26rpx;
  404. $font-xxs: 24rpx;
  405. $radius-lg: 20rpx;
  406. $radius-md: 12rpx;
  407. $radius-sm: 8rpx;
  408. $radius-circle: 50%;
  409. $spacing-xl: 80rpx;
  410. $spacing-lg: 32rpx;
  411. $spacing-md: 24rpx;
  412. $spacing-sm: 24rpx;
  413. $spacing-xs: 16rpx;
  414. $spacing-xxs: 12rpx;
  415. $shadow-sm: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
  416. @mixin flex-center {
  417. display: flex;
  418. justify-content: center;
  419. align-items: center;
  420. }
  421. @mixin flex-between {
  422. display: flex;
  423. justify-content: space-between;
  424. align-items: center;
  425. }
  426. @mixin flex-column {
  427. display: flex;
  428. flex-direction: column;
  429. align-items: center;
  430. }
  431. @mixin bg-card {
  432. background-color: $bg-white;
  433. border-radius: $radius-lg;
  434. padding: $spacing-md;
  435. }
  436. @mixin text-ellipsis {
  437. overflow: hidden;
  438. text-overflow: ellipsis;
  439. white-space: nowrap;
  440. }
  441. .page_workspace {
  442. min-height: 100vh;
  443. background-color: #F8F9FD;
  444. box-sizing: border-box;
  445. }
  446. .workspace_content {
  447. padding-left: 24rpx;
  448. padding-right: 24rpx;
  449. height: 100%;
  450. box-sizing: border-box;
  451. overflow: hidden;
  452. }
  453. // 系统列表
  454. .system_list {
  455. @include bg-card;
  456. margin-bottom: $spacing-sm;
  457. .section_title {
  458. font-size: $font-sm;
  459. font-weight: 500;
  460. color: $text-primary;
  461. margin-bottom: $spacing-sm;
  462. }
  463. .system_grid_with_large {
  464. display: flex;
  465. gap: 20rpx;
  466. margin-bottom: 20rpx;
  467. .large_card {
  468. flex: 1;
  469. display: flex;
  470. flex-direction: column;
  471. align-items: center;
  472. justify-content: center;
  473. background-color: #EAF0FF;
  474. border-radius: 20rpx;
  475. width: 324rpx;
  476. height: 352rpx;
  477. // padding: 30rpx 0;
  478. .large_icon {
  479. width: 160rpx;
  480. height: 160rpx;
  481. margin-bottom: 32rpx;
  482. }
  483. .large_name {
  484. font-size: 32rpx;
  485. color: #333333;
  486. font-weight: 500;
  487. text-align: center;
  488. line-height: 48rpx;
  489. width: 276rpx;
  490. }
  491. }
  492. .right_top_grid {
  493. flex: 1;
  494. display: grid;
  495. grid-template-columns: repeat(2, 1fr);
  496. gap: 16rpx;
  497. .small_item {
  498. display: flex;
  499. flex-direction: column;
  500. align-items: center;
  501. justify-content: center;
  502. background-color: #FFFFFF;
  503. // border-radius: 12rpx;
  504. // padding: 20rpx 0;
  505. .small_icon {
  506. width: 96rpx;
  507. height: 96rpx;
  508. margin-bottom: 20rpx;
  509. }
  510. .small_name {
  511. font-size: 28rpx;
  512. color: $text-secondary;
  513. text-align: center;
  514. }
  515. }
  516. }
  517. }
  518. .bottom_grid {
  519. display: grid;
  520. grid-template-columns: repeat(4, 1fr);
  521. gap: 16rpx;
  522. .small_item {
  523. display: flex;
  524. flex-direction: column;
  525. align-items: center;
  526. justify-content: center;
  527. background-color: #FFFFFF;
  528. border-radius: 12rpx;
  529. padding: 20rpx 0;
  530. .small_icon {
  531. width: 96rpx;
  532. height: 96rpx;
  533. margin-bottom: 20rpx;
  534. }
  535. .small_name {
  536. font-size: 28rpx;
  537. color: $text-secondary;
  538. text-align: center;
  539. }
  540. }
  541. }
  542. .system_grid_full {
  543. display: grid;
  544. grid-template-columns: repeat(4, 1fr);
  545. gap: 16rpx;
  546. .small_item {
  547. display: flex;
  548. flex-direction: column;
  549. align-items: center;
  550. justify-content: center;
  551. background-color: #FFFFFF;
  552. border-radius: 12rpx;
  553. padding: 20rpx 0;
  554. .small_icon {
  555. width: 64rpx;
  556. height: 64rpx;
  557. margin-bottom: 12rpx;
  558. }
  559. .small_name {
  560. font-size: 22rpx;
  561. color: $text-secondary;
  562. text-align: center;
  563. }
  564. }
  565. }
  566. }
  567. // 日程
  568. .calendar_section {
  569. @include bg-card;
  570. .calendar_header {
  571. @include flex-between;
  572. margin-bottom: 32rpx;
  573. .section_title {
  574. font-size: $font-sm;
  575. font-weight: 500;
  576. color: $text-primary;
  577. }
  578. .view_schedule {
  579. font-size: 28rpx;
  580. color: $primary-color;
  581. }
  582. }
  583. .calendar_toolbar {
  584. display: flex;
  585. gap: 18rpx;
  586. padding-bottom: 32rpx;
  587. .year_month_select {
  588. display: flex;
  589. gap: 18rpx;
  590. flex: 1;
  591. .select_item {
  592. flex: 1;
  593. // @include flex-center;
  594. gap: 8rpx;
  595. padding: 0;
  596. height: 72rpx;
  597. background-color: #FFFFFF;
  598. border-radius: 8rpx;
  599. border: 2rpx solid #DCDFE6;
  600. .select_content {
  601. display: flex;
  602. justify-content: space-between;
  603. align-items: center;
  604. width: 81%;
  605. padding: 0 16rpx;
  606. height: 72rpx;
  607. }
  608. .select_text {
  609. font-size: $font-xs;
  610. color: $text-primary;
  611. }
  612. }
  613. }
  614. .week_nav {
  615. display: flex;
  616. gap: 18rpx;
  617. .nav_btn {
  618. width: 122rpx;
  619. height: 72rpx;
  620. @include flex-center;
  621. background-color: #FFFFFF;
  622. border-radius: 8rpx;
  623. border: 2rpx solid #DCDFE6;
  624. .nav_text {
  625. font-size: $font-xs;
  626. color: $text-secondary;
  627. }
  628. }
  629. }
  630. }
  631. .calendar_grid {
  632. margin-bottom: $spacing-lg;
  633. .calendar_weekday {
  634. display: flex;
  635. margin-bottom: $spacing-xs;
  636. .weekday_text {
  637. flex: 1;
  638. text-align: center;
  639. font-size: 28rpx;
  640. color: $text-secondary;
  641. }
  642. }
  643. .calendar_days {
  644. display: flex;
  645. justify-content: space-around;
  646. align-items: center;
  647. height: 80rpx;
  648. .day_item {
  649. flex-shrink: 0;
  650. box-sizing: border-box;
  651. display: flex;
  652. justify-content: center;
  653. align-items: center;
  654. width: 80rpx;
  655. height: 80rpx;
  656. border-radius: 50%;
  657. border: 2rpx solid transparent;
  658. position: relative;
  659. &.active {
  660. background-color: rgba(46, 100, 250, 0.1);
  661. border-color: #2E64FA;
  662. .day_text {
  663. color: #2E64FA;
  664. }
  665. }
  666. .day_text {
  667. font-size: $font-sm;
  668. color: $text-primary;
  669. }
  670. &.weekend:not(.active) {
  671. .day_text {
  672. color: #999999;
  673. }
  674. }
  675. .schedule_dot {
  676. position: absolute;
  677. bottom: 12rpx;
  678. width: 8rpx;
  679. height: 8rpx;
  680. background-color: transparent;
  681. border-radius: 50%;
  682. &.visible {
  683. background-color: #2E64FA;
  684. }
  685. }
  686. }
  687. }
  688. }
  689. .schedule_list {
  690. margin-bottom: $spacing-lg;
  691. background: #F9FAFF;
  692. border-radius: 20rpx 20rpx 20rpx 20rpx;
  693. padding: $spacing-lg;
  694. .schedule_title {
  695. font-size: 28rpx;
  696. font-weight: 500;
  697. color: $text-primary;
  698. margin-bottom: $spacing-xs;
  699. }
  700. .schedule_item {
  701. display: flex;
  702. align-items: flex-start;
  703. padding: 24rpx 0;
  704. border-bottom: 2rpx solid #EBEEF5;
  705. &:last-child {
  706. border-bottom: none;
  707. }
  708. .schedule_dot {
  709. width: 16rpx;
  710. height: 16rpx;
  711. background-color: $primary-color;
  712. border-radius: $radius-circle;
  713. margin-top: 14rpx;
  714. margin-right: 14rpx;
  715. flex-shrink: 0;
  716. }
  717. .schedule_text_container {
  718. flex: 1;
  719. position: relative;
  720. }
  721. .schedule_text {
  722. font-size: 28rpx;
  723. color: #666666;
  724. line-height: 1.6;
  725. display: -webkit-box;
  726. flex: 1;
  727. text-align: justify;
  728. &.expanded {
  729. -webkit-line-clamp: unset;
  730. overflow: visible;
  731. text-overflow: unset;
  732. padding-right: 0;
  733. }
  734. }
  735. .toggle_text {
  736. font-size: 28rpx;
  737. color: #2E64FA;
  738. position: absolute;
  739. right: 0;
  740. bottom: 0;
  741. line-height: 1.6;
  742. }
  743. }
  744. }
  745. .add_schedule_btn {
  746. @include flex-center;
  747. gap: 16rpx;
  748. height: 56rpx;
  749. background-color: #FFFFFF;
  750. border-radius: 12rpx 12rpx 12rpx 12rpx;
  751. ;
  752. border: 1px solid #2E64FA;
  753. .btn_text {
  754. font-size: 28rpx;
  755. color: #2E64FA;
  756. font-weight: 500;
  757. }
  758. .add_icon {
  759. width: 32rpx;
  760. height: 32rpx;
  761. }
  762. }
  763. }
  764. .modal-overlay {
  765. position: fixed;
  766. top: 0;
  767. left: 0;
  768. right: 0;
  769. bottom: 0;
  770. background-color: rgba(0, 0, 0, 0.5);
  771. display: flex;
  772. justify-content: center;
  773. align-items: center;
  774. z-index: 1000;
  775. }
  776. .modal-content {
  777. width: 702rpx;
  778. background-color: #FFFFFF;
  779. border-radius: 16rpx;
  780. overflow: hidden;
  781. .modal-header {
  782. display: flex;
  783. justify-content: space-between;
  784. align-items: center;
  785. height: 96rpx;
  786. padding: 0 40rpx;
  787. background-color: #F5F7FA;
  788. .modal-title {
  789. font-size: 32rpx;
  790. font-weight: 500;
  791. color: #303133;
  792. }
  793. .modal-close {
  794. width: 60rpx;
  795. height: 60rpx;
  796. display: flex;
  797. justify-content: center;
  798. align-items: center;
  799. }
  800. .close-icon {
  801. width: 40rpx;
  802. height: 40rpx;
  803. }
  804. }
  805. .modal-body {
  806. padding: 24rpx;
  807. .modal-date {
  808. font-size: 32rpx;
  809. color: #333333;
  810. margin-bottom: 24rpx;
  811. display: block;
  812. }
  813. .schedule-textarea {
  814. width: 100%;
  815. height: 364rpx;
  816. padding: 20rpx;
  817. border: 2rpx solid #E8E8E8;
  818. border-radius: 12rpx;
  819. font-size: 28rpx;
  820. color: #333333;
  821. box-sizing: border-box;
  822. }
  823. .textarea-placeholder {
  824. color: #999999;
  825. }
  826. }
  827. .modal-footer {
  828. display: flex;
  829. justify-content: flex-end;
  830. align-items: center;
  831. padding: 28rpx 40rpx;
  832. gap: 16rpx;
  833. border-top: 2rpx solid #EBEEF5;
  834. .modal-btn {
  835. height: 72rpx;
  836. // padding: 0 48rpx;
  837. width: 136rpx;
  838. display: flex;
  839. justify-content: center;
  840. align-items: center;
  841. font-size: 28rpx;
  842. border-radius: 8rpx;
  843. flex-shrink: 0;
  844. &.cancel-btn {
  845. color: #666666;
  846. background-color: #FFFFFF;
  847. border: 2rpx solid #DCDFE6;
  848. height: 68rpx;
  849. }
  850. &.confirm-btn {
  851. color: #FFFFFF;
  852. background-color: #2E64FA;
  853. border: none;
  854. }
  855. }
  856. }
  857. }
  858. </style>