situationPreview.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="situation-preview">
  3. <uni-popup ref="popup" type="bottom" :maskClick="true" @change="onMaskChange">
  4. <tm-radio-group :list="situationTypeList" :defaultValue='situationPreview.situationType' :setting="{
  5. value: 'situationType',
  6. name: 'situationTypeName'
  7. }" :openkeys="[0]" @change="situationTypeChanged" />
  8. </uni-popup>
  9. <view class="title">情境预览</view>
  10. <view class="box1">
  11. <view class="row1">
  12. <view class="top">
  13. <text>主题:{{theme.title}}</text>
  14. <view @click="goMapList">
  15. <text>查看查核地图</text>
  16. <image src="../../../static/icon-blueMore.png"></image>
  17. </view>
  18. </view>
  19. <view class="list">
  20. <text v-for="(item, index) in list" :key="index">{{item.name}}</text>
  21. </view>
  22. </view>
  23. <view class="row2">
  24. <view class="item">
  25. <text>查核组</text>
  26. <text>{{checkRent.checkedItem.name}}</text>
  27. </view>
  28. <view class="item">
  29. <text>组长</text>
  30. <text>{{checkRent.checkedItem.groupManagerName}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="box2">
  35. <view class="situationType" @click="selectSituationType">
  36. <text>情境类型</text>
  37. <text class="typeValue">{{situationTypeName}}</text>
  38. <image class="arrowRight" src="../../../static/incon-more.png" mode=""></image>
  39. </view>
  40. <view class="input-wrap">
  41. <view>情境名称</view>
  42. <input maxlength="16"
  43. v-model="situationPreview.sitName"
  44. placeholder="限2~16个中文、英文或数字" />
  45. </view>
  46. <view class="input-wrap">
  47. <view>情境描述</view>
  48. <textarea maxlength="300"
  49. rows=""
  50. v-model="situationPreview.description"
  51. placeholder="限300字" />
  52. </view>
  53. </view>
  54. <view class="box2">
  55. <view>
  56. <text>计划开始前</text>
  57. <input v-model="situationPreview.preDay"
  58. placeholder="请输入"
  59. type="number" />
  60. <text>天的</text>
  61. <input v-model="situationPreview.preH"
  62. placeholder="请输入"
  63. type="number" />
  64. <text>时提醒</text>
  65. </view>
  66. <view>
  67. <text>启动</text>
  68. <input v-model="situationPreview.startDay"
  69. placeholder="请输入"
  70. type="number" />
  71. <text>天前提醒</text>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import { mapState,mapMutations } from "vuex";
  78. export default {
  79. computed: {
  80. ...mapState({
  81. theme: state => state.creatingSituations.theme,
  82. condition: state => state.creatingSituations.condition,
  83. checkRent: state => state.creatingSituations.checkRent,
  84. situationPreview: state => state.creatingSituations.situationPreview,
  85. situationTypeList:state => state.creatingSituations.situationTypeList
  86. }),
  87. situationTypeName(){
  88. const temp = this.situationTypeList.filter(item=>item.situationType == this.situationPreview.situationType);
  89. return temp[0].situationTypeName;
  90. },
  91. list: function() {
  92. const { conditionIds, options } = this.condition;
  93. let list = [];
  94. this.loopOptions(options, conditionIds, list);
  95. return list;
  96. }
  97. },
  98. methods: {
  99. ...mapMutations(['comChangeState']),
  100. situationTypeChanged(type,name){
  101. console.log({type,name});
  102. this.$store.commit('creatingSituations/comChangeState',{key:'situationPreview',data:{...this.situationPreview,situationType:type}});
  103. },
  104. selectSituationType(){
  105. this.$refs.popup.open();
  106. },
  107. onMaskChange(){
  108. },
  109. loopOptions: function(arr, conditionIds, list) {
  110. arr.map((item)=>{
  111. if(conditionIds.includes(item.id)) {
  112. list.push(item);
  113. }
  114. if(item.children.length > 0) {
  115. this.loopOptions(item.children, conditionIds, list);
  116. }
  117. });
  118. },
  119. goMapList: function() {
  120. uni.navigateTo({
  121. url: '/pages/checkMapList/checkMapList'
  122. });
  123. }
  124. }
  125. }
  126. </script>
  127. <style lang="less">
  128. .situation-preview {
  129. overflow: hidden;
  130. font-size: 22.5rpx;
  131. line-height: 33.75rpx;
  132. color: #292C33;
  133. .box1,
  134. .box2 {
  135. margin-bottom: 15rpx;
  136. padding: 25rpx;
  137. width: 100%;
  138. background-color: #fff;
  139. }
  140. .box1 {
  141. display: flex;
  142. flex-direction: column;
  143. .row1 {
  144. display: flex;
  145. flex-direction: column;
  146. margin-bottom: 35rpx;
  147. .top {
  148. display: flex;
  149. flex-direction: row;
  150. justify-content: space-between;
  151. margin-bottom: 6.25rpx;
  152. >text {
  153. font-size: 30rpx;
  154. line-height: 45rpx;
  155. }
  156. >view {
  157. display: flex;
  158. flex-direction: row;
  159. align-items: center;
  160. font-size: 20rpx;
  161. line-height: 30rpx;
  162. color: #3377FF;
  163. image {
  164. margin-left: 10rpx;
  165. width: 11.87rpx;
  166. height: 20rpx;
  167. }
  168. }
  169. }
  170. .list {
  171. overflow: hidden;
  172. display: flex;
  173. flex-direction: row;
  174. flex-wrap: wrap;
  175. align-items: center;
  176. >text {
  177. margin-top: 6.25rpx;
  178. margin-right: 15rpx;
  179. border-radius: 5rpx;
  180. padding: 2.5rpx 20.62rpx;
  181. font-size: 17.5rpx;
  182. line-height: 26.25rpx;
  183. color: #7A8499;
  184. background-color: #EBEFF7;
  185. }
  186. }
  187. }
  188. .row2 {
  189. display: flex;
  190. flex-direction: row;
  191. justify-content: center;
  192. align-items: center;
  193. .item {
  194. display: flex;
  195. flex-direction: column;
  196. width: 47.5%;
  197. text {
  198. overflow: hidden;
  199. white-space: nowrap;
  200. text-overflow: ellipsis;
  201. font-size: 25rpx;
  202. line-height: 37.5rpx;
  203. }
  204. text:first-child {
  205. margin-bottom: 4.37rpx;
  206. font-size: 17.5rpx;
  207. line-height: 26.25rpx;
  208. color: #666F80;
  209. }
  210. &:first-child {
  211. margin-right: 5%;
  212. border-right: 1px solid #DADEE6;
  213. }
  214. }
  215. }
  216. }
  217. .box2 {
  218. padding: 0;
  219. padding-left: 25rpx;
  220. >view {
  221. display: flex;
  222. flex-direction: row;
  223. align-items: center;
  224. border-bottom: 1px solid #DADEE6;
  225. height: 87.5rpx;
  226. color: #525866;
  227. >text {
  228. white-space: nowrap;
  229. color: #292C33;
  230. }
  231. >input {
  232. padding: 0 9.37rpx;
  233. width: 80rpx;
  234. height: 33.75rpx;
  235. font-size: 22.5rpx;
  236. line-height: 33.75rpx;
  237. text-align: center;
  238. }
  239. &:last-child {
  240. border-bottom: 0;
  241. }
  242. &.input-wrap {
  243. display: flex;
  244. flex-direction: row;
  245. &:last-child {
  246. align-items: flex-start;
  247. padding: 20rpx 0;
  248. height: 200rpx;
  249. }
  250. view {
  251. margin-right: 40rpx;
  252. white-space: nowrap;
  253. }
  254. input, textarea {
  255. padding: 0;
  256. padding-right: 25rpx;
  257. width: 100%;
  258. font-size: 22.5rpx;
  259. line-height: 33.75rpx;
  260. text-align: left;
  261. }
  262. textarea {
  263. height: 100%;
  264. }
  265. }
  266. }
  267. .situationType {
  268. position: relative;
  269. .typeValue {
  270. display: inline-block;
  271. margin-left: 40rpx;
  272. }
  273. .arrowRight {
  274. position: absolute;
  275. right:20rpx;
  276. width: 15rpx;
  277. height: 25rpx;
  278. }
  279. }
  280. }
  281. }
  282. </style>