index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974
  1. <template>
  2. <view class="page_workspace"
  3. :style="{ paddingTop: statusBarHeight + 160 + 'rpx', paddingBottom: safeAreaBottom + 150 + 'rpx' }">
  4. <pageHeader></pageHeader>
  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. <noData 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/pageHeader.vue';
  140. import NoData from '@/components/noData.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: 'teacherHonor', 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' || item.key == 'studentStudy' || item.key == 'teacherHonor') {//教师研修 学生学习
  304. uni.navigateTo({
  305. url: `/pages/${item.key}/index`
  306. });
  307. } else {
  308. uni.showToast({ title: `即将打开:${item.name}`, icon: 'none' });
  309. }
  310. };
  311. const handleViewSchedule = () => {
  312. uni.navigateTo({
  313. url: '/pages/workspace/schedule'
  314. });
  315. };
  316. const handlePrevWeek = () => {
  317. const currentDate = new Date(currentYear.value, currentMonth.value - 1, currentDay.value);
  318. currentDate.setDate(currentDate.getDate() - 7);
  319. currentYear.value = currentDate.getFullYear();
  320. currentMonth.value = currentDate.getMonth() + 1;
  321. currentDay.value = currentDate.getDate();
  322. updateYearMonthIndex();
  323. updateCalendarDays();
  324. fetchScheduleList();
  325. };
  326. const handleNextWeek = () => {
  327. const currentDate = new Date(currentYear.value, currentMonth.value - 1, currentDay.value);
  328. currentDate.setDate(currentDate.getDate() + 7);
  329. currentYear.value = currentDate.getFullYear();
  330. currentMonth.value = currentDate.getMonth() + 1;
  331. currentDay.value = currentDate.getDate();
  332. updateYearMonthIndex();
  333. updateCalendarDays();
  334. fetchScheduleList();
  335. };
  336. const handleDayClick = (day) => {
  337. calendarDays.value.forEach(d => d.isActive = false);
  338. day.isActive = true;
  339. currentYear.value = day.year;
  340. currentMonth.value = day.month;
  341. currentDay.value = day.date;
  342. updateYearMonthIndex();
  343. };
  344. const handleYearChange = (e) => {
  345. yearIndex.value = e.detail.value;
  346. currentYear.value = parseInt(yearList.value[e.detail.value].replace('年', ''));
  347. updateCalendarDays();
  348. fetchScheduleList();
  349. };
  350. const handleMonthChange = (e) => {
  351. monthIndex.value = e.detail.value;
  352. currentMonth.value = parseInt(monthList.value[e.detail.value].replace('月', ''));
  353. updateCalendarDays();
  354. fetchScheduleList();
  355. };
  356. const showAddScheduleModal = ref(false);
  357. const scheduleContent = ref('');
  358. const handleAddSchedule = () => {
  359. showAddScheduleModal.value = true;
  360. scheduleContent.value = '';
  361. };
  362. const handleCloseModal = () => {
  363. showAddScheduleModal.value = false;
  364. scheduleContent.value = '';
  365. };
  366. const handleConfirmSchedule = async () => {
  367. if (!scheduleContent.value.trim()) {
  368. uni.showToast({ title: '请输入日程内容', icon: 'none' });
  369. return;
  370. }
  371. const scheduleDate = `${currentYear.value}-${String(currentMonth.value).padStart(2, '0')}-${String(currentDay.value).padStart(2, '0')}`;
  372. try {
  373. await workspaceApi.saveSchedule({
  374. content: scheduleContent.value.trim(),
  375. scheduleDate
  376. });
  377. uni.showToast({ title: '添加成功', icon: 'success' });
  378. showAddScheduleModal.value = false;
  379. scheduleContent.value = '';
  380. fetchScheduleList();
  381. } catch (error) {
  382. console.error('添加日程失败:', error);
  383. uni.showToast({ title: '添加日程失败,请稍后重试', icon: 'none', duration: 3000 });
  384. }
  385. };
  386. </script>
  387. <style lang="scss">
  388. $primary-color: #2E64FA;
  389. $text-primary: #333333;
  390. $text-secondary: #666666;
  391. $text-tertiary: #999999;
  392. $bg-color: #F5F7FA;
  393. $bg-white: #FFFFFF;
  394. $border-color: #F0F0F0;
  395. $header-border: #EEEEEE;
  396. $font-lg: 44rpx;
  397. $font-md: 34rpx;
  398. $font-sm: 32rpx;
  399. $font-xs: 26rpx;
  400. $font-xxs: 24rpx;
  401. $radius-lg: 20rpx;
  402. $radius-md: 12rpx;
  403. $radius-sm: 8rpx;
  404. $radius-circle: 50%;
  405. $spacing-xl: 80rpx;
  406. $spacing-lg: 32rpx;
  407. $spacing-md: 24rpx;
  408. $spacing-sm: 24rpx;
  409. $spacing-xs: 16rpx;
  410. $spacing-xxs: 12rpx;
  411. $shadow-sm: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
  412. @mixin flex-center {
  413. display: flex;
  414. justify-content: center;
  415. align-items: center;
  416. }
  417. @mixin flex-between {
  418. display: flex;
  419. justify-content: space-between;
  420. align-items: center;
  421. }
  422. @mixin flex-column {
  423. display: flex;
  424. flex-direction: column;
  425. align-items: center;
  426. }
  427. @mixin bg-card {
  428. background-color: $bg-white;
  429. border-radius: $radius-lg;
  430. padding: $spacing-md;
  431. }
  432. @mixin text-ellipsis {
  433. overflow: hidden;
  434. text-overflow: ellipsis;
  435. white-space: nowrap;
  436. }
  437. .page_workspace {
  438. min-height: 100vh;
  439. background-color: #F8F9FD;
  440. box-sizing: border-box;
  441. }
  442. .workspace_content {
  443. padding-left: 24rpx;
  444. padding-right: 24rpx;
  445. height: 100%;
  446. box-sizing: border-box;
  447. overflow: hidden;
  448. }
  449. // 系统列表
  450. .system_list {
  451. @include bg-card;
  452. margin-bottom: $spacing-sm;
  453. .section_title {
  454. font-size: $font-sm;
  455. font-weight: 500;
  456. color: $text-primary;
  457. margin-bottom: $spacing-sm;
  458. }
  459. .system_grid_with_large {
  460. display: flex;
  461. gap: 20rpx;
  462. margin-bottom: 20rpx;
  463. .large_card {
  464. flex: 1;
  465. display: flex;
  466. flex-direction: column;
  467. align-items: center;
  468. justify-content: center;
  469. background-color: #EAF0FF;
  470. border-radius: 20rpx;
  471. width: 324rpx;
  472. height: 352rpx;
  473. // padding: 30rpx 0;
  474. .large_icon {
  475. width: 160rpx;
  476. height: 160rpx;
  477. margin-bottom: 32rpx;
  478. }
  479. .large_name {
  480. font-size: 32rpx;
  481. color: #333333;
  482. font-weight: 500;
  483. text-align: center;
  484. line-height: 48rpx;
  485. width: 276rpx;
  486. }
  487. }
  488. .right_top_grid {
  489. flex: 1;
  490. display: grid;
  491. grid-template-columns: repeat(2, 1fr);
  492. gap: 16rpx;
  493. .small_item {
  494. display: flex;
  495. flex-direction: column;
  496. align-items: center;
  497. justify-content: center;
  498. background-color: #FFFFFF;
  499. // border-radius: 12rpx;
  500. // padding: 20rpx 0;
  501. .small_icon {
  502. width: 96rpx;
  503. height: 96rpx;
  504. margin-bottom: 20rpx;
  505. }
  506. .small_name {
  507. font-size: 28rpx;
  508. color: $text-secondary;
  509. text-align: center;
  510. }
  511. }
  512. }
  513. }
  514. .bottom_grid {
  515. display: grid;
  516. grid-template-columns: repeat(4, 1fr);
  517. gap: 16rpx;
  518. .small_item {
  519. display: flex;
  520. flex-direction: column;
  521. align-items: center;
  522. justify-content: center;
  523. background-color: #FFFFFF;
  524. border-radius: 12rpx;
  525. padding: 20rpx 0;
  526. .small_icon {
  527. width: 96rpx;
  528. height: 96rpx;
  529. margin-bottom: 20rpx;
  530. }
  531. .small_name {
  532. font-size: 28rpx;
  533. color: $text-secondary;
  534. text-align: center;
  535. }
  536. }
  537. }
  538. .system_grid_full {
  539. display: grid;
  540. grid-template-columns: repeat(4, 1fr);
  541. gap: 16rpx;
  542. .small_item {
  543. display: flex;
  544. flex-direction: column;
  545. align-items: center;
  546. justify-content: center;
  547. background-color: #FFFFFF;
  548. border-radius: 12rpx;
  549. padding: 20rpx 0;
  550. .small_icon {
  551. width: 64rpx;
  552. height: 64rpx;
  553. margin-bottom: 12rpx;
  554. }
  555. .small_name {
  556. font-size: 22rpx;
  557. color: $text-secondary;
  558. text-align: center;
  559. }
  560. }
  561. }
  562. }
  563. // 日程
  564. .calendar_section {
  565. @include bg-card;
  566. .calendar_header {
  567. @include flex-between;
  568. margin-bottom: 32rpx;
  569. .section_title {
  570. font-size: $font-sm;
  571. font-weight: 500;
  572. color: $text-primary;
  573. }
  574. .view_schedule {
  575. font-size: 28rpx;
  576. color: $primary-color;
  577. }
  578. }
  579. .calendar_toolbar {
  580. display: flex;
  581. gap: 18rpx;
  582. padding-bottom: 32rpx;
  583. .year_month_select {
  584. display: flex;
  585. gap: 18rpx;
  586. flex: 1;
  587. .select_item {
  588. flex: 1;
  589. // @include flex-center;
  590. gap: 8rpx;
  591. padding: 0;
  592. height: 72rpx;
  593. background-color: #FFFFFF;
  594. border-radius: 8rpx;
  595. border: 2rpx solid #DCDFE6;
  596. .select_content {
  597. display: flex;
  598. justify-content: space-between;
  599. align-items: center;
  600. width: 81%;
  601. padding: 0 16rpx;
  602. height: 72rpx;
  603. }
  604. .select_text {
  605. font-size: $font-xs;
  606. color: $text-primary;
  607. }
  608. }
  609. }
  610. .week_nav {
  611. display: flex;
  612. gap: 18rpx;
  613. .nav_btn {
  614. width: 122rpx;
  615. height: 72rpx;
  616. @include flex-center;
  617. background-color: #FFFFFF;
  618. border-radius: 8rpx;
  619. border: 2rpx solid #DCDFE6;
  620. .nav_text {
  621. font-size: $font-xs;
  622. color: $text-secondary;
  623. }
  624. }
  625. }
  626. }
  627. .calendar_grid {
  628. margin-bottom: $spacing-lg;
  629. .calendar_weekday {
  630. display: flex;
  631. margin-bottom: $spacing-xs;
  632. .weekday_text {
  633. flex: 1;
  634. text-align: center;
  635. font-size: 28rpx;
  636. color: $text-secondary;
  637. }
  638. }
  639. .calendar_days {
  640. display: flex;
  641. justify-content: space-around;
  642. align-items: center;
  643. height: 80rpx;
  644. .day_item {
  645. flex-shrink: 0;
  646. box-sizing: border-box;
  647. display: flex;
  648. justify-content: center;
  649. align-items: center;
  650. width: 80rpx;
  651. height: 80rpx;
  652. border-radius: 50%;
  653. border: 2rpx solid transparent;
  654. position: relative;
  655. &.active {
  656. background-color: rgba(46, 100, 250, 0.1);
  657. border-color: #2E64FA;
  658. .day_text {
  659. color: #2E64FA;
  660. }
  661. }
  662. .day_text {
  663. font-size: $font-sm;
  664. color: $text-primary;
  665. }
  666. &.weekend:not(.active) {
  667. .day_text {
  668. color: #999999;
  669. }
  670. }
  671. .schedule_dot {
  672. position: absolute;
  673. bottom: 12rpx;
  674. width: 8rpx;
  675. height: 8rpx;
  676. background-color: transparent;
  677. border-radius: 50%;
  678. &.visible {
  679. background-color: #2E64FA;
  680. }
  681. }
  682. }
  683. }
  684. }
  685. .schedule_list {
  686. margin-bottom: $spacing-lg;
  687. background: #F9FAFF;
  688. border-radius: 20rpx 20rpx 20rpx 20rpx;
  689. padding: $spacing-lg;
  690. .schedule_title {
  691. font-size: 28rpx;
  692. font-weight: 500;
  693. color: $text-primary;
  694. margin-bottom: $spacing-xs;
  695. }
  696. .schedule_item {
  697. display: flex;
  698. align-items: flex-start;
  699. padding: 24rpx 0;
  700. border-bottom: 2rpx solid #EBEEF5;
  701. &:last-child {
  702. border-bottom: none;
  703. }
  704. .schedule_dot {
  705. width: 16rpx;
  706. height: 16rpx;
  707. background-color: $primary-color;
  708. border-radius: $radius-circle;
  709. margin-top: 14rpx;
  710. margin-right: 14rpx;
  711. flex-shrink: 0;
  712. }
  713. .schedule_text_container {
  714. flex: 1;
  715. position: relative;
  716. }
  717. .schedule_text {
  718. font-size: 28rpx;
  719. color: #666666;
  720. line-height: 1.6;
  721. display: -webkit-box;
  722. flex: 1;
  723. text-align: justify;
  724. &.expanded {
  725. -webkit-line-clamp: unset;
  726. overflow: visible;
  727. text-overflow: unset;
  728. padding-right: 0;
  729. }
  730. }
  731. .toggle_text {
  732. font-size: 28rpx;
  733. color: #2E64FA;
  734. position: absolute;
  735. right: 0;
  736. bottom: 0;
  737. line-height: 1.6;
  738. }
  739. }
  740. }
  741. .add_schedule_btn {
  742. @include flex-center;
  743. gap: 16rpx;
  744. height: 56rpx;
  745. background-color: #FFFFFF;
  746. border-radius: 12rpx 12rpx 12rpx 12rpx;
  747. ;
  748. border: 1px solid #2E64FA;
  749. .btn_text {
  750. font-size: 28rpx;
  751. color: #2E64FA;
  752. font-weight: 500;
  753. }
  754. .add_icon {
  755. width: 32rpx;
  756. height: 32rpx;
  757. }
  758. }
  759. }
  760. .modal-overlay {
  761. position: fixed;
  762. top: 0;
  763. left: 0;
  764. right: 0;
  765. bottom: 0;
  766. background-color: rgba(0, 0, 0, 0.5);
  767. display: flex;
  768. justify-content: center;
  769. align-items: center;
  770. z-index: 1000;
  771. }
  772. .modal-content {
  773. width: 702rpx;
  774. background-color: #FFFFFF;
  775. border-radius: 16rpx;
  776. overflow: hidden;
  777. .modal-header {
  778. display: flex;
  779. justify-content: space-between;
  780. align-items: center;
  781. height: 96rpx;
  782. padding: 0 40rpx;
  783. background-color: #F5F7FA;
  784. .modal-title {
  785. font-size: 32rpx;
  786. font-weight: 500;
  787. color: #303133;
  788. }
  789. .modal-close {
  790. width: 60rpx;
  791. height: 60rpx;
  792. display: flex;
  793. justify-content: center;
  794. align-items: center;
  795. }
  796. .close-icon {
  797. width: 40rpx;
  798. height: 40rpx;
  799. }
  800. }
  801. .modal-body {
  802. padding: 24rpx;
  803. .modal-date {
  804. font-size: 32rpx;
  805. color: #333333;
  806. margin-bottom: 24rpx;
  807. display: block;
  808. }
  809. .schedule-textarea {
  810. width: 100%;
  811. height: 364rpx;
  812. padding: 20rpx;
  813. border: 2rpx solid #E8E8E8;
  814. border-radius: 12rpx;
  815. font-size: 28rpx;
  816. color: #333333;
  817. box-sizing: border-box;
  818. }
  819. .textarea-placeholder {
  820. color: #999999;
  821. }
  822. }
  823. .modal-footer {
  824. display: flex;
  825. justify-content: flex-end;
  826. align-items: center;
  827. padding: 28rpx 40rpx;
  828. gap: 16rpx;
  829. border-top: 2rpx solid #EBEEF5;
  830. .modal-btn {
  831. height: 72rpx;
  832. // padding: 0 48rpx;
  833. width: 136rpx;
  834. display: flex;
  835. justify-content: center;
  836. align-items: center;
  837. font-size: 28rpx;
  838. border-radius: 8rpx;
  839. flex-shrink: 0;
  840. &.cancel-btn {
  841. color: #666666;
  842. background-color: #FFFFFF;
  843. border: 2rpx solid #DCDFE6;
  844. height: 68rpx;
  845. }
  846. &.confirm-btn {
  847. color: #FFFFFF;
  848. background-color: #2E64FA;
  849. border: none;
  850. }
  851. }
  852. }
  853. }
  854. </style>