ProbeConfigRnav.cshtml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. 
  2. <div id="ProbeConfigDiv">
  3. <form action="" method="post" class="config-form">
  4. <div class="config-form-group">
  5. <label class="config-form-label">探棒序列号</label>
  6. <select class="config-form-select" v-model="values.DeviceId" @@change="changeSerial">
  7. <option v-for='item in values.atgList'>{{ item.DeviceId }}</option>
  8. </select>
  9. <span class="config-form-danger"></span>
  10. </div>
  11. <div class="config-form-hint-group">
  12. <label class="config-form-hint">请选择需要配置的序列号</label>
  13. </div>
  14. <div class="config-form-group">
  15. <label class="config-form-label">探棒描述</label>
  16. <input class="config-form-input" v-model="descrip" readonly="readonly" />
  17. <span class="config-form-danger"></span>
  18. </div>
  19. <div class="config-form-hint-group">
  20. <label class="config-form-hint">自动读取,不可编辑</label>
  21. </div>
  22. <div class="config-form-group">
  23. <label class="config-form-label">深度偏差</label>
  24. <input class="config-form-input" v-model.number="values.ProbeOffset" />
  25. <span class="config-form-danger"></span>
  26. </div>
  27. <div class="config-form-hint-group">
  28. <label class="config-form-hint">探棒距离油罐底部的高度 (毫米)</label>
  29. </div>
  30. <div class="config-form-group">
  31. <label class="config-form-label">水位偏差</label>
  32. <input class="config-form-input" v-model.number="values.WaterOffset" />
  33. <span class="config-form-danger"></span>
  34. </div>
  35. <div class="config-form-hint-group">
  36. <label class="config-form-hint">油罐底部存留的水位高度 (毫米)</label>
  37. </div>
  38. <div class="config-form-submit-group">
  39. <label :class="show ? (result ? 'config-form-result' : 'config-form-result-fail') : 'color-transparent'">{{ result ? '提交完成' : '提交失败' }}</label>
  40. </div>
  41. <div class="config-form-submit-group">
  42. <label class="config-form-label"></label>
  43. <button class="config-form-submit" type="button" @@click="submit(event)" id="ProbeConfig" />
  44. </div>
  45. </form>
  46. </div>
  47. <script type="text/javascript">
  48. var vm = new Vue({
  49. el: '#ProbeConfigDiv',
  50. data: {
  51. values: { 'atgList': [{ 'DeviceId': 1, 'Name': '1号罐探棒' }, { 'DeviceId': 3, 'Name': '3号罐探棒' }], 'DeviceId': 3, 'ProbeOffset': 120, 'WaterOffset': 50 },
  52. descrip: '',
  53. show: false,
  54. result: false
  55. },
  56. mounted: function () {
  57. let path = '/sys/atg_classic_App/Application.ATG_Classic_App.App/thing/service/GetConfigAsync'
  58. this.changeSerial(0)
  59. Publish1(path)
  60. },
  61. methods: {
  62. changeSerial: function (ev) {
  63. let val = this.values.atgList.find((m) => m.DeviceId == this.values.DeviceId)
  64. this.descrip = val.Name
  65. },
  66. submit(e) {
  67. let path = '/sys/atg_classic_App/Application.ATG_Classic_App.App/thing/service/UpsertConfigAsync'
  68. Publish(e.target.id, JSON.stringify(this.values), path)
  69. return false
  70. }
  71. }
  72. })
  73. function OnReply(jsonObj) {
  74. console.log(jsonObj)
  75. }
  76. </script>