大空间消毒机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

248 lines
25 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="formula_container">
  3. <div v-if="isSettingVisible">
  4. <PreSetting :hideSettingModal="hideSettingModal" />
  5. </div>
  6. <div v-else>
  7. <div class="header_wrap">
  8. <p>配方名称</p>
  9. <p>操作</p>
  10. </div>
  11. <div
  12. :class="
  13. formulaStore?.formulaList?.length == 0
  14. ? 'content_wrap layout'
  15. : 'content_wrap'
  16. "
  17. >
  18. <div
  19. class="line"
  20. v-for="item in formulaStore?.formulaList"
  21. :key="item.id"
  22. >
  23. <div class="username">{{ item?.formula_id }}</div>
  24. <div class="btns">
  25. <div class="btn" @click="delModalShow(item)">删除</div>
  26. <div class="btn mg" @click="showSetting(item)">配置</div>
  27. <div class="btn" @click="runConfig(item)">执行</div>
  28. </div>
  29. </div>
  30. <svg
  31. v-if="formulaStore?.formulaList?.length == 0"
  32. xmlns="http://www.w3.org/2000/svg"
  33. xmlns:xlink="http://www.w3.org/1999/xlink"
  34. fill="none"
  35. version="1.1"
  36. width="129"
  37. height="148.6171875"
  38. viewBox="0 0 129 148.6171875"
  39. >
  40. <g>
  41. <g>
  42. <path
  43. d="M77.56318437499999,42.283203125L77.56318437499999,47.883203125C77.56318437499999,49.516503125,78.93818437499999,50.683203125,80.771484375,50.683203125L87.41728437500001,50.683203125L87.41728437500001,64.91650312499999C87.41728437500001,66.549903125,86.04228437500001,67.716503125,84.208984375,67.716503125L67.708984375,67.716503125C65.87568437499999,67.716503125,64.50068437499999,66.316503125,64.50068437499999,64.91650312499999L64.50068437499999,44.849903125C64.50068437499999,43.216503125,65.87568437499999,42.049903125,67.708984375,42.049903125L77.56318437499999,42.049903125L77.56318437499999,42.283203125ZM42.500651375,52.083203125C45.021484375,54.883203125,50.063154374999996,56.983203125,59.000684375,56.983203125L60.604784375,56.983203125L60.604784375,66.783203125L59.000684375,66.783203125C48.000654374999996,66.783203125,41.583984784782,63.516503125,41.583984784782,59.783203125L41.583984784782,54.183203125C41.583984784782,53.483203125,41.813151375,52.783203125,42.500651375,52.083203125ZM78.25068437499999,63.283203125L69.083984375,63.283203125L69.083984375,65.61650312500001L78.25068437499999,65.61650312500001L78.25068437499999,63.283203125ZM82.833984375,58.616503125L69.083984375,58.616503125L69.083984375,60.949903125L82.833984375,60.949903125L82.833984375,58.616503125ZM82.833984375,53.949903125L69.083984375,53.949903125L69.083984375,56.283203125L82.833984375,56.283203125L82.833984375,53.949903125ZM42.500651375,38.316503125C45.021484375,41.116503125,50.063154374999996,43.216503125,59.000684375,43.216503125L60.604784375,43.216503125L60.604784375,53.016503125L59.000684375,53.016503125C48.000654374999996,53.016503125,41.583984784782,49.749903125,41.583984784782,46.016503125L41.583984784782,40.416503125C41.583984784782,39.716503125,41.813151375,39.016503125,42.500651375,38.316503125ZM80.54228437500001,42.283203125L87.41728437500001,49.283203125L81.91728437500001,49.283203125C81.22978437500001,49.283203125,80.54228437500001,48.583203125,80.54228437500001,47.883203125L80.54228437500001,42.283203125ZM59.000684375,21.283203125C70.00068437499999,21.283203125,77.56318437499999,24.316533125,77.56318437499999,28.283203125L77.56318437499999,32.483203125C77.56318437499999,36.449903125,70.00068437499999,39.483203125,59.000684375,39.483203125C48.000654374999996,39.483203125,41.583984375,36.449903125,41.583984375,32.483203125L41.583984375,28.283203125C41.583984375,24.316533125,48.000654374999996,21.283202707767,59.000684375,21.283203125Z"
  44. fill="#999999"
  45. fill-opacity="1"
  46. />
  47. </g>
  48. <g>
  49. <path
  50. d="M63.989446875,0C39.391046875,0,19.373046875,20.2104,19.373046875,45.0454C19.373046875,69.8804,39.391046875,90.0908,63.989446875,90.0908C88.587846875,90.0908,108.605846875,69.8804,108.605846875,45.0454C108.605846875,20.2104,88.598046875,0,63.989446875,0ZM63.989446875,83.7231C42.864446875,83.7231,25.680076875,66.3735,25.680076875,45.0454C25.680076875,36.145,28.686326875,27.9419,33.703546875,21.3999L89.999646875,73.3975C83.17464687500001,79.7959,74.033946875,83.7231,63.989446875,83.7231ZM94.275346875,68.6909L37.969146875,16.6934C44.804246875000004,10.2949,53.955046875,6.36768,63.989446875,6.36768C85.114446875,6.36768,102.298846875,23.7173,102.298846875,45.0454C102.298846875,53.9458,99.302746875,62.1489,94.275346875,68.6909Z"
  51. fill="#999999"
  52. fill-opacity="1"
  53. />
  54. </g>
  55. <g>
  56. <path
  57. d="M16.89,116.8571875L16.89,121.2971875C16.89,123.7571875,16.68,126.9971875,14.73,129.3971875C15.33,129.6671875,16.44,130.4171875,16.89,130.8371875C18.45,128.9171875,19.08,126.2471875,19.32,123.8171875L22.71,123.8171875L22.71,130.6871875L25.32,130.6871875L25.32,123.8171875L28.62,123.8171875L28.62,121.5371875L19.41,121.5371875L19.41,121.3571875L19.41,118.7771875C22.41,118.5371875,25.62,118.0571875,27.96,117.3671875L26.58,115.2296875C24.21,116.0134875,20.25,116.5866875,16.89,116.8571875ZM7.77,137.4671875L22.23,137.4671875L22.23,139.53718750000002L7.77,139.53718750000002L7.77,137.4671875ZM7.77,135.5171875L7.77,133.4771875L22.23,133.4771875L22.23,135.5171875L7.77,135.5171875ZM5.07,131.3171875L5.07,142.72468750000002L7.77,142.72468750000002L7.77,141.7271875L22.23,141.7271875L22.23,142.6941875L25.05,142.6941875L25.05,131.3171875L5.07,131.3171875ZM1.56,126.6971875L1.77,129.03718750000002L8.55,128.3171875L8.55,130.6871875L11.16,130.6871875L11.16,128.0471875L15.39,127.5671875L15.36,125.5271875L11.16,125.8871875L11.16,124.0271875L15.66,124.0271875L15.66,121.8071875L11.16,121.8071875L11.16,119.9471875L8.55,119.9471875L8.55,121.8071875L5.16,121.8071875C5.91,120.9371875,6.69,119.9771875,7.44,118.9271875L15.57,118.9271875L15.57,116.7671875L8.88,116.7671875L9.6,115.5615675L6.75,114.8378175C6.48,115.4710975,6.15,116.1343875,5.82,116.7671875L1.53,116.7671875L1.53,118.9271875L4.53,118.9271875C3.99,119.7371875,3.54,120.3671875,3.3,120.6671875C2.7,121.3571875,2.22,121.8371875,1.71,121.9571875C2.01,122.6471875,2.43,123.9371875,2.58,124.4771875C2.85,124.2071875,3.87,124.0271875,5.1,124.0271875L8.55,124.0271875L8.55,126.1271875L1.56,126.6971875ZM36.33,116.82718750000001L36.33,119.6171875L46.02,119.6171875C45.96,121.5671875,45.87,123.57718750000001,45.6,125.5571875L34.47,125.5571875L34.47,128.3471875L45.06,128.3471875C43.83,133.2671875,40.95,137.7671875,34.05,140.3471875C34.77,140.94718749999998,35.58,141.9671875,35.97,142.7232875C43.68,139.5971875,46.71,134.1671875,48,128.3471875L48.24,128.3471875L48.24,137.94718749999998C48.24,141.0671875,49.14,141.9971875,52.56,141.9971875C53.25,141.9971875,56.94,141.9971875,57.66,141.9971875C60.72,141.9971875,61.59,140.7071875,61.92,135.7571875C61.11,135.5471875,59.82,135.0671875,59.19,134.5571875C59.04,138.5471875,58.83,139.2071875,57.45,139.2071875C56.61,139.2071875,53.55,139.2071875,52.89,139.2071875C51.45,139.2071875,51.21,139.0271875,51.21,137.9171875L51.21,128.3471875L61.65,128.3471875L61.65,125.5571875L48.48,125.5571875C48.75,123.57718750000001,48.84,121.5671875,48.93,119.6171875L59.97,119.6171875L59.97,116.82718750000001L36.33,116.82718750000001ZM79.05,115.3459375C78.54,116.4887875,77.61,118.2024875,76.89,119.2848875L78.72,120.1266875C79.53,119.1648875,80.49,117.6915875,81.42,116.3382875L79.05,115.3459375ZM68.37,116.3382875C69.15,117.5710875,69.9,119.2248875,70.14,120.2771875L72.3,119.3152875C72.03,118.2624875,71.22,116.66918749999999,70.41,115.4964075L68.37,116.3382875ZM77.82,132.69718749999998C77.19,134.0190875,76.35,135.1909875,75.36,136.1818875C74.37,135.6713875,73.35,135.1909875,72.36,134.7399875L73.5,132.69718749999998L77.82,132.69718749999998ZM68.91,135.6713875C70.32,136.2423875,71.91,136.9932875,73.38,137.77418749999998C71.55,139.0060875,69.39,139.87698749999998,67.05,140.3879875C67.53,140.92848750000002,68.07,141.91988750000002,68.34,142.5507875C71.07,141.7998875,73.59,140.6879875,75.69,139.0360875C76.65,139.6065875,77.49,140.1474875,78.15,140.6579875L79.86,138.7955875C79.2,138.3451875,78.39,137.8641875,77.52,137.3537875C79.08,135.6113875,80.28,133.4785875,81.03,130.8371875L79.5,130.2671875L79.05,130.3571875L74.64,130.3571875L75.21,128.9771875L72.72,128.4971875C72.48,129.0971875,72.24,129.7271875,71.94,130.3571875L67.98,130.3571875L67.98,132.69718749999998L70.74,132.69718749999998C70.14,133.8090875,69.48,134.8304875,68.91,135.6713875ZM73.38,114.8349975L73.38,120.3371875L67.41,120.3371875L67.41,122.6171875L72.51,122.6171875C71.04,124.3571875,68.91,125.9771875,66.96,126.7871875C67.5,127.32718750000001,68.13,128.28718750000002,68.46,128.9171875C70.14,127.9871875,71.94,126.5471
  58. fill="#9E9E9E"
  59. fill-opacity="1"
  60. />
  61. </g>
  62. </g>
  63. </svg>
  64. </div>
  65. <div class="bottom_btn">
  66. <svg
  67. @click="addNewPre"
  68. xmlns="http://www.w3.org/2000/svg"
  69. xmlns:xlink="http://www.w3.org/1999/xlink"
  70. fill="none"
  71. version="1.1"
  72. width="158"
  73. height="40"
  74. viewBox="0 0 158 40"
  75. >
  76. <g>
  77. <g>
  78. <g>
  79. <rect
  80. x="0"
  81. y="0"
  82. width="158"
  83. height="40"
  84. rx="20"
  85. fill="#06518B"
  86. fill-opacity="1"
  87. />
  88. </g>
  89. <g>
  90. <path
  91. d="M21.014699999999998,7Q23.694200000000002,7,26.0646,8.017009999999999Q28.4349,9.03401,30.2016,10.80272Q31.9683,12.57143,32.9841,14.94445Q34,17.317500000000003,34,20Q34,22.712,32.9841,25.0703Q31.9683,27.4286,30.2016,29.1973Q28.4349,30.966,26.0646,31.983Q23.694200000000002,33,21.014699999999998,33Q18.305799999999998,33,15.93545,31.983Q13.56512,30.966,11.79841,29.1973Q10.03171,27.4286,9.01585,25.0703Q7.999999670926,22.712,8,20Q8,17.317500000000003,9.01585,14.94445Q10.03171,12.57143,11.79841,10.80272Q13.56512,9.03401,15.93545,8.017009999999999Q18.305799999999998,6.999999231289,21.014699999999998,7ZM28.4349,21.7982Q29.2005,21.7982,29.7305,21.2528Q30.2605,20.7075,30.2605,19.941000000000003Q30.2605,19.174599999999998,29.7305,18.644Q29.2005,18.1134,28.4349,18.1134L22.8992,18.1134L22.8992,12.57143Q22.8992,11.80499,22.3545,11.259640000000001Q21.8097,10.71429,21.0442,10.71429Q20.2786,10.71429,19.7486,11.259640000000001Q19.218600000000002,11.80499,19.218600000000002,12.57143L19.218600000000002,18.1134L13.6829,18.1134Q12.91733,18.1134,12.387319999999999,18.644Q11.85731,19.174599999999998,11.85731,19.941000000000003Q11.85731,20.7075,12.387319999999999,21.2528Q12.91733,21.7982,13.6829,21.7982L19.218600000000002,21.7982L19.218600000000002,27.3107Q19.218600000000002,28.0771,19.7486,28.6225Q20.2786,29.1678,21.0442,29.1678Q21.8097,29.1678,22.3545,28.6225Q22.8992,28.0771,22.8992,27.3107L22.8992,21.7982L28.4349,21.7982Z"
  92. fill="#FFFFFF"
  93. fill-opacity="1"
  94. />
  95. </g>
  96. <g>
  97. <path
  98. d="M53.512,22.852C53.144,24.067999999999998,52.472,25.46,51.480000000000004,26.276L52.36,26.932C53.4,26.004,54.056,24.5,54.456,23.22L53.512,22.852ZM57.288,23.412C57.752,24.484,58.216,25.892,58.344,26.836L59.32,26.468C59.16,25.556,58.712,24.164,58.184,23.108L57.288,23.412ZM59.256,22.98C60.168,24.195999999999998,61.128,25.876,61.512,26.98L62.519999999999996,26.468C62.104,25.364,61.144,23.747999999999998,60.2,22.532L59.256,22.98ZM55.528,21.124000000000002L55.528,27.428C55.528,27.62,55.464,27.684,55.24,27.684C55.032,27.684,54.344,27.7,53.544,27.668C53.688,28.004,53.832,28.436,53.88,28.756C54.952,28.756,55.656,28.74,56.088,28.564C56.519999999999996,28.388,56.647999999999996,28.068,56.647999999999996,27.444L56.647999999999996,21.124000000000002L55.528,21.124000000000002ZM48.36,15.044C49.288,15.508,50.408,16.26025,50.936,16.80475L51.656,15.828C51.096000000000004,15.3,49.976,14.6105,49.064,14.17625L48.36,15.044ZM47.608,19.3823C48.568,19.7985,49.72,20.486800000000002,50.28,20.999299999999998L50.968,20.0225C50.392,19.5103,49.24,18.88575,48.264,18.50175L47.608,19.3823ZM47.96,27.8833L49.032,28.5555C49.736,27.1308,50.536,25.2578,51.144,23.6568L50.184,22.984299999999998C49.512,24.7133,48.6,26.6985,47.96,27.8833ZM52.232,14.948L52.232,16.067999999999998L55.768,16.067999999999998C55.592,16.804000000000002,55.352000000000004,17.524,55.048,18.212L51.496,18.212L51.496,19.348L54.456,19.348C53.656,20.6453,52.552,21.766,51.064,22.5028C51.288,22.7268,51.64,23.1593,51.8,23.4155C53.624,22.4708,54.903999999999996,21.0295,55.8,19.348L57.816,19.348C58.712,20.9495,60.216,22.4225,61.752,23.1593C61.928,22.871000000000002,62.296,22.4545,62.536,22.2305C61.208,21.67,59.912,20.5813,59.064,19.348L62.263999999999996,19.348L62.263999999999996,18.212L56.344,18.212C56.616,17.524,56.84,16.804000000000002,57.032,16.067999999999998L61.72,16.067999999999998L61.72,14.948L52.232,14.948ZM73.752,16.02L73.752,28.5208L74.904,28.5208L74.904,27.332L78.008,27.332L78.008,28.3923L79.208,28.3923L79.208,16.02L73.752,16.02ZM74.904,26.18L74.904,17.188000000000002L78.008,17.188000000000002L78.008,26.18L74.904,26.18ZM67.72,14.238L67.70400000000001,17.076L65.44800000000001,17.076L65.44800000000001,18.244L67.672,18.244C67.56,22.276,67.064,25.828,65.048,27.94C65.352,28.132,65.78399999999999,28.5,65.976,28.7745C68.136,26.42,68.696,22.58,68.84,18.244L71.27199999999999,18.244C71.144,24.404,71,26.596,70.664,27.06C70.52,27.268,70.36,27.332,70.12,27.316C69.832,27.316,69.144,27.316,68.392,27.252C68.6,27.588,68.712,28.1,68.744,28.452C69.464,28.5,70.2,28.5163,70.648,28.452C71.112,28.388,71.416,28.244,71.70400000000001,27.828C72.2,27.14,72.312,24.804000000000002,72.44,17.683999999999997C72.44,17.508,72.44,17.076,72.44,17.076L68.872,17.076L68.904,14.238L67.72,14.238ZM87.96000000000001,24.067999999999998C88.44,24.868000000000002,89.01599999999999,25.956,89.27199999999999,26.66L90.12,26.148C89.88,25.476,89.304,24.436,88.77600000000001,23.636L87.96000000000001,24.067999999999998ZM84.36,23.716C84.03999999999999,24.692,83.512,25.684,82.856,26.388C83.096,26.532,83.512,26.836,83.70400000000001,26.996C84.328,26.244,84.968,25.076,85.336,23.956L84.36,23.716ZM91.048,15.57175L91.048,21.076C91.048,23.204,90.92,25.956,89.56,27.876C89.816,28.02,90.29599999999999,28.388,90.488,28.6138C91.96000000000001,26.5375,92.168,23.3828,92.168,21.0768L92.168,20.564L94.6,20.564L94.6,28.6835L95.768,28.6835L95.768,20.564L97.52799999999999,20.564L97.52799999999999,19.444000000000003L92.168,19.444000000000003L92.168,16.368000000000002C93.864,16.11175,95.688,15.69525,97.032,15.1985L96.056,14.31725C94.904,14.801,92.84,15.28275,91.048,15.57175ZM85.624,14.239C85.88,14.688500000000001,86.136,15.2345,86.328,15.716000000000001L83.176,15.716000000000001L83.176,16.724L90.24799999999999,16.724L90.24799999999999,15.716000000000001L87.576,15.716000000000001C87.368,15.186250000000001,87.01599999999999,14.496,86.712,13.966000000000001L85.624,14.239ZM88.232,16.804000000000002C88.03999999999999,17.54,87.672,18.628,87.368,19.364L82.936,19.364L82.936,20.387999999999998L86.21600000000001,20.387999999999998L86.21600000000001,22.
  99. fill="#FFFFFF"
  100. fill-opacity="1"
  101. />
  102. </g>
  103. </g>
  104. </g>
  105. </svg>
  106. </div>
  107. </div>
  108. <DelPreModal v-if="delPreModalVisible" :hideDelModal="hideDelModal" />
  109. </div>
  110. </template>
  111. <script setup>
  112. import { ref, onMounted } from 'vue'
  113. import DelPreModal from 'cpns/dialogs/DelPreModal'
  114. import PreSetting from './PreSetting'
  115. import { getAllFormulaJSON } from '@/mock/command'
  116. import { useWebSocketStore, useFormulaStore } from '@/store'
  117. import { startFormulaJSON } from '@/mock/command'
  118. const webSocketStore = useWebSocketStore()
  119. const formulaStore = useFormulaStore()
  120. const delPreModalVisible = ref(false)
  121. const delModalShow = item => {
  122. formulaStore.updateCurrentFormula(item)
  123. delPreModalVisible.value = true
  124. }
  125. const hideDelModal = () => {
  126. delPreModalVisible.value = false
  127. }
  128. const isSettingVisible = ref(false)
  129. const showSetting = item => {
  130. formulaStore.updateCurrentFormula(item)
  131. isSettingVisible.value = true
  132. }
  133. const hideSettingModal = () => {
  134. isSettingVisible.value = false
  135. }
  136. // 执行配置
  137. const runConfig = item => {
  138. formulaStore.updateCurrentFormula(item)
  139. webSocketStore.sendCommandMsg(startFormulaJSON(item.id))
  140. console.log('run config', item)
  141. }
  142. const addNewPre = () => {
  143. // 添加新预设
  144. isSettingVisible.value = true
  145. }
  146. onMounted(() => {
  147. // webSocketStore.sendCommandMsg(getAllFormulaJSON)
  148. })
  149. </script>
  150. <style lang="scss" scoped>
  151. .formula_container {
  152. margin-bottom: 19px;
  153. height: 580px;
  154. box-sizing: border-box;
  155. border-radius: 16px;
  156. background: #fff;
  157. .header_wrap {
  158. display: flex;
  159. align-items: center;
  160. justify-content: space-between;
  161. height: 80.29px;
  162. background: #f6f6f6;
  163. border-radius: 16px 16px 0px 0px;
  164. padding: 0 130px;
  165. box-sizing: border-box;
  166. font-family: Source Han Sans CN;
  167. font-size: 18px;
  168. font-weight: normal;
  169. line-height: normal;
  170. letter-spacing: 0.07em;
  171. color: #999999;
  172. padding-right: 192px;
  173. }
  174. .content_wrap {
  175. height: 446px;
  176. overflow: scroll;
  177. box-sizing: border-box;
  178. .line {
  179. padding: 12px;
  180. padding-left: 40px;
  181. padding-right: 60px;
  182. font-family: Source Han Sans CN;
  183. font-size: 18px;
  184. font-weight: normal;
  185. line-height: normal;
  186. letter-spacing: 0.07em;
  187. color: #191919;
  188. display: flex;
  189. align-items: center;
  190. justify-content: space-between;
  191. border-bottom: 1px solid #f6f6f6;
  192. box-sizing: border-box;
  193. .username {
  194. width: 251px;
  195. overflow: hidden;
  196. white-space: nowrap;
  197. text-overflow: ellipsis;
  198. text-align: center;
  199. }
  200. .btns {
  201. display: flex;
  202. align-items: center;
  203. .btn {
  204. width: 87px;
  205. height: 45px;
  206. border-radius: 23px;
  207. background: #06518b;
  208. display: flex;
  209. align-items: center;
  210. justify-content: center;
  211. font-family: Source Han Sans CN;
  212. font-size: 20px;
  213. font-weight: normal;
  214. line-height: normal;
  215. letter-spacing: 0.1em;
  216. color: #ffffff;
  217. }
  218. .mg {
  219. margin: 0 20px;
  220. }
  221. }
  222. }
  223. }
  224. .layout {
  225. display: flex;
  226. align-items: center;
  227. justify-content: center;
  228. }
  229. .bottom_btn {
  230. display: flex;
  231. align-items: center;
  232. justify-content: flex-end;
  233. padding-right: 20px;
  234. }
  235. }
  236. </style>