PlatFormModal.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div class="vehicle_servies_modal" v-if="modalFlag" @mousewheel="mousewheel">
  3. <div class="modal_content">
  4. <div class="input">
  5. <p>平台名称</p>
  6. <input type="text" v-model="platName" />
  7. </div>
  8. <div class="btn">
  9. <button @click="submit" style="margin: 0">保存</button>
  10. <button @click="hideModal" style="margin: 0">取消</button>
  11. </div>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. modalFlag: {
  19. type: Boolean,
  20. default: false,
  21. },
  22. },
  23. data() {
  24. return {
  25. platName: "",
  26. };
  27. },
  28. methods: {
  29. submit: function () {
  30. let platName = this.platName.replace(/\s/g,"");
  31. if (platName) {
  32. this.$emit("submit", platName);
  33. } else {
  34. alert('请输入平台名称');
  35. }
  36. },
  37. hideModal: function () {
  38. this.$emit("hide_modal");
  39. },
  40. mousewheel: function (e) {
  41. e.preventDefault();
  42. },
  43. },
  44. };
  45. </script>
  46. <style scoped lang="less">
  47. .vehicle_servies_modal {
  48. position: fixed;
  49. left: 0;
  50. top: 0;
  51. height: 100vh;
  52. width: 100vw;
  53. background-color: rgba(127, 127, 127, 0.7);
  54. display: flex;
  55. justify-content: center;
  56. align-items: center;
  57. .modal_content {
  58. width: 600px;
  59. height: 300px;
  60. background-color: #fff;
  61. transform: translateY(-50px);
  62. .input {
  63. width: 280px;
  64. margin: 0 auto;
  65. margin-top: 80px;
  66. display: flex;
  67. height: 28px;
  68. p {
  69. width: 80px;
  70. height: 28px;
  71. line-height: 28px;
  72. }
  73. input {
  74. width: 200px;
  75. border: 1px solid #555;
  76. }
  77. }
  78. .btn {
  79. padding-left: 80px;
  80. margin: 0 auto;
  81. width: 200px;
  82. margin-top: 30px;
  83. display: flex;
  84. justify-content: space-between;
  85. button {
  86. margin: 0!;
  87. }
  88. }
  89. }
  90. }
  91. </style>