From b73b5dd97cbda40d0584f579ed9f65f4fcffe23f Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期一, 31 三月 2025 15:33:02 +0800 Subject: [PATCH] 测试完成 --- src/views/outsideChainxj.vue | 159 +++++++++++++++++++++++++++++++++-------------------- 1 files changed, 99 insertions(+), 60 deletions(-) diff --git a/src/views/outsideChainxj.vue b/src/views/outsideChainxj.vue index 0e19559..3fa6b0c 100644 --- a/src/views/outsideChainxj.vue +++ b/src/views/outsideChainxj.vue @@ -1,43 +1,50 @@ <template> <div class="questionnaire"> - <div class="CONTENT"> - <div class="title">鏆戞湡涓�鍙峰鏁�</div> + <!-- <div class="CONTENT"> + <div class="title">鏅畞浜烘皯鍖婚櫌鍖绘姢鐭ヨ瘑瀹f暀</div> <div class="preview-left"> - <!-- 鍗曢�� --> - <div - class="topic-dev" - v-for="(item, index) in questionList" - :key="item.aaa" - > - <div class="dev-text"> - {{ index + 1 }}銆�<span>{{ item.questionText }}</span> - </div> + <div v-html="richText"></div> + </div> - <div class="dev-xx" v-if="item.valueType == 1"> - <el-radio-group v-model="item.asrtext"> - <el-radio - v-for="(items, index) in item.ivrLibaScriptTargetoptionList" - :key="items.id" - :label="items.targetvalue" - >{{ items.targetvalue }}</el-radio - > - </el-radio-group> - </div> - <div v-else> - <el-input - type="textarea" - placeholder="璇疯緭鍏ュ唴瀹�" - v-model.sync="item.asrtext" - :rows="2" - /> + </div> --> + <div class="CONTENT" > + <div class="preview-left"> + <div class="toptitle"> + <div class="title">{{ taskname ? taskname : "鏅畞浜烘皯鍖婚櫌鍖绘姢鐭ヨ瘑瀹f暀" }}</div> + <div style="font-size: 22px; margin-bottom: 20px; line-height: 1.5"> + {{ + kcb + ? kcb + : "浜茬埍鐨勬偅鑰�-瀹跺睘锛屾偍濂斤紒鎴戜滑鏄櫙瀹佷汉姘戝尰闄㈢殑鍖绘姢浜哄憳锛屼负浜嗘洿濂藉湴浜嗚В鎮ㄧ殑搴峰鎯呭喌锛岃鎮ㄦ娊涓�鐐瑰疂璐垫椂闂达紝瑙傜湅杩欎唤瀹f暀璧勮銆�" + }} + <!-- 浜茬埍鐨勬偅鑰�/瀹跺睘鎮ㄥソ锛屼负浜嗘洿濂界殑浜嗚В鎮ㄥ嚭闄㈠悗鐨勫悍澶嶆儏鍐碉紝缁欐偍閫傚綋鍙婃椂鐨勫仴搴锋寚瀵硷紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤鍑洪櫌闅忚闂嵎璋冩煡銆� --> </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 + : "鐢熸椿涓婅鍔抽�哥粨鍚堬紝娉ㄦ剰浼戞伅鍜岃惀鍏伙紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈瀹f暀鍐呭灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒" + }} </div> + <!-- <div style="font-size: 20px"> + {{ + jsy + ? jsy + : "鐢熸椿涓婅鍔抽�哥粨鍚堬紝娉ㄦ剰浼戞伅鍜岃惀鍏伙紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈瀹f暀鍐呭灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒" + }} + </div> --> </div> - <el-form :model="formData" label-width="80px"> - <el-form-item> - <el-button type="primary" @click="submitForm">纭鏌ョ湅</el-button> - </el-form-item> - </el-form> </div> </div> </template> @@ -45,8 +52,10 @@ <script> import { getExternalfollowup, - SetsaveQuestionAnswer, + Submitaquestionnaire, } from "@/api/AiCentre/index"; +import { getToken } from "@/utils/auth"; +import axios from "axios"; import JSEncrypt from "jsencrypt"; export default { data() { @@ -65,6 +74,11 @@ question2: "", question3: "", }, + richText: "<p>Hello, <strong>world</strong>!</p>", + url:'', + taskname:'', + kcb:'', + jsy:'', }; }, @@ -74,24 +88,45 @@ methods: { // 鑾峰彇鏁版嵁 getQuestionnaire() { - let taskid = this.$route.query.param1; - let patid = this.$route.query.param2; - // let taskid = - // "OFp7tn/B6x7IzKJetvGWHdSWBj7msRlnlj6am9dyuHTH6sEt4uBbVCUXs5kcF/e4O2W6vqHf2Bz9K3/evbYDmw=="; - // let patid = - // "CVk0j8O86AeCqhV5WPsBBYDg9fec0wDoDlP9imYK4wDBNIkxywZzMJEGlPagOxnq6qr2WYZo0U8MUGWRGnq8ZA=="; - this.taskid = this.decrypt(taskid); - this.patid = this.decrypt(patid); + 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: taskids, param2: patids }).then((res) => { + // // 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.questionList = res.rows; + 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) { @@ -111,8 +146,8 @@ // 鎻愪氦琛ㄥ崟閫昏緫 console.log(this.questionList); let form = { - param1: this.encrypt(this.taskid), - param2: this.encrypt(this.patid), + param1: this.taskid, + param2: this.patid, ivrTaskcalldetailList: [], }; this.questionList.forEach((item) => { @@ -123,14 +158,14 @@ let ivrTaskcalldetail = { asrtext: item.asrtext, valueType: item.valueType, - questiontext: item.questionText, + scriptContent: item.scriptContent, targetoptions: optionarr.join(","), }; form.ivrTaskcalldetailList.push(ivrTaskcalldetail); }); console.log(form, "form"); - SetsaveQuestionAnswer(form).then((res) => { + Submitaquestionnaire(form).then((res) => { if (res.code == 200) { this.$modal.msgSuccess("鎻愪氦鎴愬姛"); } @@ -142,13 +177,10 @@ </script> <style lang="scss" scoped> + .questionnaire { - // background-image: url("../assets/images/chainbackground.jpg"); - // background-repeat: no-repeat; - // background-position: center center; - // background-size: cover; - // height: 100vh; background-image: url("../assets/images/chainbackground1.jpg"); + background-color: #f9f9fb; background-size: cover; background-attachment: fixed; /* 淇濇寔鑳屾櫙鍥哄畾 */ background-position: center; @@ -157,8 +189,10 @@ margin: 0; padding: 0; .CONTENT { - padding: 10px; + padding-top: 15px; + padding-bottom: 15px; .title { + color: #3769f3; font-size: 22px; font-weight: bold; margin-bottom: 20px; @@ -167,9 +201,14 @@ } } .preview-left { - margin: 20px; + margin: 10px; + margin-bottom: 60px; + background-color: #fff; + border-radius: 5px; // margin: 20px; - padding: 30px; + 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), -- Gitblit v1.9.3