| <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, | 
|   Submitaquestionnaire, | 
| } 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: { | 
|     // 获取数据 | 
|     getQuestionnaire() { | 
|       this.taskid = this.$route.query.param1; | 
|       this.patid = this.$route.query.param2; | 
|       this.taskname = this.$route.query.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"); | 
|   | 
|       Submitaquestionnaire(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> |