situationPreview.vue 5.3 KB

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