From fbb61549bf96e9e0910b676a5524b0760d29c4be Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 07 四月 2026 15:16:54 +0800
Subject: [PATCH] 测试完成

---
 src/views/Satisfaction/sfstatistics/components/components/TopicDialog.vue |  208 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 208 insertions(+), 0 deletions(-)

diff --git a/src/views/Satisfaction/sfstatistics/components/components/TopicDialog.vue b/src/views/Satisfaction/sfstatistics/components/components/TopicDialog.vue
new file mode 100644
index 0000000..46e59de
--- /dev/null
+++ b/src/views/Satisfaction/sfstatistics/components/components/TopicDialog.vue
@@ -0,0 +1,208 @@
+<template>
+  <div class="topic-dialog">
+    <div class="topicdia">
+      <div style="overflow-x: hidden; overflow-y: auto; max-height: 65vh">
+        <!-- 淇敼杩欓噷锛氫娇鐢� processedTopicList 鑰屼笉鏄� topicList -->
+        <div
+          v-for="(item, index) in processedTopicList"
+          :key="item.scriptid"
+          class="ttaabbcc"
+        >
+          <div class="describe">
+            绗瑊{ index + 1 }}棰橈細 {{ item.scriptContent }}
+            <span>[{{ item.scriptType == 1 ? "鍗曢�夐" : "澶氶�夐" }}]</span>
+          </div>
+          <div>
+            <el-table :data="item.details" style="width: 100%">
+              <el-table-column
+                prop="optionText"
+                label="闂閫夐」"
+                align="center"
+                min-width="200"
+              />
+              <el-table-column
+                prop="chosenQuantity"
+                label="閫夋嫨浜烘暟"
+                align="center"
+                min-width="120"
+              >
+                <template slot-scope="{ row }">
+                  {{ row.chosenQuantity || 0 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="chosenPercentage"
+                label="姣斾緥"
+                align="center"
+                min-width="120"
+              >
+                <template slot-scope="{ row }">
+                  <span
+                    v-if="
+                      row.chosenPercentage !== null &&
+                      row.chosenPercentage !== undefined
+                    "
+                  >
+                    {{ (Number(row.chosenPercentage) * 100).toFixed(2) }}%
+                  </span>
+                  <span v-else>-</span>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <!-- 濡傛灉娌℃湁鏁版嵁 -->
+    <div
+      v-if="!processedTopicList.length"
+      class="no-data"
+      style="text-align: center; padding: 50px 0"
+    >
+      <el-empty description="鏆傛棤鏁版嵁"></el-empty>
+    </div>
+
+    <div
+      slot="footer"
+      class="dialog-footer"
+      style="text-align: center; padding-top: 20px"
+    >
+      <el-button @click="handleClose">鍏� 闂�</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "TopicDialog",
+  props: {
+    rowData: {
+      type: Object,
+      default: () => ({}),
+    },
+    queryParams: {
+      type: Object,
+      default: () => ({}),
+    },
+    topicList: {
+      type: [Array, Object],
+      default: () => ({}),
+    },
+  },
+  data() {
+    return {
+      processedTopicList: [], // 澶勭悊鍚庣殑鏁版嵁
+    };
+  },
+  watch: {
+    // 鐩戝惉鐖剁粍浠朵紶閫掔殑鏁版嵁鍙樺寲
+    topicList: {
+      immediate: true,
+      handler(newVal) {
+        console.log("TopicDialog鎺ユ敹鍒扮埗缁勪欢鏁版嵁:", newVal);
+        this.processTopicList(newVal);
+      },
+    },
+  },
+  mounted() {
+    console.log("TopicDialog mounted, props:", this.$props);
+  },
+  methods: {
+    // 澶勭悊topicList鏁版嵁
+    processTopicList(data) {
+      console.log("寮�濮嬪鐞嗘暟鎹�:", data);
+
+      if (!data || typeof data !== "object") {
+        this.processedTopicList = [];
+        return;
+      }
+
+      // 灏嗗璞¤浆鎹负鏁扮粍
+      const result = [];
+
+      Object.keys(data).forEach((key) => {
+        const item = data[key];
+        if (item && item.scriptContent) {
+          // 娣辨嫹璐漣tem锛岄伩鍏嶄慨鏀瑰師鏁版嵁
+          const processedItem = JSON.parse(JSON.stringify(item));
+
+          // 杩囨护details锛屽彧淇濈暀鏈夐�夐」鏂囨湰鐨�
+          if (processedItem.details && Array.isArray(processedItem.details)) {
+            processedItem.details = processedItem.details.filter(
+              (detail) => detail && detail.optionText
+            );
+          }
+
+          result.push(processedItem);
+        }
+      });
+
+      console.log("澶勭悊鍚庣殑鏁版嵁:", result);
+      this.processedTopicList = result;
+    },
+
+    // 鏍煎紡鍖栫櫨鍒嗘瘮
+    formatPercent(value) {
+      if (value === null || value === undefined) return "-";
+      const num = parseFloat(value);
+      if (isNaN(num)) return "-";
+      return `${num.toFixed(2)}%`; // 娉ㄦ剰锛氫綘鐨勬暟鎹腑鐧惧垎姣斿凡缁忔槸0-100鐨勫舰寮�
+    },
+
+    // 鍏抽棴瀵硅瘽妗�
+    handleClose() {
+      this.$emit("close");
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.topic-dialog {
+  .topicdia {
+    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+      "Helvetica Neue", Arial, sans-serif;
+    color: #333;
+  }
+
+  .ttaabbcc {
+    background: #fafafa;
+    border-radius: 6px;
+    padding: 16px;
+    margin-bottom: 20px;
+    border-left: 4px solid #4794c5;
+  }
+
+  .describe {
+    font-size: 15px;
+    line-height: 1.6;
+    margin-bottom: 12px;
+    color: #1f2d3d;
+  }
+
+  .describe span {
+    font-size: 13px;
+    color: #999;
+    font-style: italic;
+    margin-left: 8px;
+  }
+
+  ::v-deep .el-table {
+    border-radius: 4px;
+    overflow: hidden;
+    font-size: 14px;
+  }
+
+  ::v-deep .el-table th {
+    background-color: #f1f5f9;
+    color: #333;
+    font-weight: 600;
+  }
+
+  ::v-deep .el-table td {
+    border-bottom: 1px solid #f0f0f0;
+    padding: 12px 0;
+  }
+}
+</style>

--
Gitblit v1.9.3