From 44fe7b7d69118a4d03bed8dadcf9b6bba1416f9d Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 04 九月 2024 18:08:10 +0800
Subject: [PATCH] 测试完成
---
src/views/outsideChainxj.vue | 95 +++++++++++++++++++++++------------------------
1 files changed, 47 insertions(+), 48 deletions(-)
diff --git a/src/views/outsideChainxj.vue b/src/views/outsideChainxj.vue
index 0e19559..c8a7b9e 100644
--- a/src/views/outsideChainxj.vue
+++ b/src/views/outsideChainxj.vue
@@ -1,43 +1,16 @@
<template>
<div class="questionnaire">
<div class="CONTENT">
- <div class="title">鏆戞湡涓�鍙峰鏁�</div>
+ <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 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>
+ <div v-html="richText"></div>
</div>
- <el-form :model="formData" label-width="80px">
+ <!-- <el-form :model="formData" label-width="80px">
<el-form-item>
<el-button type="primary" @click="submitForm">纭鏌ョ湅</el-button>
</el-form-item>
- </el-form>
+ </el-form> -->
</div>
</div>
</template>
@@ -47,6 +20,8 @@
getExternalfollowup,
SetsaveQuestionAnswer,
} from "@/api/AiCentre/index";
+import { getToken } from "@/utils/auth";
+import axios from "axios";
import JSEncrypt from "jsencrypt";
export default {
data() {
@@ -65,6 +40,8 @@
question2: "",
question3: "",
},
+ richText: "<p>Hello, <strong>world</strong>!</p>",
+ url:'',
};
},
@@ -74,24 +51,42 @@
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;
+ // // 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;
+ // 涓存椂鑾峰彇鏁版嵁
+ 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 +106,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,7 +118,7 @@
let ivrTaskcalldetail = {
asrtext: item.asrtext,
valueType: item.valueType,
- questiontext: item.questionText,
+ scriptContent: item.scriptContent,
targetoptions: optionarr.join(","),
};
form.ivrTaskcalldetailList.push(ivrTaskcalldetail);
@@ -181,5 +176,9 @@
margin-bottom: 10px;
}
}
+ img {
+ width: 80vw !important;
+ height: 20vh !important;
+ }
}
</style>
--
Gitblit v1.9.3