emergencyEvacuationSubList.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <view id="emergencyEvacuationSubList">
  3. <view class="top-search-max-box">
  4. <view class="left-search-box">
  5. <uni-icons class="icon-view-left" type="search" size="20"></uni-icons>
  6. <input class="search-input" @confirm="searchButton()"
  7. v-model="getData.subName" maxlength="10" focus placeholder="搜索实验室/房间号">
  8. <uni-icons v-if="getData.subName" @click="clearButton()"
  9. type="clear" class="icon-view-right" size="20" color="#999999"></uni-icons>
  10. </view>
  11. <view class="right-search-button" @click="searchButton()">搜索</view>
  12. </view>
  13. <scroll-view scroll-y @scrolltolower="scrollGet" class="bottom-for-max-box">
  14. <view class="for-max-big-sub-box" v-for="(item,index) in dataList" :key="index">
  15. <view class="left-big-box">
  16. <view class="sub-name-box">
  17. {{item.subName}}{{item.roomName?'('+item.roomName+')':''}}
  18. </view>
  19. <view class="sub-type-box">
  20. <view v-if="item.levelName" class="level-p"
  21. :style="'border:1px solid '+item.levelColor+';color:'+item.levelColor+';'">{{item.levelName}}</view>
  22. <view v-if="item.typeName" class="type-p">{{item.typeName}}</view>
  23. <view v-if="item.moldName" class="type-p">{{item.moldName}}</view>
  24. <view v-if="item.subArea" class="type-p">{{item.subArea}}m²</view>
  25. </view>
  26. <view class="sub-address-box">
  27. <img src="@/pages_manage/images/icon_14.png">
  28. <view>
  29. {{item.deptName?item.deptName:''}}{{item.deptName&&item.buildName?'丨':''}}{{item.buildName?item.buildName:''}}{{item.buildName&&item.floorName?'-':''}}{{item.floorName?item.floorName:''}}
  30. </view>
  31. </view>
  32. </view>
  33. <view class="right-button" @click="goPage(item)">
  34. <view></view>
  35. <view>确认</view>
  36. <view></view>
  37. </view>
  38. </view>
  39. <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
  40. <view class="get-data-null-p" v-else="getDataType">- 滑动加载更多 -</view>
  41. </scroll-view>
  42. </view>
  43. </template>
  44. <script>
  45. import {
  46. laboratorySubRelInfoSelectAdminBySubPage,
  47. laboratoryBigViewGetFloorByBigView,
  48. } from '@/pages_manage/api/index.js'
  49. export default {
  50. data() {
  51. return {
  52. dataList: [],
  53. total: 0,
  54. getData: {
  55. page: 1,
  56. pageSize: 10,
  57. subName: '',
  58. },
  59. getDataType: false,
  60. }
  61. },
  62. created() {
  63. },
  64. mounted() {
  65. this.laboratorySubRelInfoSelectAdminBySubPage();
  66. },
  67. methods: {
  68. //跳转
  69. goPage(item) {
  70. if(!item.buildId){
  71. uni.showToast({
  72. title: '该实验室为绑定楼栋,请联系管理员.',
  73. icon: "none",
  74. mask: true,
  75. duration: 2000
  76. });
  77. return
  78. }else if(!item.floorId){
  79. uni.showToast({
  80. title: '该实验室为绑定楼层,请联系管理员.',
  81. icon: "none",
  82. mask: true,
  83. duration: 2000
  84. });
  85. return
  86. }else if(!item.subId){
  87. uni.showToast({
  88. title: '实验室数据异常,请联系管理员.',
  89. icon: "none",
  90. mask: true,
  91. duration: 2000
  92. });
  93. return
  94. }
  95. let obj = {
  96. type: 'skip',
  97. buildId: item.buildId,
  98. floorId: item.floorId,
  99. subId: item.subId,
  100. };
  101. this.laboratoryBigViewGetFloorByBigView(obj);
  102. },
  103. async laboratoryBigViewGetFloorByBigView(obj) {
  104. const {
  105. data
  106. } = await laboratoryBigViewGetFloorByBigView({
  107. id: obj.floorId
  108. })
  109. if (data.code == 200) {
  110. if(data.data[0]){
  111. if(data.data[0].buildLayoutVoList){
  112. if (data.data[0].buildLayoutVoList[0]) {
  113. uni.navigateTo({
  114. url: '/pages_manage/views/emergencyEvacuationBig?item=' + encodeURIComponent(JSON.stringify(obj))
  115. });
  116. }else{
  117. uni.showToast({
  118. title: '该实验室楼层未配置地图数据,请联系管理员.',
  119. icon: "none",
  120. mask: true,
  121. duration: 4000
  122. });
  123. }
  124. }else{
  125. uni.showToast({
  126. title: '该实验室楼层未配置地图数据,请联系管理员.',
  127. icon: "none",
  128. mask: true,
  129. duration: 4000
  130. });
  131. }
  132. }else{
  133. uni.showToast({
  134. title: '该实验室楼层未配置地图数据,请联系管理员.',
  135. icon: "none",
  136. mask: true,
  137. duration: 4000
  138. });
  139. }
  140. }
  141. },
  142. //搜索按钮
  143. clearButton(){
  144. this.$set(this, 'getDataType', false);
  145. this.$set(this, 'dataList', []);
  146. this.$set(this, 'total', 0);
  147. this.$set(this.getData, 'subName','');
  148. this.$set(this.getData, 'page', 1);
  149. this.laboratorySubRelInfoSelectAdminBySubPage();
  150. },
  151. //搜索按钮
  152. searchButton() {
  153. this.$set(this, 'getDataType', false);
  154. this.$set(this, 'dataList', []);
  155. this.$set(this, 'total', 0);
  156. this.$set(this.getData, 'page', 1);
  157. this.laboratorySubRelInfoSelectAdminBySubPage();
  158. },
  159. //滚动加载事件
  160. scrollGet() {
  161. let self = this;
  162. if (self.total / self.getData.pageSize <= self.getData.page) {
  163. this.$set(this, 'getDataType', true);
  164. } else {
  165. this.getData.page += 1;
  166. this.$nextTick(() => {
  167. this.laboratorySubRelInfoSelectAdminBySubPage();
  168. })
  169. }
  170. },
  171. //获取实验室
  172. async laboratorySubRelInfoSelectAdminBySubPage() {
  173. let self = this;
  174. const {
  175. data
  176. } = await laboratorySubRelInfoSelectAdminBySubPage(this.getData);
  177. if (data.code == 200) {
  178. if (self.getData.page == 1) {
  179. this.dataList = data.data.records;
  180. this.total = data.data.total;
  181. if (data.data.total / self.getData.pageSize <= self.getData.page) {
  182. this.$set(this, 'getDataType', true);
  183. }
  184. } else {
  185. this.dataList = [...this.dataList, ...data.data.records]
  186. this.total = data.data.total;
  187. if (data.data.total / self.getData.pageSize <= self.getData.page) {
  188. this.$set(this, 'getDataType', true);
  189. }
  190. }
  191. }
  192. },
  193. },
  194. }
  195. </script>
  196. <style lang="stylus" scoped>
  197. #emergencyEvacuationSubList {
  198. height: 100%;
  199. display flex;
  200. flex-direction column;
  201. overflow: hidden;
  202. .top-search-max-box {
  203. height: 130rpx;
  204. display: flex;
  205. background-color: #fff;
  206. margin-bottom: 20rpx;
  207. .left-search-box {
  208. display: flex;
  209. height: 78rpx;
  210. width: 590rpx;
  211. border: 1px solid #E0E0E0;
  212. border-radius: 50rpx;
  213. margin: 25rpx 9rpx 0 30rpx;
  214. .icon-view-left {
  215. margin: 18rpx 18rpx;
  216. }
  217. .search-input {
  218. width: 430rpx;
  219. height: 78rpx;
  220. line-height: 78rpx;
  221. }
  222. .icon-view-right{
  223. width:80rpx;
  224. height:80rpx;
  225. line-height:80rpx;
  226. text-align: center;
  227. }
  228. }
  229. .right-search-button {
  230. width: 110rpx;
  231. line-height: 100rpx;
  232. margin: 15rpx 0;
  233. color: #0183FA;
  234. text-align: center;
  235. }
  236. }
  237. .bottom-for-max-box {
  238. flex: 1;
  239. overflow-x: hidden;
  240. overflow-y: scroll;
  241. .for-max-big-sub-box {
  242. background-color: #fff;
  243. border-radius: 20rpx;
  244. margin: 0 30rpx 20rpx;
  245. overflow: hidden;
  246. display: flex;
  247. .left-big-box {
  248. flex: 1;
  249. overflow: hidden;
  250. word-wrap: break-word;
  251. /* 旧版本浏览器支持 */
  252. overflow-wrap: break-word;
  253. /* 标准属性 */
  254. padding: 20rpx 0 26rpx 37rpx;
  255. .sub-name-box {
  256. font-size: 30rpx;
  257. }
  258. .sub-type-box {
  259. margin: 17rpx 0 26rpx 0;
  260. view:nth-child(1) {
  261. margin-left: 0 !important;
  262. }
  263. view {
  264. font-size: 24rpx;
  265. text-align: center;
  266. display: inline-block;
  267. margin: 10rpx 0 0 10rpx;
  268. border-radius: 10rpx;
  269. padding: 0 15rpx;
  270. }
  271. .level-p {
  272. height: 38rpx;
  273. line-height: 38rpx;
  274. }
  275. .type-p {
  276. height: 40rpx;
  277. line-height: 38rpx;
  278. background-color: rgba(1, 131, 250, 0.2);
  279. color: #0183FA;
  280. }
  281. }
  282. .sub-address-box {
  283. display: flex;
  284. img {
  285. display: inline-block;
  286. height: 30rpx;
  287. width: 30rpx;
  288. margin: 4rpx 14rpx 0 0;
  289. }
  290. view {
  291. flex: 1;
  292. font-size: 28rpx;
  293. line-height: 39rpx;
  294. margin-right: 20rpx;
  295. }
  296. }
  297. }
  298. .right-button {
  299. width: 100rpx;
  300. display: flex;
  301. flex-direction: column;
  302. background-color: #CCE6FE;
  303. view:nth-child(1) {
  304. flex: 1;
  305. }
  306. view:nth-child(2) {
  307. font-size: 24rpx;
  308. color: #0183FA;
  309. text-align: center;
  310. }
  311. view:nth-child(3) {
  312. flex: 1;
  313. }
  314. }
  315. }
  316. .get-data-null-p {
  317. text-align: center;
  318. line-height: 100rpx;
  319. padding-bottom: 80px;
  320. color: #999;
  321. }
  322. }
  323. }
  324. </style>