OperationCard.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="operation">
  3. <view class="operation__header">{{ dourceData.name }}</view>
  4. <view class="operation__body">
  5. <view class="operation__body-content">
  6. <view class="operation__body-content--title">展开</view>
  7. <view class="operation__body-content--desc">
  8. <u-switch
  9. v-model="runStatus"
  10. active-color="#14A478"
  11. inactive-color="#C3CAD8"
  12. size="36"
  13. ></u-switch>
  14. </view>
  15. </view>
  16. <view class="operation__body-content">
  17. <view class="operation__body-content--title">收拢</view>
  18. <view class="operation__body-content--desc">
  19. <u-switch
  20. v-model="closeStatus"
  21. active-color="#14A478"
  22. inactive-color="#C3CAD8"
  23. size="36"
  24. ></u-switch>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. name: 'OperationCard',
  33. props: {
  34. dourceData: {
  35. type: Object,
  36. default: () => {},
  37. },
  38. },
  39. computed: {
  40. runStatus: {
  41. get() {
  42. // 展开
  43. return this.dourceData.down_status == '1';
  44. },
  45. set(val) {
  46. this.$emit('run-status', this.dourceData);
  47. },
  48. },
  49. closeStatus: {
  50. get() {
  51. // 收拢
  52. return this.dourceData.up_status == '1';
  53. },
  54. set(val) {
  55. this.$emit('close-status', this.dourceData);
  56. },
  57. },
  58. },
  59. data() {
  60. return {
  61. checked: true,
  62. checked1: false,
  63. };
  64. },
  65. methods: {},
  66. };
  67. </script>
  68. <style scoped lang="scss">
  69. .operation {
  70. justify-content: center;
  71. border-radius: 4px;
  72. background: #eff2fa;
  73. margin-bottom: 32rpx;
  74. &__header {
  75. height: 64rpx;
  76. line-height: 64rpx;
  77. color: #333333;
  78. font-family: 'Source Han Sans CN VF';
  79. font-size: 28rpx;
  80. font-weight: 500;
  81. border-bottom: 2rpx solid #e4e7ed;
  82. padding: 0 32rpx;
  83. }
  84. &__body {
  85. display: grid;
  86. grid-template-columns: repeat(2, 1fr);
  87. grid-gap: 24rpx;
  88. padding: 30rpx;
  89. &-content {
  90. height: 72rpx;
  91. background: #ffffff;
  92. border-radius: 16rpx;
  93. display: flex;
  94. align-items: center;
  95. justify-content: space-between;
  96. padding: 0 16rpx;
  97. }
  98. }
  99. }
  100. </style>