|
|
@@ -103,7 +103,7 @@
|
|
|
b.“重要分”,指标逻辑为根据团队全体对当前主题所对应各问卷题目重要性评分的均值,用来表征团队对这一主题问卷所陈述内容对于团队重要性的平均认知,最高分:5分,最低分:0分;<br>
|
|
|
c.“影响力分”,指标逻辑为团队全体对当前主题所对应各问卷题目的认同度评分与重要性评分乘积的均值,用来表征团队对这一主题问卷所陈述内容对于团队的影响力水平,最高分:25分,最低分:0分;</view>
|
|
|
<view class="v2b-title">评估结果</view>
|
|
|
- <view class="v2b-p" v-html="(reportData.totalDiagnosticOutput||'').replaceAll('\n\n','<br>').replaceAll('**','<b>')"></view>
|
|
|
+ <view class="v2b-p" v-html="renderMarkdown(reportData.totalDiagnosticOutput||'')"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 总体评估分析 评估建议-->
|
|
|
@@ -115,7 +115,7 @@
|
|
|
<view class="v2-box" style="border: 1px solid #33A7A7;">
|
|
|
<img class="vb-img1" :src="'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/intro_box_img1.png'">
|
|
|
<view class="v2b-title" style="margin-top: 0;">评估建议</view>
|
|
|
- <view class="v2b-p" v-html="(reportData.totalDiagnosisSuggest||'').replaceAll('\n\n','<br>').replaceAll('**','<b>')"></view>
|
|
|
+ <view class="v2b-p" v-html="renderMarkdown(reportData.totalDiagnosisSuggest||'')"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 多维度 -->
|
|
|
@@ -169,7 +169,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="v2-subp">评估结果</view>
|
|
|
- <view class="v2-p" style="margin-top: 6px;" v-html="(item.diagnosisOutput||'').replaceAll('\n\n','<br>').replaceAll('**','<b>')"></view>
|
|
|
+ <view class="v2-p" style="margin-top: 6px;" v-html="renderMarkdown2(item.diagnosisOutput||'')"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="cd_box adffc" style="border: none;">
|
|
|
@@ -178,7 +178,7 @@
|
|
|
<view class="vt-right">团队发展动态评估报告(团队版) </view>
|
|
|
</view>
|
|
|
<view class="v2-box" :style="{'border':'none','padding':0}">
|
|
|
- <view class="v2-p" style="margin-top: 6px;" v-html="(item.diagnosisSuggest||'').replaceAll('\n\n','<br>').replaceAll('**','<b>')"></view>
|
|
|
+ <view class="v2-p" style="margin-top: 6px;" v-html="renderMarkdown2(item.diagnosisSuggest||'')"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</block>
|
|
|
@@ -308,7 +308,42 @@
|
|
|
this.calculateScaleAndPosition();
|
|
|
});
|
|
|
},
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ renderMarkdown(val) {
|
|
|
+ if(!val) return '';
|
|
|
+ val = '<span style="padding-left:4ch;"></span>'+val;
|
|
|
+ val = this.formattedText2(val);
|
|
|
+ val = val.replaceAll('\n','<br><span style="padding-left:4ch;"></span>')
|
|
|
+ val = this.formattedText(val);
|
|
|
+ return val
|
|
|
+ },
|
|
|
+ renderMarkdown2(val) {
|
|
|
+ if(!val) return '';
|
|
|
+ val = '<span style="padding-left:4ch;"></span>'+val;
|
|
|
+ val = val.replaceAll('\n','<br><span style="padding-left:4ch;"></span>')
|
|
|
+ return val
|
|
|
+ },
|
|
|
+ formattedText(val) {
|
|
|
+ // 正则表达式:匹配**包裹的内容
|
|
|
+ // /\*\*(.*?)\*\*/g 解析:
|
|
|
+ // \*\* 匹配两个星号(*需要转义)
|
|
|
+ // (.*?) 非贪婪匹配任意字符(括号捕获匹配的内容)
|
|
|
+ // g 全局匹配(替换所有符合条件的内容)
|
|
|
+ const regex = /\*\*(.*?)\*\*/g
|
|
|
+ // 替换为<b>标签,$1表示正则中括号捕获的内容
|
|
|
+ return val.replace(regex, '<b>$1</b>')
|
|
|
+ },
|
|
|
+ formattedText2(val) {
|
|
|
+ // 正则解析:
|
|
|
+ // #{1,6} 匹配1到6个#
|
|
|
+ // (.*?) 非贪婪捕获#后、空格前的任意文字(核心要保留的内容)
|
|
|
+ // \s 匹配后面的空格(注意是单个空格,若要兼容多个空格可改为\s+)
|
|
|
+ // g 全局匹配,替换所有符合条件的内容
|
|
|
+ const regex = /#{1,6}\s*(.+?)\s*\n/g;
|
|
|
+
|
|
|
+ // 替换规则:将匹配到的 "#文字 " / "##文字 " / "###文字 " 转为 "<b>文字</b>"
|
|
|
+ return val.replace(regex, '<b>$1</b><br>')
|
|
|
+ },
|
|
|
getReportData(){
|
|
|
this.$api.get(`/core/report/previewReport/${this.reportId}`).then(async ({data:res})=>{
|
|
|
if(res.code!==0) return this.$showToast(res.msg)
|