WXL (wul)
2 天以前 e0909a604449641ebcc6ed15495e6f28515f437c
src/views/followvisit/record/detailpage/index.vue
@@ -282,11 +282,7 @@
                    >
                      <!-- 单选 -->
                      <div
                        :class="
                          item.isabnormal
                            ? 'scriptTopic-isabnormal'
                            : 'scriptTopic-dev'
                        "
                        :class="getTopicClass(item)"
                        :key="index"
                        v-if="item.scriptType == 1 && !item.astrict"
                      >
@@ -301,7 +297,7 @@
                              v-for="(
                                items, indexs
                              ) in item.svyTaskTemplateTargetoptions"
                              :class="items.isabnormal ? 'red-star' : ''"
                              :class="getOptionClass(items)"
                              :key="indexs"
                              :label="items.optioncontent"
                              @click.native.prevent="
@@ -1407,6 +1403,29 @@
  },
  methods: {
    // 获取主题样式类
    getTopicClass(item) {
      console.log(item.isabnormal,'111');
      // 根据状态值返回对应的样式类
      if (item.isabnormal == 1) {
        return "scriptTopic-isabnormal"; // 异常 - 红色
      } else if (item.isabnormal == 2) {
        return "scriptTopic-warning"; // 警告 - 黄色
      } else {
        return "scriptTopic-dev"; // 正常 - 默认样式
      }
    },
    // 获取选项样式类
    getOptionClass(items) {
      if (items.isabnormal == 1) {
        return "red-star"; // 异常 - 红色星号
      } else if (items.isabnormal == 2) {
        return "yellow-star"; // 警告 - 黄色星号
      }
      return ""; // 正常 - 无特殊样式
    },
    // 获取问卷数据
    getsearchrResults(id) {
      getsearchrResults({
@@ -1797,7 +1816,7 @@
    yuyingetdetail() {
      const dataToSubmit = JSON.parse(JSON.stringify(this.tableDatatop));
      console.log(dataToSubmit, "dataToSubmit");
      return;
      // return;
      dataToSubmit.forEach((item, index) => {
        // 对拷贝的数据进行操作,不影响原始的 scriptResult 数组
        item.scriptResult = item.scriptResult.join("&");
@@ -2094,7 +2113,7 @@
      if (questionItem.matchedtext == optionValue) {
        this.$set(questionItem, "matchedtext", "");
        // 同时重置与选项相关的状态
        questionItem.isabnormal = false;
        // questionItem.isabnormal = false;
        questionItem.showAppendInput = false;
        // 注意:取消选中时,我们通常不希望触发题目跳转逻辑,所以直接返回
        // 如果需要,可以在这里添加取消选中后的特定逻辑,例如重置题目序列
@@ -2110,7 +2129,7 @@
      if (questionItem.scriptResult === optionValue) {
        questionItem.scriptResult = ""; // 清空选中值
        // 同时重置与选项相关的状态
        questionItem.isabnormal = false;
        // questionItem.isabnormal = false;
        questionItem.showAppendInput = false;
        // 注意:取消选中时,我们通常不希望触发题目跳转逻辑,所以直接返回
        // 如果需要,可以在这里添加取消选中后的特定逻辑,例如重置题目序列
@@ -2138,7 +2157,7 @@
      // 处理异常状态高亮
      this.tableDatatop[questionIndex].isabnormal =
        !!selectedOptionObj.isabnormal;
        selectedOptionObj.isabnormal;
      // 处理附加输入框显示
      this.tableDatatop[questionIndex].showAppendInput =
@@ -2213,7 +2232,7 @@
          astrict: index === questionIndex + 1 ? 0 : item.astrict,
          hiddenByEnd: index === questionIndex + 1 ? false : item.hiddenByEnd,
        }));
      }
      }2
      this.$forceUpdate();
    },
@@ -2224,9 +2243,7 @@
        );
        if (obj) {
          if (obj.isabnormal) {
            this.tableDatatop[index].isabnormal = true;
          } else {
            this.tableDatatop[index].isabnormal = false;
            this.tableDatatop[index].isabnormal = obj.isabnormal;
          }
          this.$forceUpdate();
        }
@@ -2618,6 +2635,18 @@
  }
}
/* 异常状态样式 - 红色 (保持不变) */
.scriptTopic-isabnormal {
  color: red;
}
/* 新增:警告状态样式 - 黄色 */
.scriptTopic-warning {
  color: #d4be00; /* 您指定的黄色 */
}
/* 异常选项样式 - 红色星号 (保持不变) */
.red-star {
  ::v-deep.el-radio__label {
    position: relative;
@@ -2631,25 +2660,43 @@
    right: -5px;
    top: 0;
  }
}
  ::v-deep.el-input-group__textarea {
    white-space: pre-wrap;
    word-break: break-all;
  }
  ::v-deep.el-checkbox__label {
/* 新增:警告选项样式 - 黄色星号 */
.yellow-star {
  ::v-deep.el-radio__label {
    position: relative;
    padding-right: 10px;
  }
  ::v-deep.el-checkbox__label::after {
  ::v-deep.el-radio__label::after {
    content: "*";
    color: red;
    color: #ffe202; /* 黄色星号 */
    position: absolute;
    right: -5px;
    top: 0;
    font-weight: bold;
  }
}
/* 共用样式保持不变 */
::v-deep.el-input-group__textarea {
  white-space: pre-wrap;
  word-break: break-all;
}
::v-deep.el-checkbox__label {
  position: relative;
  padding-right: 10px;
}
::v-deep.el-checkbox__label::after {
  content: "*";
  color: red;
  position: absolute;
  right: -5px;
  top: 0;
}
.tag-selector-container {
  display: flex;
  align-items: center;