浏览代码

feat: 评测报告兼容没有音频的情况

TIANYONG 6 天之前
父节点
当前提交
6792e2a7ed
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/page-instrument/custom-plugins/guide-driver/index.tsx

+ 7 - 2
src/page-instrument/custom-plugins/guide-driver/index.tsx

@@ -1346,13 +1346,18 @@ export const EvaluatingReportDriver = defineComponent({
             title: "",
             description: "",
             popoverClass: "popoverClass popoverClassReport3 popoverClose",
-            align: "start",
+            align: "end",
             side: "bottom",
             prevBtnText: "再看一遍",
             doneBtnText: "完成",
             showButtons: ["next", "previous"],
             onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
-              driverInitialPosition(popover, options);
+              options.config.stageRadius = 8;
+              options.config.stagePadding = 5;
+              try {
+                const rect = options.state.activeElement?.getBoundingClientRect();
+                popover.wrapper.style.marginLeft = ((rect?.width || 0) / 2) * -1 + 4 + "px";
+              } catch {}
             },
             onPrevClick: () => {
               driverObj.drive(0);