|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706 |
- <template>
- <div class="psychological-container">
- <van-nav-bar :title="emoName + '监测'" :border="true" :left-arrow="true" @click-left="onNavBack">
- <template #left>
- <van-icon name="arrow-left" size="24" style="padding: 0" />
- <span>返回</span>
- </template>
- </van-nav-bar>
- <div class="tab-bar">
- <div class="date-tab-con">
- <div class="date-tab-list">
- <div :class="[
- 'date-tab-item',
- { active: current === index, notClick: false },
- ]" @click="onTabClick(item.value, index)" v-for="(item, index) in dateList" :key="index">
- <img :src="tabImgUrl" alt v-if="index == 3" />
- <span>{{ item.text }}</span>
- <img class="more" :src="selectDownImg" alt v-if="index == 3" />
- </div>
- </div>
- </div>
- </div>
- <!-- 情绪切换 -->
- <div class="psy-tab-bar" v-if="pageType !== 1">
- <div class="psy-tab-con">
- <div class="psy-tab-list">
- <div :class="[
- 'psy-tab-item',
- { active: psyCurrent === index, notClick: false },
- ]" @click="onPsyTabClick(item.name, index)" v-for="(item, index) in psyList" :key="index">
- <span>{{ item.text }}</span>
- </div>
- </div>
- </div>
- </div>
- <div class="main" v-show="current !== 3">
- <div class="top">
- <!-- 日期选择 -->
- <!-- 标题 -->
- <div class="title">
- <div class="title-left">
- {{ titleLeft }}<van-icon name="question-o" @click="onHelp" />
- </div>
- <div class="title-right" v-show="currentDays === 0">
- <div class="title-right-button" @click="onPsychologicalScale">量表记录</div>
- <div class="title-right-button" @click="onHistory">历史监测</div>
- </div>
- </div>
- <!-- 日历 -->
-
- <van-dialog class="calenddar-dialog" v-model="calendarDialogShow" :show-confirm-button="false"
- :show-cancle-button="false" :close-on-click-overlay="true" ref="calenddarDialog">
- <template #default>
- <div class="calendar" ref="calendarCon">
- <van-calendar v-model="calendarShow" :min-date="minDate" :max-date="maxDate" :default-date="defaultDate"
- :round="false" :poppable="false" color="#62BD48" :show-confirm="false" :show-title="false"
- :show-subtitle="false" :formatter="formatter" @select="onSelect" />
- </div>
- </template>
- </van-dialog>
-
- <!-- 监测次数 -->
- <div class="monitoring-count">
- <p>监测次数:{{ monitoringCount || "0" }}次</p>
- </div>
-
- <!-- 折线图-非日报 -->
-
- <div class="pie-chart-con">
- <div class="pie-chart-left">
- <div id="pieChart" ref="pieChart"></div>
- </div>
-
- <div class="pie-chart-right">
- <div class="list">
- <div class="item" v-for="(item, index) in pieRightList" :key="index">
- <div class="item-left">
- <div class="circle" :style="{ backgroundColor: item.color }"></div>
-
- <span class="text">{{ item.text || "--" }}</span>
- </div>
-
- <div class="item-right">
- <span :style="{ color: item.color }">{{
- item.count ? item.count + "次" : "0次"
- }}</span>
- <label :style="{ color: item.color }">{{
- item.percentage ? "(" + item.percentage + "%" + ")" : "(0%)"
- }}</label>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <!-- 统计 -->
-
- <div class="statistics">
- <div class="list">
- <div class="item" v-for="(item, index) in statisticsList" :key="index">
- <div class="top">
- <span>{{ item.label || "--" }}</span>
- </div>
-
- <div class="middle">
- <span :style="{ color: calcResultColor(item.level) }">{{
- item.value || "--"
- }}</span>
- </div>
-
- <div class="bottom">
- <span>{{ item.time || "--" }}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 分割线 -->
- <div class="line"></div>
- <!-- 底部 -->
- <div class="bottom">
- <div class="echart-container">
- <div class="echart" ref="charts"></div>
- </div>
-
- <div class="line-gray"></div>
-
- <div class="result" v-if="monitoringCount == ''">
- <div class="result-con">
- <div class="title">
- <span class="title-no-data">结果解读</span>
- <div class="no-data">
- <img src="../../../assets/img/no_data_01.png" alt />
- <p>暂无数据</p>
- </div>
- </div>
- </div>
- </div>
-
- <div class="result" v-else>
- <div class="result-con reminder" v-show="current === 0">
- <div class="title">
- <span class="title-reminder">结果解读</span>
-
- <p class="title-emo" :style="{ color: currentColor }">
- {{ this.$replaceAll(result, '抑郁', '忧郁') }}
- </p>
-
- <span class="font-28"><!-- 继续保持积极乐观,培养健康的生活习惯,预防消极事件对情绪带来的不良影响。 -->{{
- advice
- }}</span>
- </div>
-
- <div class="friendly-reminder" v-if="emoType === 2">
- <p :style="{ color: currentColor }">友情提示:</p>
- <span>如果您发现{{ anxietyText }}倾向分值升高或处于轻度水平,不需要过度紧张,这可能是由正常的情绪波动或者生活习惯(睡眠时间、运动量等)的改变造成的。如果您发现{{ anxietyText
- }}倾向分值连续7天及以上处于中度或重度水平,建议您寻求家人朋友或心理咨询师的帮助,及早进行干预。</span>
- </div>
-
- <div class="warm-reminder">
- <p :style="{ color: currentColor }">温馨提示:</p>
- <span>{{ warmTips }}</span>
- </div>
- </div>
-
- <div class="result-con" v-show="current > 0">
- <div class="title">
- <span class="title-text">{{ surveyTitle }}</span>
- <div class="mood-list" v-if="emotionList.length > 0">
- <div class="item" v-for="(item, index) in emotionList" :key="index">
- <p>
- <span :style="{ color: item.color }" class="day">{{
- item.days
- }}</span>
- <span class="day-text">天</span>
- </p>
-
- <p>{{ item.text }}</p>
- </div>
- </div>
- <div class="mood-list-no-data" v-else>
- <div class="no-data">
- <img src="../../../assets/img/no_data_01.png" alt />
- <p>暂无数据</p>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <!-- -->
- </div>
- </div>
- <!-- 周报菜单 -->
- <div class="main report" v-show="current == 3">
- <div class="content">
- <div class="list" v-if="pageType === 0 && weekList.length > 0">
- <div class="item" v-for="(item, index) in weekList" :key="index" @click="onClickItem(item)">
- <div class="left">
- <img :src="weekImg" alt />
- <div class="middle">
- <div class="title">
- <span>周报</span>
- <p>{{ item.name }}</p>
- </div>
- <div class="overall">
- <span>总评</span>
- <div class="left">
-
- <p :style="{ color: calcResultColor(item.summaryLevel) }">
- {{ item.summary }}
- </p>
- </div>
- </div>
- </div>
- </div>
-
- <div class="right">
- <img :src="moreImg" alt />
- </div>
- </div>
- </div>
- <div class="list" v-if="pageType === 1 && weekResultList.length > 0">
- <div class="item" v-for="(item, index) in weekResultList" :key="index" @click="onClickItem(item[1])">
- <div class="left">
- <img :src="weekImg" alt />
- <div class="middle">
- <div class="title">
- <span>周报</span>
- <p>{{ item[1].name }}</p>
- </div>
- <div class="overall">
- <span>总评</span>
- <div class="left">
- <p v-for="(su, index) in item[1].summaryDetails" :key="index" :style="{ color: calcResultColor(su.summaryLevel) }">
- {{ su.summary }}
- </p>
- <!-- <p :style="{ color: calcResultColor(item.summaryLevel) }">
- {{ item.summary }}
- </p>
- <p :style="{ color: calcResultColor(item.summaryLevel) }">
- {{ item.summary }}
- </p>
- <p :style="{ color: calcResultColor(item.summaryLevel) }">
- {{ item.summary }}
- </p> -->
- </div>
- </div>
- <!-- <div class="trend">
- <p>( <span>无抑郁倾向</span><span>5%</span>,<span>轻度抑郁倾向</span> <span>5%</span> )</p>
- </div>-->
- </div>
- </div>
-
- <div class="right">
- <img :src="moreImg" alt />
- </div>
- </div>
- </div>
- <div class="list no-data" v-if="weekList.length < 1 && weekResultList.length < 1 ">
- <img :src="noDataImg" alt />
- <p>连续佩戴两周产生对比数据</p>
- </div>
- </div>
- </div>
- <!-- 弹出层 -->
- <van-popup v-model="isPopup">
- <div class="popup">
- <div class="item science-tips first" v-if="emoType === 2">
- <div class="tips">
- <h5>小科普</h5>
- </div>
- <p>
- {{ anxietyText }}症是一种心理疾病,严重时可发展为精神障碍。然而当我们体会到了痛苦、悲伤、和郁闷等负面情绪,并不意味着我们就是{{ anxietyText
- }}症。日常的短时的喜、怒、哀、乐,都是正常的情绪变化,然而长期的低落情绪、兴趣缺失等可能会让我们有{{ anxietyText }}的风险。
- </p>
- </div>
- <div class="item">
- <h5 v-html="title1"></h5>
- <div v-html="article1"></div>
- </div>
- <div class="item">
- <h5 v-html="title2"></h5>
- <div v-html="article2"></div>
- </div>
- <van-button size="large" @click="onClose">返回</van-button>
- </div>
- </van-popup>
- </div>
- </template>
-
- <script>
- import { EmotionModel, PsyBaseUrl, } from "@/config/models";
- import axios from "axios";
- export default {
- name: "psychological-monitor",
- data() {
- return {
- // 日期选择标签
- dateList: [
- { name: "today", text: "今天", value: 0 },
- { name: "week", text: "前7天", value: 7 },
- { name: "month", text: "前30天", value: 30 },
- { name: "weekReport", text: "周报", value: 49 },
- ],
- // 情绪tab
- psyList: [
- { name: "tiredness", text: "疲劳", value: 0 },
- { name: "stress", text: "压力", value: 1 },
- { name: "depression", text: this.$replaceAll('抑郁', '抑郁', '忧郁'), value: 2 },
- ],
- // 当前情绪下标
- psyCurrent: 0,
- current: 0, // 日期选择标签-当前选中的标签
- currentDays: 0, //日期选择标签-日期参数
- emotionData: [], //情绪数据,TODO 接口对接
- echarts: null, //折线图
- itemHeight: Number(((document.body.clientWidth / 750) * 95).toFixed()), // 日历组件item高度
- xAxisData: [], //图表x轴展示的数据
- monitoringCount: "", //监测次数
- pieEcharts: null, //饼状图
- pieData: [], //饼状图数据
- //饼状图右边数据,TODO 根据接口数据和 模块 重新封装数组
- pieRightList: [
- /* {
- text: "无情绪倾向",
- count: 12,
- percentage: "80",
- color: "#62BD48"
- },
- {
- text: "轻度情绪倾向",
- count: 2,
- percentage: "80",
- color: "#ffde00"
- },
- {
- text: "中度情绪倾向",
- count: 1,
- percentage: "80",
- color: "#ff8a00"
- },
- {
- text: "重度情绪倾向",
- count: 1,
- percentage: "80",
- color: "#d70d0d"
- } */
- ],
- // 情绪状态列表
- statisticsList: [
- /* { label: "最大值", value: "75", time: "08:15" },
- { label: "最小值", value: "40", time: "10:15" },
- { label: "最近值", value: "50", time: "18:15" } */
- ],
- // 周报-情绪计算
- emotionList: [
- /* { days: "5", text: "无情绪倾向", color: "#62BD48" },
- { days: "4", text: "轻度情绪倾向", color: "#ffde00" },
- { days: "3", text: "中度情绪倾向", color: "#ff8a00" },
- { days: "2", text: "重度情绪倾向", color: "#ACACAC" } */
- ],
- // 弹窗-日历是否显示
- calendarDialogShow: false,
- // 日历是否显示,默认为true
- calendarShow: true,
- // 日历 默认最小可选择日期,默认为最近1个月
- minDate: new Date(
- this.$dayjs()
- .month(this.$dayjs().month() - 1)
- .hour(0)
- .minute(0)
- .second(0)
- .format()
- ),
- // 日历 默认最小可选择日期,默认为当前时间
- maxDate: new Date(this.$dayjs().hour(0).minute(0).second(0).format()),
- // 默认日历日期时间
- defaultDate: new Date(this.$dayjs().hour(0).minute(0).second(0).format()),
- // 路由传过来的情绪参数
- emoName: "",
- // 默认折线图 Series 配置
- defaultSeries: null,
- // 非日报折线图 Series 配置
- weekAndMonthSeries: null,
- // 当前情绪类型
- emoType: "",
- // 结果解读
- result: "",
- // 需要高亮的日期数组
- highlightDates: [],
- // 选中的日历日期
- selectDate: "",
- uid: "",
- // 建议
- advice: "",
- // 底部天数标题
- surveyTitle: "" || "7天概览",
- // 路由中的日期
- routeDate: "",
- // 路由参数
- params: {},
- // 是否显示帮助
- isPopup: false,
- // 结果等级
- resultLevel: "",
- // 轻度级别颜色
- mildColor: "#ffde00",
- // 中度级别颜色
- severeColor: "#ff8a00",
- // 重度级别颜色
- moderateColor: "#d70d0d",
- // 7天和30天最大数据列表
- weekAndMonData: [],
- tabImgUrl: require("@/assets/img/psychological/statistical_form.png"),
- selectDownImg: require("@/assets/img/psychological/select_down.png"),
- weekImg: require("@/assets/img/psychological/week_report.png"),
- moreImg: require("@/assets/img/psychological/more.png"),
- noDataImg: require("@/assets/img/no_data_01.png"),
- weekList: [],
- startDate: "", //接口需要的开始时间
- endDate: "", //接口需要的结束时间
- currentEmoName: "", //当前情绪名称
- weekResultList: [], //周报新详情周报列表
- };
- },
- computed: {
- // 页面类型,0 保持不动,1显示方式为新页面显示方式
- pageType() {
- return Number(this.$route.query.pageType) || 0
- },
- anxietyText() {
- const appTypeList = ['1'];
- return appTypeList.indexOf(this.$store.getters.appType) > -1 ? `忧郁` : `抑郁`
- },
- // 默认折线图配置,echarts 具体配置 见 https://echarts.apache.org/zh/option.html#title
- defaultOptions() {
- return {
- time: {
- useUTC: false,
- },
- title: {
- text: this.echartsTitle,
- left: 1,
- right: 25,
- bottom: 20,
- top: "3%",
- textStyle: {
- fontSize: 16,
- fontWeight: "bold",
- },
- },
- legend: {
- width: "65%",
- orient: "horizontal",
- right: "5%",
- top: 1,
- bottom: "1%",
- itemHeight: 12,
- itemWidth: 12,
- itemGap: 10,
- align: "left",
- selectedMode: false,
- data: [
- {
- name: `无${this.emoName}倾向`,
- icon: "rect",
-
- itemStyle: {
- color: "#62BD48",
- },
- textStyle: {
- fontSize: 12,
- },
- },
- {
- name: `轻度${this.emoName}倾向`,
- icon: "rect",
- itemStyle: {
- color: "#ffde00",
- },
- textStyle: {
- fontSize: 12,
- },
- },
- {
- name: `中度${this.emoName}倾向`,
- itemStyle: {
- color: "#ff8a00",
- },
- icon: "rect",
- textStyle: {
- fontSize: 12,
- },
- },
- {
- name: `重度${this.emoName}倾向`,
- itemStyle: {
- color: "#d70d0d",
- },
- icon: "rect",
- textStyle: {
- fontSize: 12,
- },
- },
- ],
- formatter: function (name) {
- // 自定义显示内容
- if (name.length > 6) {
- return name.substring(0, 6) + "\n" + name.substring(6);
- } else {
- return name;
- }
- },
- },
- grid: {
- show: true,
- borderWidth: 1,
- top: "20%",
- left: "1%",
- right: "5%",
- bottom: "10%",
- containLabel: true,
- },
- xAxis: {
- type: "category",
- axisLine: {
- show: false,
- },
- textStyle: {
- fontSize: 10,
- },
- axisTick: {
- show: false,
- },
- splitLine: {
- show: false,
- lineStyle: {
- color: "#ddd",
- width: 2,
- },
- },
- nameLocation: "center",
- axisLabel: {
- show: true,
- fontSize: 12,
- showMinLabel: true, //显示最小值
- showMaxLabel: true, //显示最大值
- },
- data: this.xAxisData,
- },
- dataZoom: [
- /* {
- type: "inside",
- start: 0,
- end: 100,
- }, */
- {
- start: 0,
- end: 100,
- textStyle: {
- color: "#FFF",
- fontSize: 14,
- },
- show: true,
- height: 15,
- bottom: 5,
- handleStyle: {
- borderWidth: 1,
- borderCap: "square",
- },
- },
- ],
- tooltip: {
- trigger: "axis",
- textStyle: {
- fontSize: 14,
- align: "center",
- },
- formatter: function (params) {
- return (
- params[0].marker +
- params[0].name +
- "--" +
- params[0].value +
- "</br>"
- );
- },
- },
- yAxis: {
- type: "value",
- max: 100,
- min: 0,
- interval: 20,
- splitNumber: 1,
- boundaryGap: ["5%", "5%"],
- nameTextStyle: {
- fontSize: 13,
- },
- alignTicks: true,
- axisTick: {
- show: true,
- },
- axisLabel: {
- show: true,
- fontSize: 13,
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: "#ddd",
- width: 1,
- },
- },
- },
- series: [
- {
- name: `无${this.emoName}倾向`,
- type: "line",
- padding: 5,
- data: this.emotionData,
- symbol: "circle",
- symbolSize: 8,
- },
- {
- name: `轻度${this.emoName}倾向`,
- type: "line",
- data: "",
- },
- {
- name: `中度${this.emoName}倾向`,
- type: "line",
- data: "",
- },
- {
- name: `重度${this.emoName}倾向`,
- type: "line",
- data: "",
- },
- ],
- };
- },
- imei() {
- return this.$store.getters.serialNo;
- },
- // 饼状图配置
- pieOption() {
- return {
- tooltip: {
- trigger: "item",
- textStyle: {
- fontSize: 14,
- },
- position: "right",
- },
- legend: {
- top: "5%",
- left: "center",
- show: false,
- },
- series: [
- {
- type: "pie",
- radius: ["40%", "80%"],
- avoidLabelOverlap: false,
- startAngle: 270, // 设置逆时针渲染
- itemStyle: {
- borderRadius: 5,
- borderColor: "#fff",
- borderWidth: 2,
- fontSize: 16,
- },
- label: {
- show: false,
- position: "center",
- fontSize: 16,
- },
- emphasis: {
- label: {
- show: false,
- fontSize: 16,
- fontWeight: "bold",
- },
- },
- labelLine: {
- show: false,
- },
- data: this.pieData,
- },
- ],
- };
- },
- titleLeft() {
- let text = this.emoName === "depression" ? "趋势" : "";
- let today = "";
- if (this.currentDays !== 0) {
- today = "";
- } else {
- today =
- this.$dayjs(this.selectDate || this.defaultDate).format(
- "YYYY-MM-DD"
- ) === this.$dayjs(new Date()).format("YYYY-MM-DD")
- ? "今天"
- : "";
- }
- return `${today}${this.emoName}倾向${text}`;
- },
- // 折线图标题
- echartsTitle() {
- let today = "";
- if (this.currentDays !== 0) {
- today = "";
- } else {
- today =
- this.$dayjs(this.selectDate || this.defaultDate).format(
- "YYYY-MM-DD"
- ) === this.$dayjs(new Date()).format("YYYY-MM-DD")
- ? "今天"
- : "";
- }
- return `${today}${this.emoName}数据图`;
- },
- warmTips() {
- return `正常连续佩戴腕表,每${this.emoType == 2 ? "一" : "半"
- }小时计算一个${this.emoName}分值。`;
- /* return `正常连续佩戴手表,每半小时计算一个${this.emoName}分值,睡眠期间不进行计算。` */
- },
- title1() {
- return this.params.name ? this.$replaceAll(EmotionModel[this.params.name].title1, '抑郁', '忧郁') : ''
- },
- article1() {
- return this.params.name ? this.$replaceAll(EmotionModel[this.params.name].article1, '抑郁', '忧郁') : ''
- },
- title2() {
- return this.params.name ? this.$replaceAll(EmotionModel[this.params.name].title2, '抑郁', '忧郁') : ''
- },
- article2() {
- return this.params.name ? this.$replaceAll(EmotionModel[this.params.name].article2, '抑郁', '忧郁') : ''
- },
- // 当前情绪颜色
- currentColor() {
- return this.calcResultColor(this.resultLevel) || "#62BD48";
- },
- },
- watch: {
- // 监听数据发生变化 初始化各项图表
- emotionData: {
- handler(n, o) {
- this.initEchart();
- },
- deep: true,
- },
- xAxisData: {
- handler(n, o) {
- this.initEchart();
- },
- deep: true,
- },
- pieData: {
- handler(n, o) {
- this.initPieEchart();
- },
- deep: true,
- },
- },
- created() {
- // 读取路由传过来的参数,根据路由传过来的参数判断是哪种情绪
- this.loadParams();
- this.initEchartText();
- /* this.getPieData(); */
- this.getCalendarData();
- this.getPsychologiclData();
- this.getWeekResult();
- },
- mounted() {
- this.initEchart();
- if(this.params.current) {
- this.current = Number(this.params.current);
- } else {
- this.current = Number(this.$store.getters.tabClick) || 0;
- }
-
- this.currentDays = this.calcDaysByTabClick(
- Number(this.$store.getters.tabClick)
- );
- this.psyCurrent = this.calcPsyTabindex(EmotionModel[this.params.name].type);
- window.document.title = "心理监测";
- if(this.pageType === 1) {
- this.getWeekResultAny();
- }
- },
- methods: {
- loadParams() {
- let params = this.$route.query;
- if (params) {
- this.emoName = this.$replaceAll(EmotionModel[params.name].name, '抑郁', '忧郁');
- this.emoType = EmotionModel[params.name].type;
- this.uid = params.uid;
- this.routeDate = params.date;
- this.params = params;
- this.currentEmoName = params.name;
- if (params.date) {
- this.dateList[0].text =
- this.$dayjs(params.date).format("YYYY-MM-DD") ===
- this.$dayjs(new Date()).format("YYYY-MM-DD")
- ? "今天"
- : this.$dayjs(params.date).format("MM-DD");
- this.defaultDate = new Date(
- this.$dayjs(params.date).hour(0).minute(0).second(0).format()
- );
- }
- }
- },
- // 计算点击的天数
- calcDaysByTabClick(value) {
- let days = "";
- console.log("value", value);
- switch (value) {
- case 0:
- days = 0;
- break;
- case 1:
- days = 7;
- break;
- case 2:
- days = 30;
- break;
- case 3:
- days = 49;
- break;
- default:
- break;
- }
- return days;
- },
- // 计算psyTab的下标值
- calcPsyTabindex(type) {
- let psyIndex = "";
- switch (type) {
- case 1:
- psyIndex = 1;
- break;
- case 2:
- psyIndex = 2;
- break;
- case 3:
- psyIndex = 0;
- break;
- default:
- break;
- }
- return psyIndex;
- },
- // 获取这个月中有数据的日期,控制日历组件的日期样式
- getCalendarData() {
- let currentDate = new Date();
- // 获取最近30天的心情等级日历数据
- let dateList = this.getPostDate(currentDate, 30, true);
- let reqUrl = `${PsyBaseUrl}/api/Data/GetCalendarData`;
- let reqParams = {
- uid: this.uid,
- startDate: dateList[0],
- endDate: dateList[1],
- };
- axios
- .get(reqUrl, {
- params: { ...reqParams },
- headers: { AccessToken: this.$store.getters.ssjlToken },
- })
- .then((res) => {
- if (res.data) {
- let data = res.data.response;
- // const mergedArr = [...new Set([...arr1, ...arr2, ...arr3])];
- /* let name = this.params.name.charAt(0).toUpperCase()+ this.params.name.slice(1); */
- let currentName = this.currentEmoName;
- let list = [];
- if (currentName === "stress") {
- list = data.Stress;
- } else if (currentName === "depression") {
- list = data.Depression;
- } else {
- list = data.Tiredness;
- }
- list = list.map((item) => {
- item.Date = this.$dayjs(item.Date.replace(/-/g, "/")).format(
- "YYYY/MM/DD"
- );
- return item;
- });
- this.highlightDates = [...list];
- }
- });
- },
- // 获取饼状图数据,TODO 对接接口数据
- getPieData() {
- this.pieData = [
- { value: 12, name: "", itemStyle: { color: "green" } },
- { value: 2, name: "", itemStyle: { color: "orange" } },
- { value: 1, name: "", itemStyle: { color: "#FFC0CB" } },
- { value: 1, name: "", itemStyle: { color: "red" } },
- ];
- },
- // 获取情绪数据
- getPsychologiclData(date, startDate, endDate) {
- this.$toast.loading({
- message: "数据加载中",
- });
- let reqDate = date
- ? this.$dayjs(date).format("YYYY-MM-DD")
- : this.routeDate ||
- this.$dayjs(this.defaultDate).format("YYYY-MM-DD"); /* "2023-05-23" */
- let reqParams = {
- uid: this.uid,
- startDate: startDate || reqDate,
- endDate: endDate || reqDate,
- type: this.emoType,
- };
- console.log("请求参数", reqParams);
- let reqUrl = `${PsyBaseUrl}/api/Data/GetHisData`;
- axios
- .get(reqUrl, {
- params: { ...reqParams },
- headers: { AccessToken: this.$store.getters.ssjlToken },
- })
- .then((res) => {
- if (res.data) {
- let data = res.data.response;
- // 监测次数
- this.monitoringCount = data.Count;
- this.pieRightList = [];
- this.statisticsList = [];
- this.emotionList = [];
- let None = {
- count: data.None,
- percentage: this.calcPercentage(data.None, data.Count),
- text: `无${this.emoName}倾向`,
- color: "#62BD48",
- };
- let Mild = {
- count: data.Mild,
- percentage: this.calcPercentage(data.Mild, data.Count),
- text: `轻度${this.emoName}倾向`,
- color: "#ffde00",
- };
- let Moderate = {
- count: data.Moderate,
- percentage: this.calcPercentage(data.Moderate, data.Count),
- text: `中度${this.emoName}倾向`,
- color: "#ff8a00",
- };
- let Severe = {
- count: data.Severe,
- percentage: this.calcPercentage(data.Severe, data.Count),
- text: `重度${this.emoName}倾向`,
- color: "#d70d0d",
- };
- // 饼状图右边数据
- this.pieRightList.push(None);
- this.pieRightList.push(Mild);
- this.pieRightList.push(Moderate);
- this.pieRightList.push(Severe);
- this.pieData = this.pieRightList.map((item) => {
- item.value = item.count;
- item.itemStyle = {
- color: item.color,
- };
- return item;
- });
- // 最大,最小和最近值
- let Max = {
- label: "最大值",
- value: data.Max,
- time: data.MaxDesc
- ? this.currentDays === 0
- ? this.$dayjs(data.MaxDesc).format("HH:mm")
- : this.$dayjs(data.MaxDesc).format("MM/DD HH:mm")
- : "",
- level: data.MaxLevel
- };
- let Min = {
- label: "最小值",
- value: data.Min,
- time: data.MinDesc
- ? this.currentDays === 0
- ? this.$dayjs(data.MinDesc).format("HH:mm")
- : this.$dayjs(data.MinDesc).format("MM/DD HH:mm")
- : "",
- level: data.MinLevel
- };
- let Avg = {
- label: "平均值",
- value: data.Avg,
- time: data.AvgDesc
- ? this.currentDays === 0
- ? this.$dayjs(data.AvgDesc).format("HH:mm")
- : this.$dayjs(data.AvgDesc).format("MM/DD HH:mm")
- : "",
- level: data.AvgLevel
- };
- let Current = {
- label: "最近值",
- value: data.Current,
- time: data.CurrentDesc
- ? this.currentDays === 0
- ? this.$dayjs(data.CurrentDesc).format("HH:mm")
- : this.$dayjs(data.CurrentDesc).format("MM/DD HH:mm")
- : "",
- level: data.CurrentLevel
- };
- this.statisticsList.push(Max);
- this.statisticsList.push(Min);
- this.statisticsList.push(Avg);
- this.statisticsList.push(Current);
- // 周报月报底部显示数据
- let NoneDay = {
- days: data.NoneDay,
- text: `无${this.emoName}倾向`,
- color: "#62BD48",
- };
- let MildDay = {
- days: data.MildDay,
- text: `轻度${this.emoName}倾向`,
- color: "#ffde00",
- };
- let ModerateDay = {
- days: data.ModerateDay,
- text: `中度${this.emoName}倾向`,
- color: "#ff8a00",
- };
- let SevereDay = {
- days: data.SevereDay,
- text: `重度${this.emoName}倾向`,
- color: "#d70d0d",
- };
- this.emotionList.push(NoneDay);
- this.emotionList.push(MildDay);
- this.emotionList.push(ModerateDay);
- this.emotionList.push(SevereDay);
- // 图表数据
- this.emotionData = data.ChartDatas.map((item) => {
- return {
- value: item.Value,
- itemStyle: {
- color: this.calcResultColor(item.Level),
- },
- };
- });
- // 7天 和 30天柱形图显示
- this.weekAndMonData = data.ChartDatas.map((item, index) => {
- return {
- value: [index, item.MinValue, item.MaxValue],
- };
- });
- // x轴显示数据
- if (this.currentDays === 0) {
- // 显示今天数据
- this.xAxisData = data.ChartDatas.map((item) => {
- return this.$dayjs(item.Key.replace(/-/g, "/")).format("HH:mm");
- });
- } else {
- this.xAxisData = data.ChartDatas.map((item) => {
- return this.$dayjs(item.Key.replace(/-/g, "/")).format("MM/DD");
- });
- let emphasisStyle = {
- itemStyle: {
- shadowBlur: 10,
- shadowColor: "rgba(0,0,0,0.3)",
- },
- };
- let that = this;
- // 7天和30天变成柱状图
- this.weekAndMonthSeries = [
- {
- name: "平均值",
- type: "scatter",
- symbolSize: 8,
- data: this.emotionData,
- },
- {
- name: "",
- type: "custom",
- data: this.weekAndMonData,
- renderItem: function (params, api) {
- var categoryIndex = api.value(0);
- var end = api.coord([categoryIndex, api.value(1)]);
- var start = api.coord([categoryIndex, api.value(2)]);
- var width = 8;
- var rectShape = that.$echarts.graphic.clipRectByRect(
- {
- x: start[0] - width / 2,
- y: start[1],
- width: 8,
- height: end[1] - start[1],
- },
- {
- x: params.coordSys.x,
- y: params.coordSys.y,
- width: params.coordSys.width,
- height: params.coordSys.height,
- }
- );
- if (rectShape) {
- rectShape.r = [10];
- }
- return (
- rectShape && {
- type: "rect",
- shape: rectShape,
- style: api.style(),
- }
- );
- },
- itemStyle: {
- opacity: 0.8,
- },
- encode: {
- y: [1, 2],
- x: 0,
- },
- },
- {
- name: `轻度${this.emoName}倾向`,
- type: "scatter",
- symbolSize: 8,
- data: "",
- },
- {
- name: `中度${this.emoName}倾向`,
- type: "scatter",
- symbolSize: 8,
- data: "",
- },
- {
- name: `重度${this.emoName}倾向`,
- type: "scatter",
- symbolSize: 8,
- data: "",
- },
- {
- name: `无${this.emoName}倾向`,
- type: "scatter",
- symbolSize: 8,
- data: "",
- },
- ];
- // 点击提示此时为空
- this.defaultOptions.tooltip = {
- trigger: "axis",
- formatter: function (params) {
- return (
- params[0].marker +
- "平均值:" +
- params[0].name +
- "--" +
- params[0].value +
- "</br>" +
- params[1].marker +
- "最大值:" +
- params[1].name +
- "--" +
- params[1].value[2] +
- "</br>" +
- params[1].marker +
- "最小值:" +
- params[1].name +
- "--" +
- params[1].value[1]
- );
- },
- };
- this.defaultOptions.series = this.weekAndMonthSeries;
- }
- // 结果解读
- this.result = data.Result;
- this.resultLevel = data.ResultLevel;
- this.advice = data.Advice;
- this.$toast.success({
- message: "数据加载完成",
- });
- }
- })
- .catch(() => {
- this.$dialog({
- message: "登录过期,请重新进入",
- });
- })
- .finally(() => { });
- },
- // 计算百分比
- calcPercentage(value, total) {
- if (
- typeof value !== "number" ||
- typeof total !== "number" ||
- total === 0
- ) {
- return 0;
- }
- let milValue = value * 1000;
- let milTotal = total * 1000;
- return Math.round((milValue / milTotal) * 100);
- },
- // 初始化图表的文字内容
- initEchartText() {
- let text = this.emoName === "depression" ? "趋势" : "";
- let today =
- this.$dayjs(this.defaultDate).format("YYYY-MM-DD") ===
- this.$dayjs(new Date()).format("YYYY-MM-DD")
- ? "今天"
- : "";
- this.result = `无${this.emoName}倾向`;
- this.defaultSeries = [
- {
- name: ``,
- type: "line",
- padding: 5,
- data: this.emotionData,
- symbol: "circle",
- symbolSize: 8, // 拐点圆的大小
- areaStyle: {},
- },
- {
- name: `轻度${this.emoName}倾向`,
- type: "line",
- padding: 10,
- data: "",
- symbol: "circle",
- symbolSize: 8, // 拐点圆的大小
- },
- {
- name: `中度${this.emoName}倾向`,
- type: "line",
- data: "",
- },
- {
- name: `重度${this.emoName}倾向`,
- type: "line",
- data: "",
- },
- ];
- this.pieRightList = this.pieRightList.map((item) => {
- item.text = item.text.replace("情绪", this.emoName);
- return item;
- });
- },
- // 初始化饼状图
- initPieEchart() {
- if (
- this.pieEcharts != null &&
- this.pieEcharts != "" &&
- this.pieEcharts != undefined
- ) {
- this.pieEcharts.dispose();
- }
- this.pieEcharts = this.$echarts.init(this.$refs.pieChart);
- this.pieEcharts.setOption(this.pieOption);
- },
- // 格式化日期显示参数
- formatter(day) {
- const month = day.date.getMonth() + 1;
- const date = day.date.getDate();
- const formatDate = this.$dayjs(day.date).format("YYYY/MM/DD");
- const currentDate = this.$dayjs(new Date()).format("YYYY/MM/DD");
- day.className = "custom-calendar";
- for (let h = 0; h < this.highlightDates.length; h++) {
- if (this.highlightDates[h].Date === formatDate) {
- day.className = `highlight-border ${this.calcResultColor(
- this.highlightDates[h].SummaryLevel,
- true
- )}`;
- } else if (formatDate === currentDate) {
- day.text = "今天";
- }
- }
- return day;
- },
- // 返回
- onNavBack() {
- this.params.name = "";
- this.$router.replace({
- name: "psychologicalMain",
- query: {
- ...this.params,
- },
- });
- },
- // 点击日期选择
- onTabClick(value, index) {
- this.current = index;
- this.currentDays = value;
- this.$store.commit("tabClick", index);
- let currentDate = value === 0 ? new Date() : new Date(this.$dayjs().subtract(1, 'days'))
- this.surveyTitle = value === 7 ? "7天概览" : "30天概览";
- if (value === 7) {
- let dateList = this.getPostDate(currentDate, 6, true);
- this.getPsychologiclData("", dateList[0], dateList[1]);
- this.startDate = dateList[0];
- this.endDate = dateList[1];
- } else if (value === 0) {
- // 今天
- this.defaultOptions.xAxis.data = this.xAxisData;
- this.defaultOptions.series = this.defaultSeries;
- this.defaultOptions.series[0].data = this.emotionData;
- this.getPsychologiclData(
- this.selectDate
- ? this.selectDate
- : this.$dayjs(currentDate).format("YYYY-MM-DD")
- );
- this.startDate =
- this.selectDate || this.$dayjs(currentDate).format("YYYY-MM-DD");
- this.endDate =
- this.selectDate || this.$dayjs(currentDate).format("YYYY-MM-DD");
- } else if (value === 30) {
- // 30天
- this.defaultOptions.xAxis.data = this.xAxisData;
- this.defaultOptions.series = this.defaultSeries;
- this.defaultOptions.series[0].data = this.emotionData;
- let dateList = this.getPostDate(currentDate, 30, true);
- this.getPsychologiclData("", dateList[0], dateList[1]);
- this.startDate = dateList[0];
- this.endDate = dateList[1];
- } else {
- // 周报菜单
-
- if(this.pageType !== 1) {
- this.getWeekResult();
- } else {
- this.getWeekResultAny();
- }
-
- }
- },
- // 点击情绪tab
- onPsyTabClick(name, index) {
- this.psyCurrent = index;
- this.emoName = this.$replaceAll(EmotionModel[name].name, '抑郁', '忧郁');
- this.currentEmoName = name;
- this.emoType = EmotionModel[name].type;
- console.log("this.currentDays", this.currentDays);
- if (this.currentDays === 49) {
- // 即点击了周报,此时调用获取周报接口
- this.getWeekResult();
- } else {
-
- this.getPsychologiclData(this.selectDate, this.startDate, this.endDate);
- }
- this.getCalendarData();
- },
- getCurrentMonthStaAndEnd(currentDate) {
- let list = [];
- let monthStart = new Date(
- currentDate.getFullYear(),
- currentDate.getMonth(),
- 1
- ); // 获取本月第一天的日期时间
- let monthEnd = new Date(
- currentDate.getFullYear(),
- currentDate.getMonth() + 1,
- 0,
- 23,
- 59,
- 59
- ); // 获取本月最后一天的日期时间(时间为23:59:59)
- list.push(this.$dayjs(monthStart).format("YYYY-MM-DD"));
- list.push(this.$dayjs(monthEnd).format("YYYY-MM-DD"));
- return list;
- },
- // 获取指定天数的起始日期
- /**
- *
- * @param dateNow :Date类
- * @param intervalDays :间隔天数
- * @param bolPastTime :Boolean,判断在参数date之前,还是之后,
- */
- getPostDate(dateNow, intervalDays, bolPastTime) {
- let oneDayTime = 24 * 60 * 60 * 1000;
- let list = [];
- let lastDay;
-
- if (bolPastTime == true) {
- lastDay = new Date(dateNow.getTime() - intervalDays * oneDayTime);
- list.push(this.formateDate(lastDay));
- list.push(this.formateDate(dateNow));
- } else {
- lastDay = new Date(dateNow.getTime() + intervalDays * oneDayTime);
- list.push(this.formateDate(dateNow));
- list.push(this.formateDate(lastDay));
- }
- return list;
- },
- formateDate(time) {
- let year = time.getFullYear();
- let month = time.getMonth() + 1;
- let day = time.getDate();
- if (month < 10) {
- month = "0" + month;
- }
- if (day < 10) {
- day = "0" + day;
- }
- return year + "-" + month + "-" + day + "";
- },
- // 字体大小转化
- fontChar(res) {
- const clientWidth =
- window.innerWidth ||
- document.documentElement.clientWidth ||
- document.body.clientWidth;
- if (!clientWidth) return;
- let fontSize = clientWidth / 750;
- return res * fontSize;
- },
- // 初始化折线图表
- initEchart() {
- if (
- this.echarts != null &&
- this.echarts != "" &&
- this.echarts != undefined
- ) {
- this.echarts.dispose();
- }
- this.echarts = this.$echarts.init(this.$refs.charts);
- this.echarts.setOption(this.defaultOptions);
- },
- // 点击心理量表记录
- onPsychologicalScale(){
- this.$router.push({
- name: "PsychologicalScaleList",
- query: {
- uid: this.uid,
- accessToken: this.$store.getters.ssjlToken,
- showLeftArrow:1,
- },
- });
- },
- // 点击历史监测,打开日历
- onHistory() {
- this.calendarDialogShow = true;
- },
- // 选择日历具体某一个日期
- onSelect(value) {
- const selectDate = this.$dayjs(value).format("YYYY-MM-DD");
- this.dateList[0].text =
- this.$dayjs(value).format("YYYY-MM-DD") ===
- this.$dayjs(new Date()).format("YYYY-MM-DD")
- ? "今天"
- : this.$dayjs(value).format("MM-DD");
- this.calendarDialogShow = false;
- this.selectDate = selectDate;
- this.startDate = selectDate;
- this.endDate = selectDate;
- this.current = 0;
- this.getPsychologiclData(selectDate);
- },
- // 计算字体显示的颜色
- calcColor(value) {
- let color = "";
- if (value <= 40) {
- color = "#62BD48";
- } else if (value > 40 && value <= 65) {
- color = "#ffde00";
- } else if (value > 65 && value <= 80) {
- color = "#ff8a00";
- } else if (value > 80) {
- color = "#d70d0d";
- } else {
- color = "";
- }
- return color;
- },
- // 计算结果采用哪种颜色
- calcResultColor(value, isCallBackClass) {
- let color = "";
- let className = "";
- switch (Number(value)) {
- case 0:
- color = "#62BD48";
- className = "none";
- break;
- case 1:
- color = "#ffde00";
- className = "mild";
- break;
- case 2:
- color = "#ff8a00";
- className = "moderate";
- break;
- case 3:
- color = "#d70d0d";
- className = "severe";
- break;
- }
- return isCallBackClass ? className : color;
- },
- // 点击帮助
- onHelp() {
- this.isPopup = true;
- },
- // 关闭poup
- onClose() {
- this.isPopup = false;
- },
- //循环调用3次 GetWeekResult 接口
- async getWeekResultAny() {
-
- Promise.all([
- await this.getWeekResultPro(1),
- await this.getWeekResultPro(2),
- await this.getWeekResultPro(3),
- ]).then(res =>{
- let weekResultLists = res.reduce((accumulator, currentValue) => accumulator.concat(currentValue), [])
-
- let typeMap = {};
- weekResultLists.forEach(item => {
- if (!typeMap[item.name]) {
- typeMap[item.name] = {
- name: item.name,
- recordId: [],
- summary: [],
- summaryLevel: [],
- summaryDetails: [],
- type: item.type,
-
- };
- weekResultLists.push(typeMap[item.name]);
- }
-
- typeMap[item.name].recordId.push(item.recordId);
- typeMap[item.name].summary.push(item.summary);
- typeMap[item.name].summaryLevel.push(item.summaryLevel);
- let combinedArray = typeMap[item.name].summary.map((sum, index) => ({summary: sum, summaryLevel: typeMap[item.name].summaryLevel[index]}));
- console.log(combinedArray);
- typeMap[item.name].summaryDetails = combinedArray
-
- });
- let array = Object.entries(typeMap);
- this.weekResultList = array.reverse();
- console.log("weekResultLists", this.weekResultList);
- console.log("typeMap", typeMap);
- });
-
- },
- getWeekResultPro(type) {
- let baseUrl =
- process.env.NODE_ENV === "production"
- ? "https://dbmq.rzliot.com/auth_heart"
- : "https://dbmq.rzliot.com/heart";
- let reqUrl = `${baseUrl}/api/Data/GetWeekResult`;
- let reqParams = {
- uid: this.uid /* '1929285069986332672' */,
- type: type || this.emoType,
- };
- return new Promise(resolve => {
- axios
- .get(reqUrl, {
- params: { ...reqParams },
- /* headers: { 'AccessToken': this.$store.getters.ssjlToken } */
- }).then(res => {
- const data = res.data.response;
- let summaryList = data.map(item => {
- return {
- name: item.Name.replace("周报", "")
- .replace(/-/g, ".")
- .replace(/~/g, "-"),
- recordId: item.RecordId,
- summary: this.$replaceAll(item.Summary, '抑郁', '忧郁'),
- summaryLevel: item.SummaryLevel,
- type: item.Type,
- };
- });
- resolve(summaryList)
- })
- })
- },
- getWeekResult(type) {
- this.$toast.loading("数据加载中");
- let baseUrl =
- process.env.NODE_ENV === "production"
- ? "https://dbmq.rzliot.com/auth_heart"
- : "https://dbmq.rzliot.com/heart";
- let reqUrl = `${baseUrl}/api/Data/GetWeekResult`;
- let reqParams = {
- uid: this.uid /* '1929285069986332672' */,
- type: this.emoType,
- };
- axios
- .get(reqUrl, {
- params: { ...reqParams },
- /* headers: { 'AccessToken': this.$store.getters.ssjlToken } */
- })
- .then((res) => {
- console.log("res", res);
- const data = res.data.response;
- this.weekList = data
- .map((item) => {
- return {
- name: item.Name.replace("周报", "")
- .replace(/-/g, ".")
- .replace(/~/g, "-"),
- recordId: item.RecordId,
- summary: this.$replaceAll(item.Summary, '抑郁', '忧郁'),
- summaryLevel: item.SummaryLevel,
- type: this.emoType,
- };
- })
- .reverse();
- this.$toast.success("数据加载完成");
- });
- },
- onClickItem(item) {
- if(this.pageType === 1) {
- // 跳转去新的周报详情页
- this.$router.push({
- name: "reportDetails",
- query: {
- recordId: item.recordId[Number(this.psyCurrent) - 1],
- name: this.currentEmoName,
- isShowLeft: true,
- uid: this.uid,
- time: item.name,
- current: 3,
-
- },
- });
- } else {
- this.$router.push({
- name: "psychologicalReport",
- query: {
- recordId: item.recordId,
- name: this.currentEmoName,
- isShowLeft: true,
- uid: this.uid,
- },
- });
- }
-
- },
- },
- };
- </script>
-
- <style lang="scss">
- .van-nav-bar .van-icon {
- padding-left: 10px;
- }
-
- .calenddar-dialog {
- overflow: scroll;
- }
-
- .calendar {
- overflow: scroll;
-
- .van-calendar {
- height: 350px;
-
- .van-calendar__header {
- display: none;
- }
-
- .van-calendar__days .van-calendar__day {
- width: 27px;
- height: 27px;
- margin: 5px;
- font-size: 12px;
-
- &.custom-calendar {
- width: 27px;
- height: 27px;
- }
-
- &.highlight-border {
- border: 1px solid #62bd48;
- width: 27px;
- height: 27px;
- border-radius: 50%;
-
- &.none {
- border: 1px solid #62bd48;
- }
-
- &.mild {
- border: 1px solid #ffde00;
- }
-
- &.moderate {
- border: 1px solid #ff8a00;
- }
-
- &.severe {
- border: 1px solid #d70d0d;
- }
- }
- }
-
- .van-calendar__selected-day {
- width: 27px;
- height: 27px;
- border-radius: 50%;
- font-size: 12px;
- }
- }
- }
- </style>
- <style scoped lang="scss">
- @import "./index.scss";
- </style>
|