createInfo.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div>
  3. <el-dialog
  4. v-dialog-drag
  5. class="dialog"
  6. title="新建人员配置"
  7. :visible.sync="dialogVisible"
  8. width="360px"
  9. left
  10. >
  11. <el-divider></el-divider>
  12. <el-form
  13. label-position="left"
  14. label-width="80px"
  15. >
  16. <el-form-item
  17. :model="form.typeName"
  18. label="类别名称:"
  19. >
  20. <el-input v-model="value"></el-input>
  21. </el-form-item>
  22. </el-form>
  23. <div
  24. slot="footer"
  25. class="dialog-footer"
  26. >
  27. <el-button
  28. @click="dialogVisible = false"
  29. type="primary"
  30. >取消</el-button>
  31. <el-button
  32. type="primary"
  33. @click="sure"
  34. >确认</el-button>
  35. </div>
  36. </el-dialog>
  37. </div>
  38. </template>
  39. <script>
  40. import api from "@/api/infoConfig/api";
  41. export default {
  42. props: {
  43. update: {
  44. type: Function,
  45. },
  46. },
  47. data() {
  48. return {
  49. value: "",
  50. dialogVisible: false,
  51. form: {
  52. typeName: "",
  53. },
  54. };
  55. },
  56. methods: {
  57. sure() {
  58. let that = this;
  59. api
  60. .addSecurityInfoConfiguration({
  61. name: this.value,
  62. })
  63. .then((result) => {
  64. if (result.data.code == 0) {
  65. that.$message.success("配置添加成功!");
  66. that.dialogVisible = false;
  67. // 刷新列表
  68. that.update();
  69. } else {
  70. that.$message.error("配置添加失败!");
  71. }
  72. })
  73. .catch((err) => {
  74. that.$message.error("配置添加失败!");
  75. });
  76. },
  77. close() {
  78. this.dialogVisible = false;
  79. },
  80. },
  81. };
  82. </script>
  83. <style lang="less" scoped>
  84. /deep/.el-dialog {
  85. height: 295px !important;
  86. }
  87. .el-select {
  88. width: 280px;
  89. }
  90. .el-form {
  91. .el-form-item {
  92. margin-inline: 20px;
  93. // margin-bottom: 0;
  94. }
  95. /deep/.el-form-item__label {
  96. padding: 0;
  97. }
  98. /deep/.el-form-item__content {
  99. display: flex;
  100. }
  101. }
  102. // /deep/.el-dialog {
  103. // height: 30vh;
  104. // }
  105. // /deep/.el-dialog__title {
  106. // margin-right: 330px;
  107. // }'
  108. /deep/.el-dialog__header {
  109. padding-bottom: 0;
  110. color: #333333;
  111. }
  112. /deep/.el-dialog__headerbtn {
  113. font-size: 25px;
  114. }
  115. /deep/.el-dialog__body {
  116. padding: 0;
  117. }
  118. /deep/.el-divider--horizontal {
  119. display: block;
  120. height: 1px;
  121. width: 100%;
  122. margin: 0;
  123. // margin-left: 2.5%;
  124. }
  125. /deep/.el-dialog__footer {
  126. margin-top: 60px;
  127. }
  128. .el-button {
  129. width: 100px;
  130. height: 30px;
  131. text-align: center;
  132. margin: 30px;
  133. padding: 5px;
  134. }
  135. </style>