From feb5a669dced68415bc7e32f237f77bf9842fe8b Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 03 六月 2026 17:42:18 +0800
Subject: [PATCH] 测试完成

---
 src/views/outsideChainwtnew.vue |  751 ++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 555 insertions(+), 196 deletions(-)

diff --git a/src/views/outsideChainwtnew.vue b/src/views/outsideChainwtnew.vue
index 3b5a39e..3882e7f 100644
--- a/src/views/outsideChainwtnew.vue
+++ b/src/views/outsideChainwtnew.vue
@@ -1,160 +1,315 @@
 <template>
   <div class="questionnaire-optimized">
-    <div class="content-wrapper" v-if="!accomplish">
-      <div class="questionnaire-container">
-        <!-- 闂嵎鏍囬鍖哄煙 -->
-        <div class="questionnaire-header">
-          <h1 class="questionnaire-title">
-            {{ taskname ? taskname : "闂嵎" }}
-          </h1>
-          <div class="questionnaire-description">
-            {{
-              kcb
-                ? kcb
-                : "浜茬埍鐨勬偅鑰�-瀹跺睘锛屾垜浠槸鍖婚櫌鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�"
-            }}
-          </div>
-        </div>
-
-        <el-divider class="custom-divider"></el-divider>
-
-        <!-- 闂嵎棰樼洰鍖哄煙 -->
-        <div class="questions-section">
-          <div
-            class="question-item"
-            v-for="(item, index) in visibleQuestions"
-            :key="item.id"
-            :class="{
-              'has-warning':
-                item.prompt &&
-                item.scriptResult &&
-                (item.scriptType !== 2 || item.scriptResult.length > 0),
-            }"
-          >
-            <!-- 棰樼洰棰樺共 -->
-            <div class="question-stem">
-              <span class="question-number"
-                >{{ getVisibleQuestionIndex(index) }}.</span
-              >
-              <span class="question-text">{{ item.scriptContent }}</span>
-              <span class="question-type-tag">
-                {{
-                  item.scriptType === 1
-                    ? "[鍗曢�塢"
-                    : item.scriptType === 2
-                    ? "[澶氶�塢"
-                    : "[闂瓟]"
-                }}
-              </span>
-            </div>
-
-            <!-- 鍗曢�夐鐩� -->
-            <div
-              class="question-options"
-              v-if="item.scriptType == 1 && !item.ishide"
-            >
-              <el-radio-group class="options-group" v-model="item.scriptResult">
-                <el-radio
-                  v-for="(
-                    option, optionIndex
-                  ) in item.svyTaskTemplateTargetoptions"
-                  :key="optionIndex"
-                  :label="option.optioncontent"
-                  :class="{
-                    'abnormal-option':
-                      option.isabnormal &&
-                      item.scriptResult == option.optioncontent,
-                  }"
-                  @click.native.prevent="
-                    handleRadioToggle(
-                      item,
-                      index,
-                      item.svyTaskTemplateTargetoptions,
-                      option.optioncontent
-                    )
-                  "
-                  class="option-radio"
-                >
-                  <span class="option-text">{{ option.optioncontent }}</span>
-                </el-radio>
-              </el-radio-group>
-            </div>
-
-            <!-- 澶氶�夐鐩� -->
-            <div class="question-options" v-if="item.scriptType == 2">
-              <el-checkbox-group
-                class="options-group"
-                v-model="item.scriptResult"
-              >
-                <el-checkbox
-                  v-for="(
-                    option, optionIndex
-                  ) in item.svyTaskTemplateTargetoptions"
-                  :key="optionIndex"
-                  :label="option.optioncontent"
-                  :class="{
-                    'abnormal-option': option.isabnormal,
-                  }"
-                  @change="$forceUpdate()"
-                  class="option-checkbox"
-                >
-                  <span class="option-text">{{ option.optioncontent }}</span>
-                </el-checkbox>
-              </el-checkbox-group>
-            </div>
-
-            <!-- 濉┖棰樼洰 -->
-            <div class="question-input" v-if="item.scriptType == 4">
-              <el-input
-                type="textarea"
-                :rows="3"
-                placeholder="璇疯緭鍏ユ偍鐨勫洖绛�"
-                v-model="item.scriptResult"
-                clearable
-                class="answer-textarea"
-              ></el-input>
-            </div>
-
-            <!-- 鎻愮ず淇℃伅 -->
-            <div
-              class="question-warning"
-              v-show="
-                item.prompt &&
-                item.scriptResult &&
-                (item.scriptType !== 2 || item.scriptResult.length > 0)
-              "
-            >
-              <el-alert
-                :title="item.prompt"
-                type="warning"
-                :closable="false"
-                class="warning-alert"
-              ></el-alert>
-            </div>
-          </div>
-        </div>
-
-        <!-- 鎻愪氦鎸夐挳 -->
-        <div class="submit-section">
-          <el-button type="primary" @click="cache(true)" class="submit-button">
-            鎻愪氦闂嵎
-          </el-button>
-        </div>
+    <div v-if="loading && !accomplish" class="loading-container">
+      <div class="loading-content">
+        <i class="el-icon-loading loading-icon"></i>
+        <div class="loading-text">闂嵎鍔犺浇涓紝璇风◢鍊�...</div>
       </div>
     </div>
 
-    <!-- 瀹屾垚椤甸潰 -->
-    <div class="completion-page" v-else>
-      <div class="completion-content">
-        <div class="completion-icon">鉁�</div>
-        <h2 class="completion-title">鎰熻阿鎮ㄧ殑閰嶅悎!</h2>
-        <p class="completion-message">
-          {{
-            jsy
-              ? jsy
-              : "鐢熸椿涓婅鍔抽�哥粨鍚堬紝娉ㄦ剰浼戞伅鍜岃惀鍏伙紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒"
-          }}
-        </p>
+    <!-- 姝e父鍐呭 -->
+    <div v-else>
+      <div class="content-wrapper" v-if="!accomplish">
+        <div class="questionnaire-container">
+          <!-- 闂嵎鏍囬鍖哄煙 -->
+          <div class="questionnaire-header">
+            <h1 class="questionnaire-title">
+              {{ taskname ? taskname : "闂嵎" }}
+            </h1>
+            <div class="questionnaire-description">
+              {{
+                kcb
+                  ? kcb
+                  : "浜茬埍鐨勬偅鑰�-瀹跺睘锛屾垜浠槸鍖婚櫌鐨勫尰鎶や汉鍛橈紝涓轰簡鏇村ソ鍦颁簡瑙f偍鐨勫悍澶嶆儏鍐碉紝璇锋偍鎶戒竴鐐瑰疂璐垫椂闂达紝瀹屾垚杩欎唤闅忚闂嵎銆�"
+              }}
+            </div>
+          </div>
+
+          <el-divider class="custom-divider"></el-divider>
+
+          <!-- 鎸夌淮搴﹀垎缁勭殑棰樼洰鍖哄煙 -->
+          <div class="dimension-section" v-if="hasDimension">
+            <!-- 閬嶅巻缁村害鍒嗙粍 -->
+            <div
+              class="dimension-group"
+              v-for="(group, dimensionKey) in dimensionGroups"
+              :key="dimensionKey"
+            >
+              <!-- 缁村害鏍囬 - 鍙樉绀烘湁缁村害鏍囩鐨� -->
+              <div class="dimension-title" v-if="group.dimensionLabel">
+                <h3>{{ group.dimensionLabel }}</h3>
+              </div>
+
+              <!-- 璇ョ淮搴︿笅鐨勯鐩� -->
+              <div class="questions-section">
+                <div
+                  class="question-item"
+                  v-for="(item, index) in group.questions"
+                  :key="item.id"
+                  :class="{
+                    'has-warning':
+                      item.prompt &&
+                      item.scriptResult &&
+                      (item.scriptType !== 2 || item.scriptResult.length > 0),
+                  }"
+                >
+                  <!-- 棰樼洰棰樺共 -->
+                  <div class="question-stem">
+                    <span class="question-number"
+                      >{{ getQuestionNumber(group, index) }}.</span
+                    >
+                    <span class="question-text">{{ item.scriptContent }}</span>
+                    <span class="question-type-tag">
+                      {{
+                        item.scriptType == 1
+                          ? "[鍗曢�塢"
+                          : item.scriptType == 2
+                          ? "[澶氶�塢"
+                          : "[闂瓟]"
+                      }}
+                    </span>
+                  </div>
+
+                  <!-- 鍗曢�夐鐩� -->
+                  <div
+                    class="question-options"
+                    v-if="item.scriptType == 1 && !item.ishide"
+                  >
+                    <el-radio-group
+                      class="options-group"
+                      v-model="item.scriptResult"
+                    >
+                      <el-radio
+                        v-for="(
+                          option, optionIndex
+                        ) in item.svyTaskTemplateTargetoptions"
+                        :key="optionIndex"
+                        :label="option.optioncontent"
+                        :class="{
+                          'abnormal-option':
+                            option.isabnormal &&
+                            item.scriptResult == option.optioncontent,
+                        }"
+                        @click.native.prevent="
+                          handleRadioToggle(
+                            item,
+                            getGlobalIndex(dimension, group, index),
+                            item.svyTaskTemplateTargetoptions,
+                            option.optioncontent
+                          )
+                        "
+                        class="option-radio"
+                      >
+                        <span class="option-text">{{
+                          option.optioncontent
+                        }}</span>
+                      </el-radio>
+                    </el-radio-group>
+                  </div>
+
+                  <!-- 澶氶�夐鐩� -->
+                  <div class="question-options" v-if="item.scriptType == 2">
+                    <el-checkbox-group
+                      class="options-group"
+                      v-model="item.scriptResult"
+                    >
+                      <el-checkbox
+                        v-for="(
+                          option, optionIndex
+                        ) in item.svyTaskTemplateTargetoptions"
+                        :key="optionIndex"
+                        :label="option.optioncontent"
+                        :class="{
+                          'abnormal-option': option.isabnormal,
+                        }"
+                        @change="$forceUpdate()"
+                        class="option-checkbox"
+                      >
+                        <span class="option-text">{{
+                          option.optioncontent
+                        }}</span>
+                      </el-checkbox>
+                    </el-checkbox-group>
+                  </div>
+
+                  <!-- 濉┖棰樼洰 -->
+                  <div class="question-input" v-if="item.scriptType == 4">
+                    <el-input
+                      type="textarea"
+                      :rows="3"
+                      placeholder="璇疯緭鍏ユ偍鐨勫洖绛�"
+                      v-model="item.scriptResult"
+                      clearable
+                      class="answer-textarea"
+                    ></el-input>
+                  </div>
+
+                  <!-- 鎻愮ず淇℃伅 -->
+                  <div
+                    class="question-warning"
+                    v-show="
+                      item.prompt &&
+                      item.scriptResult &&
+                      (item.scriptType !== 2 || item.scriptResult.length > 0)
+                    "
+                  >
+                    <el-alert
+                      :title="item.prompt"
+                      type="warning"
+                      :closable="false"
+                      class="warning-alert"
+                    ></el-alert>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+
+          <!-- 鏃犵淮搴︽椂鐨勯鐩尯鍩燂紙淇濇寔鍘熸牱锛� -->
+          <div class="questions-section" v-else>
+            <div
+              class="question-item"
+              v-for="(item, index) in visibleQuestions"
+              :key="item.id"
+              :class="{
+                'has-warning':
+                  item.prompt &&
+                  item.scriptResult &&
+                  (item.scriptType !== 2 || item.scriptResult.length > 0),
+              }"
+            >
+              <!-- 棰樼洰棰樺共 -->
+              <div class="question-stem">
+                <span class="question-number"
+                  >{{ getVisibleQuestionIndex(index) }}.</span
+                >
+                <span class="question-text">{{ item.scriptContent }}</span>
+                <span class="question-type-tag">
+                  {{
+                    item.scriptType == 1
+                      ? "[鍗曢�塢"
+                      : item.scriptType == 2
+                      ? "[澶氶�塢"
+                      : "[闂瓟]"
+                  }}
+                </span>
+              </div>
+
+              <!-- 鍗曢�夐鐩� -->
+              <div
+                class="question-options"
+                v-if="item.scriptType == 1 && !item.ishide"
+              >
+                <el-radio-group
+                  class="options-group"
+                  v-model="item.scriptResult"
+                >
+                  <el-radio
+                    v-for="(
+                      option, optionIndex
+                    ) in item.svyTaskTemplateTargetoptions"
+                    :key="optionIndex"
+                    :label="option.optioncontent"
+                    :class="{
+                      'abnormal-option':
+                        option.isabnormal &&
+                        item.scriptResult == option.optioncontent,
+                    }"
+                    @click.native.prevent="
+                      handleRadioToggle(
+                        item,
+                        index,
+                        item.svyTaskTemplateTargetoptions,
+                        option.optioncontent
+                      )
+                    "
+                    class="option-radio"
+                  >
+                    <span class="option-text">{{ option.optioncontent }}</span>
+                  </el-radio>
+                </el-radio-group>
+              </div>
+
+              <!-- 澶氶�夐鐩� -->
+              <div class="question-options" v-if="item.scriptType == 2">
+                <el-checkbox-group
+                  class="options-group"
+                  v-model="item.scriptResult"
+                >
+                  <el-checkbox
+                    v-for="(
+                      option, optionIndex
+                    ) in item.svyTaskTemplateTargetoptions"
+                    :key="optionIndex"
+                    :label="option.optioncontent"
+                    :class="{
+                      'abnormal-option': option.isabnormal,
+                    }"
+                    @change="$forceUpdate()"
+                    class="option-checkbox"
+                  >
+                    <span class="option-text">{{ option.optioncontent }}</span>
+                  </el-checkbox>
+                </el-checkbox-group>
+              </div>
+
+              <!-- 濉┖棰樼洰 -->
+              <div class="question-input" v-if="item.scriptType == 4">
+                <el-input
+                  type="textarea"
+                  :rows="3"
+                  placeholder="璇疯緭鍏ユ偍鐨勫洖绛�"
+                  v-model="item.scriptResult"
+                  clearable
+                  class="answer-textarea"
+                ></el-input>
+              </div>
+
+              <!-- 鎻愮ず淇℃伅 -->
+              <div
+                class="question-warning"
+                v-show="
+                  item.prompt &&
+                  item.scriptResult &&
+                  (item.scriptType !== 2 || item.scriptResult.length > 0)
+                "
+              >
+                <el-alert
+                  :title="item.prompt"
+                  type="warning"
+                  :closable="false"
+                  class="warning-alert"
+                ></el-alert>
+              </div>
+            </div>
+          </div>
+
+          <!-- 鎻愪氦鎸夐挳 -->
+          <div class="submit-section">
+            <el-button
+              type="primary"
+              @click="cache(true)"
+              class="submit-button"
+            >
+              鎻愪氦闂嵎
+            </el-button>
+          </div>
+        </div>
+      </div>
+
+      <!-- 瀹屾垚椤甸潰 -->
+      <div class="completion-page" v-else>
+        <div class="completion-content">
+          <div class="completion-icon">鉁�</div>
+          <h2 class="completion-title">鎰熻阿鎮ㄧ殑閰嶅悎!</h2>
+          <p class="completion-message">
+            {{
+              jsy
+                ? jsy
+                : "鐢熸椿涓婅鍔抽�哥粨鍚堬紝娉ㄦ剰浼戞伅鍜岃惀鍏伙紝閫傚綋閿荤偧锛屾垝鐑熼檺閰掞紝淇濇寔蹇冩儏鑸掔晠锛屽畾鏈熷璇娿�傞偅鏈鍥炶灏卞埌杩欓噷锛岀鎮ㄨ韩浣撳仴搴凤紒"
+            }}
+          </p>
+        </div>
       </div>
     </div>
   </div>
@@ -165,6 +320,7 @@
   getExternalfollowup,
   getCachequestionnaire,
   Cachequestionnaire,
+  gettypeout,
   Submitaquestionnaire,
   geturlinfo,
 } from "@/api/AiCentre/index";
@@ -172,6 +328,7 @@
 export default {
   data() {
     return {
+      loading: true,
       taskid: 355,
       patid: 265823,
       kcb: "",
@@ -179,10 +336,28 @@
       isabnormal: 0,
       taskname: "",
       questionList: [],
+      param6: null,
       jsy: null,
       dialogVisible: false,
       Endornot: true,
       accomplish: false,
+      dimensionTypes: [
+        {
+          value: 1,
+          label: "缁村害1",
+          listClass: "primary",
+        },
+        {
+          value: 2,
+          label: "缁村害浜�",
+          listClass: "primary",
+        },
+        {
+          value: 3,
+          label: "缁村害涓�",
+          listClass: "primary",
+        },
+      ],
       // 鍓嶇鍏挜
       publicKey:
         "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKR0yHv0rbJWQE+Sc7/FwpW66qMd9qX2k6z+SDgkSdxWh/1GbBoAP7bDQQRF6vXmoKsD2ya42H6XRLSDXAoayuMCAwEAAQ== ",
@@ -203,12 +378,89 @@
     // window.removeEventListener("beforeunload", this.cache);
   },
   created() {
+    this.gettypeout();
     this.geturlinfo();
   },
   computed: {
     // 璁$畻灞炴�э細鑾峰彇鎵�鏈夊彲瑙佺殑棰樼洰
     visibleQuestions() {
+      if (!Array.isArray(this.questionList)) {
+        return [];
+      }
       return this.questionList.filter((question) => !question.ishide);
+    },
+
+    // 璁$畻灞炴�э細妫�鏌ユ槸鍚︽湁缁村害瀛楁
+    hasDimension() {
+      if (!this.questionList || this.questionList.length == 0) {
+        return false;
+      }
+      // 妫�鏌ヤ换鎰忎竴涓鐩槸鍚︽湁dimension瀛楁
+      return this.questionList.some(
+        (question) =>
+          question.dimension && this.getDimensionLabel(question.dimension)
+      );
+    },
+
+    // 璁$畻灞炴�э細鎸夌淮搴︽暣鐞嗛鐩�
+    dimensionGroups() {
+      if (!this.questionList || this.questionList.length == 0) {
+        return {};
+      }
+
+      const groups = {};
+      let currentGroupKey = null;
+      let groupStartIndex = 0; // 璁板綍褰撳墠缁村害缁勭殑寮�濮嬬储寮�
+
+      this.visibleQuestions.forEach((question, index) => {
+        const dimensionValue = question.dimension;
+        const dimensionLabel = this.getDimensionLabel(dimensionValue);
+
+        // 鐢熸垚缁刱ey锛氭湁缁村害鐢ㄧ淮搴﹀�硷紝鏃犵淮搴︾敤鐗规畩鏍囪+璧峰绱㈠紩
+        let groupKey;
+        if (dimensionValue && dimensionLabel) {
+          groupKey = `dimension-${dimensionValue}`;
+        } else {
+          // 鏃犵淮搴︽垨缁村害鏄犲皠涓嶅瓨鍦ㄧ殑棰樼洰鍗曠嫭鍒嗙粍
+          groupKey = `no-dimension-${groupStartIndex}`;
+        }
+
+        // 鍒涘缓鎴栬幏鍙栫淮搴︾粍
+        if (!groups[groupKey]) {
+          groups[groupKey] = {
+            questions: [],
+            startIndex: groupStartIndex,
+            dimensionValue: dimensionValue, // 淇濆瓨缁村害鍊肩敤浜庡悗缁鐞�
+            dimensionLabel: dimensionLabel, // 淇濆瓨缁村害鏍囩
+            isNoDimension: !dimensionValue || !dimensionLabel,
+          };
+          currentGroupKey = groupKey;
+        }
+
+        // 灏嗛鐩坊鍔犲埌瀵瑰簲鐨勭淮搴︾粍
+        groups[groupKey].questions.push(question);
+
+        // 濡傛灉涓嬩竴涓鐩淮搴︿笉鍚岋紝閲嶆柊寮�濮嬭鏁�
+        const nextQuestion = this.visibleQuestions[index + 1];
+        if (nextQuestion) {
+          const nextDimensionValue = nextQuestion.dimension;
+          const nextDimensionLabel = this.getDimensionLabel(nextDimensionValue);
+          const currentDimensionLabel = this.getDimensionLabel(dimensionValue);
+
+          // 鍒ゆ柇缁村害鏄惁鐩稿悓
+          if (
+            dimensionValue !== nextDimensionValue ||
+            (dimensionValue &&
+              nextDimensionValue &&
+              ((!dimensionValue && nextDimensionValue) ||
+                (dimensionValue && !nextDimensionValue)))
+          ) {
+            groupStartIndex = index + 1;
+          }
+        }
+      });
+
+      return groups;
     },
   },
   methods: {
@@ -228,8 +480,26 @@
             res.data.param3,
             res.data.param5
           );
+          this.param6 = res.data.param6;
         }
       });
+    },
+    // 鑾峰彇瀛楀吀
+    gettypeout() {
+      gettypeout("dimensionality_type").then((res) => {
+        if (res.code == 200) {
+          this.dimensionTypes = res.data;
+        }
+      });
+    },
+    // 鏍规嵁缁村害鍊艰幏鍙栫淮搴︽爣绛�
+    getDimensionLabel(dimensionValue) {
+      if (!dimensionValue) return "";
+
+      const dimensionType = this.dimensionTypes.find(
+        (item) => item.dictValue == Number(dimensionValue)
+      );
+      return dimensionType ? dimensionType.dictLabel : "";
     },
     //     extractLastSegmentFromUrl(url) {
     //     // 鎵惧埌鏈�鍚庝竴涓�'/'鐨勪綅缃�
@@ -247,6 +517,8 @@
       this.taskid = decodeURIComponent(param1);
       this.patid = decodeURIComponent(param2);
       this.taskname = decodeURIComponent(param3);
+      this.loading = true;
+
       // let taskid =
       //   "OFp7tn/B6x7IzKJetvGWHdSWBj7msRlnlj6am9dyuHTH6sEt4uBbVCUXs5kcF/e4O2W6vqHf2Bz9K3/evbYDmw==";
       // let patid =
@@ -256,10 +528,10 @@
       // let taskids = this.encrypt(this.taskid);
       // let patids = this.encrypt(this.patid);
       // 鍏堝彇缂撳瓨
-      getCachequestionnaire({ param1: this.taskid, param2: this.patid }).then(
-        (res) => {
+      getCachequestionnaire({ param1: this.taskid, param2: this.patid })
+        .then((res) => {
           if (res.code == 200) {
-            this.questionList = res.data;
+            this.questionList = res.data.result;
             this.accomplish = res.data.submit;
             if (this.questionList[0]) {
               this.questionList.forEach((item) => {
@@ -269,6 +541,8 @@
                   item.scriptResult = item.scriptResult.split("&");
                 }
               });
+              this.loading = false;
+
               return;
             } else {
               this.getExternalfollowup();
@@ -276,13 +550,13 @@
           } else {
             this.getExternalfollowup();
           }
-        }
-      );
+        })
+        .finally(() => {});
     },
     // 鑾峰彇鏁版嵁
     getExternalfollowup() {
-      getExternalfollowup({ param1: this.taskid, param2: this.patid }).then(
-        (res) => {
+      getExternalfollowup({ param1: this.taskid, param2: this.patid })
+        .then((res) => {
           if (res.code == 200) {
             this.questionList = res.data.script;
             this.jsy = res.data.jsy;
@@ -294,9 +568,12 @@
                 item.scriptResult = [];
               }
             });
+            this.loading = false;
           }
-        }
-      );
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     // 鍔犲瘑鍑芥暟
     encrypt(txt) {
@@ -316,6 +593,7 @@
       let form = {
         param1: this.taskid,
         param2: this.patid,
+        param6: this.param6,
         excep: this.excep,
         isabnormal: this.isabnormal,
         serviceSubtaskDetailList: [],
@@ -346,6 +624,7 @@
       let form = {
         param1: this.taskid,
         param2: this.patid,
+        param6: this.param6,
         svyTaskTemplateScriptVOS: [],
       };
       const arr = structuredClone(this.questionList);
@@ -399,19 +678,42 @@
     getVisibleQuestionIndex(index) {
       return index + 1;
     },
+
+    // 鑾峰彇缁村害鍐呴鐩殑搴忓彿
+    getQuestionNumber(group, index) {
+      return group.startIndex + index + 1;
+    },
+
+    // 鑾峰彇棰樼洰鍦ㄥ叏閲忔暟缁勪腑鐨勭储寮�
+    getGlobalIndex(dimension, group, localIndex) {
+      return group.startIndex + localIndex;
+    },
+    // 鍦ㄦā鏉夸腑浣跨敤
+    getDimensionLabelForDisplay(dimensionKey) {
+      if (dimensionKey.startsWith("no-dimension-")) {
+        return "";
+      }
+      const dimensionValue = dimensionKey.replace("dimension-", "");
+      return this.getDimensionLabel(dimensionValue);
+    },
     // 鏂板鐨勫垏鎹㈤�変腑/鍙栨秷閫変腑鏂规硶
-    handleRadioToggle(questionItem, index, options, optionValue) {
+    handleRadioToggle(questionItem, globalIndex, options, optionValue) {
       // 淇濆瓨褰撳墠鐘舵�佷互渚垮悗缁瘮杈�
       const previousState = JSON.parse(JSON.stringify(this.questionList));
 
       // 鍘熸湁鐨勫鐞嗛�昏緫
-      if (questionItem.scriptResult === optionValue) {
+      if (questionItem.scriptResult == optionValue) {
         questionItem.scriptResult = "";
         questionItem.isabnormal = 0;
         questionItem.showAppendInput = false;
       } else {
         questionItem.scriptResult = optionValue;
-        this.handleOptionChange(optionValue, index, options, questionItem);
+        this.handleOptionChange(
+          optionValue,
+          globalIndex,
+          options,
+          questionItem
+        );
       }
 
       // 澶勭悊瀹屾垚鍚庯紝纭繚閲嶆柊璁$畻鍙棰樼洰鐨勫簭鍙�
@@ -471,6 +773,8 @@
         } else {
           // 姝e父璺宠浆閫昏緫
           const nextQuestionIndex = selectedOptionObj.nextQuestion - 1;
+          console.log(nextQuestionIndex, 4);
+          console.log(selectedOptionObj);
 
           this.questionList = this.questionList.map((item, index) => {
             // 淇濈暀褰撳墠棰樼洰涔嬪墠鐨勯殣钘忕姸鎬�
@@ -483,12 +787,12 @@
             }
 
             // 褰撳墠棰樼洰鎬绘槸鍙
-            if (index === questionIndex) {
+            if (index == questionIndex) {
               return { ...item, ishide: 0, hiddenByEnd: false };
             }
 
             // 鏄剧ず鐩爣涓嬩竴棰�
-            if (index === nextQuestionIndex) {
+            if (index == nextQuestionIndex) {
               return { ...item, ishide: 0, hiddenByEnd: false };
             }
 
@@ -510,8 +814,8 @@
         // 濡傛灉娌℃湁璺宠浆锛屽彧闇�纭繚涓嬩竴棰樺彲瑙�
         this.questionList = this.questionList.map((item, index) => ({
           ...item,
-          ishide: index === questionIndex + 1 ? 0 : item.ishide,
-          hiddenByEnd: index === questionIndex + 1 ? false : item.hiddenByEnd,
+          ishide: index == questionIndex + 1 ? 0 : item.ishide,
+          hiddenByEnd: index == questionIndex + 1 ? false : item.hiddenByEnd,
         }));
       }
 
@@ -520,32 +824,6 @@
         this.$forceUpdate();
       });
     },
-    // 澶勭悊鍗曢�夐�夐」
-    // handleOptionChange(selectedvalue, index, arr) {
-    //   // 鏌ユ壘閫変腑鐨勯�夐」瀵硅薄
-    //   const selectedOption = arr.svyTaskTemplateTargetoptions.find(
-    //     (option) => option.optioncontent == selectedvalue
-    //   );
-    //   if (selectedOption) {
-    //     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.svyTaskTemplateTargetoptions.find(
-    //       (option) => option.optioncontent == value
-    //     );
-    //     if (selectedOption) {
-    //       score += Number(selectedOption.score);
-    //     }
-    //   });
-    //   this.questionList[index].score = score;
-    // },
   },
 };
 </script>
@@ -598,12 +876,40 @@
   background-color: #eaeef2;
 }
 
+/* 缁村害鍒嗙粍鏍峰紡 */
+.dimension-section {
+  margin-bottom: 20px;
+}
+
+.dimension-group {
+  margin-bottom: 30px;
+
+  &:last-child {
+    margin-bottom: 0;
+  }
+}
+
+.dimension-title {
+  background: linear-gradient(135deg, #e8f4ff 0%, #d1e7ff 100%);
+  padding: 12px 20px;
+  border-radius: 8px;
+  margin-bottom: 20px;
+  border-left: 4px solid #175997;
+
+  h3 {
+    color: #175997;
+    font-size: 20px;
+    font-weight: 600;
+    margin: 0;
+  }
+}
+
 .questions-section {
-  margin-bottom: 40px;
+  margin-bottom: 10px;
 }
 
 .question-item {
-  margin-bottom: 35px;
+  margin-bottom: 25px;
   padding: 20px;
   border-radius: 8px;
   border: 1px solid #eaeef2;
@@ -616,6 +922,10 @@
 
   &.has-warning {
     border-left: 4px solid #e6a23c;
+  }
+
+  &:last-child {
+    margin-bottom: 0;
   }
 }
 
@@ -722,6 +1032,8 @@
 .submit-section {
   text-align: center;
   padding: 20px 0 10px;
+  border-top: 1px solid #eaeef2;
+  margin-top: 20px;
 }
 
 .submit-button {
@@ -815,6 +1127,14 @@
     padding: 15px;
   }
 
+  .dimension-title {
+    padding: 10px 15px;
+
+    h3 {
+      font-size: 18px;
+    }
+  }
+
   .completion-content {
     padding: 30px 20px;
   }
@@ -840,5 +1160,44 @@
   .completion-icon {
     font-size: 60px;
   }
+
+  .dimension-title h3 {
+    font-size: 16px;
+  }
+}
+.loading-container {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  min-height: 70vh;
+}
+
+.loading-content {
+  text-align: center;
+  padding: 40px;
+  background: #fff;
+  border-radius: 8px;
+  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
+}
+
+.loading-icon {
+  font-size: 40px;
+  color: #409eff;
+  margin-bottom: 15px;
+  animation: rotating 2s linear infinite;
+}
+
+.loading-text {
+  font-size: 16px;
+  color: #606266;
+}
+
+@keyframes rotating {
+  from {
+    transform: rotate(0deg);
+  }
+  to {
+    transform: rotate(360deg);
+  }
 }
 </style>

--
Gitblit v1.9.3