EditGrids.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div class="edit-grids">
  3. <el-form
  4. ref="modalFormComp"
  5. :model="modalForm"
  6. :key="modalForm.id"
  7. label-width="100px"
  8. >
  9. <el-form-item prop="columnCount" label="单行网格数:">
  10. <el-input-number
  11. style="width:125px;"
  12. v-model.number="modalForm.columnCount"
  13. :min="2"
  14. :max="100"
  15. :step="1"
  16. step-strictly
  17. :controls="false"
  18. ></el-input-number>
  19. </el-form-item>
  20. <el-form-item prop="rowCount" label="网格行数:">
  21. <el-input-number
  22. style="width:125px;"
  23. v-model.number="modalForm.rowCount"
  24. :min="2"
  25. :max="100"
  26. :step="1"
  27. step-strictly
  28. :controls="false"
  29. ></el-input-number>
  30. </el-form-item>
  31. <el-form-item prop="rowSpace" label="网格行间距:">
  32. <el-input-number
  33. style="width:125px;"
  34. v-model.number="modalForm.rowSpace"
  35. :min="0"
  36. :max="100"
  37. :step="1"
  38. step-strictly
  39. :controls="false"
  40. ></el-input-number>
  41. </el-form-item>
  42. <el-form-item label="网格宽度:">
  43. <el-input-number
  44. style="width:125px;"
  45. v-model.number="modalForm.columnSize"
  46. :min="0"
  47. :max="100"
  48. :step="1"
  49. step-strictly
  50. :controls="false"
  51. :disabled="modalForm.halving"
  52. ></el-input-number>
  53. </el-form-item>
  54. <el-form-item>
  55. <el-checkbox v-model="modalForm.halving">是否自动网格宽度</el-checkbox>
  56. </el-form-item>
  57. <el-form-item label="线条形状:">
  58. <line-style-select v-model="modalForm.style"></line-style-select>
  59. </el-form-item>
  60. </el-form>
  61. </div>
  62. </template>
  63. <script>
  64. import LineStyleSelect from "../../components/common/LineStyleSelect";
  65. const initModalForm = {
  66. id: "",
  67. columnSize: 43,
  68. columnCount: 16,
  69. rowCount: 3,
  70. rowSpace: 0,
  71. halving: true,
  72. style: "solid"
  73. };
  74. export default {
  75. name: "edit-grids",
  76. components: { LineStyleSelect },
  77. props: {
  78. instance: {
  79. type: Object,
  80. default() {
  81. return {};
  82. }
  83. }
  84. },
  85. data() {
  86. return {
  87. modalForm: { ...initModalForm }
  88. };
  89. },
  90. mounted() {
  91. this.initData(this.instance);
  92. },
  93. methods: {
  94. initData(val) {
  95. this.modalForm = { ...val };
  96. },
  97. submit() {
  98. this.$emit("modified", this.modalForm);
  99. }
  100. }
  101. };
  102. </script>