form-club-device.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="club-device">
  3. <template v-for="i in 2">
  4. <div :key="i">
  5. <el-form :model="formData" :rules="rules">
  6. <el-form-item :label="`设备名称${i}:`">
  7. <el-select
  8. v-model="formData.deviceName"
  9. filterable
  10. allow-create
  11. placeholder="请输入新设备名称或选择已有设备"
  12. >
  13. <el-option label="中国" :value="1"> </el-option>
  14. </el-select>
  15. </el-form-item>
  16. <el-form-item prop="mobile" label="设备图片:">
  17. <br />
  18. <el-input v-show="false"></el-input>
  19. <SimpleUploadImage :limit="1" />
  20. </el-form-item>
  21. <el-form-item label="所属品牌:">
  22. <el-select v-model="formData.deviceName" placeholder="请选择品牌">
  23. <el-option label="中国" :value="1"> </el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item prop="mobile" label="购买渠道:">
  27. <el-input placeholder="请输入购买渠道"></el-input>
  28. </el-form-item>
  29. <el-form-item prop="mobile" label="发票:">
  30. <br />
  31. <el-input v-show="false"></el-input>
  32. <SimpleUploadImage :limit="1" />
  33. </el-form-item>
  34. <el-form-item prop="mobile" label="设备SN码:">
  35. <el-input placeholder="请输入设备SN码"></el-input>
  36. </el-form-item>
  37. <el-form-item prop="mobile" label="设备参数:">
  38. <br />
  39. <div class="device-param-list">
  40. <span class="add-param">添加参数</span>
  41. <template v-for="i in 3">
  42. <div :key="i">
  43. <div class="param flex justify-between mb-4">
  44. <el-input placeholder="例如:品牌" class="mr-2"></el-input>
  45. <el-input placeholder="请输入参数信息"></el-input>
  46. <span class="remove el-icon-close"></span>
  47. </div>
  48. </div>
  49. </template>
  50. </div>
  51. </el-form-item>
  52. </el-form>
  53. <el-divider></el-divider>
  54. </div>
  55. </template>
  56. <div class="add-device">
  57. <div class="add-icon"></div>
  58. 添加设备
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import SimpleUploadImage from '@/components/SimpleUploadImage'
  64. export default {
  65. components: {
  66. SimpleUploadImage,
  67. },
  68. data() {
  69. return {
  70. formData: {
  71. deviceName: '',
  72. },
  73. rules: {},
  74. }
  75. },
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .el-select {
  80. width: 100%;
  81. }
  82. .device-param-list {
  83. position: relative;
  84. .add-param {
  85. position: absolute;
  86. cursor: pointer;
  87. top: -40px;
  88. right: 0;
  89. text-decoration: underline;
  90. font-size: 14px;
  91. @include themify($themes) {
  92. color: themed('color');
  93. }
  94. }
  95. .param {
  96. position: relative;
  97. .remove {
  98. position: absolute;
  99. right: 0;
  100. top: 0;
  101. width: 20px;
  102. height: 20px;
  103. background: #f94b4b;
  104. border-radius: 2px;
  105. cursor: pointer;
  106. color: #fff;
  107. font-size: 14px;
  108. text-align: center;
  109. line-height: 20px;
  110. }
  111. }
  112. }
  113. .add-device {
  114. display: flex;
  115. justify-content: center;
  116. align-items: center;
  117. width: 162px;
  118. height: 46px;
  119. border-radius: 4px;
  120. box-sizing: border-box;
  121. font-size: 18px;
  122. margin: 0 auto;
  123. cursor: pointer;
  124. @include themify($themes) {
  125. border: 1px solid themed('color');
  126. color: themed('color');
  127. }
  128. .add-icon {
  129. width: 20px;
  130. height: 20px;
  131. position: relative;
  132. margin-right: 16px;
  133. &::before,
  134. &::after {
  135. position: absolute;
  136. width: 3px;
  137. height: 20px;
  138. left: 50%;
  139. top: 50%;
  140. transform: translate(-50%, -50%);
  141. border-radius: 1px;
  142. content: '';
  143. display: block;
  144. @include themify($themes) {
  145. background: themed('color');
  146. }
  147. }
  148. &::after {
  149. transform: translate(-50%, -50%) rotateZ(90deg);
  150. }
  151. }
  152. }
  153. </style>