fix: update insertForm component

This commit is contained in:
yanglbme 2020-07-12 22:55:41 +08:00
parent 47847aabc4
commit 214f4ba3ae

View File

@ -52,7 +52,10 @@
<script>
import config from "../../assets/scripts/config";
import { mapState, mapMutations } from "vuex";
import {
mapState,
mapMutations
} from "vuex";
export default {
props: {
dialogFormVisible: {
@ -87,24 +90,16 @@ export default {
let table = "";
let currRow = [];
for (let i = 0; i < rows + 2; ++i) {
table += "|";
table += "|\t";
currRow = [];
for (let j = 0; j < cols; ++j) {
let rowIdx = i;
if (i > 1) {
rowIdx = i - 1;
const rowIdx = i > 1 ? i - 1 : i;
i === 1 ?
currRow.push("---\t") :
currRow.push(this.tableData[`k_${rowIdx}_${j}`] || "");
}
i === 1
? currRow.push("---")
: currRow.push(
this.tableData[`k_${rowIdx}_${j}`]
? this.tableData[`k_${rowIdx}_${j}`]
: ""
);
}
table += currRow.join("|");
table += "|\n";
table += currRow.join("\t|\t");
table += "\t|\n";
}
this.tableData = {};
this.rowNum = 1;
@ -117,6 +112,7 @@ export default {
handleChange(val, type) {}
}
};
</script>
<style lang="less">