TheResultPanel.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <script setup>
  2. import { computed } from 'vue';
  3. import { NNumberAnimation } from 'naive-ui';
  4. import { SvgIcon } from '@/components';
  5. const isVisibleBtn = defineModel();
  6. const modelSystemStatus = defineModel('system');
  7. const emit = defineEmits(['on-click', 'on-update']);
  8. const props = defineProps({
  9. nums: {
  10. type: Object,
  11. default: () => ({})
  12. },
  13. minAndMaxNum: {
  14. type: Object,
  15. default: () => ({})
  16. }
  17. });
  18. const getTipsText = (name, updateNum, doseNum) => {
  19. const { minAddAmount, maxAddAmount } = props.minAndMaxNum;
  20. const { currentResultNum1, currentResultNum2 } = props.nums;
  21. const num = name === '北池' ? currentResultNum1 : currentResultNum2;
  22. if ( updateNum === doseNum ) {
  23. return `${name}设定后,系统加药量未发生变化`;
  24. }
  25. if ( updateNum >= maxAddAmount ) {
  26. return `${name}设定系统加药量计算值为${num}L/h,已达到最大值${maxAddAmount}L/h,按照最大值投放`;
  27. }
  28. if ( updateNum <= minAddAmount ) {
  29. return `${name}设定系统加药量计算值为${num}L/h,已达到最小值${minAddAmount}L/h,按照最小值投放`;
  30. }
  31. return `${name}有新投放方案,加药量计算为:${updateNum}L/h`
  32. }
  33. const noticeTextVal = computed(() => {
  34. const { updateNum1, doseNum1, updateNum2, doseNum2 } = props.nums;
  35. return {
  36. southVal: getTipsText('北池', updateNum1, doseNum1),
  37. northVal: getTipsText('南池', updateNum2, doseNum2)
  38. }
  39. })
  40. const emitEvent = (type) => {
  41. // emit('on-click', type);
  42. };
  43. const emitUpdate = async () => {
  44. emit('on-update');
  45. };
  46. </script>
  47. <template>
  48. <div class="result-card_view">
  49. <div class="update-message-box space-x-[30px]" v-show="isVisibleBtn">
  50. <ul class="update-message">
  51. <li class="flex items-center space-x-[4px]">
  52. <SvgIcon name="control-icon-warning" size="14"></SvgIcon>
  53. <span>{{ noticeTextVal.southVal }}</span>
  54. <!-- <span>北池加药量计算:{{ nums.updateNum1 || 0 }}L/h</span> -->
  55. </li>
  56. <li class="flex items-center space-x-[4px]">
  57. <SvgIcon name="control-icon-warning" size="14"></SvgIcon>
  58. <span>{{ noticeTextVal.northVal }}</span>
  59. <!-- <span>南池加药量计算:{{ nums.updateNum2 || 0}}L/h,是否更新?</span> -->
  60. </li>
  61. </ul>
  62. <div class="space-x-[10px]">
  63. <span class="text-[#ed742f] cursor-pointer" @click="emitUpdate">更新投放</span>
  64. <span class="text-[#88909b] cursor-pointer" @click="isVisibleBtn = false">取消</span>
  65. </div>
  66. </div>
  67. <div class="result-card">
  68. <div class="result-inner space-x-[8px]">
  69. <div class="result-card_item">
  70. <ul class="board-inner">
  71. <li class="board-item">
  72. <span class="label">北池</span>
  73. <h4>碳源投加瞬时流量(L/h)</h4>
  74. <span class="num">
  75. <NNumberAnimation :from="0" :to="nums.flowNum1" :duration="1000"
  76. :precision="3"></NNumberAnimation>
  77. </span>
  78. </li>
  79. <li class="line"></li>
  80. <li class="board-item">
  81. <h4>系统加药量(L/h)</h4>
  82. <span class="num">
  83. <NNumberAnimation :from="0" :to="nums.doseNum1" :duration="1000"
  84. :precision="3"></NNumberAnimation>
  85. </span>
  86. </li>
  87. </ul>
  88. <div class="btn-card">
  89. <div :class="['round-btn']" @click="emitEvent('one')">
  90. <div class="circle1" v-show="modelSystemStatus.activeOne === 1"></div>
  91. <div class="circle2" v-show="modelSystemStatus.activeOne === 1"></div>
  92. <div class="circle3" v-show="modelSystemStatus.activeOne === 1"></div>
  93. <div class="inner space-y-[4px]">
  94. <SvgIcon name="control-icon-result-btn" size="14" />
  95. <span>{{ modelSystemStatus.activeOne === 1 ? "系统投放" : "组态投放" }}</span>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="result-card_item">
  101. <ul class="board-inner">
  102. <li class="board-item">
  103. <span class="label">南池</span>
  104. <h4>碳源投加瞬时流量(L/h)</h4>
  105. <span class="num">
  106. <NNumberAnimation :from="0" :to="nums.flowNum2" :duration="1000"
  107. :precision="3"></NNumberAnimation>
  108. </span>
  109. </li>
  110. <li class="line"></li>
  111. <li class="board-item">
  112. <h4>系统加药量(L/h)</h4>
  113. <span class="num">
  114. <NNumberAnimation :from="0" :to="nums.doseNum2" :duration="1000"
  115. :precision="3"></NNumberAnimation>
  116. </span>
  117. </li>
  118. </ul>
  119. <div class="btn-card">
  120. <div :class="['round-btn']" @click="emitEvent('two')">
  121. <div class="circle1" v-show="modelSystemStatus.activeTwo === 1"></div>
  122. <div class="circle2" v-show="modelSystemStatus.activeTwo === 1"></div>
  123. <div class="circle3" v-show="modelSystemStatus.activeTwo === 1"></div>
  124. <div class="inner space-y-[4px]">
  125. <SvgIcon name="control-icon-result-btn" size="14" />
  126. <span>{{ modelSystemStatus.activeTwo === 1 ? "系统投放" : "组态投放" }}</span>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </template>
  135. <style lang="scss" scoped>
  136. .result-card_view {
  137. position: relative;
  138. padding: 0px 16px 24px 16px;
  139. .update-message-box {
  140. display: flex;
  141. align-items: center;
  142. justify-content: flex-start;
  143. padding: 0 10px;
  144. border-radius: 8px;
  145. border: 1px solid #FFE9CE;
  146. background: #FFF5E5;
  147. font-size: 12px;
  148. }
  149. .update-message {
  150. height: 100%;
  151. flex-shrink: 0;
  152. color: #7E604F;
  153. }
  154. .result-card {
  155. @include flex(x, center, between);
  156. padding: 16px 16px 16px 16px;
  157. // margin-top: -9px;
  158. border: 1px solid #fff;
  159. border-radius: 8px;
  160. background: url('@/assets/images/control/bg-control-top.png') center right no-repeat, linear-gradient(90deg, #E0E8FC 0%, #F2F4FF 100%);
  161. background-size: auto 100%, auto;
  162. background-position: 450px 10%, 100% 100%;
  163. .result-inner {
  164. width: 100%;
  165. width: 100%;
  166. border-radius: 8px;
  167. @include flex(x, center, start);
  168. .result-card_item {
  169. width: 50%;
  170. height: 124px;
  171. padding: 12px 0px 12px 24px;
  172. border-radius: inherit;
  173. background: #fff;
  174. background: linear-gradient(90deg, #FFF 50%, rgba(255, 255, 255, 0.50) 100%);
  175. // background: url("@/assets/images/control/bg-board-card.png") no-repeat;
  176. background-size: 100% 100%;
  177. backdrop-filter: blur(2px);
  178. overflow: hidden;
  179. .board-inner {
  180. display: flex;
  181. flex-flow: column;
  182. height: 100%;
  183. .board-item {
  184. position: relative;
  185. @include flex(y, start, between);
  186. height: 50%;
  187. .label {
  188. position: absolute;
  189. top: -12px;
  190. right: 0;
  191. width: 84px;
  192. height: 24px;
  193. border-bottom-left-radius: 10px;
  194. line-height: 24px;
  195. text-align: center;
  196. font-size: 12px;
  197. color: #fff;
  198. background: rgba(121, 105, 245, 1);
  199. }
  200. h4 {
  201. font-size: 12px;
  202. line-height: 20px;
  203. color: #5E5E5E;
  204. }
  205. }
  206. .line {
  207. flex-shrink: 0;
  208. height: 2px;
  209. margin-bottom: 2px;
  210. background: linear-gradient(90deg, #EEE 0%, rgba(238, 238, 238, 0.00) 100%);
  211. }
  212. }
  213. .num {
  214. color: #1A2029;
  215. font-family: D-DIN-PRO-700-Bold;
  216. font-size: 20px;
  217. font-weight: bold;
  218. }
  219. }
  220. }
  221. }
  222. .btn-card {
  223. position: absolute;
  224. bottom: 10px;
  225. right: 20px;
  226. }
  227. .round-btn {
  228. position: relative;
  229. @include flex(x, center, center);
  230. width: 70px;
  231. height: 70px;
  232. border: 2px solid #E6EFFE;
  233. border-radius: 50%;
  234. background: #898EFE;
  235. font-size: 10px;
  236. font-weight: bold;
  237. color: #fff;
  238. // cursor: pointer;
  239. transition: all 0.5s;
  240. .inner {
  241. position: relative;
  242. @include flex(x, center, center);
  243. flex-flow: column;
  244. width: 58px;
  245. height: 58px;
  246. border-radius: 100%;
  247. background: #2454FF;
  248. transition: all 0.3s;
  249. font-size: 10px;
  250. }
  251. }
  252. .disable {
  253. cursor: not-allowed;
  254. }
  255. .circle1,
  256. .circle2,
  257. .circle3 {
  258. position: absolute;
  259. width: 40px;
  260. height: 40px;
  261. background: rgba(137, 142, 254, 1);
  262. border: 1px solid rgba(137, 142, 254, 0.85);
  263. border-radius: 999px;
  264. }
  265. .circle1,
  266. .circle2,
  267. .circle3 {
  268. animation-name: circleChange;
  269. animation-duration: 3s;
  270. animation-iteration-count: infinite;
  271. animation-timing-function: linear;
  272. }
  273. .circle1 {
  274. animation-delay: 0.5s;
  275. }
  276. .circle2 {
  277. animation-delay: 1.5s;
  278. }
  279. .circle3 {
  280. animation-delay: 2.5s;
  281. }
  282. @keyframes circleChange {
  283. 0% {
  284. transform: scale(1.2);
  285. opacity: 0.95;
  286. }
  287. // 25% {
  288. // transform: scale(1.8);
  289. // opacity: 0.75;
  290. // }
  291. // 50% {
  292. // transform: scale(2);
  293. // opacity: 0.5;
  294. // }
  295. // 75% {
  296. // transform: scale(2.4);
  297. // opacity: 0.25;
  298. // }
  299. 100% {
  300. transform: scale(2.5);
  301. opacity: 0.05;
  302. }
  303. }
  304. }
  305. </style>