123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <template>
- <div class="app-container">
- <Header />
- <div class="main-container">
- <van-nav-bar left-arrow title="测试结果" @click-left="goBack" />
- <div class="main-outline">
- <div class="top-info">
- <div class="line-name">
- 测试者:<span>{{ getUserInfo.petName }}</span>
- </div>
- <div class="line-test-name">
- <!-- {{ type == "0" ? "量表名称" : type == "1" ? "任务名称" : "其它" }}:-->
- <span>{{ tableName }}</span>
- </div>
- <div class="line-test-time">
- 测试时间:<span>{{ time }}</span>
- </div>
- </div>
- <PageModule text="分值">
- <table class="inner-table">
- <tr class="table-th">
- <th>项目</th>
- <th>内容</th>
- </tr>
- <!-- {{-->
- <!-- resResult-->
- <!-- }}-->
- <tr v-for="(item, index) in resResult" :key="index">
- <!-- {{-->
- <!-- resResult-->
- <!-- }}-->
- <td class="td-result">{{ item.name }}</td>
- <td class="td-result">{{ item.score }}</td>
- </tr>
- </table>
- </PageModule>
- <div class="report-tip">
- <div class="tip-title">报告阅读说明</div>
- <p class="tip-desc">谢谢您的参与,阅读本报告时,请注意以下内容:</p>
- <!--<p class="tip-content">测评图表可快速帮您掌握报告内容;</p>-->
- <p class="tip-content">本结果仅供参考,不可作为临床诊断的依据;</p>
- <p class="tip-content">
- 如结果与你自己或他人感知的有出入,可回忆在测试时是否有事情影响了你,或自己答题时是否有所顾虑;
- </p>
- <p class="tip-content">
- 如对报告有不理解的地方,建议向专业资质人员进行咨询。
- </p>
- </div>
- <div class="btnArea">
- <van-button round size="small" type="primary" @click="download"
- >点击下载
- </van-button>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- // import StackedLine from "@/components/echarts/StackedLine";
- import Header from "@/components/header/index.vue";
- import PageModule from "@/components/PageModule/index.vue";
- import { mapGetters } from "vuex";
- export default {
- name: "cognitiveTaskOldTestRecord",
- components: { Header, PageModule },
- data() {
- return {
- name: "",
- tableName: "",
- time: "",
- baseUrl: baseUrl,
- resResult: [],
- userType: "", //用户类
- sex: 0,
- type: "", //量表类型0是量表,1是认知任务
- id: "", //来自测试列表
- from: "", //1-来自首页量表,2-来自测试记录列表页
- testPlanId: "", //来自测试计划
- testResultData: {}
- };
- },
- computed: {
- ...mapGetters({
- getUserInfo: "getUserInfo"
- })
- },
- created() {
- this.id = this.$route.query.id || "";
- this.from = this.$route.query.from || "";
- this.testPlanId = this.$route.query.testPlanId || "";
- },
- mounted() {
- this.inits(this.$route.query.id);
- },
- methods: {
- getDataList(v) {
- // console.log("vvvvv", v);
- v.forEach(item => {
- if (item && item.value[0] && item.value[0] != "") {
- this.resResult.push({
- name: item.name,
- score: item.value[0]
- });
- }
- });
- },
- inits(id) {
- this.$http.get(`getRecordById?id=${id}`, {}, res => {
- //当返回正确的话
- console.log(res.data.userRecordEntity, "res结果页面");
- this.testResultData = res.data;
- if (res && res.code == 200) {
- this.type = res.data?.userRecordEntity.type;
- // console.log(res,"认知任务返回")
- const datas = res.data.userRecordEntity.testResult;
- if (res.data.userRecordEntity.flag === "ProspectiveMemory") {
- // this.getDataList(datas);
- this.resResult.push({
- name: "前瞻性记忆能力",
- score: res.data.userRecordEntity.testResults
- });
- } else {
- const resResultData =
- typeof datas == "string"
- ? JSON.parse(datas)[0].tableContext
- : datas[0].tableContext;
- this.getDataList(resResultData);
- }
- //先获取到测试者
- let str = res.data.userRecordEntity.fileName;
- let testDate = res.data.userRecordEntity.testDate;
- let yearMonthDay = testDate
- .replace("年", "/")
- .replace("月", "/")
- .replace("日", " ")
- .replace("时", ":")
- .replace("分", ":")
- .replace("秒", "");
- this.time = yearMonthDay;
- this.tableName = res.data.userRecordEntity.name;
- let sd = str.split("/");
- let sp = sd[sd.length - 1];
- let a = sp.split("-");
- this.name = res.data.userRecordEntity.phone;
- this.sex = a[4];
- }
- });
- },
- //返回上一级
- goBack() {
- // this.$router.push("/index/scaleTest");
- if (this.testPlanId) {
- //来自测试计划列表
- this.$router.push({
- name: "testPlanClassify",
- params: {
- testPlanId: this.testPlanId
- }
- });
- } else if (this.from == 1) {
- // 来自普通测试列表
- this.$router.push("/index/cognitionTask");
- } else {
- // 来自测试记录列表
- this.$router.push("/testRecords");
- }
- },
- // 下载
- download() {
- window.location.href = `${baseUrl}/result/download/testResult?id=${this.id}`;
- },
- downloadFile() {
- if (this.tableName == "画钟测试") {
- window.open(`${baseUrl}result/download/CDTImg?id=${this.id}`, "_blank");
- }
- window.open(
- `${baseUrl}result/download/testResult?id=${this.id}`,
- "_blank"
- );
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .main-outline {
- overflow-y: auto !important;
- .top-info {
- width: calc(100% - 24px);
- margin: 0 12px;
- height: 136px;
- background: url("~@/assets/image/bg-result-top.png") no-repeat center;
- background-size: 100% 100%;
- overflow: hidden;
- .line-name {
- font-size: 20px;
- color: #8ac962;
- padding-left: 20px;
- margin-top: 40px;
- }
- .line-test-name {
- font-size: 15px;
- color: #333333;
- margin-top: 14px;
- padding-left: 20px;
- }
- .line-test-time {
- font-size: 12px;
- color: #999999;
- margin-top: 4px;
- padding-left: 20px;
- }
- }
- .inner-table {
- width: 100%;
- border-radius: 10px;
- overflow: hidden;
- .table-th {
- height: 32px;
- font-size: 14px;
- background: #8ac962;
- color: #fff;
- th {
- border-bottom: 1px solid white;
- border-right: 1px solid white;
- }
- }
- .td-result {
- height: 14px;
- min-height: 32px;
- padding: 7px;
- font-size: 14px;
- width: 50%;
- background-color: #f0f3f6;
- border-bottom: 1px solid white;
- border-right: 1px solid white;
- text-align: center;
- }
- }
- .report-tip {
- width: calc(100% - 24px);
- margin: 32px 12px 0;
- font-size: 12px;
- .tip-title {
- width: 100px;
- height: 20px;
- font-size: 15px;
- font-weight: 500;
- color: #333333;
- line-height: 20px;
- }
- .tip-desc {
- font-size: 12px;
- color: #999999;
- margin: 4px 0 8px;
- }
- .tip-content {
- font-size: 12px;
- color: #555555;
- line-height: 20px;
- display: list-item;
- list-style-type: disc;
- margin-left: 14px;
- }
- }
- .btnArea {
- margin: 20px 0;
- padding: 15px;
- display: flex;
- align-items: center;
- justify-content: center;
- .van-button {
- width: 2.6rem;
- }
- }
- }
- </style>
|