浏览代码

拉取代码

maotao 2 周之前
父节点
当前提交
de2ef90df8

+ 2 - 2
manifest.json

@@ -123,9 +123,9 @@
123 123
             "disableHostCheck" : true,
124 124
             "proxy" : {
125 125
                 "/service" : {
126
-                    "target" : "http://192.168.3.108", //请求的目标域名
126
+                    // "target" : "http://192.168.3.108", //请求的目标域名
127 127
 
128
-                    // "target" : "http://192.168.4.163", //宋程玉本地
128
+                    "target" : "http://192.168.4.163", //宋程玉本地
129 129
                     "changeOrigin" : true, //是否跨域
130 130
                     "secure" : false
131 131
                 }

+ 9 - 1
pages.json

@@ -720,7 +720,15 @@
720 720
           "titleNView": false
721 721
         }
722 722
       }
723
-    }
723
+    },
724
+		{
725
+		  "path": "pages/searchFloor/searchFloor",
726
+		  "style": {
727
+		    "h5": {
728
+		      "titleNView": false
729
+		    }
730
+		  }
731
+		}
724 732
   ],
725 733
   "globalStyle": {
726 734
     "navigationBarTextStyle": "black",

+ 34 - 5
pages/mypage/mypage.vue

@@ -3,7 +3,12 @@
3 3
     <view class="myTop">
4 4
 			<view class="topText">
5 5
 			  <view class="topTextHeader">
6
-			    <view class="text">您好,{{ userData.name }}</view>
6
+			    <view class="text">
7
+						<view>
8
+							您好,{{ userData.name }}
9
+						</view>
10
+						<view>{{userData.currentHospital.hosName}}</view>
11
+						</view>
7 12
 			  <!--  <button v-show="!userData.online" class="changeHospital" size="mini" type="default" @click="changeHospital">
8 13
 			      切换院区
9 14
 			    </button> -->
@@ -83,7 +88,13 @@
83 88
         </view>
84 89
       </view>
85 90
     </view>
86
-		<view class="page_item_btn" hover-class="seimin-btn-hover" @click="GoWork()">{{userData.online ? '我要下班':'我要上班'}}</view>
91
+		<view v-if="!userData.online" class="df-fl">
92
+			<view class="page_item_btn width-50" hover-class="seimin-btn-hover" @click="changeHospital">切换院区</view>
93
+			<view class="page_item_btn width-50" hover-class="seimin-btn-hover" @click="GoWork()">继续工作</view>
94
+		</view>
95
+		<view v-if="userData.online">
96
+			<view class="page_item_btn width-100" hover-class="seimin-btn-hover" @click="GoWork()">我要下班</view>
97
+		</view>
87 98
     <!-- 弹窗 -->
88 99
     <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
89 100
       @ok="ok" @cancel="cancel" :operate="models.operate"></showModel>
@@ -171,6 +182,9 @@
171 182
             userData.user.currentHospital = result.user.user.currentHospital;
172 183
             uni.setStorageSync("userData", userData);
173 184
             this.tab("day", "今日");
185
+						setTimeout(_=>{
186
+							this.userData = uni.getStorageSync("userData").user;
187
+						})
174 188
           } else {
175 189
             uni.showToast({
176 190
               icon: "none",
@@ -527,6 +541,7 @@
527 541
   .mypage {
528 542
 		padding: 20rpx;
529 543
 		background: #F0F6ED;
544
+		position: relative;
530 545
     .charts {
531 546
       width: 625upx;
532 547
       height: 500upx;
@@ -574,6 +589,8 @@
574 589
       .topText {
575 590
         .topTextHeader {
576 591
 					.text{
592
+						display: flex;
593
+						justify-content: space-between;
577 594
 						font-size: 30rpx;
578 595
 						font-weight: bold;
579 596
 					}
@@ -617,6 +634,10 @@
617 634
       }
618 635
 
619 636
       .myCont_cont {
637
+				height: calc(100vh - 410rpx);
638
+				overflow-y: auto;
639
+				overflow-x: hidden;
640
+				margin-bottom: 20rpx;
620 641
         .myCont_cont_tab {
621 642
           height: 90rpx;
622 643
           line-height: 90rpx;
@@ -684,9 +705,6 @@
684 705
         .TB_list {
685 706
           width: 100%;
686 707
           text-align: left;
687
-					height: calc(100vh - 700rpx);
688
-					overflow-y: auto;
689
-					margin-bottom: 20rpx;
690 708
           view {
691 709
             height: 84rpx;
692 710
             line-height: 84rpx;
@@ -709,7 +727,12 @@
709 727
         }
710 728
       }
711 729
     }
730
+		.df-fl{
731
+			display: flex;
732
+			justify-content: space-between;
733
+		}
712 734
 		.page_item_btn {
735
+			// position: fixed;
713 736
 		  height: 88rpx;
714 737
 		  background-image: linear-gradient(to right, #72c172, #3bb197);
715 738
 		  border-radius: 8rpx;
@@ -719,5 +742,11 @@
719 742
 		  font-weight: 700;
720 743
 		  text-align: center;
721 744
 		}
745
+		.width-50{
746
+			width: 48%;
747
+		}
748
+		.width-100{
749
+			width: 100%;
750
+		}
722 751
   }
723 752
 </style>

+ 87 - 4
pages/newDrug/detail.vue

@@ -10,19 +10,19 @@
10 10
 
11 11
     <view class="Scanning_cont">
12 12
       <view class="column head">
13
-				<view class="value2" v-if="queryObj.showPatientInfo==1">患者信息</view>
13
+				<!-- <view class="value2" v-if="queryObj.showPatientInfo==1">患者信息</view> -->
14 14
         <view class="value1">药品名称+规格<text class="red">({{drugsList.length}})</text></view>
15 15
         <view class="value2">数量</view>
16 16
       </view>
17 17
       <scroll-view scroll-y class="scrollContent">
18 18
         <view class="column" v-for="item in drugsList" :key="item.id">
19
-					<view class="value2" v-if="queryObj.showPatientInfo==1">
19
+					<!-- <view class="value2" v-if="queryObj.showPatientInfo==1">
20 20
 					  <view>
21 21
 							{{item.patientName }}<text v-if="item.bedNum">({{item.bedNum}})</text>
22 22
 							<view>{{item.residenceNo ? item.residenceNo : ''}}</view>
23 23
 						</view>
24
-					</view>
25
-          <view class="value1">{{item.drugsInfo}} {{item.model}}</view>
24
+					</view> -->
25
+          <view class="value1" @click="viewName(item)">{{item.drugsInfo}} {{item.model}}</view>
26 26
           <view class="value2">{{item.drugsNum}}</view>
27 27
         </view>
28 28
       </scroll-view>
@@ -33,6 +33,22 @@
33 33
         <view class="btn" @click="goBack()">返回</view>
34 34
       </view>
35 35
     </view>
36
+		
37
+		<!-- 查看患者 -->
38
+		<view class="showModel" v-if="infoModel">
39
+			<view class="showModel__wrap">
40
+				<view class="showModel__header">
41
+				  患者信息
42
+				</view>
43
+				<view class="content">
44
+					<view>{{itemData.patientNames}}</view>
45
+				</view>
46
+				<view class="bottom">
47
+					<button class="bottom-btn confirm-btn" @click="infoModel = false">知道了</button>
48
+				</view>
49
+			</view>
50
+		</view>
51
+		
36 52
   </view>
37 53
 </template>
38 54
 <script>
@@ -50,9 +66,19 @@
50 66
         queryObj: {}, //路由传递过来的数据
51 67
         drugsBag: {}, //药包信息
52 68
         config: {}, //配置
69
+				infoModel:false,
70
+				itemData:{}
53 71
       };
54 72
     },
55 73
     methods: {
74
+			// 查看患者
75
+			viewName(item){
76
+				console.log(222,this.queryObj)
77
+				if(this.queryObj.showPatientInfo==1){
78
+					this.itemData = item
79
+					this.infoModel = true
80
+				}
81
+			},
56 82
       // 返回
57 83
       goBack(){
58 84
         uni.navigateBack()
@@ -225,4 +251,61 @@
225 251
       }
226 252
     }
227 253
   }
254
+	
255
+	.showModel {
256
+	  position: fixed;
257
+	  left: 0;
258
+	  right: 0;
259
+	  top: 0;
260
+	  bottom: 0;
261
+	  background-color: rgba(0, 0, 0, 0.2);
262
+	  z-index: 99;
263
+	
264
+	  .showModel__wrap {
265
+	    width: 90%;
266
+	    position: absolute;
267
+	    left: 50%;
268
+	    top: 50%;
269
+	    transform: translate(-50%, -50%);
270
+	    background-color: #fff;
271
+	    border-radius: 12rpx;
272
+	
273
+	    .showModel__header {
274
+	      font-size: 36rpx;
275
+	      color: #000;
276
+				font-weight: bold;
277
+	      height: 84rpx;
278
+	      display: flex;
279
+	      justify-content: center;
280
+	      align-items: center;
281
+	    }
282
+			.content{
283
+				background: #fff;
284
+				text-align: center;
285
+				padding: 20rpx 0;
286
+			}
287
+			.bottom{
288
+				border-top: 1px solid #ccc;
289
+				display: flex;
290
+				uni-button{
291
+					background: #fff !important;
292
+				}
293
+				uni-button:after{
294
+					border: none !important;
295
+				}
296
+				.bottom-btn{
297
+					color: #A8A8A8;
298
+					font-size: 30rpx;
299
+					padding: 10rpx 0;
300
+					width: 100%;
301
+					display: flex;
302
+					align-items: center;
303
+					justify-content: center;
304
+				}
305
+				.confirm-btn{
306
+					color: #5DAC6B;
307
+				}
308
+			}
309
+	  }
310
+	}
228 311
 </style>

+ 2 - 3
pages/newDrug/list.vue

@@ -9,8 +9,7 @@
9 9
           </view>
10 10
           <view class="body">
11 11
             <view class="bodyColumn" v-if="queryObj.showPatientInfo==1">
12
-              <view class="name">姓名(床号):{{item.patientName ? item.patientName : ''}} <text v-if="item.bedNum">({{item.bedNum}})</text></view>
13
-              <view class="value">住院号:{{item.residenceNo ? item.residenceNo : ''}}</view>
12
+              <view class="name">姓名:{{item.patientNames ? item.patientNames : ''}}</view>
14 13
             </view>
15 14
 						<view class="bodyColumn">
16 15
 						  <view class="name">种类数:{{item.drugsTypeCount}}</view>
@@ -55,7 +54,7 @@
55 54
       // 详情
56 55
       toDetail(drugsBagId){
57 56
         uni.navigateTo({
58
-          url: `/pages/newDrug/detail?drugsBagType=${this.queryObj.drugsBagType}&drugsBagId=${drugsBagId}`,
57
+          url: `/pages/newDrug/detail?drugsBagType=${this.queryObj.drugsBagType}&drugsBagId=${drugsBagId}&showPatientInfo=${this.queryObj.showPatientInfo}`,
59 58
         });
60 59
       },
61 60
       //获取页面信息

+ 37 - 32
pages/receiptpage/receiptpage.vue

@@ -50,7 +50,7 @@
50 50
                   </image>
51 51
                   {{ item.emergencyType.name }}</text>
52 52
                 </view>
53
-                <view class="page_item_top_R type" :style="{color: item.taskTypeConfig.renderColors?item.taskTypeConfig.renderColors:'#333'}" style="margin-left: 16rpx;">
53
+                <view class="page_item_top_R type" :style="{color: item.taskType?item.taskType.renderColors:'#333'}" style="margin-left: 16rpx;">
54 54
                   {{ item.taskType.taskName }}<template v-if="item.goodsRemark">-{{item.goodsRemark}}</template>
55 55
                 </view>
56 56
                 <!-- <text class="L_time" v-if="item.overdueTime">{{ item.overdueTime }}前送达</text> -->
@@ -667,7 +667,8 @@
667 667
 				  idx: 0,
668 668
 				  sum: 9999,
669 669
 					taskType:{
670
-						hosIds:this.hosId
670
+						hosIds:this.hosId,
671
+						simpleQuery: true
671 672
 					}
672 673
 				};
673 674
 				
@@ -676,7 +677,6 @@
676 677
 							this.taskTypeList = res.list
677 678
 							console.log(444,this.taskTypeList)
678 679
 				    }
679
-						this.initList();
680 680
 				  });
681 681
 			},
682 682
 			confirmKey(data){
@@ -2699,24 +2699,21 @@
2699 2699
           if (res.status == 200) {
2700 2700
             this.triggered = false;
2701 2701
             this.freshing = true;
2702
-            this.totalNum = res.data.resultCount;
2703
-            res.data.data = res.data.data || [];
2704
-            res.data.data.forEach(v => {
2705
-							// for(let i of this.taskTypeList){
2706
-							// 	if(i.associationType.id == v.taskType.associationType.id){
2707
-							// 		v.colorStyle = i.renderColors
2708
-							// 	}
2709
-							// }
2710
-							v.taskTypeConfig = this.taskTypeList.find(i=>i.associationType.id == v.taskType.associationType.id)
2711
-							v.clinicalTaskIdsFlag = this.clinicalTaskIds.includes(v.taskType.id.toString());
2712
-            })
2713
-            if (idx === 0) {
2714
-              this.zxzData = res.data.data;
2715
-            } else {
2716
-              this.zxzData.push(...res.data.data);
2717
-            }
2718
-						console.log(4444,res.data.data)
2719
-            this.tabs[1].num = res.data.resultCount;
2702
+						if(res.data){
2703
+							this.totalNum = res.data.resultCount;
2704
+							res.data.data = res.data.data || [];
2705
+							res.data.data.forEach(v => {
2706
+								v.taskTypeConfig = this.taskTypeList.find(i=>i.id == v.taskType.id)
2707
+								v.clinicalTaskIdsFlag = this.clinicalTaskIds.includes(v.taskType.id.toString());
2708
+							})
2709
+							if (idx === 0) {
2710
+							  this.zxzData = res.data.data;
2711
+							} else {
2712
+							  this.zxzData.push(...res.data.data);
2713
+							}
2714
+							console.log(4444,res.data.data)
2715
+							this.tabs[1].num = res.data.resultCount;
2716
+						}
2720 2717
           } else {
2721 2718
             uni.showToast({
2722 2719
               icon: "none",
@@ -2761,13 +2758,20 @@
2761 2758
           if (res.status == 200) {
2762 2759
             this.triggered = false;
2763 2760
             this.freshing = true;
2764
-            this.totalNum = res.data.resultCount;
2765
-            if (idx === 0) {
2766
-              this.zxzData = res.data.data;
2767
-            } else {
2768
-              this.zxzData.push(...res.data.data);
2769
-            }
2770
-            this.tabs[0].num = res.data.resultCount;
2761
+						if(res.data){
2762
+							this.totalNum = res.data.resultCount;
2763
+							res.data.data.forEach(v => {
2764
+								v.taskTypeConfig = this.taskTypeList.find(i=>i.id == v.taskType.id)
2765
+								v.clinicalTaskIdsFlag = this.clinicalTaskIds.includes(v.taskType.id.toString());
2766
+							})
2767
+							if (idx === 0) {
2768
+							  this.zxzData = res.data.data;
2769
+							} else {
2770
+							  this.zxzData.push(...res.data.data);
2771
+							}
2772
+							this.tabs[0].num = res.data.resultCount;
2773
+						}
2774
+						
2771 2775
           } else {
2772 2776
             uni.showToast({
2773 2777
               icon: "none",
@@ -2832,7 +2836,7 @@
2832 2836
         }
2833 2837
         post("/workerOrder/executingOrders", data).then((res) => {
2834 2838
           if (res.status == 200) {
2835
-            this.tabs[1].num = res.data.resultCount;
2839
+            this.tabs[1].num = res.data ? res.data.resultCount : 0;
2836 2840
           } else {
2837 2841
             uni.showToast({
2838 2842
               icon: "none",
@@ -2849,7 +2853,7 @@
2849 2853
         };
2850 2854
         post("/workerOrder/waitingOrders", data).then((res) => {
2851 2855
           if (res.status == 200) {
2852
-            this.tabs[0].num = res.data.resultCount;
2856
+            this.tabs[0].num = res.data ? res.data.resultCount : 0;
2853 2857
           } else {
2854 2858
             uni.showToast({
2855 2859
               icon: "none",
@@ -2957,7 +2961,8 @@
2957 2961
       // });
2958 2962
       // #endif
2959 2963
       this.selectedLabelSlots = "执行中";
2960
-			this.getTaskType();
2964
+			// this.getTaskType();
2965
+			this.initList();
2961 2966
       this.getConfig();
2962 2967
       // 科室二维码切换科室回显
2963 2968
       if (options.showDepartmentQrcodeId && options.showDepartmentQrcodeDept) {
@@ -3387,7 +3392,7 @@
3387 3392
 
3388 3393
                 &.type {
3389 3394
                   margin-right: 32rpx;
3390
-                  color: red;
3395
+                  // color: red;
3391 3396
                   max-width: 260rpx;
3392 3397
                   white-space: nowrap;
3393 3398
                   text-overflow: ellipsis;

+ 459 - 0
pages/searchFloor/searchFloor.vue

@@ -0,0 +1,459 @@
1
+<template>
2
+  <view class="content">
3
+		<view class="df-fl">
4
+			<view class="df-all">
5
+				<checkbox-group @change="allCheckChange">
6
+					<checkbox value="all" color="#42b983" :checked="allCheck"/>
7
+					<text class="text">全选</text>
8
+				</checkbox-group>
9
+			</view>
10
+			<view class="title">{{name}}</view>
11
+		</view>
12
+    <view class="search-keyword">
13
+      <scroll-view class="keyword-list-box" scroll-y>
14
+				<checkbox-group @change="checkboxChange">
15
+					<view v-for="(row, index) in dataList" :key="index" class="view-box">
16
+							<checkbox class="top-check1" color="#42b983" :value="row.floor.id + 'parent'" :checked="row.checked" />
17
+							<uni-collapse ref="collapse" v-model="row.floor.collapseValue">
18
+								<uni-collapse-item :title="row.floor.floorName + '楼'">
19
+									<view v-for="(item, index) in row.children" :key="item.id">
20
+										<view class="keyword-entry">
21
+											<view class="keyword-text">
22
+												<checkbox class="top-check2" color="#42b983" :value="item.id" :checked="item.checked" />
23
+												<view class="title-2">{{item.dept}}</view>
24
+											</view>
25
+										</view>
26
+									</view>
27
+								</uni-collapse-item>
28
+							</uni-collapse>
29
+					</view>
30
+				</checkbox-group>
31
+      </scroll-view>
32
+    </view>
33
+    <view class="toolbar">
34
+      <view class="back" @click="back()">返回</view>
35
+			<view class="confirm" @click="confirm()">确定</view>
36
+    </view>
37
+    <!-- 弹窗 -->
38
+    <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content" @know="know" :operate="models.operate"></showModel>
39
+  </view>
40
+</template>
41
+
42
+<script>
43
+  import {
44
+    post,
45
+    webHandle
46
+  } from "../../http/http.js";
47
+  export default {
48
+    data() {
49
+      return {
50
+        type: "", //进入该页面的类型
51
+        configName: "", //快速组合名称
52
+        id: "", //快速组合id
53
+				name:"",
54
+        changedept: 0, //是否从列表过来的切换负责科室
55
+        hosId: "",
56
+        dataList: [],
57
+        //系统设置的科室类型
58
+        sysDeptType: 0,
59
+        quickCombinationDeptType: 0,
60
+        // 弹窗model
61
+        models: {
62
+          disjunctor: false,
63
+        },
64
+				valueColl:false,
65
+				allCheck:false,
66
+				buildIds:[],
67
+				ids:[]
68
+      };
69
+    },
70
+    onLoad(options) {
71
+      this.hosId = uni.getStorageSync("userData").user.currentHospital.id;
72
+      console.log(options, 'options');
73
+			this.name = options.name
74
+			this.id = options.id;
75
+			this.configName = options.configName;
76
+			this.changedept = options.changedept;
77
+      this.getBuildings();
78
+      // #ifdef APP-PLUS
79
+      webHandle("no", "app");
80
+      // #endif
81
+      // #ifdef H5
82
+      webHandle("no", "wx");
83
+      // #endif
84
+    },
85
+		onShow(){
86
+			this.getBuildings();
87
+		},
88
+    methods: {
89
+			// 全选
90
+			allCheckChange(e){
91
+				if(e.detail.value.length>0){
92
+					this.dataList.forEach((item, index)=>{
93
+						item.checked = true
94
+						if(item.children && item.children.length>0){
95
+							for(let i of item.children){
96
+								i.checked = true
97
+								this.buildIds.push(i)
98
+							}
99
+						}
100
+					})
101
+				}else{
102
+					this.dataList.forEach((item, index)=>{
103
+						item.checked = false
104
+						if(item.children && item.children.length>0){
105
+							for(let i of item.children){
106
+								i.checked = false
107
+								this.buildIds = []
108
+							}
109
+						}
110
+					})
111
+				}
112
+				// this.buildIds = this.buildIds.filter(v => v.indexOf('parent')==-1);
113
+				console.log(888,this.buildIds)
114
+			},
115
+      //知道了
116
+      know() {
117
+        this.models.disjunctor = false;
118
+      },
119
+			back(){
120
+				uni.navigateBack({
121
+					delta: 1,
122
+				})
123
+			},
124
+      // 确认
125
+      confirm() {
126
+        // const dataList = this.buildIds.filter(v => v.indexOf('parent')==-1);
127
+        console.log(3333,this.buildIds);
128
+				if (this.buildIds.length === 0) {
129
+          this.models = {
130
+            disjunctor: true,
131
+            title: "提示",
132
+            content: "请选择至少一个楼层",
133
+            icon: "warn",
134
+            operate: {
135
+              know: "知道了",
136
+            },
137
+          };
138
+        } else {
139
+					uni.setStorageSync("setDepts", this.buildIds)
140
+          uni.navigateTo({
141
+            url: `../setDept/setDept?configName=${this.configName}&id=${this.id}&changedept=${this.changedept}`,
142
+          });
143
+        }
144
+      },
145
+			// 选择楼栋
146
+			itemClick(item){
147
+				console.log(3333,item)
148
+			},
149
+			changeColl(){
150
+				
151
+			},
152
+      // 选择楼栋
153
+      checkboxChange: function(e) {
154
+				// this.buildIds = e.detail.value
155
+				this.buildIds = []
156
+				// for (let i of dataList){
157
+				// 	for(let item of i.children){
158
+				// 		for(let x of e.detail.value){
159
+				// 			if(x == item.id){
160
+				// 				this.buildIds.push(i)
161
+				// 			}else{
162
+								
163
+				// 			}
164
+				// 		}
165
+				// 	}
166
+				// }
167
+				
168
+				if(e.detail.value.length>0){
169
+					this.dataList.forEach((item, index)=>{
170
+						if(item.children && item.children.length>0){
171
+							for(let i of item.children){
172
+								if(e.detail.value.includes(i.id)){
173
+									this.buildIds.push(i)
174
+								}
175
+							}
176
+						}
177
+					})
178
+				}
179
+				console.log(888,this.buildIds)
180
+     //    var dataList = this.dataList,
181
+     //        values = e.detail.value;
182
+     //    for (let i of dataList) {
183
+					// for(let item of i.children){
184
+					// 	if (values.includes(item.id)) {
185
+					// 	  this.$set(item, 'checked', true)
186
+					// 	} else {
187
+					// 	  this.$set(item, 'checked', false)
188
+					// 	}
189
+					// }
190
+     //    }
191
+      },
192
+      //获取楼栋列表
193
+      getBuildings() {
194
+				let data = uni.getStorageSync("floorList")
195
+				data.forEach((item, index)=>{
196
+					item.floor.collapseValue = []
197
+					item.floor.id = item.floor.id.toString()
198
+					item.floor.checked = false
199
+					if(item.children && item.children.length>0){
200
+						for(let i of item.children){
201
+							i.checked = false
202
+							i.id = i.id.toString()
203
+						}
204
+					}
205
+       })
206
+			 console.log(3232131,data)
207
+       this.dataList = data || [];
208
+      }
209
+    },
210
+  };
211
+</script>
212
+<style>
213
+	uni-checkbox-group{
214
+	/* 	display: flex;
215
+		align-items: center;
216
+		position: relative; */
217
+	}
218
+	/deep/ .uni-collapse-item__title-box{
219
+		margin-left: 50rpx
220
+	}
221
+</style>
222
+<style scoped lang="less">
223
+  view {
224
+    display: block;
225
+  }
226
+	.df-fl{
227
+		display: flex;
228
+		align-items: center;
229
+		justify-content: center;
230
+		position: relative;
231
+	}
232
+	.df-all{
233
+		position: absolute;
234
+		left: 16rpx;
235
+		.text{
236
+			margin-left: 8rpx;
237
+		}
238
+	}
239
+	.view-box{
240
+		position: relative;
241
+	}
242
+	.top-check1{
243
+		position: absolute;
244
+		left: 0;
245
+		top: 20rpx;
246
+		z-index: 999;
247
+	}
248
+	.top-check2{
249
+		position: absolute;
250
+		left: 0;
251
+		top: 20rpx;
252
+		z-index: 999;
253
+	}
254
+	.title{
255
+		padding: 30rpx;
256
+		font-size: 32rpx;
257
+		text-align: center;
258
+		font-weight: bold;
259
+	}
260
+  // 底部
261
+  .toolbar {
262
+    position: fixed;
263
+    left: 0;
264
+    right: 0;
265
+    bottom: 30rpx;
266
+		width: 96%;
267
+		margin-left: 2%;
268
+    z-index: 9999;
269
+    height: 88rpx;
270
+    display: flex;
271
+    justify-content: space-between;
272
+    align-items: center;
273
+    box-sizing: border-box;
274
+		color: #fff;
275
+		
276
+		.back{
277
+			width: 48%;
278
+			height: 88rpx;
279
+			display: flex;
280
+			justify-content: center;
281
+			align-items: center;
282
+			box-sizing: border-box;
283
+			border-radius: 10rpx;
284
+			background-color: #8F939C;
285
+		}
286
+		.confirm{
287
+			width: 46%;
288
+			height: 88rpx;
289
+			display: flex;
290
+			justify-content: center;
291
+			align-items: center;
292
+			box-sizing: border-box;
293
+			border-radius: 10rpx;
294
+			background-color: #49B856;
295
+		}
296
+  }
297
+
298
+  .search-box {
299
+    width: 95%;
300
+    background-color: rgb(242, 242, 242);
301
+    padding: 15upx 2.5%;
302
+    display: flex;
303
+    justify-content: space-between;
304
+    position: sticky;
305
+    top: 0;
306
+  }
307
+
308
+  .search-box .mSearch-input-box {
309
+    width: 100%;
310
+  }
311
+
312
+  .search-box .input-box {
313
+    width: 85%;
314
+    flex-shrink: 1;
315
+    display: flex;
316
+    justify-content: center;
317
+    align-items: center;
318
+  }
319
+
320
+  .search-box .search-btn {
321
+    width: 15%;
322
+    margin: 0 0 0 2%;
323
+    display: flex;
324
+    justify-content: flex-start;
325
+    align-items: center;
326
+    flex-shrink: 0;
327
+    font-size: 28upx;
328
+    color: #fff;
329
+    background: linear-gradient(to right, #ff9801, #ff570a);
330
+    border-radius: 60upx;
331
+  }
332
+
333
+  .search-box .input-box>input {
334
+    width: 100%;
335
+    height: 60upx;
336
+    font-size: 32upx;
337
+    border: 0;
338
+    border-radius: 60upx;
339
+    -webkit-appearance: none;
340
+    -moz-appearance: none;
341
+    appearance: none;
342
+    padding: 0 3%;
343
+    margin: 0;
344
+    background-color: #ffffff;
345
+  }
346
+
347
+  .placeholder-class {
348
+    color: #9e9e9e;
349
+  }
350
+
351
+  .search-keyword {
352
+    width: 100%;
353
+    background-color: rgb(242, 242, 242);
354
+  }
355
+
356
+  .keyword-list-box {
357
+    height: calc(100vh - 230rpx);
358
+    padding-top: 10upx;
359
+		// padding: 0 20rpx;
360
+    border-radius: 20upx 20upx 0 0;
361
+    background-color: #fff;
362
+		width: 96%;
363
+		padding-left: 2%;
364
+  }
365
+
366
+  .keyword-entry-tap {
367
+    background-color: #eee;
368
+  }
369
+
370
+  .keyword-entry {
371
+    width: 94%;
372
+    height: 80rpx;
373
+    margin: 0 3%;
374
+    font-size: 30rpx;
375
+    color: #333;
376
+    display: flex;
377
+    justify-content: start;
378
+    align-items: center;
379
+    border-bottom: solid 1rpx #DEDEDE;
380
+  }
381
+
382
+  .keyword-entry image {
383
+    width: 60upx;
384
+    height: 60upx;
385
+  }
386
+
387
+  .keyword-entry .keyword-text,
388
+  .keyword-entry .keyword-img {
389
+    height: 80upx;
390
+    display: flex;
391
+    align-items: center;
392
+		position: relative;
393
+  }
394
+	
395
+	.title-2{
396
+		padding-left: 76rpx;
397
+	}
398
+	
399
+  .keyword-entry .keyword-text {
400
+    // width: 90%;
401
+  }
402
+
403
+  .keyword-entry .keyword-img {
404
+    width: 10%;
405
+    justify-content: center;
406
+  }
407
+
408
+  .keyword-box {
409
+    height: calc(100vh - 110upx);
410
+    border-radius: 20upx 20upx 0 0;
411
+    background-color: #fff;
412
+  }
413
+
414
+  .keyword-box .keyword-block {
415
+    padding: 10upx 0;
416
+  }
417
+
418
+  .keyword-box .keyword-block .keyword-list-header {
419
+    width: 94%;
420
+    padding: 10upx 3%;
421
+    font-size: 27upx;
422
+    color: #333;
423
+    display: flex;
424
+    justify-content: space-between;
425
+  }
426
+
427
+  .keyword-box .keyword-block .keyword-list-header image {
428
+    width: 40upx;
429
+    height: 40upx;
430
+  }
431
+
432
+  .keyword-box .keyword-block .keyword {
433
+    width: 94%;
434
+    padding: 3px 3%;
435
+    display: flex;
436
+    flex-flow: wrap;
437
+    justify-content: flex-start;
438
+  }
439
+
440
+  .keyword-box .keyword-block .hide-hot-tis {
441
+    display: flex;
442
+    justify-content: center;
443
+    font-size: 28upx;
444
+    color: #6b6b6b;
445
+  }
446
+
447
+  .keyword-box .keyword-block .keyword>view {
448
+    display: flex;
449
+    justify-content: center;
450
+    align-items: center;
451
+    border-radius: 60upx;
452
+    padding: 0 20upx;
453
+    margin: 10upx 20upx 10upx 0;
454
+    height: 60upx;
455
+    font-size: 28upx;
456
+    background-color: rgb(242, 242, 242);
457
+    color: #6b6b6b;
458
+  }
459
+</style>

+ 138 - 81
pages/searchMuti/searchMuti.vue

@@ -1,8 +1,9 @@
1 1
 <template>
2 2
   <view class="content">
3
+		<view class="title">请选择楼栋</view>
3 4
     <view class="search-keyword">
4 5
       <scroll-view class="keyword-list-box" scroll-y>
5
-        <checkbox-group @change="checkboxChange">
6
+        <!-- <checkbox-group @change="checkboxChange">
6 7
           <label v-for="(row, index) in dataList" :key="row.id">
7 8
             <view class="keyword-entry" hover-class="keyword-entry-tap">
8 9
               <view class="keyword-text">
@@ -14,11 +15,18 @@
14 15
               </view>
15 16
             </view>
16 17
           </label>
17
-        </checkbox-group>
18
+        </checkbox-group> -->
19
+				<label v-for="(row, index) in dataList" :key="row.id" @click="itemClick(row)">
20
+				  <view class="keyword-entry" hover-class="keyword-entry-tap">
21
+				    <view class="keyword-text">
22
+				      {{row.buildingName}}
23
+				    </view>
24
+				  </view>
25
+				</label>
18 26
       </scroll-view>
19 27
     </view>
20 28
     <view class="toolbar" @click="determine()" hover-class="seimin-btn-hover">
21
-      <text class="toolbar-sao">确定</text>
29
+      返回
22 30
     </view>
23 31
     <!-- 弹窗 -->
24 32
     <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content" @know="know" :operate="models.operate"></showModel>
@@ -103,72 +111,118 @@
103 111
       },
104 112
       // 确认
105 113
       determine() {
106
-        console.log(this.dataList);
107
-        const dataList = this.dataList.filter(v => v.checked);
108
-        if (dataList.length === 0) {
109
-          this.models = {
110
-            disjunctor: true,
111
-            title: "提示",
112
-            content: "请选择至少一个楼栋",
113
-            icon: "warn",
114
-            operate: {
115
-              know: "知道了",
116
-            },
117
-          };
118
-        } else {
119
-          let postData = {
120
-            "idx": 0,
121
-            "sum": 9999,
122
-            department: {
123
-              buildIds: dataList.map(v => v.id).toString()
124
-            }
125
-          }
114
+				uni.navigateBack({
115
+					delta: 1,
116
+				})
117
+				return
118
+       //  console.log(this.dataList);
119
+       //  const dataList = this.dataList.filter(v => v.checked);
120
+       //  if (dataList.length === 0) {
121
+       //    this.models = {
122
+       //      disjunctor: true,
123
+       //      title: "提示",
124
+       //      content: "请选择至少一个楼栋",
125
+       //      icon: "warn",
126
+       //      operate: {
127
+       //        know: "知道了",
128
+       //      },
129
+       //    };
130
+       //  } else {
131
+       //    let postData = {
132
+       //      "idx": 0,
133
+       //      "sum": 9999,
134
+       //      department: {
135
+       //        buildIds: dataList.map(v => v.id).toString(),
136
+							// groupByFloor: true
137
+       //      }
138
+       //    }
126 139
           
127
-          if(this.quickCombinationDeptType){
128
-            postData.department.deptTypeIds = this.quickCombinationDeptType;
129
-          } else if (this.sysDeptType === 0) {
130
-            return;
131
-          } else {
132
-            postData.department.type = {
133
-              id: this.sysDeptType
134
-            }
135
-          }
140
+       //    if(this.quickCombinationDeptType){
141
+       //      postData.department.deptTypeIds = this.quickCombinationDeptType;
142
+       //    } else if (this.sysDeptType === 0) {
143
+       //      return;
144
+       //    } else {
145
+       //      postData.department.type = {
146
+       //        id: this.sysDeptType
147
+       //      }
148
+       //    }
136 149
           
137
-          uni.showLoading({
138
-            title: "加载中",
139
-          });
140
-          post("/data/fetchDataList/department", postData).then((res) => {
141
-            uni.hideLoading();
142
-            if (res.status == 200) {
143
-              let obj = uni.getStorageSync("setDepts");
144
-              console.log(res.list,obj)
145
-              if (obj) {
146
-                let list = [...res.list, ...obj];
147
-                let newArr = [];
148
-                let obj1 = {};
149
-                for (let i = 0; i < list.length; i++) {
150
-                  if (!obj1[list[i].id]) {
151
-                    newArr.push(list[i]);
152
-                    obj1[list[i].id] = true;
153
-                  }
154
-                }
155
-                console.log(newArr);
156
-                uni.setStorageSync("setDepts", newArr);
157
-              } else {
158
-                uni.setStorageSync("setDepts", res.list);
159
-              }
160
-              uni.navigateTo({
161
-                url: `../setDept/setDept?configName=${this.configName}&id=${this.id}&changedept=${this.changedept}`,//不知道
162
-              });
163
-            } else {
164
-              uni.showToast({
165
-                icon: "none",
166
-                title: res.msg || "接口获取数据失败!",
167
-              });
168
-            }
169
-          })
170
-        }
150
+       //    uni.showLoading({
151
+       //      title: "加载中",
152
+       //    });
153
+       //    post("/data/fetchDataList/department", postData).then((res) => {
154
+       //      uni.hideLoading();
155
+       //      if (res.status == 200) {
156
+       //        let obj = uni.getStorageSync("setDepts");
157
+       //        console.log(res.otherData,obj)
158
+       //        if (obj) {
159
+       //          let list = [...res.otherData, ...obj];
160
+       //          let newArr = [];
161
+       //          let obj1 = {};
162
+       //          for (let i = 0; i < list.length; i++) {
163
+       //            if (!obj1[list[i].id]) {
164
+       //              newArr.push(list[i]);
165
+       //              obj1[list[i].id] = true;
166
+       //            }
167
+       //          }
168
+       //          console.log(newArr);
169
+       //          uni.setStorageSync("setDepts", newArr);
170
+       //        } else {
171
+       //          uni.setStorageSync("setDepts", res.otherData);
172
+       //        }
173
+       //        uni.navigateTo({
174
+       //          url: `../setDept/setDept?configName=${this.configName}&id=${this.id}&changedept=${this.changedept}`,//不知道
175
+       //        });
176
+       //      } else {
177
+       //        uni.showToast({
178
+       //          icon: "none",
179
+       //          title: res.msg || "接口获取数据失败!",
180
+       //        });
181
+       //      }
182
+       //    })
183
+       //  }
171 184
       },
185
+			// 选择楼栋
186
+			itemClick(item){
187
+				console.log(3333,item)
188
+				let postData = {
189
+				  "idx": 0,
190
+				  "sum": 9999,
191
+				  department: {
192
+				    buildIds: item.id,
193
+						groupByFloor: true
194
+				  }
195
+				}
196
+				
197
+				if(this.quickCombinationDeptType){
198
+				  postData.department.deptTypeIds = this.quickCombinationDeptType;
199
+				} else if (this.sysDeptType === 0) {
200
+				  return;
201
+				} else {
202
+				  postData.department.type = {
203
+				    id: this.sysDeptType
204
+				  }
205
+				}
206
+				
207
+				uni.showLoading({
208
+				  title: "加载中",
209
+				});
210
+				post("/data/fetchDataList/department", postData).then((res) => {
211
+				  uni.hideLoading();
212
+				  if (res.status == 200) {
213
+						console.log(2222,res.list)
214
+				    uni.setStorageSync("floorList", res.list)
215
+						uni.navigateTo({
216
+						  url: `../searchFloor/searchFloor?name=${item.buildingName}&configName=${this.configName}&id=${this.id}&changedept=${this.changedept}`
217
+						});
218
+				  } else {
219
+				    uni.showToast({
220
+				      icon: "none",
221
+				      title: res.msg || "接口获取数据失败!",
222
+				    });
223
+				  }
224
+				})
225
+			},
172 226
       // 选择楼栋
173 227
       checkboxChange: function(e) {
174 228
         var dataList = this.dataList,
@@ -234,26 +288,29 @@
234 288
   view {
235 289
     display: block;
236 290
   }
291
+	.title{
292
+		padding: 30rpx;
293
+		font-size: 32rpx;
294
+		text-align: center;
295
+		font-weight: bold;
296
+	}
237 297
   // 底部
238 298
   .toolbar {
239 299
     position: fixed;
240 300
     left: 0;
241 301
     right: 0;
242
-    bottom: 0;
302
+    bottom: 30rpx;
303
+		width: 96%;
304
+		margin-left: 2%;
243 305
     z-index: 9999;
244 306
     height: 88rpx;
245 307
     display: flex;
246 308
     justify-content: center;
247 309
     align-items: center;
248 310
     box-sizing: border-box;
249
-    border-radius: 4rpx;
250
-    box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.24);
251
-    background-color: #e5e9ed;
252
-  
253
-    .toolbar-sao {
254
-      font-size: 36rpx;
255
-      color: #49b856;
256
-    }
311
+    border-radius: 10rpx;
312
+    background-color: #8F939C;
313
+		color: #fff;
257 314
   }
258 315
 
259 316
   .search-box {
@@ -315,7 +372,7 @@
315 372
   }
316 373
 
317 374
   .keyword-list-box {
318
-    height: calc(100vh - 110upx);
375
+    height: calc(100vh - 230rpx);
319 376
     padding-top: 10upx;
320 377
     border-radius: 20upx 20upx 0 0;
321 378
     background-color: #fff;
@@ -327,14 +384,14 @@
327 384
 
328 385
   .keyword-entry {
329 386
     width: 94%;
330
-    height: 80upx;
387
+    height: 80rpx;
331 388
     margin: 0 3%;
332
-    font-size: 30upx;
389
+    font-size: 30rpx;
333 390
     color: #333;
334 391
     display: flex;
335
-    justify-content: space-between;
392
+    justify-content: center;
336 393
     align-items: center;
337
-    border-bottom: solid 1upx #e7e7e7;
394
+    border-bottom: solid 1rpx #DEDEDE;
338 395
   }
339 396
 
340 397
   .keyword-entry image {
@@ -350,7 +407,7 @@
350 407
   }
351 408
 
352 409
   .keyword-entry .keyword-text {
353
-    width: 90%;
410
+    // width: 90%;
354 411
   }
355 412
 
356 413
   .keyword-entry .keyword-img {

+ 38 - 0
uni_modules/uni-collapse/changelog.md

@@ -0,0 +1,38 @@
1
+## 1.4.4(2024-03-20)
2
+- 修复 titleBorder类型修正
3
+## 1.4.3(2022-01-25)
4
+- 修复 初始化的时候 ,open 属性失效的bug
5
+## 1.4.2(2022-01-21)
6
+- 修复 微信小程序resize后组件收起的bug
7
+## 1.4.1(2021-11-22)
8
+- 修复 vue3中个别scss变量无法找到的问题
9
+## 1.4.0(2021-11-19)
10
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
11
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-collapse](https://uniapp.dcloud.io/component/uniui/uni-collapse)
12
+## 1.3.3(2021-08-17)
13
+- 优化 show-arrow 属性默认为true
14
+## 1.3.2(2021-08-17)
15
+- 新增 show-arrow 属性,控制是否显示右侧箭头
16
+## 1.3.1(2021-07-30)
17
+- 优化 vue3下小程序事件警告的问题
18
+## 1.3.0(2021-07-30)
19
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
20
+## 1.2.2(2021-07-21)
21
+- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug
22
+## 1.2.1(2021-07-21)
23
+- 优化 组件示例
24
+## 1.2.0(2021-07-21)
25
+- 新增 组件折叠动画
26
+- 新增 value\v-model 属性 ,动态修改面板折叠状态
27
+- 新增 title 插槽 ,可定义面板标题
28
+- 新增 border 属性 ,显示隐藏面板内容分隔线
29
+- 新增 title-border 属性 ,显示隐藏面板标题分隔线
30
+- 修复 resize 方法失效的Bug
31
+- 修复 change 事件返回参数不正确的Bug
32
+- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法
33
+## 1.1.7(2021-05-12)
34
+- 新增 组件示例地址
35
+## 1.1.6(2021-02-05)
36
+- 优化 组件引用关系,通过uni_modules引用组件
37
+## 1.1.5(2021-02-05)
38
+- 调整为uni_modules目录规范

+ 402 - 0
uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue

@@ -0,0 +1,402 @@
1
+<template>
2
+	<view class="uni-collapse-item">
3
+		<!-- onClick(!isOpen) -->
4
+		<view @click="onClick(!isOpen)" class="uni-collapse-item__title"
5
+			:class="{'is-open':isOpen &&titleBorder === 'auto' ,'uni-collapse-item-border':titleBorder !== 'none'}">
6
+			<view class="uni-collapse-item__title-wrap">
7
+				<slot name="title">
8
+					<view class="uni-collapse-item__title-box" :class="{'is-disabled':disabled}">
9
+						<image v-if="thumb" :src="thumb" class="uni-collapse-item__title-img" />
10
+						<text class="uni-collapse-item__title-text">{{ title }}</text>
11
+					</view>
12
+				</slot>
13
+			</view>
14
+			<view v-if="showArrow"
15
+				:class="{ 'uni-collapse-item__title-arrow-active': isOpen, 'uni-collapse-item--animation': showAnimation === true }"
16
+				class="uni-collapse-item__title-arrow">
17
+				<uni-icons :color="disabled?'#ddd':'#bbb'" size="14" type="bottom" />
18
+			</view>
19
+		</view>
20
+		<view class="uni-collapse-item__wrap" :class="{'is--transition':showAnimation}"
21
+			:style="{height: (isOpen?height:0) +'px'}">
22
+			<view :id="elId" ref="collapse--hook" class="uni-collapse-item__wrap-content"
23
+				:class="{open:isheight,'uni-collapse-item--border':border&&isOpen}">
24
+				<slot></slot>
25
+			</view>
26
+		</view>
27
+
28
+	</view>
29
+</template>
30
+
31
+<script>
32
+	// #ifdef APP-NVUE
33
+	const dom = weex.requireModule('dom')
34
+	// #endif
35
+	/**
36
+	 * CollapseItem 折叠面板子组件
37
+	 * @description 折叠面板子组件
38
+	 * @property {String} title 标题文字
39
+	 * @property {String} thumb 标题左侧缩略图
40
+	 * @property {String} name 唯一标志符
41
+	 * @property {Boolean} open = [true|false] 是否展开组件
42
+	 * @property {Boolean} titleBorder = [true|false] 是否显示标题分隔线
43
+	 * @property {String} border = ['auto'|'show'|'none'] 是否显示分隔线
44
+	 * @property {Boolean} disabled = [true|false] 是否展开面板
45
+	 * @property {Boolean} showAnimation = [true|false] 开启动画
46
+	 * @property {Boolean} showArrow = [true|false] 是否显示右侧箭头
47
+	 */
48
+	export default {
49
+		name: 'uniCollapseItem',
50
+		props: {
51
+			// 列表标题
52
+			title: {
53
+				type: String,
54
+				default: ''
55
+			},
56
+			name: {
57
+				type: [Number, String],
58
+				default: ''
59
+			},
60
+			// 是否禁用
61
+			disabled: {
62
+				type: Boolean,
63
+				default: false
64
+			},
65
+			// #ifdef APP-PLUS
66
+			// 是否显示动画,app 端默认不开启动画,卡顿严重
67
+			showAnimation: {
68
+				type: Boolean,
69
+				default: false
70
+			},
71
+			// #endif
72
+			// #ifndef APP-PLUS
73
+			// 是否显示动画
74
+			showAnimation: {
75
+				type: Boolean,
76
+				default: true
77
+			},
78
+			// #endif
79
+			// 是否展开
80
+			open: {
81
+				type: Boolean,
82
+				default: false
83
+			},
84
+			// 缩略图
85
+			thumb: {
86
+				type: String,
87
+				default: ''
88
+			},
89
+			// 标题分隔线显示类型
90
+			titleBorder: {
91
+				type: String,
92
+				default: 'auto'
93
+			},
94
+			border: {
95
+				type: Boolean,
96
+				default: true
97
+			},
98
+			showArrow: {
99
+				type: Boolean,
100
+				default: true
101
+			}
102
+		},
103
+		data() {
104
+			// TODO 随机生生元素ID,解决百度小程序获取同一个元素位置信息的bug
105
+			const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
106
+			return {
107
+				isOpen: false,
108
+				isheight: null,
109
+				height: 0,
110
+				elId,
111
+				nameSync: 0
112
+			}
113
+		},
114
+		watch: {
115
+			open(val) {
116
+				this.isOpen = val
117
+				this.onClick(val, 'init')
118
+			}
119
+		},
120
+		updated(e) {
121
+			this.$nextTick(() => {
122
+				this.init(true)
123
+			})
124
+		},
125
+		created() {
126
+			this.collapse = this.getCollapse()
127
+			this.oldHeight = 0
128
+			this.onClick(this.open, 'init')
129
+		},
130
+		// #ifndef VUE3
131
+		// TODO vue2
132
+		destroyed() {
133
+			if (this.__isUnmounted) return
134
+			this.uninstall()
135
+		},
136
+		// #endif
137
+		// #ifdef VUE3
138
+		// TODO vue3
139
+		unmounted() {
140
+			this.__isUnmounted = true
141
+			this.uninstall()
142
+		},
143
+		// #endif
144
+		mounted() {
145
+			if (!this.collapse) return
146
+			if (this.name !== '') {
147
+				this.nameSync = this.name
148
+			} else {
149
+				this.nameSync = this.collapse.childrens.length + ''
150
+			}
151
+			if (this.collapse.names.indexOf(this.nameSync) === -1) {
152
+				this.collapse.names.push(this.nameSync)
153
+			} else {
154
+				console.warn(`name 值 ${this.nameSync} 重复`);
155
+			}
156
+			if (this.collapse.childrens.indexOf(this) === -1) {
157
+				this.collapse.childrens.push(this)
158
+			}
159
+			this.init()
160
+		},
161
+		methods: {
162
+			init(type) {
163
+				// #ifndef APP-NVUE
164
+				this.getCollapseHeight(type)
165
+				// #endif
166
+				// #ifdef APP-NVUE
167
+				this.getNvueHwight(type)
168
+				// #endif
169
+			},
170
+			uninstall() {
171
+				if (this.collapse) {
172
+					this.collapse.childrens.forEach((item, index) => {
173
+						if (item === this) {
174
+							this.collapse.childrens.splice(index, 1)
175
+						}
176
+					})
177
+					this.collapse.names.forEach((item, index) => {
178
+						if (item === this.nameSync) {
179
+							this.collapse.names.splice(index, 1)
180
+						}
181
+					})
182
+				}
183
+			},
184
+			onClick(isOpen, type) {
185
+				if (this.disabled) return
186
+				this.isOpen = isOpen
187
+				if (this.isOpen && this.collapse) {
188
+					this.collapse.setAccordion(this)
189
+				}
190
+				if (type !== 'init') {
191
+					this.collapse.onChange(isOpen, this)
192
+				}
193
+			},
194
+			getCollapseHeight(type, index = 0) {
195
+				const views = uni.createSelectorQuery().in(this)
196
+				views
197
+					.select(`#${this.elId}`)
198
+					.fields({
199
+						size: true
200
+					}, data => {
201
+						// TODO 百度中可能获取不到节点信息 ,需要循环获取
202
+						if (index >= 10) return
203
+						if (!data) {
204
+							index++
205
+							this.getCollapseHeight(false, index)
206
+							return
207
+						}
208
+						// #ifdef APP-NVUE
209
+						this.height = data.height + 1
210
+						// #endif
211
+						// #ifndef APP-NVUE
212
+						this.height = data.height
213
+						// #endif
214
+						this.isheight = true
215
+						if (type) return
216
+						this.onClick(this.isOpen, 'init')
217
+					})
218
+					.exec()
219
+			},
220
+			getNvueHwight(type) {
221
+				const result = dom.getComponentRect(this.$refs['collapse--hook'], option => {
222
+					if (option && option.result && option.size) {
223
+						// #ifdef APP-NVUE
224
+						this.height = option.size.height + 1
225
+						// #endif
226
+						// #ifndef APP-NVUE
227
+						this.height = option.size.height
228
+						// #endif
229
+						this.isheight = true
230
+						if (type) return
231
+						this.onClick(this.open, 'init')
232
+					}
233
+				})
234
+			},
235
+			/**
236
+			 * 获取父元素实例
237
+			 */
238
+			getCollapse(name = 'uniCollapse') {
239
+				let parent = this.$parent;
240
+				let parentName = parent.$options.name;
241
+				while (parentName !== name) {
242
+					parent = parent.$parent;
243
+					if (!parent) return false;
244
+					parentName = parent.$options.name;
245
+				}
246
+				return parent;
247
+			}
248
+		}
249
+	}
250
+</script>
251
+
252
+<style lang="scss">
253
+	.uni-collapse-item {
254
+		/* #ifndef APP-NVUE */
255
+		box-sizing: border-box;
256
+
257
+		/* #endif */
258
+		&__title {
259
+			/* #ifndef APP-NVUE */
260
+			display: flex;
261
+			width: 100%;
262
+			box-sizing: border-box;
263
+			/* #endif */
264
+			flex-direction: row;
265
+			align-items: center;
266
+			transition: border-bottom-color .3s;
267
+
268
+			// transition-property: border-bottom-color;
269
+			// transition-duration: 5s;
270
+			&-wrap {
271
+				width: 100%;
272
+				flex: 1;
273
+
274
+			}
275
+
276
+			&-box {
277
+				padding: 0 15px;
278
+				/* #ifndef APP-NVUE */
279
+				display: flex;
280
+				width: 100%;
281
+				box-sizing: border-box;
282
+				/* #endif */
283
+				flex-direction: row;
284
+				justify-content: space-between;
285
+				align-items: center;
286
+				height: 48px;
287
+				line-height: 48px;
288
+				background-color: #fff;
289
+				color: #303133;
290
+				font-size: 13px;
291
+				font-weight: 500;
292
+				/* #ifdef H5 */
293
+				cursor: pointer;
294
+				outline: none;
295
+
296
+				/* #endif */
297
+				&.is-disabled {
298
+					.uni-collapse-item__title-text {
299
+						color: #999;
300
+					}
301
+				}
302
+
303
+			}
304
+
305
+			&.uni-collapse-item-border {
306
+				border-bottom: 1px solid #ebeef5;
307
+			}
308
+
309
+			&.is-open {
310
+				border-bottom-color: transparent;
311
+			}
312
+
313
+			&-img {
314
+				height: 22px;
315
+				width: 22px;
316
+				margin-right: 10px;
317
+			}
318
+
319
+			&-text {
320
+				flex: 1;
321
+				font-size: 14px;
322
+				/* #ifndef APP-NVUE */
323
+				white-space: nowrap;
324
+				color: inherit;
325
+				/* #endif */
326
+				/* #ifdef APP-NVUE */
327
+				lines: 1;
328
+				/* #endif */
329
+				overflow: hidden;
330
+				text-overflow: ellipsis;
331
+			}
332
+
333
+			&-arrow {
334
+				/* #ifndef APP-NVUE */
335
+				display: flex;
336
+				box-sizing: border-box;
337
+				/* #endif */
338
+				align-items: center;
339
+				justify-content: center;
340
+				width: 20px;
341
+				height: 20px;
342
+				margin-right: 10px;
343
+				transform: rotate(0deg);
344
+
345
+				&-active {
346
+					transform: rotate(-180deg);
347
+				}
348
+			}
349
+
350
+
351
+		}
352
+
353
+		&__wrap {
354
+			/* #ifndef APP-NVUE */
355
+			will-change: height;
356
+			box-sizing: border-box;
357
+			/* #endif */
358
+			background-color: #fff;
359
+			overflow: hidden;
360
+			position: relative;
361
+			height: 0;
362
+
363
+			&.is--transition {
364
+				// transition: all 0.3s;
365
+				transition-property: height, border-bottom-width;
366
+				transition-duration: 0.3s;
367
+				/* #ifndef APP-NVUE */
368
+				will-change: height;
369
+				/* #endif */
370
+			}
371
+
372
+
373
+
374
+			&-content {
375
+				position: absolute;
376
+				font-size: 13px;
377
+				color: #303133;
378
+				// transition: height 0.3s;
379
+				border-bottom-color: transparent;
380
+				border-bottom-style: solid;
381
+				border-bottom-width: 0;
382
+
383
+				&.uni-collapse-item--border {
384
+					border-bottom-width: 1px;
385
+					border-bottom-color: red;
386
+					border-bottom-color: #ebeef5;
387
+				}
388
+
389
+				&.open {
390
+					position: relative;
391
+				}
392
+			}
393
+		}
394
+
395
+		&--animation {
396
+			transition-property: transform;
397
+			transition-duration: 0.3s;
398
+			transition-timing-function: ease;
399
+		}
400
+
401
+	}
402
+</style>

+ 147 - 0
uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue

@@ -0,0 +1,147 @@
1
+<template>
2
+	<view class="uni-collapse">
3
+		<slot />
4
+	</view>
5
+</template>
6
+<script>
7
+	/**
8
+	 * Collapse 折叠面板
9
+	 * @description 展示可以折叠 / 展开的内容区域
10
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=23
11
+	 * @property {String|Array} value 当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)
12
+	 * @property {Boolean} accordion = [true|false] 是否开启手风琴效果是否开启手风琴效果
13
+	 * @event {Function} change 切换面板时触发,如果是手风琴模式,返回类型为string,否则为array
14
+	 */
15
+	export default {
16
+		name: 'uniCollapse',
17
+		emits:['change','activeItem','input','update:modelValue'],
18
+		props: {
19
+			value: {
20
+				type: [String, Array],
21
+				default: ''
22
+			},
23
+			modelValue: {
24
+				type: [String, Array],
25
+				default: ''
26
+			},
27
+			accordion: {
28
+				// 是否开启手风琴效果
29
+				type: [Boolean, String],
30
+				default: false
31
+			},
32
+		},
33
+		data() {
34
+			return {}
35
+		},
36
+		computed: {
37
+			// TODO 兼容 vue2 和 vue3
38
+			dataValue() {
39
+				let value = (typeof this.value === 'string' && this.value === '') ||
40
+					(Array.isArray(this.value) && this.value.length === 0)
41
+				let modelValue = (typeof this.modelValue === 'string' && this.modelValue === '') ||
42
+					(Array.isArray(this.modelValue) && this.modelValue.length === 0)
43
+				if (value) {
44
+					return this.modelValue
45
+				}
46
+				if (modelValue) {
47
+					return this.value
48
+				}
49
+
50
+				return this.value
51
+			}
52
+		},
53
+		watch: {
54
+			dataValue(val) {
55
+				this.setOpen(val)
56
+			}
57
+		},
58
+		created() {
59
+			this.childrens = []
60
+			this.names = []
61
+		},
62
+		mounted() {
63
+			this.$nextTick(()=>{
64
+				this.setOpen(this.dataValue)
65
+			})
66
+		},
67
+		methods: {
68
+			setOpen(val) {
69
+				let str = typeof val === 'string'
70
+				let arr = Array.isArray(val)
71
+				this.childrens.forEach((vm, index) => {
72
+					if (str) {
73
+						if (val === vm.nameSync) {
74
+							if (!this.accordion) {
75
+								console.warn('accordion 属性为 false ,v-model 类型应该为 array')
76
+								return
77
+							}
78
+							vm.isOpen = true
79
+						}
80
+					}
81
+					if (arr) {
82
+						val.forEach(v => {
83
+							if (v === vm.nameSync) {
84
+								if (this.accordion) {
85
+									console.warn('accordion 属性为 true ,v-model 类型应该为 string')
86
+									return
87
+								}
88
+								vm.isOpen = true
89
+							}
90
+						})
91
+					}
92
+				})
93
+				this.emit(val)
94
+			},
95
+			setAccordion(self) {
96
+				if (!this.accordion) return
97
+				this.childrens.forEach((vm, index) => {
98
+					if (self !== vm) {
99
+						vm.isOpen = false
100
+					}
101
+				})
102
+			},
103
+			resize() {
104
+				this.childrens.forEach((vm, index) => {
105
+					// #ifndef APP-NVUE
106
+					vm.getCollapseHeight()
107
+					// #endif
108
+					// #ifdef APP-NVUE
109
+					vm.getNvueHwight()
110
+					// #endif
111
+				})
112
+			},
113
+			onChange(isOpen, self) {
114
+				let activeItem = []
115
+
116
+				if (this.accordion) {
117
+					activeItem = isOpen ? self.nameSync : ''
118
+				} else {
119
+					this.childrens.forEach((vm, index) => {
120
+						if (vm.isOpen) {
121
+							activeItem.push(vm.nameSync)
122
+						}
123
+					})
124
+				}
125
+				this.$emit('change', activeItem)
126
+				this.emit(activeItem)
127
+			},
128
+			emit(val){
129
+				this.$emit('input', val)
130
+				this.$emit('update:modelValue', val)
131
+			}
132
+		}
133
+	}
134
+</script>
135
+<style lang="scss" >
136
+	.uni-collapse {
137
+		/* #ifndef APP-NVUE */
138
+		width: 100%;
139
+		display: flex;
140
+		/* #endif */
141
+		/* #ifdef APP-NVUE */
142
+		flex: 1;
143
+		/* #endif */
144
+		flex-direction: column;
145
+		background-color: #fff;
146
+	}
147
+</style>

+ 86 - 0
uni_modules/uni-collapse/package.json

@@ -0,0 +1,86 @@
1
+{
2
+  "id": "uni-collapse",
3
+  "displayName": "uni-collapse 折叠面板",
4
+  "version": "1.4.4",
5
+  "description": "Collapse 组件,可以折叠 / 展开的内容区域。",
6
+  "keywords": [
7
+    "uni-ui",
8
+    "折叠",
9
+    "折叠面板",
10
+    "手风琴"
11
+],
12
+  "repository": "https://github.com/dcloudio/uni-ui",
13
+  "engines": {
14
+    "HBuilderX": ""
15
+  },
16
+  "directories": {
17
+    "example": "../../temps/example_temps"
18
+  },
19
+"dcloudext": {
20
+    "sale": {
21
+      "regular": {
22
+        "price": "0.00"
23
+      },
24
+      "sourcecode": {
25
+        "price": "0.00"
26
+      }
27
+    },
28
+    "contact": {
29
+      "qq": ""
30
+    },
31
+    "declaration": {
32
+      "ads": "无",
33
+      "data": "无",
34
+      "permissions": "无"
35
+    },
36
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
37
+    "type": "component-vue"
38
+  },
39
+  "uni_modules": {
40
+    "dependencies": [
41
+			"uni-scss",
42
+      "uni-icons"
43
+    ],
44
+    "encrypt": [],
45
+    "platforms": {
46
+      "cloud": {
47
+        "tcb": "y",
48
+        "aliyun": "y"
49
+      },
50
+      "client": {
51
+        "App": {
52
+          "app-vue": "y",
53
+          "app-nvue": "y"
54
+        },
55
+        "H5-mobile": {
56
+          "Safari": "y",
57
+          "Android Browser": "y",
58
+          "微信浏览器(Android)": "y",
59
+          "QQ浏览器(Android)": "y"
60
+        },
61
+        "H5-pc": {
62
+          "Chrome": "y",
63
+          "IE": "y",
64
+          "Edge": "y",
65
+          "Firefox": "y",
66
+          "Safari": "y"
67
+        },
68
+        "小程序": {
69
+          "微信": "y",
70
+          "阿里": "y",
71
+          "百度": "y",
72
+          "字节跳动": "y",
73
+          "QQ": "y"
74
+        },
75
+        "快应用": {
76
+          "华为": "u",
77
+          "联盟": "u"
78
+        },
79
+        "Vue": {
80
+            "vue2": "y",
81
+            "vue3": "y"
82
+        }
83
+      }
84
+    }
85
+  }
86
+}

+ 12 - 0
uni_modules/uni-collapse/readme.md

@@ -0,0 +1,12 @@
1
+
2
+
3
+## Collapse 折叠面板
4
+> **组件名:uni-collapse**
5
+> 代码块: `uCollapse`
6
+> 关联组件:`uni-collapse-item`、`uni-icons`。
7
+
8
+
9
+折叠面板用来折叠/显示过长的内容或者是列表。通常是在多内容分类项使用,折叠不重要的内容,显示重要内容。点击可以展开折叠部分。
10
+
11
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-collapse)
12
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839