mirror of
https://github.com/doocs/md.git
synced 2024-11-25 03:18:36 +08:00
fix: update insertForm component
This commit is contained in:
parent
47847aabc4
commit
214f4ba3ae
@ -52,7 +52,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import config from "../../assets/scripts/config";
|
import config from "../../assets/scripts/config";
|
||||||
import { mapState, mapMutations } from "vuex";
|
import {
|
||||||
|
mapState,
|
||||||
|
mapMutations
|
||||||
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
dialogFormVisible: {
|
dialogFormVisible: {
|
||||||
@ -87,24 +90,16 @@ export default {
|
|||||||
let table = "";
|
let table = "";
|
||||||
let currRow = [];
|
let currRow = [];
|
||||||
for (let i = 0; i < rows + 2; ++i) {
|
for (let i = 0; i < rows + 2; ++i) {
|
||||||
table += "|";
|
table += "|\t";
|
||||||
currRow = [];
|
currRow = [];
|
||||||
for (let j = 0; j < cols; ++j) {
|
for (let j = 0; j < cols; ++j) {
|
||||||
let rowIdx = i;
|
const rowIdx = i > 1 ? i - 1 : i;
|
||||||
if (i > 1) {
|
i === 1 ?
|
||||||
rowIdx = i - 1;
|
currRow.push("---\t") :
|
||||||
|
currRow.push(this.tableData[`k_${rowIdx}_${j}`] || "");
|
||||||
}
|
}
|
||||||
|
table += currRow.join("\t|\t");
|
||||||
i === 1
|
table += "\t|\n";
|
||||||
? currRow.push("---")
|
|
||||||
: currRow.push(
|
|
||||||
this.tableData[`k_${rowIdx}_${j}`]
|
|
||||||
? this.tableData[`k_${rowIdx}_${j}`]
|
|
||||||
: ""
|
|
||||||
);
|
|
||||||
}
|
|
||||||
table += currRow.join("|");
|
|
||||||
table += "|\n";
|
|
||||||
}
|
}
|
||||||
this.tableData = {};
|
this.tableData = {};
|
||||||
this.rowNum = 1;
|
this.rowNum = 1;
|
||||||
@ -117,6 +112,7 @@ export default {
|
|||||||
handleChange(val, type) {}
|
handleChange(val, type) {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
Loading…
Reference in New Issue
Block a user