| | |
| | | <textarea v-model="message" placeholder="请输入公司名称(必填)"></textarea> |
| | | <button onclick="document.getElementById('file').click()">请上传尽调报告</button> |
| | | <input type="file" id="file" accept=".doc,.docx" @change="getFiles($event)" style="display: none" /> |
| | | <p class="file-tit">已选择文件: <span v-if="selectedFile"> {{ selectedFile.name }}</span> <span v-else>暂无</span> </p> |
| | | <p class="file-tit">已选择文件: <span v-if="selectedFile"> {{ selectedFile.name }}</span> <span v-else>暂无</span> |
| | | </p> |
| | | <button @click="generateChart" :disabled="disableButton" |
| | | :class="{ 'disabled-button': disableButton }">一键生成</button> |
| | | <!-- <button style="margin-top: 20px;" @click="GetSaveExcel">下载excel</button> --> |
| | | </div> |
| | | <div class="echarts-box"> |
| | | <div class="radar-box" v-show="!loadingSub"> |
| | | <Tabs v-model='tab'> |
| | | <TabPane label="评分图表" name="tab1"></TabPane> |
| | | <TabPane label="评分详情" name="tab2"></TabPane> |
| | | </Tabs> |
| | | <div class="radar-box" v-show="!loadingSub && tab == 'tab1'"> |
| | | <div class="ent-structure" ref="ent-structure"> |
| | | <div class="ent-radar" ref="ent-radar"></div> |
| | | </div> |
| | | <h1>整体评分(满分100分):{{ totalScore }}分</h1> |
| | | </div> |
| | | |
| | | <div size="large" class="loading-box" v-if="loadingSub"> |
| | |
| | | <Spin style="margin-top: 6px;margin-left: 20px" /> |
| | | <Spin style="margin-left: 20px" size="large" /> |
| | | </div> |
| | | <div class="xlsx-box" v-if="hasScores"> |
| | | <div class="xlsx-box" v-if="tab == 'tab2'"> |
| | | <table border="1" style="border-collapse: collapse; width: 100%;"> |
| | | <thead> |
| | | <thead class="sticky-header"> |
| | | <tr> |
| | | <th v-for="(header, index) in headers" :key="index" :style="{ width: headerWidths[index] ,textAlign: 'center'}">{{ header }}</th> |
| | | <th v-for="(header, index) in headers" :key="index" |
| | | :style="{ width: headerWidths[index], textAlign: 'center' }">{{ header }}</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | |
| | | data() { |
| | | return { |
| | | loadingSub: false, |
| | | tab: 'tab1', |
| | | // disableButton: false, |
| | | message: '', |
| | | hasRadarData: false, |
| | |
| | | childLength: [], |
| | | selectedFile: null, |
| | | fileUrl: '', |
| | | excelData:'', |
| | | excelData: '', |
| | | scores: {}, // 存储接口返回的得分数据 |
| | | categoryScores: {}, // 存储大类评分 |
| | | totalScore: 0, // 总分 |
| | |
| | | // 去除前后的中文引号 |
| | | // console.log('json2222:',json); |
| | | let outputValue = json.output.replace(/[\n]/g, "").replace(/ /g, ''); // 获取 "output" 的值 |
| | | console.log('outputValue2222:',outputValue); |
| | | this.excelData=outputValue |
| | | console.log('outputValue2222:', outputValue); |
| | | this.excelData = outputValue |
| | | // 解析字符串 |
| | | const parsedData = outputValue.split(',').map(item => { |
| | | const [key, value] = item.split(':'); // 使用中文冒号分割 |
| | |
| | | acc[item.评分细则] = item.得分; |
| | | return acc; |
| | | }, {}); |
| | | this.radarData=[total1,total2,total3,total4,total5] |
| | | this.radarData = [total1, total2, total3, total4, total5] |
| | | this.renderRadar(this.radarData); // 重新渲染树图 |
| | | this.totalScore=total/5; |
| | | this.loadingSub = false; |
| | | this.hasRadarData = true; |
| | | this.hasScores = true; |
| | | // 计算大类评分和总分 |
| | | this.calculateCategoryScores(); |
| | | this.calculateTotalScore(); |
| | | // this.calculateCategoryScores(); |
| | | // this.calculateTotalScore(); |
| | | }).catch(error => { |
| | | console.error('获取得分数据失败:', error); |
| | | }); |
| | |
| | | } |
| | | }, |
| | | //下载excel |
| | | GetSaveExcel(){ |
| | | GetSaveExcel() { |
| | | axios.request({ |
| | | url: 'SubsidyData/GetSaveExcel', |
| | | method: 'post', |
| | | data: this.excelData |
| | | }).then(res => { |
| | | console.log(res); |
| | | }) |
| | | url: 'SubsidyData/GetSaveExcel', |
| | | method: 'post', |
| | | data: this.excelData |
| | | }).then(res => { |
| | | console.log(res); |
| | | }) |
| | | }, |
| | | |
| | | // 绘制企业结构的echarts |
| | |
| | | } |
| | | |
| | | .echarts-box { |
| | | flex: 1; |
| | | background: #fff; |
| | | flex: 1; |
| | | background: #fff; |
| | | } |
| | | |
| | | .xlsx-box { |
| | | .sticky-header { |
| | | position: sticky; |
| | | /* 粘性定位 */ |
| | | top: -1px; |
| | | /* 固定在顶部 */ |
| | | background-color: white; |
| | | /* 背景色,确保表头在滚动时可见 */ |
| | | z-index: 1000; |
| | | /* 确保表头在最上层 */ |
| | | } |
| | | |
| | | // background-color: #f4f4f4; |
| | | table { |
| | |
| | | width: 400px; |
| | | padding: 50px; |
| | | |
| | | |
| | | .tit { |
| | | font-size: 30px; |
| | | margin-bottom: 20px; |
| | |
| | | } |
| | | |
| | | .loading-box { |
| | | width: calc(100vw - 500px); |
| | | width: calc(100vw - 400px); |
| | | height: 100%; |
| | | position: absolute; |
| | | left: 500px; |
| | | left: 400px; |
| | | line-height: 20%; |
| | | display: flex; |
| | | padding-left: calc(50% - 250px); |
| | | padding-left: calc(50% - 300px); |
| | | padding-top: 50vh; |
| | | background: white; |
| | | color: #2d8cf0; |
| | |
| | | height: 500px; |
| | | flex: 1; |
| | | min-width: 800px; |
| | | margin-top: 10%; |
| | | h1{ |
| | | text-align: center; |
| | | } |
| | | } |
| | | |
| | | .ent-structure { |
| | | min-width: 800px; |
| | | width: 100%; |
| | | height: 100%; |
| | | background: #fff; |