190a1bbf by lihua

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

1 parent b6f64175
......@@ -424,7 +424,7 @@ const formatterPreviewDate = (row, info) => {
/** 解析的总的表格数据,方便后面修改抽样比例时使用 */
const parseFileDataSum: any = ref([]);
const currentSheet: any = ref();
const parseFileData = (fileRaw) => {
sampleTableDataLoading.value = true;
fileRaw.arrayBuffer().then(async (f) => {
......@@ -432,6 +432,7 @@ const parseFileData = (fileRaw) => {
raw: false, cellDates: true
});
const sheet = wb.Sheets[wb.SheetNames[0]];
currentSheet.value = sheet;
const json: any[] = XLSX.utils.sheet_to_json(sheet, { header: 1 });
if (json.length == 0) {
sampleTableFields.value = [];
......@@ -493,7 +494,10 @@ const transferSampleData = () => {
let object = {};
parseFileDataSum.value[0].forEach((chName, col) => {
let name = sampleTableFields.value[col].enName;
object[name] = info[col];
var cellRef = XLSX.utils.encode_cell({ r: row + 1, c: col });
var cell = currentSheet.value[cellRef];
let v = cell.w || info[col];
object[name] = v;
});
return object;
});
......@@ -1122,7 +1126,7 @@ onUnmounted(() => {
<div class="value-desc"><span style="font-weight: 600;margin-right: 8px;">环境重标识攻击概率</span>{{
'pr(context)=' +
changeNum(analysisResultInfo.envReAttackPr || 0, 2)
}}
}}
</div>
<div class="value-desc"><span style="font-weight: 600;margin-right: 8px;">重标识总体风险</span>{{
'R=Rc*pr(context)=' +
......@@ -1289,7 +1293,7 @@ onUnmounted(() => {
.table-v2-main {
width: 100%;
height: 240px;
margin-top: 2px;
.main-placeholder {
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!