pdfZyb.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957
  1. <template>
  2. <view class="page-wrappe">
  3. <cus-header title=' ' bgColor="transparent"></cus-header>
  4. <view id="pdfContainer" class="pdf-container" :style="{'transform':'scale('+scale+')', 'height': containerScaledHeight + 'px'}" v-if="reportData">
  5. <!-- 封面 -->
  6. <view class="cd_box fm2 adffc" style="margin-top: 20px;height: 868px;">
  7. <img class="fm2-logo" src="https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/fm_logo.png">
  8. <img class="fm2-logo2" src="https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/fm_logo2.png">
  9. <img class="fm2-perill" src="https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/fm_perill.png">
  10. <view class="fm2-line"></view>
  11. <view class="fm2-p">团队发展动态评估报告(团队版)</view>
  12. <view class="fm2-texts adf" style="margin-top: 5px;">
  13. <view class="fm2-texts-pre adf" style="margin-top: 10px;">
  14. <view class="fm2-texts-pre-span">客户名称:</view>
  15. <view class="fm2-texts-pre-val">{{ reportData.teamInfo.enterpriseName||'' }}</view>
  16. </view>
  17. <view class="fm2-texts-pre adf" style="margin-top: 10px;">
  18. <view class="fm2-texts-pre-span">团队名称:</view>
  19. <view class="fm2-texts-pre-val">{{ reportData.teamInfo.teamName||'' }}</view>
  20. </view>
  21. <view class="fm2-texts-pre adf" style="margin-top: 10px;">
  22. <view class="fm2-texts-pre-span">评估发起人:</view>
  23. <view class="fm2-texts-pre-val">{{ reportData.teamInfo.initiator||'' }}</view>
  24. </view>
  25. <view class="fm2-texts-pre adf" style="margin-top: 10px;">
  26. <view class="fm2-texts-pre-span">报告生成时间:</view>
  27. <view class="fm2-texts-pre-val">{{ reportData.teamInfo.reportDate||'' }}</view>
  28. </view>
  29. <view class="fm2-texts-pre adf" style="margin-top: 10px;">
  30. <view class="fm2-texts-pre-span">团队类型:</view>
  31. <view class="fm2-texts-pre-val">{{ reportData.teamInfo.functionName||'' }}</view>
  32. </view>
  33. <view class="fm2-texts-pre adf" style="margin-top: 10px;">
  34. <view class="fm2-texts-pre-span">团队层级:</view>
  35. <view class="fm2-texts-pre-val">{{ reportData.teamInfo.hierarchy||'' }}</view>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 介绍 -->
  40. <view class="cd_box">
  41. <view class="v2-top adfacjb" :style="{'background-image':'url(https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/intro_title_bg.png)'}">
  42. <view class="vt-left" style="color: #FFFFFF;">介绍<span>PERILL团队发展动态评估简介</span></view>
  43. <view class="vt-right">PERILL团队发展动态评估报告(团队版)</view>
  44. </view>
  45. <view class="v2-box">
  46. <img class="vb-img1" :src="'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+'intro'+'_box_img1.png'">
  47. <img class="vb-img2" :src="'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+'intro'+'_box_img2.png'">
  48. <view class="v2-p">PERILL团队发展动态评估源于团队教练辅导领域的先驱、管理思维与团队绩效领域的权威、全球顶尖团队教练David Clutterbuck教授及其团队通过深入研究,提炼出影响团队绩效的140多个基于实证的因素,整合而成的团队评估和提升工具-PERILL团队发展动态评估。</view>
  49. <view class="v2-p" style="margin-top: 8px;">创衡国际基于10多年来在全球与200多家具有前瞻性的国际公司以及国内具有行业代表性公司的合作经验,结合CCMI的PERILL团队发展动态评估工具,在中国推出的团队发展动态评估系统,旨在帮助团队更全面、更有效地从六个维度评估团队的发展现状,为支持团队成为高价值团队提供全景式的客观评估。</view>
  50. <view class="v2-p" style="margin-top: 8px;">PERILL团队发展动态评估的主体内容由<span>{{reportData.teamInfo.questionCount||0}}</span>个关于团队的描述组成。</view>
  51. </view>
  52. <view class="v2-six">
  53. <view class="vsix-title">PERILL六大纬度</view>
  54. <view class="vsix-p">PERILL团队发展动态评估提供了一个复杂的团队系统概览,它并非针对孤立的问题,也不是简单的优缺点,而是着眼于团队系统的复杂性。它 通过6个影响因素(如下所述)提出问题,以揭示团队系统各要素之间的联系,以及这些联系如何影响团队的高效运作能力。</view>
  55. <view class="vsix-boxs">
  56. <view class="vsb adfac" v-for="(item,index) in sixWd" :key="index">
  57. <img class="vsb-img" :src="item.image"/>
  58. <view class="vsb-right">
  59. <view class="vsbr-top adfac">
  60. <view class="vsbrt-type" :style="{'background':item.color}">{{ item.type }}</view>
  61. <view class="vsbrt-title" :style="{'color':item.color}">{{ item.title }}</view>
  62. </view>
  63. <view class="vsbr-desc">{{ item.desc }}</view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <!-- 总体评估分析 -->
  70. <view class="cd_box adffc">
  71. <view class="v2-top adfacjb" :style="{'background-image':'url(https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+'intro'+'_top_title_bg2.png)'}">
  72. <view class="vt-left">总体评估分析</view>
  73. <view class="vt-right">PERILL团队发展动态评估报告(团队版)</view>
  74. </view>
  75. <view class="v2-box" @click="downloadZtzdfxImg">
  76. <img class="vb-img1" :src="'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+'intro'+'_box_img1.png'">
  77. <img class="vb-img2" :src="'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+'intro'+'_box_img2.png'">
  78. <view class="v2-p2">报告的核心是PERILL团队发展动态评估分析下的整体团队表现。这包括团队在PERILL团队发展动态评估每个关键要素上的综合得分,通过结合得分和置信指数,我们能够展示出高功能领域和低功能域。</view>
  79. <view class="v2-p2" style="margin-top: 16px;">下面图中的位置标记显示了团队按主题划分的总分。</view>
  80. <view class="vb-category">
  81. <view class="vbc-pre adfac">
  82. <view class="vbcp-yuan y1"></view>
  83. <view class="vbcp-text">团队Leader</view>
  84. </view>
  85. <view class="vbc-pre adfac">
  86. <view class="vbcp-yuan y2"></view>
  87. <view class="vbcp-text">团队Member</view>
  88. </view>
  89. <view class="vbc-pre adfac">
  90. <view class="vbcp-yuan y3"></view>
  91. <view class="vbcp-text">利益相关方Stakeholder</view>
  92. </view>
  93. <view class="vbc-pre adfac">
  94. <view class="vbcp-yuan y4"></view>
  95. <view class="vbcp-text">赞助人Sponsor</view>
  96. </view>
  97. </view>
  98. <view style="width:360px;height:360px;margin: 0 auto;" class="pdfEchart">
  99. <l-echart ref="ztzdfxRef" :canvas2d="true" @finished="initZtzdfxChart" style="width: 100%;height: 100%;"></l-echart>
  100. </view>
  101. </view>
  102. <view class="v2-data">
  103. <view class="vd-title" :style="{'background-image':'url(https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+'intro'+'_title_bg1.png)'}">评估结果</view>
  104. <view class="v2-p" v-html="(reportData.totalDiagnosticOutput||'').replaceAll('\n\n','<br>')"></view>
  105. </view>
  106. <view class="v2-data" style="flex: 1;margin-top: 20px;">
  107. <view class="vd-title vt2" :style="{'background-image':'url(https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+'intro'+'_title_bg2.png)'}">团队提升&教练建议</view>
  108. <view class="v2-p" v-html="(reportData.totalDiagnosisSuggest||'').replaceAll('\n\n','<br>')"></view>
  109. </view>
  110. </view>
  111. <!-- 多维度 -->
  112. <canvas type="2d" id="table-canvas" canvas-id="table-canvas" class="offscreen-canvas"></canvas>
  113. <template v-if="reportData&&reportData.dimensionAnalysis&&reportData.dimensionAnalysis.length">
  114. <view class="cd_box adffc" style="border: none;" :style="{'background-image':'url('+'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+typeDict[item.title]+'_bg.png)'}" v-for="(item,index) in reportData.dimensionAnalysis" :key="index">
  115. <view class="v2-top adfacjb" :style="{'background-image':'url('+'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+typeDict[item.title]+'_title_bg.png)'}">
  116. <view class="vt-left" :class="{'black':(item.title=='人际关系'||item.title=='学习')}">{{ item.title }}</view>
  117. <view class="vt-right">PERILL团队发展动态评估报告(团队版)</view>
  118. </view>
  119. <view class="v2-box" :style="{'border':'1px solid '+item.bcolor}">
  120. <img class="vb-img1" :src="'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+typeDict[item.title]+'_box_img1.png'">
  121. <img class="vb-img2" :src="'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+typeDict[item.title]+'_box_img2.png'">
  122. <view class="v2-p2">{{ item.desc }}</view>
  123. <!-- <view class="v2-p2" style="margin-top: 16px;">评分总体分布</view> -->
  124. <view class="vb-table" :style="{'border':'1px solid '+item.bcolor,'margin-top':'22px'}">
  125. <view class="vbt-th adfac" :class="{'black':(item.title=='人际关系'||item.title=='学习')}" :style="{'background':item.thcolor}">
  126. <view class="vbtt-w1">主题</view>
  127. <view class="vbtt-w2">最低分</view>
  128. <view class="vbtt-w2">平均分</view>
  129. <view class="vbtt-w2">最高分</view>
  130. <view class="vbtt-w3">问卷陈述</view>
  131. </view>
  132. <view class="vbt-pre adfac" v-for="(ss,si) in item.scoreSpreads" :key="si">
  133. <view class="vbtp-left vbtt-w1 adfacjc" :class="{'black':(item.title=='人际关系'||item.title=='学习'||item.title=='内部流程及系统与架构')}" :style="{'background':item.titlecolor,'padding':'0 16px'}">{{ ss.theme||'' }}</view>
  134. <view class="vbtp-num vbtt-w2" :style="{'border-bottom':'1px solid '+item.bcolor}">{{ ss.minScore||0 }}</view>
  135. <view class="vbtp-num vbtt-w2 green" :style="{'border-bottom':'1px solid '+item.bcolor}">{{ ss.avgScore||0 }}</view>
  136. <view class="vbtp-num vbtt-w2" :style="{'border-bottom':'1px solid '+item.bcolor}">{{ ss.maxScore||0 }}</view>
  137. <view class="vbtp-desc" :style="{'border-bottom':'1px solid '+item.bcolor}">
  138. <view class="vbtpd-title">{{ ss.question||'' }}</view>
  139. <view class="xr_tb adfac">
  140. <view class="xt_pre p1"></view>
  141. <view class="xt_pre p2"></view>
  142. <view class="xt_pre p3"></view>
  143. <view class="xt_score adfac" :style="{'left':ss.left,'width':(((ss.maxScore>25?25:ss.maxScore)-(ss.minScore>25?25:ss.minScore))*4)+'%'}">
  144. <view class="xts_num adfacjc red">{{ ss.minScore>25?25:ss.minScore }}</view>
  145. <view class="xts_box"></view>
  146. <view class="xts_num adfacjc green">{{ ss.maxScore>25?25:ss.maxScore }}</view>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. <view class="v2-data" :style="{'border':'1px solid '+item.bcolor}">
  154. <view class="vd-title vt3" :class="{'black':(item.title=='人际关系'||item.title=='学习')}" :style="{'background-image':'url(https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+typeDict[item.title]+'_title_bg1.png)'}">评估结果</view>
  155. <view class="adfac">
  156. <view class="v2-p3" style="width: 76px;">纬度得分</view>
  157. <view class="vd-wd adfac" :style="{'background':item.wddf}">
  158. <view class="vdwd-pre">维度加权总分:<span>{{ item.weightedTotal||0 }}</span><span>/{{ item.weightedTotalFull||0 }}</span></view>
  159. <view class="vdwd-pre vp">维度同意度总分(未加权):<span>{{ item.consentTotal||0 }}</span><span>/{{ item.consentTotalFull||0 }}</span></view>
  160. <view class="vdwd-pre">维度权重:<span>{{ item.weight||0 }}</span><span>/{{ item.weightFull||0 }}</span></view>
  161. </view>
  162. </view>
  163. <view class="v2-p" style="margin-top: 8px;" v-html="(item.diagnosisOutput||'').replaceAll('\n\n','<br>')"></view>
  164. </view>
  165. <view class="v2-data" :style="{'border':'1px solid '+item.bcolor}" style="flex: 1;margin-top: 15px;">
  166. <view class="vd-title vt3" :class="{'black':(item.title=='人际关系'||item.title=='学习')}" :style="{'background-image':'url(https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/'+typeDict[item.title]+'_title_bg1.png)'}">评估建议</view>
  167. <view class="v2-p" v-html="(item.diagnosisSuggest||'').replaceAll('\n\n','<br>')"></view>
  168. </view>
  169. </view>
  170. </template>
  171. </view>
  172. <view class="pdf_btn" @click="createPdf">生成PDF</view>
  173. <view class="loading adffcacjc" v-if="isLoading">
  174. <u-loading-icon text="数据加载中,请耐心等待" :vertical="true" size="72" color="#FFFFFF" textSize="32" textColor="#FFFFFF"></u-loading-icon>
  175. </view>
  176. </view>
  177. </template>
  178. <script name="">
  179. import { BaseApi } from '@/http/baseApi.js';
  180. import * as echarts from '@/pagesHome/components/lime-echart/static/echarts.min.js'
  181. import lEchart from '@/pagesHome/components/lime-echart/components/l-echart/l-echart.vue'
  182. export default {
  183. name: 'ZtzdfxChart',
  184. components:{ lEchart },
  185. data() {
  186. return {
  187. isLoading: true,
  188. reportId:'',
  189. reportData: null,
  190. isChartReady: false,
  191. scale:1,
  192. originalContainerHeight: 0,
  193. containerScaledHeight: 'auto',
  194. typeDict: {
  195. '宗旨与动机': 'zzdj',
  196. '外部流程及系统与架构': 'wbjg',
  197. '人际关系': 'rjgx',
  198. '内部流程及系统与架构': 'nbjg',
  199. '学习': 'xx',
  200. '领导力': 'ldl'
  201. },
  202. sixWd: [
  203. {
  204. image: 'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/intro_img_p.png',
  205. type: 'P',
  206. title: '宗旨与动机',
  207. desc: '指团队共享的目的和存在的意义, 包含对共同的愿景,目标和优先级的清晰度。',
  208. color: '#761E6A'
  209. },
  210. {
  211. image: 'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/intro_img_e.png',
  212. type: 'E',
  213. title: '外部流程、系统与结构',
  214. desc: '指团队与其外部利益相关者 - 客户,供应商,股东,组织内的其他团队等的互动关联。',
  215. color: '#009191'
  216. },
  217. {
  218. image: 'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/intro_img_r.png',
  219. type: 'R',
  220. title: '人际关系',
  221. desc: '指团队成员如何共同工作–他们是否相互尊重对方的能力,足够心理安全以能够坦诚相对,真正关心彼此的幸福感。',
  222. color: '#FFD750'
  223. },
  224. {
  225. image: 'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/intro_img_i.png',
  226. type: 'I',
  227. title: '内部流程、系统与结构',
  228. desc: '指团队如何管理工作流程,互相支持和高质量的沟通和决策(包括工作任务和团队感情)。',
  229. color: '#4EB2B2'
  230. },
  231. {
  232. image: 'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/intro_img_l.png',
  233. type: 'L',
  234. title: '学习',
  235. desc: '指团队应对多变的环境和保持持续的进步和成长的能力。团队如何提高绩效(如何完成今天的任务)、能力(如何提高技能和资源以处理明天的任务)和容量(长期的愿景, 如何用更少的资源做更多的事情)',
  236. color: '#AFCDF5'
  237. },
  238. {
  239. image: 'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/versionTwo/intro_img_l2.png',
  240. type: 'L',
  241. title: '领导力',
  242. desc: '指团队认为需要怎样的领导行为能够让他们,作为个人或者团队做到最好。团队可以和他们的领导者讨论他们的责任,以帮助领导者成为他们需要的领导者。',
  243. color: '#002846'
  244. }
  245. ],
  246. pdfImages:[],
  247. };
  248. },
  249. onLoad(options) {
  250. this.reportId = options.reportId;
  251. this.getReportData();
  252. },
  253. mounted() {
  254. this.calculateScaleAndPosition();
  255. uni.onWindowResize(() => {
  256. this.calculateScaleAndPosition();
  257. });
  258. },
  259. methods: {
  260. getReportData(){
  261. this.$api.get(`/core/report/previewReport/${this.reportId}`).then(async ({data:res})=>{
  262. if(res.code!==0) return this.$showToast(res.msg)
  263. this.reportData = res.data;
  264. const tempDimensionAnalysis = [
  265. {title:'宗旨与动机',bcolor:'#E4D2E1',thcolor:'#761E6A',titlecolor:'#BA8EB4',wddf:'linear-gradient( 90deg, #F5EFF5 0%, #FAF2F9 100%)',
  266. desc:`「宗旨与动机」维度,我们旨在探究是否存在一个清晰的存在理由和明确的方向,能够激发团队成员的动力并吸引他们的想象力,以及个人与集体的身份认同是否围绕共同的目标,并达成一致。`},
  267. {title:'外部流程及系统与架构',bcolor:'#B3DEDE',thcolor:'#009191',titlecolor:'#80C8C8',wddf:'linear-gradient( 90deg, #E8F5F5 0%, #F0F8F8 100%)',
  268. desc:`「外部流程、系统与结构」维度,我们旨在探究团队如何与各种利益相关者互动,他们与团队的利益相关方各自如何寻求了解对方,以及现有系统和流程的有效性,以帮助管理不同的期望和需求。`},
  269. {title:'人际关系',bcolor:'#FFDF73',thcolor:'#FFD750',titlecolor:'#FFEBA8',wddf:'linear-gradient( 90deg, rgba(255,215,80,0.34) 0%, rgba(251,225,130,0.09) 100%)',
  270. desc:`「人际关系」维度,我们旨在探究团队成员如何相互交流、信任程度、尊重和关心的程度,以及团队成员之间的关系如何促进(或破坏)协作。`},
  271. {title:'内部流程及系统与架构',bcolor:'#B3DEDE',thcolor:'#4EB2B2',titlecolor:'#CDE9EA',wddf:'linear-gradient( 90deg, #E8F5F5 0%, #F0F8F8 100%)',
  272. desc:`「内部流程、系统与结构」维度,我们旨在探究团队如何在平衡责任与自主权方面进行协作。我们关注团队的敏捷程度、沟通方式以及决策过程的有效性。`},
  273. {title:'学习',bcolor:'#C7DCF8',thcolor:'#AFCDF5',titlecolor:'#D7E5FA',wddf:'linear-gradient( 270deg, #F2F5F9 0%, #E3ECF8 100%)',
  274. desc:`「学习」维度,我们旨在探究团队如何提高其绩效、技能和资源以应对当前和未来的任务。我们还希望了解团队如何管理能力和提高效率。`},
  275. {title:'领导力',bcolor:'#E6EAED',thcolor:'#002846',titlecolor:'#8093A3',wddf:'linear-gradient( 270deg, #F2F4F6 0%, #EDF0F2 100%)',
  276. desc:`「领导力」维度,我们旨在探究领导素质和行为如何对团队功能和其他因素产生调节影响,以及这是积极的还是消极的。`}
  277. ]
  278. this.reportData.dimensionAnalysis.forEach((d,i)=>{
  279. d.scoreSpreads.forEach(s=>{
  280. if((s.minScore+'').length>2) s.minScore = (s.minScore||0).toFixed(2)
  281. if((s.maxScore+'').length>2) s.maxScore = (s.maxScore||0).toFixed(2)
  282. if((s.avgScore+'').length>2) s.avgScore = (s.avgScore||0).toFixed(2)
  283. s.theme = s.theme.replaceAll(',','').replaceAll(',','');
  284. s.range = [s.minScore>25?25:s.minScore,s.maxScore>25?25:s.maxScore];
  285. if(s.minScore==0) s.left = '0%';
  286. else if(s.minScore>=25) s.left = 'calc(100% - 48px)';
  287. else s.left = s.minScore*4+'%';
  288. })
  289. this.reportData.dimensionAnalysis[i] = {...d,...tempDimensionAnalysis[i]}
  290. })
  291. // 【关键逻辑】在数据渲染后,开始预加载图片
  292. await this.$nextTick(); // 确保DOM更新完毕
  293. try {
  294. const imageUrls = this.collectImageUrls();
  295. const results = await this.preloadAllImages(imageUrls);
  296. // (可选) 检查加载结果并上报或提示
  297. const failedImages = results
  298. .filter(result => result.status === 'rejected')
  299. .map(result => result.reason.url); // 获取加载失败的图片URL
  300. if (failedImages.length > 0) {
  301. console.error(`加载失败的图片 (重试3次后):`, failedImages);
  302. this.$showToast('部分图片资源加载失败');
  303. } else {
  304. console.log('所有依赖的图片已加载完成!');
  305. }
  306. } catch (error) {
  307. // Promise.allSettled 本身不应该抛出错误,这里作为保险
  308. console.error('预加载过程中发生意外错误:', error);
  309. } finally {
  310. // 无论成功或失败,最后都隐藏loading
  311. this.isLoading = false;
  312. }
  313. }).catch(err => {
  314. // 网络请求失败等情况
  315. console.error('获取报告数据失败:', err);
  316. this.isLoading = false;
  317. this.$showToast('获取报告数据失败,请检查网络');
  318. });
  319. },
  320. /**
  321. * @description 新增:收集页面上所有需要预加载的图片URL
  322. * @returns {Array<string>} 包含所有图片URL的数组
  323. */
  324. collectImageUrls() {
  325. // 使用 Set 来自动去重
  326. const imageUrls = new Set();
  327. const baseUrl = 'https://oss.familydaf.cn/sxsnfile/';
  328. // 1. 静态图片 (封面、介绍等)
  329. imageUrls.add(baseUrl + '20251230/b70c19716d86452aaa0c9808a2851e8b.png');
  330. console.log(`[Preload] 收集到 ${imageUrls.size} 个待加载的图片URL`);
  331. return Array.from(imageUrls); // 将 Set 转换为数组
  332. },
  333. /**
  334. * @description 【新增】带重试逻辑的单个图片加载器
  335. * @param {string} url 图片URL
  336. * @param {number} maxRetries 最大重试次数
  337. * @returns {Promise} 成功时 resolve, 彻底失败时 reject
  338. */
  339. loadImageWithRetry(url, maxRetries = 5) {
  340. return new Promise((resolve, reject) => {
  341. let attempts = 0;
  342. const tryLoad = () => {
  343. attempts++;
  344. uni.getImageInfo({
  345. src: url,
  346. success: (res) => {
  347. // console.log(`图片加载成功: ${url} (尝试次数: ${attempts})`);
  348. resolve(res);
  349. },
  350. fail: (err) => {
  351. console.warn(`图片加载失败: ${url} (尝试次数: ${attempts}/${maxRetries})`);
  352. if (attempts < maxRetries) {
  353. // 稍作延迟后重试,避免立即请求导致服务器压力
  354. setTimeout(tryLoad, 300);
  355. } else {
  356. // 达到最大重试次数,彻底失败
  357. console.error(`图片彻底加载失败: ${url}`);
  358. reject({ url, error: err }); // reject时返回包含url的对象,方便追踪
  359. }
  360. }
  361. });
  362. };
  363. tryLoad();
  364. });
  365. },
  366. /**
  367. * @description 【优化】预加载所有图片,并处理重试逻辑
  368. * @param {Array<string>} urls 图片URL数组
  369. * @returns {Promise<Array<Object>>} 返回 Promise.allSettled 的结果数组
  370. */
  371. preloadAllImages(urls) {
  372. const promises = urls.map(url => this.loadImageWithRetry(url, 5));
  373. // 使用 Promise.allSettled
  374. // 它会等待所有 Promise 完成(无论是 resolve还是reject)
  375. // 这样即使有图片加载失败,也不会中断整个过程
  376. return Promise.allSettled(promises);
  377. },
  378. async createPdf(){
  379. uni.showLoading({
  380. title:'正在生成PDF所需的图片...'
  381. })
  382. try {
  383. const ztzdfxImgPromise = this.downloadZtzdfxImg();
  384. const dimensionImagePromises = this.reportData.dimensionAnalysis.map(d => {
  385. return this.generateTableImage(d,d.scoreSpreads);
  386. });
  387. const allImageUrls = await Promise.all([
  388. ztzdfxImgPromise,
  389. ...dimensionImagePromises
  390. ]);
  391. this.pdfImages = allImageUrls;
  392. this.$api.post('/core/report/reportToPdf',{
  393. images:this.pdfImages,
  394. reportId:this.reportId
  395. }).then(({data:res})=>{
  396. if(res.code!==0) return this.$showToast(res.msg)
  397. uni.hideLoading();
  398. this.$showToast('生成成功');
  399. setTimeout(()=>{
  400. uni.redirectTo({
  401. url:'/pagesHome/report'
  402. })
  403. },1500)
  404. })
  405. } catch (error) {
  406. uni.hideLoading();
  407. console.error('生成图片过程中发生错误:', error);
  408. uni.showToast({ title: '生成图片失败,请重试', icon: 'none' });
  409. }
  410. },
  411. /**
  412. * @description 使用 Canvas 绘制表格并生成图片
  413. * @param {Object} dimensionData 维度数据
  414. * @param {Array} tableData 表格数据
  415. * @returns {Promise<string>} 返回生成的图片临时文件路径
  416. */
  417. generateTableImage(dimensionData, tableData) {
  418. return new Promise((resolve, reject) => {
  419. const query = uni.createSelectorQuery().in(this);
  420. query.select('#table-canvas')
  421. .fields({ node: true, size: true })
  422. .exec(async (res) => {
  423. if (!res || !res[0] || !res[0].node) {
  424. return reject('获取Canvas节点失败');
  425. }
  426. const canvasNode = res[0].node;
  427. const ctx = canvasNode.getContext('2d');
  428. const dpr = uni.getSystemInfoSync().pixelRatio;
  429. // --- 1. 定义布局和尺寸常量
  430. const TABLE_WIDTH = 548;
  431. const HEADER_HEIGHT = 38;
  432. const ROW_HEIGHT = 49;
  433. const FONT_FAMILY = 'sans-serif';
  434. const COL_WIDTHS = { theme: 72, min: 49, avg: 49, max: 49, statement: 329 };
  435. const COL_POSITIONS = {
  436. theme: 0,
  437. min: COL_WIDTHS.theme,
  438. avg: COL_WIDTHS.theme + COL_WIDTHS.min,
  439. max: COL_WIDTHS.theme + COL_WIDTHS.min + COL_WIDTHS.avg,
  440. statement: COL_WIDTHS.theme + COL_WIDTHS.min * 3
  441. };
  442. const CANVAS_HEIGHT = HEADER_HEIGHT + tableData.length * ROW_HEIGHT;
  443. const CANVAS_WIDTH = TABLE_WIDTH;
  444. canvasNode.width = CANVAS_WIDTH * dpr;
  445. canvasNode.height = CANVAS_HEIGHT * dpr;
  446. ctx.scale(dpr, dpr);
  447. ctx.fillStyle = '#FFFFFF';
  448. ctx.fillRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);
  449. ctx.strokeStyle = dimensionData.bcolor;
  450. ctx.lineWidth = 1;
  451. ctx.strokeRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);
  452. // --- 4. 绘制表头 ---
  453. const isBlackHeader = (dimensionData.title == '人际关系'||dimensionData.title == '学习');
  454. ctx.fillStyle = dimensionData.thcolor;
  455. ctx.fillRect(1, 1, CANVAS_WIDTH - 2, HEADER_HEIGHT - 1);
  456. ctx.fillStyle = isBlackHeader ? '#002846' : '#FFFFFF';
  457. ctx.font = `bold 10px ${FONT_FAMILY}`;
  458. ctx.textAlign = 'center';
  459. ctx.textBaseline = 'middle';
  460. ctx.fillText('主题', COL_POSITIONS.theme + COL_WIDTHS.theme / 2, HEADER_HEIGHT / 2);
  461. ctx.fillText('最低分', COL_POSITIONS.min + COL_WIDTHS.min / 2, HEADER_HEIGHT / 2);
  462. ctx.fillText('平均分', COL_POSITIONS.avg + COL_WIDTHS.avg / 2, HEADER_HEIGHT / 2);
  463. ctx.fillText('最高分', COL_POSITIONS.max + COL_WIDTHS.max / 2, HEADER_HEIGHT / 2);
  464. ctx.fillText('问卷陈述', COL_POSITIONS.statement + COL_WIDTHS.statement / 2, HEADER_HEIGHT / 2);
  465. // --- 5. 循环绘制每一行---
  466. tableData.forEach((row, index) => {
  467. const y = HEADER_HEIGHT + index * ROW_HEIGHT;
  468. const isBlackLeftTitle = (dimensionData.title == '人际关系' || dimensionData.title == '学习' || dimensionData.title == '内部流程及系统与架构');
  469. ctx.fillStyle = dimensionData.titlecolor;
  470. ctx.fillRect(1, y, COL_WIDTHS.theme - 1, ROW_HEIGHT);
  471. // 绘制主题文字
  472. ctx.textAlign = 'center';
  473. ctx.textBaseline = 'middle';
  474. ctx.fillStyle = isBlackLeftTitle ? '#002846' : '#FFFFFF';
  475. ctx.font = `10px ${FONT_FAMILY}`;
  476. this.drawWrappedText(ctx, row.theme, COL_POSITIONS.theme + COL_WIDTHS.theme / 2, y + ROW_HEIGHT / 2, 12, COL_WIDTHS.theme - 32);
  477. // 绘制主题单元格的白色下边框
  478. ctx.strokeStyle = '#FFFFFF';
  479. ctx.lineWidth = 1;
  480. ctx.beginPath();
  481. ctx.moveTo(1, y + ROW_HEIGHT - 1);
  482. ctx.lineTo(COL_WIDTHS.theme - 1, y + ROW_HEIGHT - 1);
  483. ctx.stroke();
  484. // 绘制其他单元格的下边框
  485. ctx.strokeStyle = dimensionData.bcolor;
  486. ['min', 'avg', 'max', 'statement'].forEach(key => {
  487. ctx.beginPath();
  488. ctx.moveTo(COL_POSITIONS[key], y + ROW_HEIGHT);
  489. ctx.lineTo(COL_POSITIONS[key] + COL_WIDTHS[key], y + ROW_HEIGHT);
  490. ctx.stroke();
  491. });
  492. const minScore = ((row.minScore||0)+'').length>2?Number(row.minScore||0).toFixed(2):row.minScore;
  493. const avgScore = ((row.avgScore||0)+'').length>2?Number(row.avgScore||0).toFixed(2):row.avgScore;
  494. const maxScore = ((row.maxScore||0)+'').length>2?Number(row.maxScore||0).toFixed(2):row.maxScore;
  495. ctx.font = `bold 14px ${FONT_FAMILY}`;
  496. ctx.fillStyle = '#667E90';
  497. ctx.fillText(minScore, COL_POSITIONS.min + COL_WIDTHS.min / 2, y + ROW_HEIGHT / 2);
  498. ctx.fillStyle = '#27AE60';
  499. ctx.fillText(avgScore, COL_POSITIONS.avg + COL_WIDTHS.avg / 2, y + ROW_HEIGHT / 2);
  500. ctx.fillStyle = '#667E90';
  501. ctx.fillText(maxScore, COL_POSITIONS.max + COL_WIDTHS.max / 2, y + ROW_HEIGHT / 2);
  502. // 5.3 绘制问卷陈述列
  503. const statementX = COL_POSITIONS.statement;
  504. const statementPadding = 10;
  505. ctx.textAlign = 'left';
  506. ctx.textBaseline = 'top';
  507. ctx.fillStyle = '#193D59';
  508. ctx.font = `9px ${FONT_FAMILY}`;
  509. this.drawWrappedText(ctx, row.question, statementX + statementPadding, y + 8, 10, COL_WIDTHS.statement - statementPadding * 2);
  510. // 绘制范围指示器
  511. const rangeBarY = y + 33;
  512. const rangeBarWidth = COL_WIDTHS.statement - statementPadding * 2;
  513. const rangeBarHeight = 4;
  514. const rangeBarX = statementX + statementPadding;
  515. // 绘制三段色背景
  516. const segWidth = rangeBarWidth / 3;
  517. ctx.fillStyle = '#BA8EB4';
  518. ctx.fillRect(rangeBarX, rangeBarY, segWidth, rangeBarHeight);
  519. ctx.fillStyle = '#66BDBD';
  520. ctx.fillRect(rangeBarX + segWidth, rangeBarY, segWidth, rangeBarHeight);
  521. ctx.fillStyle = '#AFCDF5';
  522. ctx.fillRect(rangeBarX + segWidth * 2, rangeBarY, segWidth, rangeBarHeight);
  523. // --- 开始绘制滑块 ---
  524. const scaleFactor = rangeBarWidth / 25;
  525. const minVal = row.range[0];
  526. const maxVal = row.range[1];
  527. const rangeLeft = minVal * scaleFactor;
  528. const rangeWidth = (maxVal - minVal) * scaleFactor;
  529. // 绘制中间的连接条
  530. const connectorY = rangeBarY - (8 - rangeBarHeight) / 2;
  531. const connectorHeight = 8;
  532. ctx.fillStyle = '#199C9C';
  533. ctx.fillRect(rangeBarX + rangeLeft, connectorY, rangeWidth, connectorHeight);
  534. // 绘制左右数字框
  535. const numBoxPadding = { h: 7, v: 4 };
  536. const numBoxFont = `bold 12px ${FONT_FAMILY}`;
  537. // 封装一个绘制数字框的函数
  538. const drawNumberBox = (text, side) => {
  539. ctx.font = numBoxFont;
  540. const metrics = ctx.measureText(text);
  541. const boxWidth = metrics.width + numBoxPadding.h * 2;
  542. const boxHeight = 12 + numBoxPadding.v * 2;
  543. const value = parseFloat(text);
  544. const centerPointX = rangeBarX + value * scaleFactor;
  545. let x;
  546. // 核心逻辑:判断两值是否相等
  547. if (minVal === maxVal) {
  548. // 如果相等,左右滑块并排显示,整体居中
  549. if (side === 'left') {
  550. x = centerPointX - boxWidth;
  551. } else { // 'right'
  552. x = centerPointX;
  553. }
  554. // --- 边界检查(针对组合滑块)---
  555. let combinedLeftX = centerPointX - boxWidth;
  556. if (combinedLeftX < rangeBarX) {
  557. const shift = rangeBarX - combinedLeftX;
  558. x += shift; // 将两个滑块一起向右移动
  559. }
  560. let combinedRightX = centerPointX + boxWidth;
  561. if (combinedRightX > rangeBarX + rangeBarWidth) {
  562. const shift = combinedRightX - (rangeBarX + rangeBarWidth);
  563. x -= shift; // 将两个滑块一起向左移动
  564. }
  565. } else {
  566. // 如果不相等,各自居中显示
  567. x = centerPointX - boxWidth / 2;
  568. // --- 边界检查(针对单个滑块)---
  569. if (x < rangeBarX) {
  570. x = rangeBarX;
  571. }
  572. if (x + boxWidth > rangeBarX + rangeBarWidth) {
  573. x = rangeBarX + rangeBarWidth - boxWidth;
  574. }
  575. }
  576. const boxY = connectorY + (connectorHeight - boxHeight) / 2;
  577. // 绘制阴影
  578. ctx.shadowColor = 'rgba(118, 30, 106, 0.08)';
  579. ctx.shadowBlur = 10;
  580. ctx.shadowOffsetY = 4;
  581. // 绘制圆角矩形背景
  582. ctx.fillStyle = '#FFFFFF';
  583. ctx.beginPath();
  584. ctx.moveTo(x + 4, boxY);
  585. ctx.arcTo(x + boxWidth, boxY, x + boxWidth, boxY + boxHeight, 4);
  586. ctx.arcTo(x + boxWidth, boxY + boxHeight, x, boxY + boxHeight, 4);
  587. ctx.arcTo(x, boxY + boxHeight, x, boxY, 4);
  588. ctx.arcTo(x, boxY, x + boxWidth, boxY, 4);
  589. ctx.closePath();
  590. ctx.fill();
  591. // 重置阴影
  592. ctx.shadowColor = 'transparent';
  593. ctx.shadowBlur = 0;
  594. ctx.shadowOffsetY = 0;
  595. // 绘制边框
  596. ctx.strokeStyle = 'rgba(131, 52, 120, 0.19)';
  597. ctx.lineWidth = 1;
  598. ctx.stroke();
  599. // 绘制文字
  600. ctx.fillStyle = side === 'left' ? '#904A87' : '#199C9C';
  601. ctx.textAlign = 'center';
  602. ctx.textBaseline = 'middle';
  603. ctx.fillText(text, x + boxWidth / 2, boxY + boxHeight / 2);
  604. };
  605. drawNumberBox(minVal.toString(), 'left');
  606. drawNumberBox(maxVal.toString(), 'right');
  607. });
  608. // --- 6. 生成图片文件 ---
  609. uni.canvasToTempFilePath({
  610. canvas: canvasNode,
  611. success: async (result) => {
  612. const fileurl = await this.uploadFilePromise(result.tempFilePath);
  613. resolve(fileurl);
  614. },
  615. fail: (err) => {
  616. console.error('图片生成失败', err);
  617. uni.showToast({ title: '图片生成失败', icon: 'none' });
  618. reject(err);
  619. }
  620. }, this);
  621. });
  622. });
  623. },
  624. /**
  625. * @description 辅助函数:在Canvas中绘制可自动换行的文本
  626. * @param {CanvasRenderingContext2D} ctx
  627. * @param {string} text 要绘制的文本
  628. * @param {number} x 起始x坐标
  629. * @param {number} y 起始y坐标(对于居中对齐,这是中心y;对于top对齐,这是第一行的y)
  630. * @param {number} lineHeight 行高
  631. * @param {number} maxWidth 最大宽度
  632. */
  633. drawWrappedText(ctx, text, x, y, lineHeight, maxWidth) {
  634. let words = text.split('');
  635. let line = '';
  636. let lines = [];
  637. for (let n = 0; n < words.length; n++) {
  638. let testLine = line + words[n];
  639. let metrics = ctx.measureText(testLine);
  640. if (metrics.width > maxWidth && n > 0) {
  641. lines.push(line);
  642. line = words[n];
  643. } else {
  644. line = testLine;
  645. }
  646. }
  647. lines.push(line);
  648. let startY;
  649. if (ctx.textBaseline === 'middle') {
  650. startY = y - (lineHeight * (lines.length - 1)) / 2;
  651. } else { // top
  652. startY = y;
  653. }
  654. for (let i = 0; i < lines.length; i++) {
  655. ctx.fillText(lines[i], x, startY + (i * lineHeight));
  656. }
  657. },
  658. calculateScaleAndPosition() {
  659. uni.getSystemInfo({
  660. success: (res) => {
  661. const screenWidth = res.windowWidth; // 手机屏幕的宽度
  662. const pcContentWidth = 630; // PC端内容的原始宽度
  663. this.scale = screenWidth / pcContentWidth;
  664. this.$nextTick(() => {
  665. if (this.$refs.ztzdfxRef) {
  666. this.initZtzdfxChart();
  667. }
  668. });
  669. }
  670. });
  671. },
  672. calculatePdfContainerHeight() {
  673. uni.createSelectorQuery().in(this).select('#pdfContainer').boundingClientRect(rect => {
  674. if (rect) {
  675. this.originalContainerHeight = rect.height;
  676. this.containerScaledHeight = this.originalContainerHeight * this.scale;
  677. // console.log('原始高度:', this.originalContainerHeight, '缩放比例:', this.scale, '缩放后高度:', this.containerScaledHeight);
  678. }
  679. }).exec();
  680. },
  681. downloadZtzdfxImg(){
  682. return new Promise(resolve=>{
  683. if (!this.isChartReady) return console.log('图表尚未准备好');
  684. const chartRef = this.$refs.ztzdfxRef;
  685. if (!chartRef) return console.log('无法找到图表组件');
  686. chartRef.canvasToTempFilePath({
  687. success: async (res) => {
  688. const imgUrl = await this.uploadFilePromise(res.tempFilePath);
  689. console.log(imgUrl,'imgUrl');
  690. resolve(imgUrl)
  691. },
  692. fail: (err) => {
  693. console.log('生成图片失败:', err);
  694. }
  695. });
  696. })
  697. },
  698. uploadFilePromise(url) {
  699. return new Promise((resolve, reject) => {
  700. let a = uni.uploadFile({
  701. url: BaseApi+'/uploadFile',
  702. filePath: url,
  703. name: 'file',
  704. success: (res) => {
  705. setTimeout(() => {
  706. let data = JSON.parse(res.data)
  707. if(data&&data.code===0){
  708. resolve(data.data);
  709. }else this.$showToast(data?.msg)
  710. }, 1000);
  711. },
  712. fail: err =>{
  713. resolve('');
  714. }
  715. });
  716. });
  717. },
  718. async initZtzdfxChart() {
  719. let dataSum = this.reportData.overall.length*this.reportData.overall[0].themeTotalSpreads.length;
  720. const leaderData = [],memberData = [],stakeholderData=[],sponsorData=[];
  721. const overall = this.reportData.overall||[];
  722. overall.forEach(o=>{
  723. let themeTotalSpreads = o.themeTotalSpreads||[];
  724. if(['内部流程、系统与结构','学习','领导力'].includes(o.dimension)) themeTotalSpreads = o.themeTotalSpreads.reverse()||[];
  725. themeTotalSpreads.forEach(t=>{
  726. leaderData.push(t.scoreLeader||0);
  727. memberData.push(t.scoreMember||0);
  728. stakeholderData.push(t.scoreStakeholder||0);
  729. sponsorData.push(t.scoreSponsor||0);
  730. })
  731. })
  732. const sumArr = leaderData.concat(memberData).concat(stakeholderData).concat(sponsorData);
  733. const maxValue = sumArr.reduce((a,b)=>Math.max(a,b));
  734. const minValue = sumArr.reduce((a,b)=>Math.min(a,b));
  735. const chart = await this.$refs.ztzdfxRef.init(echarts);
  736. let option = {
  737. graphic: [
  738. {
  739. type: 'image',
  740. id: 'radar-bg',
  741. z: -1,
  742. bounding: 'raw',
  743. left: 'center',
  744. top: 'center',
  745. style: {
  746. image:'https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/six_chart_bg.png',
  747. width: 360*this.scale-20,
  748. height: 360*this.scale-20,
  749. opacity: 1
  750. }
  751. },
  752. {
  753. type: 'circle',
  754. z: 100, // 设置一个较高的 z 值,确保它在最顶层
  755. left: 'center', // 水平居中
  756. top: 'center', // 垂直居中
  757. shape: {
  758. r: 12*this.scale // 圆形的半径,您可以根据需要调整大小
  759. },
  760. style: {
  761. fill: '#FFFFFF', // 填充色为白色
  762. shadowBlur: 20*this.scale, // 阴影的模糊范围
  763. shadowColor: 'rgba(0, 0, 0, 0.15)', // 阴影颜色
  764. shadowOffsetY: 4*this.scale // 向下的阴影偏移,产生悬浮效果
  765. }
  766. }
  767. ],
  768. radar: {
  769. // shape: 'circle',
  770. indicator: new Array(dataSum).fill({ max:maxValue, min:minValue }),
  771. axisName: {
  772. show: false
  773. },
  774. splitArea:{
  775. show:false
  776. },
  777. splitLine: {
  778. show: false
  779. },
  780. axisLine: {
  781. show: false
  782. },
  783. startAngle: 95
  784. },
  785. series: [
  786. {
  787. type: 'radar',
  788. data: [
  789. {
  790. value: sponsorData,
  791. itemStyle: {
  792. color: '#012846'
  793. },
  794. lineStyle: {
  795. color: '#012846',
  796. width:1.5
  797. },
  798. areaStyle: {
  799. color: 'rgba(255, 255, 255, 0.4)'
  800. },
  801. symbolSize: 3
  802. },
  803. {
  804. value: stakeholderData,
  805. itemStyle: {
  806. color: '#FFD650'
  807. },
  808. lineStyle: {
  809. color: '#FFD650',
  810. width:1.5
  811. },
  812. areaStyle: {
  813. color: 'rgba(255, 255, 255, 0.4)'
  814. },
  815. symbolSize: 3
  816. },
  817. {
  818. value: memberData,
  819. itemStyle: {
  820. color: '#AFCDF5'
  821. },
  822. lineStyle: {
  823. color: '#AFCDF5',
  824. width:1.5
  825. },
  826. areaStyle: {
  827. color: 'rgba(255, 255, 255, 0.4)'
  828. },
  829. symbolSize: 3
  830. },
  831. {
  832. value: leaderData,
  833. itemStyle: {
  834. color: '#9F6196'
  835. },
  836. lineStyle: {
  837. color: '#9F6196',
  838. width:1.5
  839. },
  840. areaStyle: {
  841. color: 'rgba(255, 255, 255, 0.4)'
  842. },
  843. symbolSize: 3
  844. }
  845. ]
  846. }
  847. ]
  848. };
  849. chart.setOption(option);
  850. this.isChartReady = true;
  851. this.$nextTick(() => {
  852. this.calculatePdfContainerHeight();
  853. });
  854. },
  855. }
  856. };
  857. </script>
  858. <style scoped lang="scss">
  859. .loading{
  860. position: fixed;
  861. left: 0;
  862. right: 0;
  863. top: 0;
  864. bottom: 0;
  865. background: rgba(0,0,0,.4);
  866. z-index: 1001;
  867. }
  868. .page-wrappe{
  869. width: 100%;
  870. background: #FFFFFF;
  871. overflow-x: hidden;
  872. overflow-y: auto;
  873. .pdf-container{
  874. width: 630px;
  875. padding: 0 20rpx;
  876. box-sizing: border-box;
  877. transform-origin: top left;
  878. }
  879. }
  880. .offscreen-canvas {
  881. position: fixed;
  882. top: -9999px;
  883. left: -9999px;
  884. }
  885. .pdf_btn{
  886. padding: 15rpx 20rpx;
  887. border-radius: 20rpx;
  888. font-size: 28rpx;
  889. color: #FFFFFF;
  890. background: #189B9B;
  891. position: fixed;
  892. right: 30rpx;
  893. bottom: 100rpx;
  894. z-index: 1000;
  895. }
  896. @import '../static/pdf.scss';
  897. </style>