190a1bbf by lihua

导入文件数据显示格式化后的值

1 parent b6f64175
...@@ -424,7 +424,7 @@ const formatterPreviewDate = (row, info) => { ...@@ -424,7 +424,7 @@ const formatterPreviewDate = (row, info) => {
424 424
425 /** 解析的总的表格数据,方便后面修改抽样比例时使用 */ 425 /** 解析的总的表格数据,方便后面修改抽样比例时使用 */
426 const parseFileDataSum: any = ref([]); 426 const parseFileDataSum: any = ref([]);
427 427 const currentSheet: any = ref();
428 const parseFileData = (fileRaw) => { 428 const parseFileData = (fileRaw) => {
429 sampleTableDataLoading.value = true; 429 sampleTableDataLoading.value = true;
430 fileRaw.arrayBuffer().then(async (f) => { 430 fileRaw.arrayBuffer().then(async (f) => {
...@@ -432,6 +432,7 @@ const parseFileData = (fileRaw) => { ...@@ -432,6 +432,7 @@ const parseFileData = (fileRaw) => {
432 raw: false, cellDates: true 432 raw: false, cellDates: true
433 }); 433 });
434 const sheet = wb.Sheets[wb.SheetNames[0]]; 434 const sheet = wb.Sheets[wb.SheetNames[0]];
435 currentSheet.value = sheet;
435 const json: any[] = XLSX.utils.sheet_to_json(sheet, { header: 1 }); 436 const json: any[] = XLSX.utils.sheet_to_json(sheet, { header: 1 });
436 if (json.length == 0) { 437 if (json.length == 0) {
437 sampleTableFields.value = []; 438 sampleTableFields.value = [];
...@@ -493,7 +494,10 @@ const transferSampleData = () => { ...@@ -493,7 +494,10 @@ const transferSampleData = () => {
493 let object = {}; 494 let object = {};
494 parseFileDataSum.value[0].forEach((chName, col) => { 495 parseFileDataSum.value[0].forEach((chName, col) => {
495 let name = sampleTableFields.value[col].enName; 496 let name = sampleTableFields.value[col].enName;
496 object[name] = info[col]; 497 var cellRef = XLSX.utils.encode_cell({ r: row + 1, c: col });
498 var cell = currentSheet.value[cellRef];
499 let v = cell.w || info[col];
500 object[name] = v;
497 }); 501 });
498 return object; 502 return object;
499 }); 503 });
...@@ -1122,7 +1126,7 @@ onUnmounted(() => { ...@@ -1122,7 +1126,7 @@ onUnmounted(() => {
1122 <div class="value-desc"><span style="font-weight: 600;margin-right: 8px;">环境重标识攻击概率</span>{{ 1126 <div class="value-desc"><span style="font-weight: 600;margin-right: 8px;">环境重标识攻击概率</span>{{
1123 'pr(context)=' + 1127 'pr(context)=' +
1124 changeNum(analysisResultInfo.envReAttackPr || 0, 2) 1128 changeNum(analysisResultInfo.envReAttackPr || 0, 2)
1125 }} 1129 }}
1126 </div> 1130 </div>
1127 <div class="value-desc"><span style="font-weight: 600;margin-right: 8px;">重标识总体风险</span>{{ 1131 <div class="value-desc"><span style="font-weight: 600;margin-right: 8px;">重标识总体风险</span>{{
1128 'R=Rc*pr(context)=' + 1132 'R=Rc*pr(context)=' +
...@@ -1289,7 +1293,7 @@ onUnmounted(() => { ...@@ -1289,7 +1293,7 @@ onUnmounted(() => {
1289 .table-v2-main { 1293 .table-v2-main {
1290 width: 100%; 1294 width: 100%;
1291 height: 240px; 1295 height: 240px;
1292 1296 margin-top: 2px;
1293 1297
1294 .main-placeholder { 1298 .main-placeholder {
1295 height: 100%; 1299 height: 100%;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!