From 007d3884ad259883d7a5db6714876e46525ae717 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期二, 26 十一月 2024 14:49:38 +0800 Subject: [PATCH] 测试完成 --- src/views/outsideChainnew.vue | 199 ++++++++++++++++++++++++++----------------------- 1 files changed, 107 insertions(+), 92 deletions(-) diff --git a/src/views/outsideChainnew.vue b/src/views/outsideChainnew.vue index 4c9d925..347ad7d 100644 --- a/src/views/outsideChainnew.vue +++ b/src/views/outsideChainnew.vue @@ -30,20 +30,20 @@ <div class="dev-xx"> <el-radio-group class="custom-radio" - v-model="item.scriptResult" + v-model="item.questionResult" @change="handleOptionChange($event, index, item)" > <el-radio border - v-for="(items, index) in item.svyLibTemplateTargetoptions" + v-for="(items, index) in item.ivrLibaScriptTargetoptionList" :class=" - items.isabnormal && item.scriptResult == items.optioncontent + items.isabnormal && item.questionResult == items.targetvalue ? 'red-star' : '' " :key="index" - :label="items.optioncontent" - >{{ items.optioncontent }}</el-radio + :label="items.targetvalue" + >{{ items.targetvalue }}</el-radio > </el-radio-group> </div> @@ -62,27 +62,27 @@ <div class="dev-xx"> <el-checkbox-group class="custom-radio" - v-model="item.scriptResult" + v-model="item.questionResult" @change="updateScore($event, index, item)" > <el-checkbox border @change="$forceUpdate()" - v-for="(items, indexs) in item.svyLibTemplateTargetoptions" + v-for="(items, indexs) in item.ivrLibaScriptTargetoptionList" :key="indexs" - :label="items.optioncontent" + :label="items.targetvalue" > - {{ items.optioncontent }} + {{ items.targetvalue }} </el-checkbox> </el-checkbox-group> </div> <!-- :class="items.isabnormal ? 'red-star' : ''" --> - <div v-show="item.prompt && item.scriptResult[0]"> + <div v-show="item.prompt && item.questionResult[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="scriptTopic-dev" :key="index" v-if="item.scriptType == 4||item.scriptType == 3"> <div class="dev-text"> {{ index + 1 }}銆�<span style="line-height: 1.5" >{{ item.scriptContent @@ -94,7 +94,7 @@ type="textarea" :rows="3" placeholder="璇疯緭鍏ョ瓟妗�" - v-model="item.scriptResult" + v-model="item.questionResult" clearable > </el-input> @@ -153,6 +153,7 @@ Submitaquestionnaire, geturlinfo, } from "@/api/AiCentre/index"; +import { type } from "jquery"; import JSEncrypt from "jsencrypt"; export default { data() { @@ -161,91 +162,92 @@ patid: 265823, kcb: "", excep: "", + taskname: "", 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+" }, + // questionResult: null, + // ivrLibaScriptTargetoptionList: [ + // { targetvalue: "18-25", value: "18-25", isabnormal: true }, + // { targetvalue: "26-35", value: "26-35" }, + // { targetvalue: "36-45", value: "36-45" }, + // { targetvalue: "46-55", value: "46-55" }, + // { targetvalue: "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" }, + // questionResult: null, + // ivrLibaScriptTargetoptionList: [ + // { targetvalue: "瀛︾敓", value: "student" }, + // { targetvalue: "鏁欏笀", value: "teacher" }, + // { targetvalue: "宸ョ▼甯�", value: "engineer" }, + // { targetvalue: "鍖荤敓", value: "doctor" }, + // { targetvalue: "鍏朵粬", 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" }, + // questionResult: [], + // ivrLibaScriptTargetoptionList: [ + // { targetvalue: "鏃呮父", value: "travel", isabnormal: true }, + // { targetvalue: "闃呰", value: "reading", isabnormal: true }, + // { targetvalue: "杩愬姩", value: "sports", isabnormal: true }, + // { targetvalue: "闊充箰", value: "music" }, + // { targetvalue: "鐢靛奖", 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" }, + // questionResult: null, + // ivrLibaScriptTargetoptionList: [ + // { targetvalue: "瀛︾敓", value: "student" }, + // { targetvalue: "鏁欏笀", value: "teacher" }, + // { targetvalue: "宸ョ▼甯�", value: "engineer" }, + // { targetvalue: "鍖荤敓", value: "doctor" }, + // { targetvalue: "鍏朵粬", 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" }, + // questionResult: null, + // ivrLibaScriptTargetoptionList: [ + // { targetvalue: "瀛︾敓", value: "student" }, + // { targetvalue: "鏁欏笀", value: "teacher" }, + // { targetvalue: "宸ョ▼甯�", value: "engineer", isabnormal: true }, + // { targetvalue: "鍖荤敓", value: "doctor" }, + // { targetvalue: "鍏朵粬", 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" }, + // questionResult: null, + // ivrLibaScriptTargetoptionList: [ + // { targetvalue: "瀛︾敓", value: "student" }, + // { targetvalue: "鏁欏笀", value: "teacher" }, + // { targetvalue: "宸ョ▼甯�", value: "engineer" }, + // { targetvalue: "鍖荤敓", value: "doctor" }, + // { targetvalue: "鍏朵粬", value: "other" }, // ], // required: false, // }, // { // scriptType: 4, // scriptContent: "鎮ㄧ殑濮撳悕鏄粈涔堬紵", - // scriptResult: "name", + // questionResult: "name", // required: true, - // scriptResult: null, + // questionResult: null, // }, ], jsy: null, @@ -282,28 +284,33 @@ // 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,) - } + 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 ''; -// }, + // extractLastSegmentFromUrl(url) { + // // 鎵惧埌鏈�鍚庝竴涓�'/'鐨勪綅缃� + // const lastSlashIndex = url.lastIndexOf('/'); + // // 濡傛灉鎵惧埌浜�'/'锛屾埅鍙栧叾鍚庣殑鎵�鏈夊瓧绗� + // if (lastSlashIndex !== -1) { + // return url.substring(lastSlashIndex + 1); + // } + // // 濡傛灉娌℃湁鎵惧埌'/'锛岃繑鍥炵┖瀛楃涓� + // return ''; + // }, // 鑾峰彇鏁版嵁 - getQuestionnaire(param1,param2,param3) { + getQuestionnaire(param1, param2, param3) { this.taskid = decodeURIComponent(param1); this.patid = decodeURIComponent(param2); - this.taskname = param3; + // this.taskname = param3; // let taskid = // "OFp7tn/B6x7IzKJetvGWHdSWBj7msRlnlj6am9dyuHTH6sEt4uBbVCUXs5kcF/e4O2W6vqHf2Bz9K3/evbYDmw=="; // let patid = @@ -320,10 +327,10 @@ 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("&"); + if (item.questionResult && item.scriptType != 2) { + item.questionResult = JSON.parse(item.questionResult); + } else if (item.questionResult && item.scriptType == 2) { + item.questionResult = item.questionResult.split("&"); } }); return; @@ -344,11 +351,14 @@ this.questionList = res.data.script; this.jsy = res.data.jsy; this.kcb = res.data.kcb; + this.taskname = res.data.taskName; + this.type = res.data.type; + // 澶勭悊棰樼洰鏀堕泦缁撴灉鏍煎紡 this.questionList.forEach((item) => { item.nextScriptno = Number(item.nextScriptno); if (item.scriptType == 2) { - item.scriptResult = []; + item.questionResult = []; } }); } @@ -374,13 +384,14 @@ param1: this.taskid, param2: this.patid, excep: this.excep, + type: this.type, 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("&"); + // item.asrtext = JSON.stringify(item.questionResult); + // if (item.scriptType == 2 && item.questionResult[0]) { + // item.questionResult = item.questionResult.join("&"); // } // }); form.serviceSubtaskDetailList = arr; @@ -400,14 +411,18 @@ let form = { param1: this.taskid, param2: this.patid, - svyLibTemplateScriptVOS: [], + type: this.type, + ivrLibaTemplateScriptVOList: [], }; const arr = structuredClone(this.questionList); console.log(arr, "srr"); arr.forEach((item, index) => { - var obj = item.svyLibTemplateTargetoptions.find( - (items) => items.optioncontent == item.scriptResult + if (item.scriptType == 3||item.scriptType == 4) return; + var obj = item.ivrLibaScriptTargetoptionList.find( + (items) => items.targetvalue == item.questionResult ); + console.log(obj, "isabnormal"); + if (obj.isabnormal) { console.log(obj.isabnormal); form.excep = 1; @@ -416,13 +431,13 @@ }); 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); + if (item.scriptType == 2 && item.questionResult[0]) { + item.questionResult = item.questionResult.join("&"); + } else if (item.scriptType != 2 && item.questionResult) { + item.questionResult = JSON.stringify(item.questionResult); } }); - form.svyLibTemplateScriptVOS = arr; + form.ivrLibaTemplateScriptVOList = arr; Cachequestionnaire(form).then((res) => { if (res.code == 200) { if (subm) { @@ -434,8 +449,8 @@ // 澶勭悊鍗曢�夐�夐」 handleOptionChange(selectedvalue, index, arr) { // 鏌ユ壘閫変腑鐨勯�夐」瀵硅薄 - const selectedOption = arr.svyLibTemplateTargetoptions.find( - (option) => option.optioncontent == selectedvalue + const selectedOption = arr.ivrLibaScriptTargetoptionList.find( + (option) => option.targetvalue == selectedvalue ); if (selectedOption) { // 灏嗛�変腑鐨勯�夐」瀵硅薄鐨� id 璧嬪�肩粰 obj.sonId @@ -449,8 +464,8 @@ // 锟斤拷鍔犲垎鏁� let score = 0; selectedvalues.forEach((value) => { - const selectedOption = arr.svyLibTemplateTargetoptions.find( - (option) => option.optioncontent == value + const selectedOption = arr.ivrLibaScriptTargetoptionList.find( + (option) => option.targetvalue == value ); if (selectedOption) { score += Number(selectedOption.score); -- Gitblit v1.9.3