emergencyEvacuationSubList.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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="imagesUrl('commonality/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. adminId: item.adminId,
  101. };
  102. this.laboratoryBigViewGetFloorByBigView(obj);
  103. },
  104. async laboratoryBigViewGetFloorByBigView(obj) {
  105. const {
  106. data
  107. } = await laboratoryBigViewGetFloorByBigView({
  108. id: obj.floorId
  109. })
  110. if (data.code == 200) {
  111. if(data.data[0]){
  112. if(data.data[0].buildLayoutVoList){
  113. if (data.data[0].buildLayoutVoList[0]) {
  114. uni.navigateTo({
  115. url: '/pages_manage/views/emergencyEvacuationBig?item=' + encodeURIComponent(JSON.stringify(obj))
  116. });
  117. }else{
  118. uni.showToast({
  119. title: '该实验室楼层未配置地图数据,请联系管理员.',
  120. icon: "none",
  121. mask: true,
  122. duration: 4000
  123. });
  124. }
  125. }else{
  126. uni.showToast({
  127. title: '该实验室楼层未配置地图数据,请联系管理员.',
  128. icon: "none",
  129. mask: true,
  130. duration: 4000
  131. });
  132. }
  133. }else{
  134. uni.showToast({
  135. title: '该实验室楼层未配置地图数据,请联系管理员.',
  136. icon: "none",
  137. mask: true,
  138. duration: 4000
  139. });
  140. }
  141. }
  142. },
  143. //搜索按钮
  144. clearButton(){
  145. this.$set(this, 'getDataType', false);
  146. this.$set(this, 'dataList', []);
  147. this.$set(this, 'total', 0);
  148. this.$set(this.getData, 'subName','');
  149. this.$set(this.getData, 'page', 1);
  150. this.laboratorySubRelInfoSelectAdminBySubPage();
  151. },
  152. //搜索按钮
  153. searchButton() {
  154. this.$set(this, 'getDataType', false);
  155. this.$set(this, 'dataList', []);
  156. this.$set(this, 'total', 0);
  157. this.$set(this.getData, 'page', 1);
  158. this.laboratorySubRelInfoSelectAdminBySubPage();
  159. },
  160. //滚动加载事件
  161. scrollGet() {
  162. let self = this;
  163. if (self.total / self.getData.pageSize <= self.getData.page) {
  164. this.$set(this, 'getDataType', true);
  165. } else {
  166. this.getData.page += 1;
  167. this.$nextTick(() => {
  168. this.laboratorySubRelInfoSelectAdminBySubPage();
  169. })
  170. }
  171. },
  172. //获取实验室
  173. async laboratorySubRelInfoSelectAdminBySubPage() {
  174. let self = this;
  175. const {
  176. data
  177. } = await laboratorySubRelInfoSelectAdminBySubPage(this.getData);
  178. if (data.code == 200) {
  179. if (self.getData.page == 1) {
  180. this.dataList = data.data.records;
  181. this.total = data.data.total;
  182. if (data.data.total / self.getData.pageSize <= self.getData.page) {
  183. this.$set(this, 'getDataType', true);
  184. }
  185. } else {
  186. this.dataList = [...this.dataList, ...data.data.records]
  187. this.total = data.data.total;
  188. if (data.data.total / self.getData.pageSize <= self.getData.page) {
  189. this.$set(this, 'getDataType', true);
  190. }
  191. }
  192. }
  193. },
  194. },
  195. }
  196. </script>
  197. <style lang="stylus" scoped>
  198. #emergencyEvacuationSubList {
  199. height: 100%;
  200. display flex;
  201. flex-direction column;
  202. overflow: hidden;
  203. .top-search-max-box {
  204. height: 130rpx;
  205. display: flex;
  206. background-color: #fff;
  207. margin-bottom: 20rpx;
  208. .left-search-box {
  209. display: flex;
  210. height: 78rpx;
  211. width: 590rpx;
  212. border: 1px solid #E0E0E0;
  213. border-radius: 50rpx;
  214. margin: 25rpx 9rpx 0 30rpx;
  215. .icon-view-left {
  216. margin: 18rpx 18rpx;
  217. }
  218. .search-input {
  219. width: 430rpx;
  220. height: 78rpx;
  221. line-height: 78rpx;
  222. }
  223. .icon-view-right{
  224. width:80rpx;
  225. height:80rpx;
  226. line-height:80rpx;
  227. text-align: center;
  228. }
  229. }
  230. .right-search-button {
  231. width: 110rpx;
  232. line-height: 100rpx;
  233. margin: 15rpx 0;
  234. color: #0183FA;
  235. text-align: center;
  236. }
  237. }
  238. .bottom-for-max-box {
  239. flex: 1;
  240. overflow-x: hidden;
  241. overflow-y: scroll;
  242. .for-max-big-sub-box {
  243. background-color: #fff;
  244. border-radius: 20rpx;
  245. margin: 0 30rpx 20rpx;
  246. overflow: hidden;
  247. display: flex;
  248. .left-big-box {
  249. flex: 1;
  250. overflow: hidden;
  251. word-wrap: break-word;
  252. /* 旧版本浏览器支持 */
  253. overflow-wrap: break-word;
  254. /* 标准属性 */
  255. padding: 20rpx 0 26rpx 37rpx;
  256. .sub-name-box {
  257. font-size: 30rpx;
  258. }
  259. .sub-type-box {
  260. margin: 17rpx 0 26rpx 0;
  261. view:nth-child(1) {
  262. margin-left: 0 !important;
  263. }
  264. view {
  265. font-size: 24rpx;
  266. text-align: center;
  267. display: inline-block;
  268. margin: 10rpx 0 0 10rpx;
  269. border-radius: 10rpx;
  270. padding: 0 15rpx;
  271. }
  272. .level-p {
  273. height: 38rpx;
  274. line-height: 38rpx;
  275. }
  276. .type-p {
  277. height: 40rpx;
  278. line-height: 38rpx;
  279. background-color: rgba(1, 131, 250, 0.2);
  280. color: #0183FA;
  281. }
  282. }
  283. .sub-address-box {
  284. display: flex;
  285. img {
  286. display: inline-block;
  287. height: 30rpx;
  288. width: 30rpx;
  289. margin: 4rpx 14rpx 0 0;
  290. }
  291. view {
  292. flex: 1;
  293. font-size: 28rpx;
  294. line-height: 39rpx;
  295. margin-right: 20rpx;
  296. }
  297. }
  298. }
  299. .right-button {
  300. width: 100rpx;
  301. display: flex;
  302. flex-direction: column;
  303. background-color: #CCE6FE;
  304. view:nth-child(1) {
  305. flex: 1;
  306. }
  307. view:nth-child(2) {
  308. font-size: 24rpx;
  309. color: #0183FA;
  310. text-align: center;
  311. }
  312. view:nth-child(3) {
  313. flex: 1;
  314. }
  315. }
  316. }
  317. .get-data-null-p {
  318. text-align: center;
  319. line-height: 100rpx;
  320. padding-bottom: 80px;
  321. color: #999;
  322. }
  323. }
  324. }
  325. </style>