PersonalCenter.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <template>
  2. <div class="news">
  3. <Banner :img="require('@/assets/img/news.png')" />
  4. <div class="common-container">
  5. <el-container>
  6. <div class="left-tabs">
  7. <h4>个人中心</h4>
  8. <ul>
  9. <li v-for="(item, index) in options"
  10. :key="index"
  11. :class="{ active: index === active }"
  12. @click="tabSelect(item, index)">
  13. {{ item.label }}
  14. </li>
  15. </ul>
  16. </div>
  17. <div class="w100">
  18. <el-row class="flex mt12"
  19. :gutter="12">
  20. <el-col :span="12">
  21. <el-card header="科研仪器">
  22. </el-card>
  23. </el-col>
  24. <el-col :span="12">
  25. <el-card header="通知公告">
  26. </el-card>
  27. </el-col>
  28. </el-row>
  29. <el-row class="flex mt12"
  30. :gutter="12">
  31. <el-col :span="12">
  32. <el-card header="科研平台">
  33. <ul class="platform-list">
  34. <li>
  35. <div class="text">
  36. <header>
  37. <p>分子生物平台</p>
  38. <span>单价:¥100/小时</span>
  39. </header>
  40. <p>位置:7栋6层-分子生物平台中心-12号终端</p>
  41. <p>有效时间:1月1日 12:00 -- 1月15日 12:00</p>
  42. </div>
  43. <div class="btn">
  44. <header>
  45. <p>剩余时长</p>
  46. <p>2天18小时</p>
  47. </header>
  48. 小计:¥300
  49. </div>
  50. </li>
  51. <li>
  52. <div class="text">
  53. <header>
  54. <p>分子生物平台</p>
  55. <span>单价:¥100/小时</span>
  56. </header>
  57. <p>位置:7栋6层-分子生物平台中心-12号终端</p>
  58. <p>有效时间:1月1日 12:00 -- 1月15日 12:00</p>
  59. </div>
  60. <div class="btn">
  61. <header>
  62. <p>剩余时长</p>
  63. <p>2天18小时</p>
  64. </header>
  65. 小计:¥300
  66. </div>
  67. </li>
  68. </ul>
  69. </el-card>
  70. <el-card header="笼位管理(共3个)"
  71. class="mt12">
  72. <ul class="cage-list">
  73. <li>
  74. <header>
  75. <p>实验用小鼠-3只</p>
  76. <el-tag type="primary"
  77. size="mini">正常</el-tag>
  78. </header>
  79. <p>位置:7栋6层-602室 4区12号架 8号笼</p>
  80. <p>到期时间:2月1日(剩余10天)</p>
  81. </li>
  82. <li>
  83. <header>
  84. <p>实验用小鼠-3只-笼位申请</p>
  85. <el-tag type="warning"
  86. size="mini">待分配</el-tag>
  87. </header>
  88. <p>位置:待分配</p>
  89. <p>申请时间:2月1日</p>
  90. </li>
  91. <li>
  92. <header>
  93. <p>实验用小鼠-3只</p>
  94. <el-tag type="primary"
  95. size="mini">正常</el-tag>
  96. </header>
  97. <p>位置:7栋6层-602室 4区12号架 8号笼</p>
  98. <p>到期时间:2月1日(剩余10天)</p>
  99. </li>
  100. </ul>
  101. </el-card>
  102. </el-col>
  103. <el-col :span="12">
  104. <el-card header="日程安排"
  105. class="calendar">
  106. <FullCalendar class="fullCalendar"
  107. ref="fullCalendar" :options="calendarOptions" />
  108. <ul>
  109. <li>仪器:需要进行第二期临床实验使用仪器</li>
  110. <li>平台:需要使用平台查找相应的案例</li>
  111. <li>笼位:进行第二次动物实验</li>
  112. <li>技术:约李老师进行第三次技术咨询</li>
  113. </ul>
  114. </el-card>
  115. <el-card header="费用统计"
  116. class="mt12 cost">
  117. <div class="chart-container">
  118. <div class="text">
  119. <header>课题组:人血球免疫蛋白应用研究课题组</header>
  120. <ul>
  121. <li>费用账单:6条待确认</li>
  122. <li>本月支出:¥567.89</li>
  123. <li>累计支出:¥1234.56</li>
  124. </ul>
  125. </div>
  126. <div id="chart"></div>
  127. </div>
  128. </el-card>
  129. </el-col>
  130. </el-row>
  131. <el-row class="flex mt12"
  132. :gutter="12">
  133. <el-col :span="24">
  134. <el-card header="日程安排">
  135. </el-card>
  136. </el-col>
  137. </el-row>
  138. </div>
  139. </el-container>
  140. </div>
  141. </div>
  142. </template>
  143. <script>
  144. import Banner from "../components/Banner";
  145. import LeftTabs from "@/components/LeftTabs";
  146. import RightContent from "@/components/RightContent";
  147. import * as echarts from "echarts";
  148. import FullCalendar from '@fullcalendar/vue'
  149. import dayGridPlugin from '@fullcalendar/daygrid'
  150. import interactionPlugin from '@fullcalendar/interaction'
  151. export default {
  152. name: "PersonalCenter",
  153. components: {
  154. Banner,
  155. LeftTabs,
  156. RightContent,
  157. FullCalendar,
  158. },
  159. data() {
  160. return {
  161. active: -1,
  162. loading: true,
  163. selectTab: {},
  164. options: [
  165. {
  166. label: "工作台",
  167. },
  168. {
  169. label: "预约信息",
  170. },
  171. {
  172. label: "通知模块",
  173. },
  174. {
  175. label: "财务中心",
  176. },
  177. ],
  178. routeList: [
  179. {
  180. name: "首页",
  181. path: "/",
  182. },
  183. {
  184. name: "个人中心",
  185. },
  186. ],
  187. breadList: [],
  188. calendarOptions: {
  189. height: 300,
  190. plugins: [dayGridPlugin, interactionPlugin], // 需要用哪个插件引入后放到这个数组里
  191. initialDate: new Date(), // 日历第一次加载时显示的初始日期。可以解析为Date的任何职包括ISO8601日期字符串,例如"2014-02-01"。
  192. initialView: "dayGridMonth", // 日历加载时的初始视图,默认值为'dayGridMonth',可以为任何可用视图的值,如例如'dayGridWeek','timeGridDay','listWeek'
  193. locale: "zh-cn", // 设置日历的语言,中文为 “zh-cn”
  194. firstDay: "1", // 设置每周的第一天,默认值取决于当前语言环境,该值为代表星期几的数字,且值必须为整数,星期日=0
  195. weekNumberCalculation: "ISO", // 指定"ISO"结果为ISO8601周数。指定"ISO"将firstDay的默认值更改为1(Monday)
  196. buttonText: {
  197. // 文本将显示在headerToolbar / footerToolbar的按钮上。不支持HTML注入。所有特殊字符将被转义。
  198. today: "今天",
  199. month: "月",
  200. week: "周",
  201. day: "天",
  202. },
  203. headerToolbar: {
  204. // 在日历顶部定义按钮和标题。将headerToolbar选项设置为false不会显示任何标题工具栏。可以为对象提供属性start/center/end或left/center/right。这些属性包含带有逗号/空格分隔值的字符串。用逗号分隔的值将相邻显示。用空格分隔的值之间会显示一个很小的间隙。
  205. right: "today prev,next",
  206. center: "title",
  207. left: "dayGridMonth,dayGridWeek,dayGridDay",
  208. },
  209. eventTimeFormat: {
  210. // 在每个事件上显示的时间的格式
  211. hour: "numeric",
  212. minute: "2-digit",
  213. hour12: false,
  214. },
  215. events: [],
  216. dateClick: this.handleDateClick, // 当用户单击日期或时间时,触发该回调,触发此回调,您必须加载interaction插件
  217. },
  218. };
  219. },
  220. mounted() {
  221. this.tabSelect(this.options[0], 0);
  222. this.initChart();
  223. },
  224. methods: {
  225. // 选择tab
  226. tabSelect(row, index) {
  227. this.active = index;
  228. this.selectTab = { ...row };
  229. this.breadList = [...this.routeList, { name: this.selectTab.label }];
  230. },
  231. initChart() {
  232. let chart = echarts.init(document.getElementById("chart"));
  233. const options = {
  234. series: [
  235. {
  236. type: "gauge",
  237. startAngle: 180,
  238. endAngle: 0,
  239. center: ["50%", "75%"],
  240. radius: "90%",
  241. min: 0,
  242. max: 1,
  243. splitNumber: 8,
  244. axisLine: {
  245. lineStyle: {
  246. width: 6,
  247. color: [
  248. [0.25, "#FF6E76"],
  249. [0.5, "#FDDD60"],
  250. [0.75, "#58D9F9"],
  251. [1, "#7CFFB2"],
  252. ],
  253. },
  254. },
  255. pointer: {
  256. icon: "path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",
  257. length: "12%",
  258. width: 20,
  259. offsetCenter: [0, "-60%"],
  260. itemStyle: {
  261. color: "auto",
  262. },
  263. },
  264. axisTick: {
  265. length: 12,
  266. lineStyle: {
  267. color: "auto",
  268. width: 2,
  269. },
  270. },
  271. splitLine: {
  272. length: 20,
  273. lineStyle: {
  274. color: "auto",
  275. width: 5,
  276. },
  277. },
  278. axisLabel: {
  279. color: "#464646",
  280. fontSize: 14,
  281. distance: -40,
  282. rotate: "tangential",
  283. formatter: function (value) {
  284. if (value === 0.875) {
  285. return "充足";
  286. } else if (value === 0.625) {
  287. return "可控";
  288. } else if (value === 0.375) {
  289. return "紧张";
  290. } else if (value === 0.125) {
  291. return "危险";
  292. }
  293. return "";
  294. },
  295. },
  296. title: {
  297. offsetCenter: [0, "-10%"],
  298. fontSize: 14,
  299. },
  300. detail: {
  301. fontSize: 20,
  302. offsetCenter: [0, "-35%"],
  303. valueAnimation: true,
  304. formatter: function (value) {
  305. return Math.round(value * 100) + "";
  306. },
  307. color: "inherit",
  308. },
  309. data: [
  310. {
  311. value: 0.7,
  312. name: "危险预算余额",
  313. },
  314. ],
  315. },
  316. ],
  317. };
  318. chart.setOption(options);
  319. },
  320. handleDateClick(dateClickInfo) {
  321. console.log(dateClickInfo)
  322. },
  323. },
  324. };
  325. </script>
  326. <style lang="scss" scoped>
  327. .flex {
  328. width: 100%;
  329. flex-wrap: wrap;
  330. .el-card {
  331. flex: 0 0 calc(50% - 14px);
  332. height: 400px;
  333. ::v-deep .el-card__body {
  334. padding: 10px;
  335. height: calc(100% - 79px);
  336. }
  337. &.calendar {
  338. height: 500px;
  339. ul {
  340. display: flex;
  341. flex-direction: column;
  342. justify-content: space-around;
  343. height: 130px;
  344. li {
  345. font-size: 14px;
  346. display: flex;
  347. align-items: center;
  348. &:before {
  349. content: '';
  350. display: inline-block;
  351. width: 6px;
  352. height: 6px;
  353. border-radius: 3px;
  354. background-color: #a30014;
  355. margin-right: 4px;
  356. }
  357. }
  358. }
  359. }
  360. &.cost {
  361. height: 300px;
  362. }
  363. }
  364. }
  365. .cage-list {
  366. display: flex;
  367. flex-wrap: wrap;
  368. list-style: none;
  369. li {
  370. height: 138px;
  371. width: 198px;
  372. font-size: 14px;
  373. border: 1px solid #ebeef5;
  374. border-radius: 6px;
  375. display: flex;
  376. flex-direction: column;
  377. justify-content: space-around;
  378. padding: 10px;
  379. &:nth-child(2n) {
  380. margin-left: 4px;
  381. }
  382. &:nth-child(n + 3) {
  383. margin-top: 4px;
  384. }
  385. header {
  386. display: flex;
  387. justify-content: space-between;
  388. p {
  389. color: #1d66dc;
  390. }
  391. }
  392. }
  393. }
  394. .platform-list {
  395. height: 100%;
  396. display: flex;
  397. flex-direction: column;
  398. li {
  399. flex: 1;
  400. display: flex;
  401. }
  402. }
  403. .chart-container {
  404. display: flex;
  405. .text {
  406. flex: 1;
  407. font-size: 14px;
  408. display: flex;
  409. flex-direction: column;
  410. header {
  411. color: #1d66dc;
  412. }
  413. ul {
  414. margin-top: 12px;
  415. flex: 1;
  416. display: flex;
  417. flex-direction: column;
  418. justify-content: space-around;
  419. }
  420. li {
  421. background-color: #e4b5bb;
  422. border-radius: 4px;
  423. padding: 4px 8px;
  424. }
  425. }
  426. #chart {
  427. width: 233px;
  428. height: 220px;
  429. }
  430. }
  431. </style>