WXL
2024-11-09 bf6643a35299f19ae9147864e6f3b6b4670da98a
测试完成
已删除1个文件
已添加4个文件
已修改18个文件
1638 ■■■■■ 文件已修改
.env.development 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.production 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.staging 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dist.zip 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/favicon1.ico 补丁 | 查看 | 原始文档 | blame | 历史
src/api/AiCentre/external.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/logo/logoxh.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/logo/logoxh1.png 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/Logo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/permission.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/followvisit/discharge/index.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/knowledge/questionnaire/compilequer/index.vue 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsideChainnew.vue 620 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsideChainwtnew.vue 621 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsideChainxj.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/outsideChainxjnew.vue 248 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/register.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/repositoryai/templateku/configurat/index.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/repositoryai/templateku/configurat/measurement.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -1,10 +1,10 @@
# é¡µé¢æ ‡é¢˜
VUE_APP_TITLE = æµ™ä¸­å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°
VUE_APP_TITLE = æµ™ä¸­åŒ»å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°
# å¼€å‘环境配置
ENV = 'development'
# æµ™ä¸­å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°/开发环境
# æµ™ä¸­åŒ»å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°/开发环境
VUE_APP_BASE_API = '/dev-api'
# è·¯ç”±æ‡’加载
.env.production
@@ -1,8 +1,8 @@
# é¡µé¢æ ‡é¢˜
VUE_APP_TITLE = æµ™ä¸­å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°
VUE_APP_TITLE = æµ™ä¸­åŒ»å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°
# ç”Ÿäº§çŽ¯å¢ƒé…ç½®
ENV = 'production'
# æµ™ä¸­å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°/生产环境
# æµ™ä¸­åŒ»å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°/生产环境
VUE_APP_BASE_API = '/prod-api'
.env.staging
@@ -1,10 +1,10 @@
# é¡µé¢æ ‡é¢˜
VUE_APP_TITLE = æµ™ä¸­å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°
VUE_APP_TITLE = æµ™ä¸­åŒ»å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°
NODE_ENV = production
# æµ‹è¯•环境配置
ENV = 'staging'
# æµ™ä¸­å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°/测试环境
# æµ™ä¸­åŒ»å¤§äºŒé™¢æ™ºæ…§éšè®¿å¹³å°/测试环境
VUE_APP_BASE_API = '/stage-api'
dist.zip
Binary files differ
package.json
@@ -1,7 +1,7 @@
{
  "name": "ruoyi",
  "version": "3.8.5",
  "description": "浙中大二院智慧随访平台",
  "description": "浙中医大二院智慧随访平台",
  "author": "杭新",
  "license": "MIT",
  "scripts": {
public/favicon1.ico

src/api/AiCentre/external.js
@@ -9,6 +9,14 @@
    data: data
  });
}
// åˆ é™¤é€šç”¨æ¨¡æ¿
export function geturlinfo(id) {
  return request({
    url: "/outPath/getInfoByParam",
    method: 'post',
    data: {param:id}
  });
}
// æäº¤ã€éšè®¿
export function SetsaveQuestionAnswer(data) {
  return request({
src/assets/logo/logoxh.png

src/assets/logo/logoxh1.png
src/layout/components/Sidebar/Logo.vue
@@ -70,7 +70,7 @@
  },
  data() {
    return {
      title: "浙中大二院智慧随访平台",
      title: "浙中医大二院智慧随访平台",
      logo: logoImg,
    };
  },
src/permission.js
@@ -8,7 +8,7 @@
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/outsideChain','/outsideChainwt','/outsideChainxj']
const whiteList = ['/login', '/auth-redirect', '/bind', '/register','/wt','/xj','/sf', '/outsideChain','/outsideChainwt','/outsideChainxj']
router.beforeEach((to, from, next) => {
  NProgress.start()
  if (getToken()) {
src/router/index.js
@@ -47,6 +47,21 @@
    hidden: true
  },
  {
    path: '/sf',
    component: () => import('@/views/outsideChainnew'),
    hidden: true
  },
  {
    path: '/wt',
    component: () => import('@/views/outsideChainwtnew'),
    hidden: true
  },
  {
    path: '/xj',
    component: () => import('@/views/outsideChainxjnew'),
    hidden: true
  },
  {
    path: '/outsideChain',
    component: () => import('@/views/outsideChain'),
    hidden: true
src/views/followvisit/discharge/index.vue
@@ -366,7 +366,6 @@
          width="200"
        />
        <el-table-column
          label="任务执行方式"
          align="center"
          key="preachform"
@@ -375,13 +374,10 @@
          :show-overflow-tooltip="true"
        >
          <template slot-scope="scope">
            <span v-for="item in scope.row.preachform"
              >{{ item }}、
            </span>
            <span v-for="item in scope.row.preachform">{{ item }}、 </span>
          </template>
        </el-table-column>
        <el-table-column
          label="任务发送流程"
          align="center"
          key="serviceSubtaskRecordList"
@@ -396,7 +392,6 @@
          </template>
        </el-table-column>
        <el-table-column
          label="任务结果说明"
          width="120"
          align="center"
@@ -414,7 +409,6 @@
        </el-table-column>
        <el-table-column
          label="操作"
          align="center"
          width="200"
          class-name="small-padding fixed-width"
@@ -835,6 +829,7 @@
      this.loading = true;
      getTaskservelist(this.topqueryParams).then((response) => {
        this.userList = response.rows[0].serviceSubtaskList;
        this.total=response.total
        this.cardlist[0].value =
          Number(response.rows[0].wzx) + Number(response.rows[0].ysf);
        this.cardlist[1].value = response.rows[0].ysf;
@@ -843,11 +838,16 @@
        this.cardlist[4].value = response.rows[0].fssb;
        this.cardlist[5].value = response.rows[0].blq;
        this.cardlist[6].value = response.rows[0].yfs;
        this.loading = false;
        this.userList.forEach((item) => {
          const idArray = null;
          if (item.endtime) {
            item.endDay = this.daysBetween(item.endtime);
          }
          const idArray = item.preachform.split(",");
          if (item.endtime) {
           idArray = item.preachform.split(",");
          }
          item.preachform = idArray.map((value) => {
            // æŸ¥æ‰¾id对应的对象
            const item = this.checkboxlist.find((item) => item.value == value);
@@ -856,7 +856,6 @@
          });
        });
        this.total = response.total;
        this.loading = false;
      });
    },
    // æŸ¥çœ‹é—¨è¯Šéšè®¿è¯¦æƒ…
src/views/knowledge/questionnaire/compilequer/index.vue
@@ -259,11 +259,11 @@
                  filterable
                  placeholder="请选择科室"
                >
                  <el-option
                <el-option
                    class="ruleFormaa"
                    v-for="item in belongDepts"
                    v-for="item in flatArray"
                    :key="item.deptCode"
                    :label="item.deptName"
                    :label="item.label"
                    :value="item.deptCode"
                  >
                  </el-option>
@@ -282,12 +282,12 @@
                  filterable
                  placeholder="请选择病区"
                >
                  <el-option
                <el-option
                    class="ruleFormaa"
                    v-for="item in belongWards"
                    :key="item.districtCode"
                    :label="item.districtName"
                    :value="item.districtCode"
                    v-for="item in flatArray"
                    :key="item.deptCode"
                    :label="item.label"
                    :value="item.deptCode"
                  >
                  </el-option>
                </el-select> </el-form-item
@@ -1262,6 +1262,8 @@
} from "@/api/AiCentre/index";
import OptionalForm from "@/components/OptionalForm"; //正则组件
import { getToken } from "@/utils/auth";
import { deptTreeSelect } from "@/api/system/user";
export default {
  name: "Questionnaireinfo",
@@ -1382,6 +1384,7 @@
      illnessVisible: false, //指标疾病弹框
      Operateit: true,
      deptOptions: [],
      flatArray:[],
      optionsillness: [],
      delScriptVOList: [],
      illnesslistapi: [],
@@ -1445,6 +1448,7 @@
  created() {
    this.getissueinfo();
    this.gettabList();
    this.getDeptTree();
    this.mode = store.getters.Askmode;
    this.languagelist = store.getters.languagelist;
    this.usable = store.getters.usable;
@@ -1552,6 +1556,33 @@
        }
      });
    },
    // èŽ·å–ç§‘å®¤æ ‘
    getDeptTree() {
      // ç§‘室列表
      deptTreeSelect().then((response) => {
        this.deptOptions = response.data;
        this.flatArray = this.flattenArray(response.data);
      });
    },
    flattenArray(multiArray) {
      let result = [];
      // é€’归函数,用于将多级数组转换为一维数组,只包含最底层的元素
      function flatten(element) {
        // å¦‚果当前元素有子元素,继续递归
        if (element.children && element.children.length > 0) {
          element.children.forEach((child) => flatten(child));
        } else {
          // å…‹éš†å…ƒç´ ä»¥é¿å…ä¿®æ”¹åŽŸå§‹æ•°æ®
          let item = JSON.parse(JSON.stringify(element));
          result.push(item); // å°†æœ€åº•层的元素添加到结果数组
        }
      }
      // ä»Žé¡¶å±‚元素开始递归
      multiArray.forEach((element) => flatten(element));
      return result; // è¿”回只包含最底层元素的一维数组
    },
    submitForm(formName) {
      this.$modal.loading("正在修正保存数据,请稍候...");
      if (Array.isArray(this.ruleForm.suitway)) {
src/views/login.vue
@@ -6,7 +6,7 @@
      :rules="loginRules"
      class="login-form"
    >
      <h3 class="title">浙中大二院智慧随访平台</h3>
      <h3 class="title">浙中医大二院智慧随访平台</h3>
      <el-form-item prop="username">
        <el-input
          v-model="loginForm.username"
src/views/outsideChainnew.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,620 @@
<template>
  <div class="questionnaire">
    <div class="CONTENT" v-if="!accomplish">
      <div class="preview-left">
        <div class="toptitle">
          <div class="title">{{ taskname ? taskname : "问卷" }}</div>
          <div style="font-size: 22px; margin-bottom: 20px; line-height: 1.5">
            {{
              kcb
                ? kcb
                : "亲爱的患者-家属,您好!我们是浙中医大二院的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,完成这份随访问卷。"
            }}
            <!-- äº²çˆ±çš„æ‚£è€…/家属您好,为了更好的了解您出院后的康复情况,给您适当及时的健康指导,请您抽一点宝贵时间,完成这份出院随访问卷调查。 -->
          </div>
        </div>
        <el-divider></el-divider>
        <!-- å•选 -->
        <div
          class="topic-dev"
          v-for="(item, index) in questionList"
          :key="item.aaa"
        >
          <div class="scriptTopic-dev" :key="index" v-if="item.scriptType == 1">
            <div class="dev-text">
              {{ index + 1 }}、<span style="line-height: 1.5"
                >{{ item.scriptContent }}
                <span style="color: #3ba2f7">[单选]</span></span
              >
            </div>
            <div class="dev-xx">
              <el-radio-group
                class="custom-radio"
                v-model="item.scriptResult"
                @change="handleOptionChange($event, index, item)"
              >
                <el-radio
                  border
                  v-for="(items, index) in item.svyLibTemplateTargetoptions"
                  :class="
                    items.isabnormal && item.scriptResult == items.optioncontent
                      ? 'red-star'
                      : ''
                  "
                  :key="index"
                  :label="items.optioncontent"
                  >{{ items.optioncontent }}</el-radio
                >
              </el-radio-group>
            </div>
            <div v-show="item.prompt">
              <el-alert :title="item.prompt" type="warning"> </el-alert>
            </div>
          </div>
          <!-- å¤šé€‰ -->
          <div class="scriptTopic-dev" :key="index" v-if="item.scriptType == 2">
            <div class="dev-text">
              {{ index + 1 }}、<span style="line-height: 1.5"
                >{{ item.scriptContent }}
                <span style="color: #3ba2f7">[多选]</span></span
              >
            </div>
            <div class="dev-xx">
              <el-checkbox-group
                class="custom-radio"
                v-model="item.scriptResult"
                @change="updateScore($event, index, item)"
              >
                <el-checkbox
                  border
                  @change="$forceUpdate()"
                  v-for="(items, indexs) in item.svyLibTemplateTargetoptions"
                  :key="indexs"
                  :label="items.optioncontent"
                >
                  {{ items.optioncontent }}
                </el-checkbox>
              </el-checkbox-group>
            </div>
            <!-- :class="items.isabnormal ? 'red-star' : ''" -->
            <div v-show="item.prompt && item.scriptResult[0]">
              <el-alert :title="item.prompt" type="warning"> </el-alert>
            </div>
          </div>
          <!-- å¡«ç©º -->
          <div class="scriptTopic-dev" :key="index" v-if="item.scriptType == 4">
            <div class="dev-text">
              {{ index + 1 }}、<span style="line-height: 1.5"
                >{{ item.scriptContent
                }}<span style="color: #3ba2f7">[问答]</span></span
              >
            </div>
            <div class="dev-xx">
              <el-input
                type="textarea"
                :rows="3"
                placeholder="请输入答案"
                v-model="item.scriptResult"
                clearable
              >
              </el-input>
            </div>
          </div>
        </div>
        <div class="bottom-fixed">
          <el-button
            type="primary"
            style="width: 80%; font-size: 20px"
            @click="cache(true)"
            >提交问卷</el-button
          >
        </div>
      </div>
    </div>
    <div class="CONTENT" v-else>
      <div class="preview-lefts">
        <div
          style="
            text-align: center;
            padding-top: 50px;
            font-size: 24px;
            color: #175997;
            font-weight: 600;
            margin-bottom: 10px;
          "
        >
          æ„Ÿè°¢æ‚¨çš„配合!
        </div>
        <div style="font-size: 20px">
          {{
            jsy
              ? jsy
              : "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次回访就到这里,祝您身体健康!"
          }}
        </div>
      </div>
    </div>
    <!-- <el-dialog
      :visible.sync="dialogVisible"
      width="50%"
    >
      <div>
        <el-alert :title="jsy" type="success"> </el-alert>
      </div>
    </el-dialog> -->
  </div>
</template>
<script>
import {
  getExternalfollowup,
  getCachequestionnaire,
  Cachequestionnaire,
  Submitaquestionnaire,
  geturlinfo,
} from "@/api/AiCentre/index";
import JSEncrypt from "jsencrypt";
export default {
  data() {
    return {
      taskid: 355,
      patid: 265823,
      kcb: "",
      excep: "",
      questionList: [
        // {
        //   scriptType: 1,
        //   scriptContent: "您的年龄范围是?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "18-25", value: "18-25", isabnormal: true },
        //     { optioncontent: "26-35", value: "26-35" },
        //     { optioncontent: "36-45", value: "36-45" },
        //     { optioncontent: "46-55", value: "46-55" },
        //     { optioncontent: "56+", value: "56+" },
        //   ],
        //   required: true,
        // },
        // {
        //   scriptType: 1,
        //   scriptContent: "您的职业是什么?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "学生", value: "student" },
        //     { optioncontent: "教师", value: "teacher" },
        //     { optioncontent: "工程师", value: "engineer" },
        //     { optioncontent: "医生", value: "doctor" },
        //     { optioncontent: "其他", value: "other" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 2,
        //   scriptContent: "您感兴趣的活动有哪些?",
        //   scriptResult: [],
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "旅游", value: "travel", isabnormal: true },
        //     { optioncontent: "阅读", value: "reading", isabnormal: true },
        //     { optioncontent: "运动", value: "sports", isabnormal: true },
        //     { optioncontent: "音乐", value: "music" },
        //     { optioncontent: "电影", value: "movies" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 1,
        //   scriptContent: "您的职业是什么?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "学生", value: "student" },
        //     { optioncontent: "教师", value: "teacher" },
        //     { optioncontent: "工程师", value: "engineer" },
        //     { optioncontent: "医生", value: "doctor" },
        //     { optioncontent: "其他", value: "other" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 1,
        //   scriptContent: "您的职业是什么?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "学生", value: "student" },
        //     { optioncontent: "教师", value: "teacher" },
        //     { optioncontent: "工程师", value: "engineer", isabnormal: true },
        //     { optioncontent: "医生", value: "doctor" },
        //     { optioncontent: "其他", value: "other" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 1,
        //   scriptContent: "您的职业是什么?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "学生", value: "student" },
        //     { optioncontent: "教师", value: "teacher" },
        //     { optioncontent: "工程师", value: "engineer" },
        //     { optioncontent: "医生", value: "doctor" },
        //     { optioncontent: "其他", value: "other" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 4,
        //   scriptContent: "您的姓名是什么?",
        //   scriptResult: "name",
        //   required: true,
        //   scriptResult: null,
        // },
      ],
      jsy: null,
      dialogVisible: false,
      Endornot: true,
      accomplish: false,
      // å‰ç«¯å…¬é’¥
      publicKey:
        "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKR0yHv0rbJWQE+Sc7/FwpW66qMd9qX2k6z+SDgkSdxWh/1GbBoAP7bDQQRF6vXmoKsD2ya42H6XRLSDXAoayuMCAwEAAQ== ",
      // åŽç«¯ç§é’¥
      privateKey:
        " MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==",
      formData: {
        question1: "",
        question2: "",
        question3: "",
      },
    };
  },
  mounted() {
    window.addEventListener("beforeunload", this.cache);
  },
  beforeDestroy() {
    window.removeEventListener("beforeunload", this.cache);
  },
  created() {
    this.geturlinfo();
  },
  methods: {
    // è§£æžurlid
    geturlinfo() {
      // let url = window.location.href;
      let url = this.$route.query.p;
      // let url = 'http://218.108.11.22:8093/sf/003';
      // let urlid = this.extractLastSegmentFromUrl(url);
      geturlinfo( url ).then((res) => {
       if (res.code==200) {
         this.getQuestionnaire(res.data.param1,res.data.param2,res.data.param3,res.data.param5,)
       }
      });
    },
//     extractLastSegmentFromUrl(url) {
//     // æ‰¾åˆ°æœ€åŽä¸€ä¸ª'/'的位置
//     const lastSlashIndex = url.lastIndexOf('/');
//     // å¦‚果找到了'/',截取其后的所有字符
//     if (lastSlashIndex !== -1) {
//         return url.substring(lastSlashIndex + 1);
//     }
//     // å¦‚果没有找到'/',返回空字符串
//     return '';
// },
    // èŽ·å–æ•°æ®
    getQuestionnaire(param1,param2,param3) {
      this.taskid = decodeURIComponent(param1);
      this.patid = decodeURIComponent(param2);
      this.taskname = param3;
      // let taskid =
      //   "OFp7tn/B6x7IzKJetvGWHdSWBj7msRlnlj6am9dyuHTH6sEt4uBbVCUXs5kcF/e4O2W6vqHf2Bz9K3/evbYDmw==";
      // let patid =
      //   "CVk0j8O86AeCqhV5WPsBBYDg9fec0wDoDlP9imYK4wDBNIkxywZzMJEGlPagOxnq6qr2WYZo0U8MUGWRGnq8ZA==";
      // this.taskid = this.decrypt(taskid);
      // this.patid = this.decrypt(patid);
      // let taskids = this.encrypt(this.taskid);
      // let patids = this.encrypt(this.patid);
      // å…ˆå–缓存
      getCachequestionnaire({ param1: this.taskid, param2: this.patid }).then(
        (res) => {
          if (res.code == 200) {
            this.questionList = res.data;
            this.accomplish = res.data.submit;
            if (this.questionList[0]) {
              this.questionList.forEach((item) => {
                if (item.scriptResult && item.scriptType != 2) {
                  item.scriptResult = JSON.parse(item.scriptResult);
                } else if (item.scriptResult && item.scriptType == 2) {
                  item.scriptResult = item.scriptResult.split("&");
                }
              });
              return;
            } else {
              this.getExternalfollowup();
            }
          } else {
            this.getExternalfollowup();
          }
        }
      );
    },
    // èŽ·å–æ•°æ®
    getExternalfollowup() {
      getExternalfollowup({ param1: this.taskid, param2: this.patid }).then(
        (res) => {
          if (res.code == 200) {
            this.questionList = res.data.script;
            this.jsy = res.data.jsy;
            this.kcb = res.data.kcb;
            // å¤„理题目收集结果格式
            this.questionList.forEach((item) => {
              item.nextScriptno = Number(item.nextScriptno);
              if (item.scriptType == 2) {
                item.scriptResult = [];
              }
            });
          }
        }
      );
    },
    // åŠ å¯†å‡½æ•°
    encrypt(txt) {
      const encryptor = new JSEncrypt();
      encryptor.setPublicKey(this.publicKey); // è®¾ç½®å…¬é’¥
      return encryptor.encrypt(txt); // å¯¹æ•°æ®è¿›è¡ŒåР坆
    },
    // è§£å¯†å‡½æ•°
    decrypt(txt) {
      const encryptor = new JSEncrypt();
      encryptor.setPrivateKey(this.privateKey); // è®¾ç½®ç§é’¥
      return encryptor.decrypt(txt); // å¯¹æ•°æ®è¿›è¡Œè§£å¯†
    },
    // æäº¤
    submitForm() {
      // æäº¤è¡¨å•逻辑
      let form = {
        param1: this.taskid,
        param2: this.patid,
        excep: this.excep,
        serviceSubtaskDetailList: [],
      };
      const arr = structuredClone(this.questionList);
      // arr.forEach((item) => {
      //   item.asrtext = JSON.stringify(item.scriptResult);
      //   if (item.scriptType == 2 && item.scriptResult[0]) {
      //     item.scriptResult = item.scriptResult.join("&");
      //   }
      // });
      form.serviceSubtaskDetailList = arr;
      Submitaquestionnaire(form).then((res) => {
        if (res.code == 200) {
          if (this.jsy) {
            this.dialogVisible = true;
          }
          this.accomplish = true;
          this.$modal.msgSuccess("提交成功");
        }
      });
    },
    // ç¼“å­˜
    cache(subm) {
      console.log("进入缓存");
      let form = {
        param1: this.taskid,
        param2: this.patid,
        svyLibTemplateScriptVOS: [],
      };
      const arr = structuredClone(this.questionList);
      console.log(arr, "srr");
      arr.forEach((item, index) => {
        var obj = item.svyLibTemplateTargetoptions.find(
          (items) => items.optioncontent == item.scriptResult
        );
        if (obj.isabnormal) {
          console.log(obj.isabnormal);
          form.excep = 1;
          this.excep = 1;
        }
      });
      arr.forEach((item) => {
        if (item.scriptType == 2 && item.scriptResult[0]) {
          item.scriptResult = item.scriptResult.join("&");
        } else if (item.scriptType != 2 && item.scriptResult) {
          item.scriptResult = JSON.stringify(item.scriptResult);
        }
      });
      form.svyLibTemplateScriptVOS = arr;
      Cachequestionnaire(form).then((res) => {
        if (res.code == 200) {
          if (subm) {
            this.submitForm();
          }
        }
      });
    },
    // å¤„理单选选项
    handleOptionChange(selectedvalue, index, arr) {
      // æŸ¥æ‰¾é€‰ä¸­çš„选项对象
      const selectedOption = arr.svyLibTemplateTargetoptions.find(
        (option) => option.optioncontent == selectedvalue
      );
      if (selectedOption) {
        // å°†é€‰ä¸­çš„选项对象的 id èµ‹å€¼ç»™ obj.sonId
        this.questionList[index].nextScriptno = selectedOption.nextQuestion;
        this.questionList[index].score = selectedOption.score;
        this.questionList[index].prompt = selectedOption.prompt;
      }
    },
    // å¤„理多选选项
    updateScore(selectedvalues, index, arr) {
      // ï¿½ï¿½åŠ åˆ†æ•°
      let score = 0;
      selectedvalues.forEach((value) => {
        const selectedOption = arr.svyLibTemplateTargetoptions.find(
          (option) => option.optioncontent == value
        );
        if (selectedOption) {
          score += Number(selectedOption.score);
        }
      });
      this.questionList[index].score = score;
    },
  },
};
</script>
<style lang="scss" scoped>
.questionnaire {
  // background-image: url("../assets/images/chainbackground.jpg");
  background-color: #f9f9fb;
  background-size: cover;
  background-attachment: fixed; /* ä¿æŒèƒŒæ™¯å›ºå®š */
  background-position: center;
  font-family: Arial, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  .CONTENT {
    .title {
      color: #3769f3;
      font-size: 22px;
      font-weight: bold;
      margin-bottom: 20px;
      text-align: center;
    }
  }
}
.preview-left {
  margin: 10px;
  margin-bottom: 60px;
  background-color: #fff;
  border-radius: 5px;
  //   margin: 20px;
  padding: 10px;
  height: 100%;
  // background: #ffff;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
  .topic-dev {
    margin-bottom: 25px;
    font-size: 20px !important;
    .dev-text {
      margin-bottom: 10px;
    }
  }
}
.preview-lefts {
  margin: 10px;
  background-color: #fff;
  border-radius: 5px;
  //   margin: 20px;
  padding: 10px;
  height: 95vh; // background: #ffff;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
  .topic-dev {
    margin-bottom: 25px;
    font-size: 20px !important;
    .dev-text {
      margin-bottom: 10px;
    }
  }
}
.red-star {
  ::v-deep.el-radio__label {
    position: relative;
    padding-right: 10px; /* æ ¹æ®éœ€è¦è°ƒæ•´ */
  }
  ::v-deep.el-radio__label::after {
    content: "*";
    color: red;
    position: absolute;
    right: -5px; /* æ ¹æ®éœ€è¦è°ƒæ•´ */
    top: 0;
  }
  ::v-deep.el-checkbox__label {
    position: relative;
    padding-right: 10px; /* æ ¹æ®éœ€è¦è°ƒæ•´ */
  }
  ::v-deep.el-checkbox__label::after {
    content: "*";
    color: red;
    position: absolute;
    right: -5px; /* æ ¹æ®éœ€è¦è°ƒæ•´ */
    top: 0;
  }
}
::v-deep.el-checkbox-group {
  font-size: 0;
  display: flex;
  flex-direction: column;
  margin: 5px 0;
}
::v-deep.el-checkbox.is-bordered + .el-checkbox.is-bordered {
  margin-left: 0;
}
::v-deep.el-radio-group {
  display: flex;
  flex-direction: column;
  margin: 5px 0;
}
::v-deep.el-radio.is-bordered + .el-radio.is-bordered {
  /* margin-left: 10px; */
  margin-left: 0;
}
::v-deep.custom-radio .el-radio {
  margin: 2px 0;
}
.radio-option {
  flex: none; /* ä¸è®©é€‰é¡¹è‡ªåŠ¨å¡«å……ç©ºé—´ */
  white-space: nowrap; /* é˜²æ­¢é€‰é¡¹æ–‡æœ¬æ¢è¡Œ */
  margin: 0 10px; /* è®¾ç½®é€‰é¡¹å·¦å³çš„é—´éš” */
  font-size: 20px; /* å¢žå¤§å­—体大小 */
}
.el-radio__label {
  font-size: 20px; /* å¢žå¤§æ ‡ç­¾æ–‡å­—大小 */
}
.toptitle {
}
.bottom-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 10px 0; /* æ ¹æ®éœ€è¦è°ƒæ•´å†…边距 */
  background: #fff; /* æ ¹æ®éœ€è¦è°ƒæ•´èƒŒæ™¯é¢œè‰² */
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* å¯é€‰çš„阴影效果 */
  z-index: 1000; /* ç¡®ä¿æŒ‰é’®åœ¨é¡µé¢æœ€ä¸Šå±‚ */
}
::v-deep.el-alert--warning.is-light {
  background-color: #fbf9f3;
  color: #ffba00;
}
::v-deep {
  .el-alert__title {
    font-size: 20px;
    line-height: 18px;
  }
}
::v-deep.el-radio--medium.is-bordered .el-radio__label {
  font-size: 20px;
}
::v-deep.el-radio--medium.is-bordered {
  padding: 5px 20px 0px 10px;
  border-radius: 4px;
  height: 36px;
}
::v-deep.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__label {
  line-height: 17px;
  font-size: 20px;
}
::v-deep.el-checkbox {
  margin-right: 0px;
}
</style>
src/views/outsideChainwtnew.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,621 @@
<template>
  <div class="questionnaire">
    <div class="CONTENT" v-if="!accomplish">
      <div class="preview-left">
        <div class="toptitle">
          <div class="title">{{ taskname ? taskname : "问卷" }}</div>
          <div style="font-size: 22px; margin-bottom: 20px; line-height: 1.5">
            {{
              kcb
                ? kcb
                : "亲爱的患者-家属,您好!我们是浙中医大二院的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,完成这份随访问卷。"
            }}
            <!-- äº²çˆ±çš„æ‚£è€…/家属您好,为了更好的了解您出院后的康复情况,给您适当及时的健康指导,请您抽一点宝贵时间,完成这份出院随访问卷调查。 -->
          </div>
        </div>
        <el-divider></el-divider>
        <!-- å•选 -->
        <div
          class="topic-dev"
          v-for="(item, index) in questionList"
          :key="item.aaa"
        >
          <div class="scriptTopic-dev" :key="index" v-if="item.scriptType == 1">
            <div class="dev-text">
              {{ index + 1 }}、<span style="line-height: 1.5"
                >{{ item.scriptContent }}
                <span style="color: #3ba2f7">[单选]</span></span
              >
            </div>
            <div class="dev-xx">
              <el-radio-group
                class="custom-radio"
                v-model="item.scriptResult"
                @change="handleOptionChange($event, index, item)"
              >
                <el-radio
                  border
                  v-for="(items, index) in item.svyLibTemplateTargetoptions"
                  :class="
                    items.isabnormal && item.scriptResult == items.optioncontent
                      ? 'red-star'
                      : ''
                  "
                  :key="index"
                  :label="items.optioncontent"
                  >{{ items.optioncontent }}</el-radio
                >
              </el-radio-group>
            </div>
            <div v-show="item.prompt">
              <el-alert :title="item.prompt" type="warning"> </el-alert>
            </div>
          </div>
          <!-- å¤šé€‰ -->
          <div class="scriptTopic-dev" :key="index" v-if="item.scriptType == 2">
            <div class="dev-text">
              {{ index + 1 }}、<span style="line-height: 1.5"
                >{{ item.scriptContent }}
                <span style="color: #3ba2f7">[多选]</span></span
              >
            </div>
            <div class="dev-xx">
              <el-checkbox-group
                class="custom-radio"
                v-model="item.scriptResult"
                @change="updateScore($event, index, item)"
              >
                <el-checkbox
                  border
                  @change="$forceUpdate()"
                  v-for="(items, indexs) in item.svyLibTemplateTargetoptions"
                  :key="indexs"
                  :label="items.optioncontent"
                >
                  {{ items.optioncontent }}
                </el-checkbox>
              </el-checkbox-group>
            </div>
            <!-- :class="items.isabnormal ? 'red-star' : ''" -->
            <div v-show="item.prompt && item.scriptResult[0]">
              <el-alert :title="item.prompt" type="warning"> </el-alert>
            </div>
          </div>
          <!-- å¡«ç©º -->
          <div class="scriptTopic-dev" :key="index" v-if="item.scriptType == 4">
            <div class="dev-text">
              {{ index + 1 }}、<span style="line-height: 1.5"
                >{{ item.scriptContent
                }}<span style="color: #3ba2f7">[问答]</span></span
              >
            </div>
            <div class="dev-xx">
              <el-input
                type="textarea"
                :rows="3"
                placeholder="请输入答案"
                v-model="item.scriptResult"
                clearable
              >
              </el-input>
            </div>
          </div>
        </div>
        <div class="bottom-fixed">
          <el-button
            type="primary"
            style="width: 80%; font-size: 20px"
            @click="cache(true)"
            >提交问卷</el-button
          >
        </div>
      </div>
    </div>
    <div class="CONTENT" v-else>
      <div class="preview-lefts">
        <div
          style="
            text-align: center;
            padding-top: 50px;
            font-size: 24px;
            color: #175997;
            font-weight: 600;
            margin-bottom: 10px;
          "
        >
          æ„Ÿè°¢æ‚¨çš„配合!
        </div>
        <div style="font-size: 20px">
          {{
            jsy
              ? jsy
              : "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次回访就到这里,祝您身体健康!"
          }}
        </div>
      </div>
    </div>
    <!-- <el-dialog
      :visible.sync="dialogVisible"
      width="50%"
    >
      <div>
        <el-alert :title="jsy" type="success"> </el-alert>
      </div>
    </el-dialog> -->
  </div>
</template>
<script>
import {
  getExternalfollowup,
  getCachequestionnaire,
  Cachequestionnaire,
  Submitaquestionnaire,
  geturlinfo,
} from "@/api/AiCentre/index";
import JSEncrypt from "jsencrypt";
export default {
  data() {
    return {
      taskid: 355,
      patid: 265823,
      kcb: "",
      excep: "",
      questionList: [
        // {
        //   scriptType: 1,
        //   scriptContent: "您的年龄范围是?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "18-25", value: "18-25", isabnormal: true },
        //     { optioncontent: "26-35", value: "26-35" },
        //     { optioncontent: "36-45", value: "36-45" },
        //     { optioncontent: "46-55", value: "46-55" },
        //     { optioncontent: "56+", value: "56+" },
        //   ],
        //   required: true,
        // },
        // {
        //   scriptType: 1,
        //   scriptContent: "您的职业是什么?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "学生", value: "student" },
        //     { optioncontent: "教师", value: "teacher" },
        //     { optioncontent: "工程师", value: "engineer" },
        //     { optioncontent: "医生", value: "doctor" },
        //     { optioncontent: "其他", value: "other" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 2,
        //   scriptContent: "您感兴趣的活动有哪些?",
        //   scriptResult: [],
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "旅游", value: "travel", isabnormal: true },
        //     { optioncontent: "阅读", value: "reading", isabnormal: true },
        //     { optioncontent: "运动", value: "sports", isabnormal: true },
        //     { optioncontent: "音乐", value: "music" },
        //     { optioncontent: "电影", value: "movies" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 1,
        //   scriptContent: "您的职业是什么?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "学生", value: "student" },
        //     { optioncontent: "教师", value: "teacher" },
        //     { optioncontent: "工程师", value: "engineer" },
        //     { optioncontent: "医生", value: "doctor" },
        //     { optioncontent: "其他", value: "other" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 1,
        //   scriptContent: "您的职业是什么?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "学生", value: "student" },
        //     { optioncontent: "教师", value: "teacher" },
        //     { optioncontent: "工程师", value: "engineer", isabnormal: true },
        //     { optioncontent: "医生", value: "doctor" },
        //     { optioncontent: "其他", value: "other" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 1,
        //   scriptContent: "您的职业是什么?",
        //   scriptResult: null,
        //   svyLibTemplateTargetoptions: [
        //     { optioncontent: "学生", value: "student" },
        //     { optioncontent: "教师", value: "teacher" },
        //     { optioncontent: "工程师", value: "engineer" },
        //     { optioncontent: "医生", value: "doctor" },
        //     { optioncontent: "其他", value: "other" },
        //   ],
        //   required: false,
        // },
        // {
        //   scriptType: 4,
        //   scriptContent: "您的姓名是什么?",
        //   scriptResult: "name",
        //   required: true,
        //   scriptResult: null,
        // },
      ],
      jsy: null,
      dialogVisible: false,
      Endornot: true,
      accomplish: false,
      // å‰ç«¯å…¬é’¥
      publicKey:
        "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKR0yHv0rbJWQE+Sc7/FwpW66qMd9qX2k6z+SDgkSdxWh/1GbBoAP7bDQQRF6vXmoKsD2ya42H6XRLSDXAoayuMCAwEAAQ== ",
      // åŽç«¯ç§é’¥
      privateKey:
        " MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==",
      formData: {
        question1: "",
        question2: "",
        question3: "",
      },
    };
  },
  mounted() {
    window.addEventListener("beforeunload", this.cache);
  },
  beforeDestroy() {
    window.removeEventListener("beforeunload", this.cache);
  },
  created() {
    this.geturlinfo();
  },
  methods: {
    // è§£æžurlid
    geturlinfo() {
       // let url = window.location.href;
       let url = this.$route.query.p;
       console.log(url,"url");
      // let url = 'http://218.108.11.22:8093/sf/003';
      // let urlid = this.extractLastSegmentFromUrl(url);
      geturlinfo( url ).then((res) => {
       if (res.code==200) {
         this.getQuestionnaire(res.data.param1,res.data.param2,res.data.param3,res.data.param5,)
       }
      });
    },
//     extractLastSegmentFromUrl(url) {
//     // æ‰¾åˆ°æœ€åŽä¸€ä¸ª'/'的位置
//     const lastSlashIndex = url.lastIndexOf('/');
//     // å¦‚果找到了'/',截取其后的所有字符
//     if (lastSlashIndex !== -1) {
//         return url.substring(lastSlashIndex + 1);
//     }
//     // å¦‚果没有找到'/',返回空字符串
//     return '';
// },
    // èŽ·å–æ•°æ®
    getQuestionnaire(param1,param2,param3) {
      this.taskid = decodeURIComponent(param1);
      this.patid = decodeURIComponent(param2);
      this.taskname = decodeURIComponent(param3);
      // let taskid =
      //   "OFp7tn/B6x7IzKJetvGWHdSWBj7msRlnlj6am9dyuHTH6sEt4uBbVCUXs5kcF/e4O2W6vqHf2Bz9K3/evbYDmw==";
      // let patid =
      //   "CVk0j8O86AeCqhV5WPsBBYDg9fec0wDoDlP9imYK4wDBNIkxywZzMJEGlPagOxnq6qr2WYZo0U8MUGWRGnq8ZA==";
      // this.taskid = this.decrypt(taskid);
      // this.patid = this.decrypt(patid);
      // let taskids = this.encrypt(this.taskid);
      // let patids = this.encrypt(this.patid);
      // å…ˆå–缓存
      getCachequestionnaire({ param1: this.taskid, param2: this.patid }).then(
        (res) => {
          if (res.code == 200) {
            this.questionList = res.data;
            this.accomplish = res.data.submit;
            if (this.questionList[0]) {
              this.questionList.forEach((item) => {
                if (item.scriptResult && item.scriptType != 2) {
                  item.scriptResult = JSON.parse(item.scriptResult);
                } else if (item.scriptResult && item.scriptType == 2) {
                  item.scriptResult = item.scriptResult.split("&");
                }
              });
              return;
            } else {
              this.getExternalfollowup();
            }
          } else {
            this.getExternalfollowup();
          }
        }
      );
    },
    // èŽ·å–æ•°æ®
    getExternalfollowup() {
      getExternalfollowup({ param1: this.taskid, param2: this.patid }).then(
        (res) => {
          if (res.code == 200) {
            this.questionList = res.data.script;
            this.jsy = res.data.jsy;
            this.kcb = res.data.kcb;
            // å¤„理题目收集结果格式
            this.questionList.forEach((item) => {
              item.nextScriptno = Number(item.nextScriptno);
              if (item.scriptType == 2) {
                item.scriptResult = [];
              }
            });
          }
        }
      );
    },
    // åŠ å¯†å‡½æ•°
    encrypt(txt) {
      const encryptor = new JSEncrypt();
      encryptor.setPublicKey(this.publicKey); // è®¾ç½®å…¬é’¥
      return encryptor.encrypt(txt); // å¯¹æ•°æ®è¿›è¡ŒåР坆
    },
    // è§£å¯†å‡½æ•°
    decrypt(txt) {
      const encryptor = new JSEncrypt();
      encryptor.setPrivateKey(this.privateKey); // è®¾ç½®ç§é’¥
      return encryptor.decrypt(txt); // å¯¹æ•°æ®è¿›è¡Œè§£å¯†
    },
    // æäº¤
    submitForm() {
      // æäº¤è¡¨å•逻辑
      let form = {
        param1: this.taskid,
        param2: this.patid,
        excep: this.excep,
        serviceSubtaskDetailList: [],
      };
      const arr = structuredClone(this.questionList);
      // arr.forEach((item) => {
      //   item.asrtext = JSON.stringify(item.scriptResult);
      //   if (item.scriptType == 2 && item.scriptResult[0]) {
      //     item.scriptResult = item.scriptResult.join("&");
      //   }
      // });
      form.serviceSubtaskDetailList = arr;
      Submitaquestionnaire(form).then((res) => {
        if (res.code == 200) {
          if (this.jsy) {
            this.dialogVisible = true;
          }
          this.accomplish = true;
          this.$modal.msgSuccess("提交成功");
        }
      });
    },
    // ç¼“å­˜
    cache(subm) {
      console.log("进入缓存");
      let form = {
        param1: this.taskid,
        param2: this.patid,
        svyLibTemplateScriptVOS: [],
      };
      const arr = structuredClone(this.questionList);
      console.log(arr, "srr");
      arr.forEach((item, index) => {
        var obj = item.svyLibTemplateTargetoptions.find(
          (items) => items.optioncontent == item.scriptResult
        );
        if (obj.isabnormal) {
          console.log(obj.isabnormal);
          form.excep = 1;
          this.excep = 1;
        }
      });
      arr.forEach((item) => {
        if (item.scriptType == 2 && item.scriptResult[0]) {
          item.scriptResult = item.scriptResult.join("&");
        } else if (item.scriptType != 2 && item.scriptResult) {
          item.scriptResult = JSON.stringify(item.scriptResult);
        }
      });
      form.svyLibTemplateScriptVOS = arr;
      Cachequestionnaire(form).then((res) => {
        if (res.code == 200) {
          if (subm) {
            this.submitForm();
          }
        }
      });
    },
    // å¤„理单选选项
    handleOptionChange(selectedvalue, index, arr) {
      // æŸ¥æ‰¾é€‰ä¸­çš„选项对象
      const selectedOption = arr.svyLibTemplateTargetoptions.find(
        (option) => option.optioncontent == selectedvalue
      );
      if (selectedOption) {
        // å°†é€‰ä¸­çš„选项对象的 id èµ‹å€¼ç»™ obj.sonId
        this.questionList[index].nextScriptno = selectedOption.nextQuestion;
        this.questionList[index].score = selectedOption.score;
        this.questionList[index].prompt = selectedOption.prompt;
      }
    },
    // å¤„理多选选项
    updateScore(selectedvalues, index, arr) {
      // ï¿½ï¿½åŠ åˆ†æ•°
      let score = 0;
      selectedvalues.forEach((value) => {
        const selectedOption = arr.svyLibTemplateTargetoptions.find(
          (option) => option.optioncontent == value
        );
        if (selectedOption) {
          score += Number(selectedOption.score);
        }
      });
      this.questionList[index].score = score;
    },
  },
};
</script>
<style lang="scss" scoped>
.questionnaire {
  // background-image: url("../assets/images/chainbackground.jpg");
  background-color: #f9f9fb;
  background-size: cover;
  background-attachment: fixed; /* ä¿æŒèƒŒæ™¯å›ºå®š */
  background-position: center;
  font-family: Arial, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  .CONTENT {
    .title {
      color: #3769f3;
      font-size: 22px;
      font-weight: bold;
      margin-bottom: 20px;
      text-align: center;
    }
  }
}
.preview-left {
  margin: 10px;
  margin-bottom: 60px;
  background-color: #fff;
  border-radius: 5px;
  //   margin: 20px;
  padding: 10px;
  height: 100%;
  // background: #ffff;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
  .topic-dev {
    margin-bottom: 25px;
    font-size: 20px !important;
    .dev-text {
      margin-bottom: 10px;
    }
  }
}
.preview-lefts {
  margin: 10px;
  background-color: #fff;
  border-radius: 5px;
  //   margin: 20px;
  padding: 10px;
  height: 95vh; // background: #ffff;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
  .topic-dev {
    margin-bottom: 25px;
    font-size: 20px !important;
    .dev-text {
      margin-bottom: 10px;
    }
  }
}
.red-star {
  ::v-deep.el-radio__label {
    position: relative;
    padding-right: 10px; /* æ ¹æ®éœ€è¦è°ƒæ•´ */
  }
  ::v-deep.el-radio__label::after {
    content: "*";
    color: red;
    position: absolute;
    right: -5px; /* æ ¹æ®éœ€è¦è°ƒæ•´ */
    top: 0;
  }
  ::v-deep.el-checkbox__label {
    position: relative;
    padding-right: 10px; /* æ ¹æ®éœ€è¦è°ƒæ•´ */
  }
  ::v-deep.el-checkbox__label::after {
    content: "*";
    color: red;
    position: absolute;
    right: -5px; /* æ ¹æ®éœ€è¦è°ƒæ•´ */
    top: 0;
  }
}
::v-deep.el-checkbox-group {
  font-size: 0;
  display: flex;
  flex-direction: column;
  margin: 5px 0;
}
::v-deep.el-checkbox.is-bordered + .el-checkbox.is-bordered {
  margin-left: 0;
}
::v-deep.el-radio-group {
  display: flex;
  flex-direction: column;
  margin: 5px 0;
}
::v-deep.el-radio.is-bordered + .el-radio.is-bordered {
  /* margin-left: 10px; */
  margin-left: 0;
}
::v-deep.custom-radio .el-radio {
  margin: 2px 0;
}
.radio-option {
  flex: none; /* ä¸è®©é€‰é¡¹è‡ªåŠ¨å¡«å……ç©ºé—´ */
  white-space: nowrap; /* é˜²æ­¢é€‰é¡¹æ–‡æœ¬æ¢è¡Œ */
  margin: 0 10px; /* è®¾ç½®é€‰é¡¹å·¦å³çš„é—´éš” */
  font-size: 20px; /* å¢žå¤§å­—体大小 */
}
.el-radio__label {
  font-size: 20px; /* å¢žå¤§æ ‡ç­¾æ–‡å­—大小 */
}
.toptitle {
}
.bottom-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 10px 0; /* æ ¹æ®éœ€è¦è°ƒæ•´å†…边距 */
  background: #fff; /* æ ¹æ®éœ€è¦è°ƒæ•´èƒŒæ™¯é¢œè‰² */
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* å¯é€‰çš„阴影效果 */
  z-index: 1000; /* ç¡®ä¿æŒ‰é’®åœ¨é¡µé¢æœ€ä¸Šå±‚ */
}
::v-deep.el-alert--warning.is-light {
  background-color: #fbf9f3;
  color: #ffba00;
}
::v-deep {
  .el-alert__title {
    font-size: 20px;
    line-height: 18px;
  }
}
::v-deep.el-radio--medium.is-bordered .el-radio__label {
  font-size: 20px;
}
::v-deep.el-radio--medium.is-bordered {
  padding: 5px 20px 0px 10px;
  border-radius: 4px;
  height: 36px;
}
::v-deep.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__label {
  line-height: 17px;
  font-size: 20px;
}
::v-deep.el-checkbox {
  margin-right: 0px;
}
</style>
src/views/outsideChainxj.vue
@@ -1,7 +1,7 @@
<template>
  <div class="questionnaire">
    <!-- <div class="CONTENT">
      <div class="title">新华医院医护知识宣教</div>
      <div class="title">浙中医大二院医护知识宣教</div>
      <div class="preview-left">
        <div v-html="richText"></div>
      </div>
@@ -10,7 +10,7 @@
    <div class="CONTENT" >
      <div class="preview-left">
        <div class="toptitle">
          <div class="title">{{ taskname ? taskname : "新华医院医护知识宣教" }}</div>
          <div class="title">{{ taskname ? taskname : "浙中医大二院医护知识宣教" }}</div>
          <div style="font-size: 22px; margin-bottom: 20px; line-height: 1.5">
            {{
              kcb
src/views/outsideChainxjnew.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,248 @@
<template>
  <div class="questionnaire">
    <!-- <div class="CONTENT">
      <div class="title">浙中医大二院医护知识宣教</div>
      <div class="preview-left">
        <div v-html="richText"></div>
      </div>
    </div> -->
    <div class="CONTENT" >
      <div class="preview-left">
        <div class="toptitle">
          <div class="title">{{ taskname ? taskname : "浙中医大二院医护知识宣教" }}</div>
          <div style="font-size: 22px; margin-bottom: 20px; line-height: 1.5">
            {{
              kcb
                ? kcb
                : "亲爱的患者-家属,您好!我们是浙中医大二院的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,观看这份宣教资讯。"
            }}
            <!-- äº²çˆ±çš„æ‚£è€…/家属您好,为了更好的了解您出院后的康复情况,给您适当及时的健康指导,请您抽一点宝贵时间,完成这份出院随访问卷调查。 -->
          </div>
        </div>
        <el-divider></el-divider>
        <div v-html="richText"></div>
        <div
          style="
            text-align: center;
            padding-top: 50px;
            font-size: 24px;
            color: #175997;
            font-weight: 600;
            margin-bottom: 10px;
          "
        >
        {{
            jsy
              ? jsy
              : "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次宣教内容就到这里,祝您身体健康!"
          }}        </div>
        <!-- <div style="font-size: 20px">
          {{
            jsy
              ? jsy
              : "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次宣教内容就到这里,祝您身体健康!"
          }}
        </div> -->
      </div>
    </div>
  </div>
</template>
<script>
import {
  getExternalfollowup,
  SetsaveQuestionAnswer,
  geturlinfo
} from "@/api/AiCentre/index";
import { getToken } from "@/utils/auth";
import axios from "axios";
import JSEncrypt from "jsencrypt";
export default {
  data() {
    return {
      taskid: 355,
      patid: 265823,
      questionList: null,
      // å‰ç«¯å…¬é’¥
      publicKey:
        "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKR0yHv0rbJWQE+Sc7/FwpW66qMd9qX2k6z+SDgkSdxWh/1GbBoAP7bDQQRF6vXmoKsD2ya42H6XRLSDXAoayuMCAwEAAQ== ",
      // åŽç«¯ç§é’¥
      privateKey:
        " MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==",
      formData: {
        question1: "",
        question2: "",
        question3: "",
      },
      richText: "<p>Hello, <strong>world</strong>!</p>",
      url:'',
      taskname:'',
      kcb:'',
      jsy:'',
    };
  },
  created() {
    this.getQuestionnaire();
  },
  methods: {
    // è§£æžurlid
    geturlinfo() {
      // let url = window.location.href;
      let url = this.$route.query.p;
      // let url = 'http://218.108.11.22:8093/sf/003';
      // let urlid = this.extractLastSegmentFromUrl(url);
      geturlinfo( url ).then((res) => {
       if (res.code==200) {
         this.getQuestionnaire(res.data.param1,res.data.param2,res.data.param3,res.data.param5,)
       }
      });
    },
    extractLastSegmentFromUrl(url) {
    // æ‰¾åˆ°æœ€åŽä¸€ä¸ª'/'的位置
    const lastSlashIndex = url.lastIndexOf('/');
    // å¦‚果找到了'/',截取其后的所有字符
    if (lastSlashIndex !== -1) {
        return url.substring(lastSlashIndex + 1);
    }
    // å¦‚果没有找到'/',返回空字符串
    return '';
},
    // èŽ·å–æ•°æ®
    getQuestionnaire(param1,param2,param3) {
      this.taskid = param1;
      this.patid = param2;
      this.taskname = param3;
      // // let taskid =
      // //   "OFp7tn/B6x7IzKJetvGWHdSWBj7msRlnlj6am9dyuHTH6sEt4uBbVCUXs5kcF/e4O2W6vqHf2Bz9K3/evbYDmw==";
      // // let patid =
      // //   "CVk0j8O86AeCqhV5WPsBBYDg9fec0wDoDlP9imYK4wDBNIkxywZzMJEGlPagOxnq6qr2WYZo0U8MUGWRGnq8ZA==";
      // this.taskid = this.decrypt(taskid);
      // this.patid = this.decrypt(patid);
      // // this.$modal.msgSuccess("用户id为" + this.patid);
      // // this.$modal.msgSuccess("任务id为" + this.taskid);
      // let taskids = this.encrypt(this.taskid);
      // let patids = this.encrypt(this.patid);
      getExternalfollowup({ param1: this.taskid, param2: this.patid }).then((res) => {
        if (res.code == 200) {
          this.url = res.data.script[0].richText;
          this.jsy = res.data.jsy;
          this.kcb = res.data.kcb;
          // ä¸´æ—¶èŽ·å–æ•°æ®
      axios
        .get(this.url)
        .then((response) => {
          console.log(response.data, "数据"); // è¾“出获取到的文件内容
          this.richText = response.data;
          this.richText = this.addStyleToImages(this.richText);
        })
        .catch((error) => {
          console.error("Failed to fetch file:", error);
        });
        }
      });
    },
    addStyleToImages(html) {
      return html.replace(
        /<img([^>]*)style=(['"])(?:(?!\2).)*\2([^>]*)>/g,
        '<img$1style="width:100%;height:auto;"$3>'
      );
    },
    // åŠ å¯†å‡½æ•°
    encrypt(txt) {
      const encryptor = new JSEncrypt();
      encryptor.setPublicKey(this.publicKey); // è®¾ç½®å…¬é’¥
      return encryptor.encrypt(txt); // å¯¹æ•°æ®è¿›è¡ŒåР坆
    },
    // è§£å¯†å‡½æ•°
    decrypt(txt) {
      const encryptor = new JSEncrypt();
      encryptor.setPrivateKey(this.privateKey); // è®¾ç½®ç§é’¥
      return encryptor.decrypt(txt); // å¯¹æ•°æ®è¿›è¡Œè§£å¯†
    },
    // æäº¤
    submitForm() {
      // æäº¤è¡¨å•逻辑
      console.log(this.questionList);
      let form = {
        param1: this.taskid,
        param2: this.patid,
        ivrTaskcalldetailList: [],
      };
      this.questionList.forEach((item) => {
        let optionarr = [];
        item.ivrLibaScriptTargetoptionList.forEach((option) => {
          optionarr.push(option.targetvalue);
        });
        let ivrTaskcalldetail = {
          asrtext: item.asrtext,
          valueType: item.valueType,
          scriptContent: item.scriptContent,
          targetoptions: optionarr.join(","),
        };
        form.ivrTaskcalldetailList.push(ivrTaskcalldetail);
      });
      console.log(form, "form");
      SetsaveQuestionAnswer(form).then((res) => {
        if (res.code == 200) {
          this.$modal.msgSuccess("提交成功");
        }
      });
      // å¯ä»¥å°†æ•°æ®æäº¤åˆ°åŽç«¯æˆ–者进行其他处理
    },
  },
};
</script>
<style lang="scss" scoped>
.questionnaire {
  background-image: url("../assets/images/chainbackground1.jpg");
  background-color: #f9f9fb;
  background-size: cover;
  background-attachment: fixed; /* ä¿æŒèƒŒæ™¯å›ºå®š */
  background-position: center;
  font-family: Arial, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  .CONTENT {
    padding-top: 15px;
    padding-bottom: 15px;
    .title {
      color: #3769f3;
      font-size: 22px;
      font-weight: bold;
      margin-bottom: 20px;
      text-align: center;
    }
  }
}
.preview-left {
  margin: 10px;
  margin-bottom: 60px;
  background-color: #fff;
  border-radius: 5px;
  //   margin: 20px;
  padding: 10px;
  padding-bottom: 100px;
  height: 100%;
  // background: #ffff;
  border: 1px solid #dcdfe6;
  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
    0 0 6px 0 rgba(0, 0, 0, 0.04);
  .topic-dev {
    margin-bottom: 25px;
    font-size: 20px !important;
    .dev-text {
      margin-bottom: 10px;
    }
  }
}
</style>
src/views/register.vue
@@ -6,7 +6,7 @@
      :rules="registerRules"
      class="register-form"
    >
      <h3 class="title">浙中大二院智慧随访平台</h3>
      <h3 class="title">浙中医大二院智慧随访平台</h3>
      <el-form-item prop="username">
        <el-input
          v-model="registerForm.username"
src/views/repositoryai/templateku/configurat/index.vue
@@ -1828,12 +1828,17 @@
        this.ruleForm.isoperation = 2;
        this.ruleForm.tempDetpRelevances = [];
        compileFollowup(this.ruleForm).then((res) => {
          this.$modal.msgSuccess("修改成功");
          if (res.code==200) {
            this.$modal.msgSuccess("修改成功");
          this.confirmillness();
          this.putbelongDepts(this.id);
          this.$modal.closeLoading();
          // this.$modal.closeLoading();
          // this.$router.go(-1);
          window.location.reload();
          }else{
            this.$modal.closeLoading();
          }
        });
      } else {
        this.ruleForm.isoperation = 1;
@@ -1842,11 +1847,16 @@
          : "1.0";
        this.ruleForm.tempDetpRelevances = [];
        compileFollowup(this.ruleForm).then((res) => {
          this.$modal.msgSuccess("新增成功");
          this.confirmillness(res.data);
          this.putbelongDepts(res.data);
          this.$modal.closeLoading();
          this.$router.go(-1);
          if (res.code==200) {
            this.$modal.msgSuccess("新增成功");
            this.confirmillness(res.data);
            this.putbelongDepts(res.data);
            this.$modal.closeLoading();
            this.$router.go(-1);
          }else{
            this.$modal.closeLoading();
          }
        });
      }
    },
src/views/repositoryai/templateku/configurat/measurement.vue
@@ -164,7 +164,7 @@
      };
      // å‘èµ·ws请求
      sendWebsocket(
        "ws://192.168.2.13:8095/chat?userId="+this.userid,
        "ws://192.168.2.10:8095/chat?userId="+this.userid,
        obj,
        this.wsMessage,
        this.wsError
@@ -186,7 +186,7 @@
      // }
      // clearTimeout(timerId)
      // ä¼˜å…ˆåŠ å…¥é€šç”¨åº“åŒ¹é…æ–‡æœ¬
      if (dataJson.nowQuestion.submoduleText) {
        this.Answerline.push({
@@ -221,6 +221,8 @@
            this.sendFn(); // åŽè°ƒç”¨
          }
        }, this.timeout * 1000);
      }else{
        clearTimeout(timerId)
      }
      console.log(this.questionList);
@@ -244,7 +246,7 @@
      console.log(obj, "入参");
      // å‘èµ·ws请求
      sendWebsocket(
        "ws://192.168.2.13:8095/chat?userId="+this.userid,
        "ws://192.168.2.10:8095/chat?userId="+this.userid,
        obj,
        this.wsMessage,
        this.wsError
vue.config.js
@@ -7,7 +7,7 @@
const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '浙中大二院智慧随访平台' // ç½‘页标题
const name = process.env.VUE_APP_TITLE || '浙中医大二院智慧随访平台' // ç½‘页标题
const port = process.env.port || process.env.npm_config_port || 8093 // ç«¯å£
@@ -36,7 +36,7 @@
      // detail: https://cli.vuejs.org/config/#devserver-proxy
      [process.env.VUE_APP_BASE_API]: {
        // target: `http://192.168.168.60:8095`,
        target: `http://192.168.2.13:8095`,
        target: `http://10.202.20.185:8095`,
        // target:`http://localhost:8095`,
        // target: `http://192.168.101.135:8095`,
        // target: `http://192.168.101.166:8093`,