situationPreview.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="situation-preview">
  3. <view class="title">情境预览</view>
  4. <view class="box1">
  5. <view class="row1">
  6. <view class="top">
  7. <text>主题:{{theme.title}}</text>
  8. <view @click="goMapList">
  9. <text>查看查核地图</text>
  10. <image src="../../../static/icon-blueMore.png"></image>
  11. </view>
  12. </view>
  13. <view class="list">
  14. <text v-for="(item, index) in list" :key="index">{{item.name}}</text>
  15. </view>
  16. </view>
  17. <view class="row2">
  18. <view class="item">
  19. <text>查核组</text>
  20. <text>{{checkRent.checkedItem.name}}</text>
  21. </view>
  22. <view class="item">
  23. <text>组长</text>
  24. <text>{{checkRent.checkedItem.groupManagerName}}</text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="box2">
  29. <view>情景名称</view>
  30. <view class="input-wrap">
  31. <input maxlength="16"
  32. v-model="situationPreview.sitName"
  33. placeholder="限2~16个中文、英文或数字" />
  34. </view>
  35. </view>
  36. <view class="box2">
  37. <view>
  38. <text>计划开始前</text>
  39. <input v-model="situationPreview.preDay"
  40. placeholder="请输入"
  41. type="number" />
  42. <text>天的</text>
  43. <input v-model="situationPreview.preH"
  44. placeholder="请输入"
  45. type="number" />
  46. <text>时提醒</text>
  47. </view>
  48. <view>
  49. <text>启动</text>
  50. <input v-model="situationPreview.startDay"
  51. placeholder="请输入"
  52. type="number" />
  53. <text>天前提醒</text>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import { mapState } from "vuex";
  60. export default {
  61. computed: {
  62. ...mapState({
  63. theme: state => state.creatingSituations.theme,
  64. condition: state => state.creatingSituations.condition,
  65. checkRent: state => state.creatingSituations.checkRent,
  66. situationPreview: state => state.creatingSituations.situationPreview,
  67. }),
  68. list: function() {
  69. const { conditionIds, options } = this.condition;
  70. let list = [];
  71. this.loopOptions(options, conditionIds, list);
  72. return list;
  73. }
  74. },
  75. methods: {
  76. loopOptions: function(arr, conditionIds, list) {
  77. arr.map((item)=>{
  78. if(conditionIds.includes(item.id)) {
  79. list.push(item);
  80. }
  81. if(item.children.length > 0) {
  82. this.loopOptions(item.children, conditionIds, list);
  83. }
  84. });
  85. },
  86. goMapList: function() {
  87. uni.navigateTo({
  88. url: '/pages/checkMapList/checkMapList'
  89. });
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="less">
  95. .situation-preview {
  96. overflow: hidden;
  97. font-size: 22.5rpx;
  98. line-height: 33.75rpx;
  99. color: #292C33;
  100. .box1,
  101. .box2 {
  102. margin-bottom: 15rpx;
  103. padding: 25rpx;
  104. width: 100%;
  105. background-color: #fff;
  106. }
  107. .box1 {
  108. display: flex;
  109. flex-direction: column;
  110. .row1 {
  111. display: flex;
  112. flex-direction: column;
  113. margin-bottom: 35rpx;
  114. .top {
  115. display: flex;
  116. flex-direction: row;
  117. justify-content: space-between;
  118. margin-bottom: 6.25rpx;
  119. >text {
  120. font-size: 30rpx;
  121. line-height: 45rpx;
  122. }
  123. >view {
  124. display: flex;
  125. flex-direction: row;
  126. align-items: center;
  127. font-size: 20rpx;
  128. line-height: 30rpx;
  129. color: #3377FF;
  130. image {
  131. margin-left: 10rpx;
  132. width: 11.87rpx;
  133. height: 20rpx;
  134. }
  135. }
  136. }
  137. .list {
  138. overflow: hidden;
  139. display: flex;
  140. flex-direction: row;
  141. flex-wrap: wrap;
  142. align-items: center;
  143. >text {
  144. margin-top: 6.25rpx;
  145. margin-right: 15rpx;
  146. border-radius: 5rpx;
  147. padding: 2.5rpx 20.62rpx;
  148. font-size: 17.5rpx;
  149. line-height: 26.25rpx;
  150. color: #7A8499;
  151. background-color: #EBEFF7;
  152. }
  153. }
  154. }
  155. .row2 {
  156. display: flex;
  157. flex-direction: row;
  158. justify-content: center;
  159. align-items: center;
  160. .item {
  161. display: flex;
  162. flex-direction: column;
  163. width: 47.5%;
  164. text {
  165. overflow: hidden;
  166. white-space: nowrap;
  167. text-overflow: ellipsis;
  168. font-size: 25rpx;
  169. line-height: 37.5rpx;
  170. }
  171. text:first-child {
  172. margin-bottom: 4.37rpx;
  173. font-size: 17.5rpx;
  174. line-height: 26.25rpx;
  175. color: #666F80;
  176. }
  177. &:first-child {
  178. margin-right: 5%;
  179. border-right: 1px solid #DADEE6;
  180. }
  181. }
  182. }
  183. }
  184. .box2 {
  185. padding: 0;
  186. padding-left: 25rpx;
  187. >view {
  188. display: flex;
  189. flex-direction: row;
  190. align-items: center;
  191. border-bottom: 1px solid #DADEE6;
  192. height: 87.5rpx;
  193. color: #525866;
  194. >text {
  195. white-space: nowrap;
  196. color: #292C33;
  197. }
  198. >input {
  199. padding: 0 9.37rpx;
  200. width: 80rpx;
  201. height: 33.75rpx;
  202. font-size: 22.5rpx;
  203. line-height: 33.75rpx;
  204. text-align: center;
  205. }
  206. &:last-child {
  207. border-bottom: 0;
  208. }
  209. &.input-wrap {
  210. >input {
  211. padding: 0;
  212. padding-right: 25rpx;
  213. width: 100%;
  214. text-align: left;
  215. }
  216. }
  217. }
  218. }
  219. }
  220. </style>