advancedParameters.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view class="">
  3. <view class="line">
  4. </view>
  5. <!-- <view class="body">
  6. <p class="p">X轴回零速度:</p>
  7. <input class="input" type="text" v-model="D420" />
  8. <button type="primary" class="button" @click="update('D-420',D420)">
  9. <p class="p2">更新</P>
  10. </button>
  11. </view>
  12. <view class="line2"></view>
  13. <view class="body">
  14. <p class="p">X轴爬行速度:</p>
  15. <input class="input" type="text" v-model="D421" />
  16. <button type="primary" class="button" @click="update('D-421',D421)">
  17. <p class="p2">更新</P>
  18. </button>
  19. </view>
  20. <view class="line2"></view>
  21. <view class="body">
  22. <p class="p">Y轴回零速度:</p>
  23. <input class="input" type="text" v-model="D422" />
  24. <button type="primary" class="button" @click="update('D-422',D422)">
  25. <p class="p2">更新</P>
  26. </button>
  27. </view>
  28. <view class="line2"></view>
  29. <view class="body">
  30. <p class="p">Y轴爬行速度:</p>
  31. <input class="input" type="text" v-model="D423" />
  32. <button type="primary" class="button" @click="update('D-423',D423)">
  33. <p class="p2">更新</P>
  34. </button>
  35. </view>
  36. <view class="line2"></view>
  37. <view class="body">
  38. <p class="p">E轴回零速度:</p>
  39. <input class="input" type="text" v-model="D424" />
  40. <button type="primary" class="button" @click="update('D-424',D424)">
  41. <p class="p2">更新</P>
  42. </button>
  43. </view>
  44. <view class="line2"></view>
  45. <view class="body">
  46. <p class="p">E轴爬行速度:</p>
  47. <input class="input" type="text" v-model="D425" />
  48. <button type="primary" class="button" @click="update('D-425',D425)">
  49. <p class="p2">更新</P>
  50. </button>
  51. </view>
  52. <view class="line2"></view> -->
  53. <view class="body">
  54. <p class="p">X轴加速度:</p>
  55. <input class="input" type="text" v-model="D426" />
  56. <button type="primary" class="button" @click="update('D426',D426)">
  57. <p class="p2">更新</P>
  58. </button>
  59. </view>
  60. <view class="line2"></view>
  61. <view class="body">
  62. <p class="p">X轴减速度:</p>
  63. <input class="input" type="text" v-model="D427" />
  64. <button type="primary" class="button" @click="update('D427',D427)">
  65. <p class="p2">更新</P>
  66. </button>
  67. </view>
  68. <view class="line2"></view>
  69. <view class="body">
  70. <p class="p">Y轴加速度:</p>
  71. <input class="input" type="text" v-model="D428" />
  72. <button type="primary" class="button" @click="update('D428',D428)">
  73. <p class="p2">更新</P>
  74. </button>
  75. </view>
  76. <view class="line2"></view>
  77. <view class="body">
  78. <p class="p">Y轴减速度:</p>
  79. <input class="input" type="text" v-model="D429" />
  80. <button type="primary" class="button" @click="update('D429',D429)">
  81. <p class="p2">更新</P>
  82. </button>
  83. </view>
  84. <view class="line2"></view>
  85. <view class="body">
  86. <p class="p">E轴加速度:</p>
  87. <input class="input" type="text" v-model="D430" />
  88. <button type="primary" class="button" @click="update('D430',D430)">
  89. <p class="p2">更新</P>
  90. </button>
  91. </view>
  92. <view class="line2"></view>
  93. <view class="body">
  94. <p class="p">E轴加速度:</p>
  95. <input class="input" type="text" v-model="D431" />
  96. <button type="primary" class="button" @click="update('D431',D431)">
  97. <p class="p2">更新</P>
  98. </button>
  99. </view>
  100. <view class="line2"></view>
  101. </view>
  102. </template>
  103. <script>
  104. import {
  105. mapState,
  106. mapActions,
  107. mapMutations
  108. } from 'vuex'
  109. export default {
  110. data() {
  111. return {
  112. D420: 0,
  113. D421: 0,
  114. D422: 0,
  115. D423: 0,
  116. D424: 0,
  117. D425: 0,
  118. D426: 0,
  119. D427: 0,
  120. D428: 0,
  121. D429: 0,
  122. D430: 0,
  123. D431: 0,
  124. }
  125. },
  126. onShow() {
  127. this.getParam();
  128. },
  129. methods: {
  130. ...mapActions('chart', ['getParameters', 'updateParameters']),
  131. getParam() {
  132. const param = {};
  133. param['id'] = uni.getStorageSync("nowEquipmentId");
  134. param['code'] = '1';
  135. this.getParameters(param).then(data => {
  136. var info = data;
  137. if (info!=null||info!='') {
  138. for (var i = 0; i < info.length; i++) {
  139. if(info[i].name=='D-420'){
  140. this.D420=info[i].val;
  141. }
  142. if(info[i].name=='D-421'){
  143. this.D421=info[i].val;
  144. }
  145. if(info[i].name=='D-422'){
  146. this.D422=info[i].val;
  147. }
  148. if(info[i].name=='D-423'){
  149. this.D423=info[i].val;
  150. }
  151. if(info[i].name=='D-424'){
  152. this.D424=info[i].val;
  153. }
  154. if(info[i].name=='D-425'){
  155. this.D425=info[i].val;
  156. }
  157. if(info[i].name=='D-426'){
  158. this.D426=info[i].val;
  159. }
  160. if(info[i].name=='D-427'){
  161. this.D427=info[i].val;
  162. }
  163. if(info[i].name=='D-428'){
  164. this.D428=info[i].val;
  165. }
  166. if(info[i].name=='D-429'){
  167. this.D429=info[i].val;
  168. }
  169. if(info[i].name=='D-430'){
  170. this.D430=info[i].val;
  171. }
  172. if(info[i].name=='D-431'){
  173. this.D431=info[i].val;
  174. }
  175. }
  176. }
  177. }, _ => void uni.stopPullDownRefresh());
  178. },
  179. update(name, val) {
  180. const param = {};
  181. param['id'] = uni.getStorageSync("nowEquipmentId");
  182. param['name'] = name;
  183. param['val'] = val;
  184. this.updateParameters(param).then(data => {
  185. if (data == 'SUCCESS') {
  186. uni.showToast({
  187. title: '修改成功',
  188. duration: 1000
  189. });
  190. }
  191. }, _ => void uni.stopPullDownRefresh());
  192. },
  193. },
  194. }
  195. </script>
  196. <style>
  197. .line {
  198. height: 50upx;
  199. }
  200. .line2 {
  201. height: 10upx;
  202. }
  203. .body {
  204. background-color: #FFFFFF;
  205. width: 600upx;
  206. padding: 10upx 10upx 10upx 10upx;
  207. display: flex;
  208. flex-direction: row;
  209. justify-content: flex-start;
  210. font-size: 32upx;
  211. }
  212. .p {
  213. width: 200upx;
  214. text-align: right;
  215. }
  216. .input {
  217. width: 200upx;
  218. box-shadow: 0upx 0upx 20upx #D3D3D3;
  219. border-radius: 5upx;
  220. }
  221. .button {
  222. width: 120upx;
  223. height: 60upx;
  224. text-align: left;
  225. border-radius: 10upx;
  226. }
  227. .p2 {
  228. font-size: 30upx;
  229. /* #ifndef H5 */
  230. padding-top: 3upx;
  231. /* #endif */
  232. position: absolute;
  233. /* 水平居中 */
  234. left: 50%;
  235. -webkit-transform: translateX(-50%);
  236. transform: translateX(-50%);
  237. }
  238. </style>