Bläddra i källkod

接单筛选条件修改

maotao 11 månader sedan
förälder
incheckning
cd8c935c3c
49 ändrade filer med 6731 tillägg och 66 borttagningar
  1. 4 0
      App.vue
  2. 1 0
      manifest.json
  3. 2 2
      pages/receipt_infopage/receipt_infopage.vue
  4. 180 63
      pages/receiptpage/receiptpage.vue
  5. 5 1
      pages/search/search.vue
  6. 77 0
      uni_modules/uni-data-picker/changelog.md
  7. 45 0
      uni_modules/uni-data-picker/components/uni-data-picker/keypress.js
  8. 380 0
      uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.uvue
  9. 551 0
      uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
  10. 1 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/loading.uts
  11. 622 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
  12. 693 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.uts
  13. 76 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.css
  14. 69 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.uvue
  15. 323 0
      uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
  16. 91 0
      uni_modules/uni-data-picker/package.json
  17. 22 0
      uni_modules/uni-data-picker/readme.md
  18. 42 0
      uni_modules/uni-icons/changelog.md
  19. 91 0
      uni_modules/uni-icons/components/uni-icons/uni-icons.uvue
  20. 110 0
      uni_modules/uni-icons/components/uni-icons/uni-icons.vue
  21. 664 0
      uni_modules/uni-icons/components/uni-icons/uniicons.css
  22. BIN
      uni_modules/uni-icons/components/uni-icons/uniicons.ttf
  23. 664 0
      uni_modules/uni-icons/components/uni-icons/uniicons_file.ts
  24. 649 0
      uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js
  25. 89 0
      uni_modules/uni-icons/package.json
  26. 8 0
      uni_modules/uni-icons/readme.md
  27. 19 0
      uni_modules/uni-load-more/changelog.md
  28. 5 0
      uni_modules/uni-load-more/components/uni-load-more/i18n/en.json
  29. 8 0
      uni_modules/uni-load-more/components/uni-load-more/i18n/index.js
  30. 5 0
      uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json
  31. 5 0
      uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json
  32. 399 0
      uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
  33. 86 0
      uni_modules/uni-load-more/package.json
  34. 14 0
      uni_modules/uni-load-more/readme.md
  35. 8 0
      uni_modules/uni-scss/changelog.md
  36. 1 0
      uni_modules/uni-scss/index.scss
  37. 82 0
      uni_modules/uni-scss/package.json
  38. 4 0
      uni_modules/uni-scss/readme.md
  39. 7 0
      uni_modules/uni-scss/styles/index.scss
  40. 3 0
      uni_modules/uni-scss/styles/setting/_border.scss
  41. 66 0
      uni_modules/uni-scss/styles/setting/_color.scss
  42. 55 0
      uni_modules/uni-scss/styles/setting/_radius.scss
  43. 56 0
      uni_modules/uni-scss/styles/setting/_space.scss
  44. 167 0
      uni_modules/uni-scss/styles/setting/_styles.scss
  45. 24 0
      uni_modules/uni-scss/styles/setting/_text.scss
  46. 146 0
      uni_modules/uni-scss/styles/setting/_variables.scss
  47. 19 0
      uni_modules/uni-scss/styles/tools/functions.scss
  48. 31 0
      uni_modules/uni-scss/theme.scss
  49. 62 0
      uni_modules/uni-scss/variables.scss

+ 4 - 0
App.vue

@@ -146,4 +146,8 @@
146 146
   .mt8{
147 147
     margin-top: 16rpx !important;
148 148
   }
149
+	
150
+	.check{
151
+		border-color:#49b856 !important;
152
+	}
149 153
 </style>

+ 1 - 0
manifest.json

@@ -83,6 +83,7 @@
83 83
           "proxy" : {
84 84
               "/service" : {
85 85
                   "target" : "http://192.168.3.108", //请求的目标域名
86
+									// "target" : "http://192.168.4.105",
86 87
                   "changeOrigin" : true, //是否跨域
87 88
                   "secure" : false
88 89
               }

+ 2 - 2
pages/receipt_infopage/receipt_infopage.vue

@@ -131,8 +131,8 @@
131 131
           <text class="text1">预约时间</text>
132 132
           <text class="text2" v-if="infoDATA.taskType.associationType.value == 'inspect'">{{ infoDATA.yyTime }}</text>
133 133
           <text class="text2"
134
-            v-if="infoDATA.taskType.associationType.value == 'patientTransport'">{{ infoDATA.yyjdTime|yyTimeFilter }}</text>
135
-        </view>
134
+            v-if="infoDATA.taskType.associationType.value == 'patientTransport' || infoDATA.taskType.associationType.value == 'other'">{{ infoDATA.yyjdTime|yyTimeFilter }}</text>
135
+				</view>
136 136
         <view class="page_item_foot_text" v-if="
137 137
             infoDATA.taskType.associationType.value == 'inspect' ||
138 138
             infoDATA.taskType.associationType.value == 'patientTransport'

+ 180 - 63
pages/receiptpage/receiptpage.vue

@@ -214,6 +214,10 @@
214 214
               </view>
215 215
               <view class="page_item_conts" v-else>
216 216
                 <view v-if="item.overdueTime">{{ item.overdueTime }}前送达</view>
217
+								<view>
218
+								  预约时间 : {{ item.yyjdTime | yyTimeFilter
219
+								  }}
220
+								</view>
217 221
                 <view style="word-break: break-all;" v-if="item.workOrderRemark">
218 222
                   备注信息 :
219 223
                   <text>{{ item.workOrderRemark || "暂无" }}</text>
@@ -349,39 +353,53 @@
349 353
       @ok="checkboxOk" @cancel="checkboxCancel">
350 354
     </checkboxModal>
351 355
     <!-- 执行中筛选 -->
352
-    <view class="execFilterMask" v-if="isShowExecFilter" @click="isShowExecFilter = false">
353
-      <view class="execFilter" @click.stop>
354
-        <view class="execFilterHeader">
355
-          全部筛选
356
-        </view>
357
-        <view class="execFilterBody">
358
-          <view class="execFilterItem">
359
-            <view class="execFilterItemHeader">
360
-              工单状态
361
-            </view>
362
-            <view class="execFilterItemBody">
363
-              <view class="execFilterItemBox" @click="currentId = item.id" :class="{active: item.id == currentId}" v-for="item in array" :key="item.id">
364
-                {{item.name}}
365
-              </view>
366
-            </view>
367
-          </view>
368
-          
369
-          <view class="execFilterItem">
370
-            <view class="execFilterItemHeader">
371
-              申请科室
372
-            </view>
373
-            <view class="execFilterItemBody">
374
-              <input class="deptName" v-model.trim="deptName" placeholder="请输入科室名称" placeholder-style="color:#cecece" />
375
-            </view>
376
-          </view>
377
-        </view>
378
-        
379
-        <view class="execFilterFooter">
380
-          <view class="btn" @click="execFilterReset()">重置</view>
381
-          <view class="btn" @click="execFilterOk()">完成</view>
382
-        </view>
383
-      </view>
384
-    </view>
356
+		<uni-drawer width="400px" :visible="isShowExecFilter" mode="right" @close="closeDrawer()">
357
+			<view class="execFilterMask">
358
+				<view class="execFilter" @click.stop>
359
+					<view class="execFilterHeader">
360
+						全部筛选
361
+					</view>
362
+					<view class="execFilterBody">
363
+						<view class="execFilterItem">
364
+							<view class="execFilterItemHeader">
365
+								工单状态
366
+							</view>
367
+							<view class="execFilterItemBody">
368
+								<view class="execFilterItemBox" @click="currentId = item.id" :class="{active: item.id == currentId}" v-for="item in array" :key="item.id">
369
+									{{item.name}}
370
+								</view>
371
+							</view>
372
+						</view>
373
+						
374
+						<view class="execFilterItem">
375
+							<view class="execFilterItemHeader">
376
+								申请科室
377
+							</view>
378
+							<view class="execFilterItemBody">
379
+								<input class="deptName" @click="searchAdm" v-model.trim="deptName" placeholder="请选择科室名称" placeholder-style="color:#cecece" />
380
+							</view>
381
+						</view>
382
+						
383
+						<view class="execFilterItem">
384
+							<view class="execFilterItemHeader">
385
+								任务类型
386
+							</view>
387
+							<view class="execFilterItemBody">
388
+								<uni-data-picker class="value" placeholder="请选择任务类型"
389
+									:localdata="taskData" v-model="taskTypeId" :clear-icon="false">
390
+								</uni-data-picker>
391
+							</view>
392
+						</view>
393
+					</view>
394
+					
395
+					<view class="execFilterFooter">
396
+						<view class="btn" @click="execFilterReset()">重置</view>
397
+						<view class="btn" @click="execFilterOk()">完成</view>
398
+					</view>
399
+				</view>
400
+			</view>
401
+		</uni-drawer>
402
+    <!-- </view> -->
385 403
     <!-- 被服洗涤弹窗 -->
386 404
     <showModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content"
387 405
       @ok="ok1" @cancel="cancel1" :operate="models1.operate"></showModel>
@@ -403,6 +421,9 @@
403 421
   import bigScreen from "../../components/bigScreen/bigScreen.vue";
404 422
   // https://ext.dcloud.net.cn/plugin?id=144
405 423
   import uniFab from "@/components/uni-fab/uni-fab.vue";
424
+	import uniDrawer from "@/components/uni-drawer/uni-drawer.vue";
425
+	import ldSelect from "@/components/ld-select/ld-select.vue";
426
+	import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue";
406 427
   import {
407 428
     get,
408 429
     post,
@@ -420,7 +441,10 @@
420 441
         workStateList: [],
421 442
         clothingType: '',//被服回收扫码的类型,dept|user
422 443
         isShowExecFilter: false,
423
-        deptName: '',
444
+        deptName: '',//科室名称
445
+				deptId:null,//科室id
446
+				taskTypeId:null,//任务类型id
447
+				taskData:[], //任务类型数据
424 448
         currentId: 0,
425 449
         otherAssociationTypeId: null,
426 450
         hosId: uni.getStorageSync('userData').user.currentHospital.id,
@@ -553,6 +577,11 @@
553 577
         quiltCode: '',
554 578
       };
555 579
     },
580
+		components: {
581
+		  uniDrawer,
582
+		  MxDatePicker,
583
+		  ldSelect,
584
+		},
556 585
     filters: {
557 586
       // 自定义管道 yyTime
558 587
       yyTimeFilter: function(data) {
@@ -588,6 +617,20 @@
588 617
       selectAccount,
589 618
     },
590 619
     methods: {
620
+			// 搜索科室
621
+			searchAdm(){
622
+				let data = {
623
+					currentId:this.currentId, //工单状态
624
+					taskType:this.taskTypeId, //任务类型
625
+					selectedLabelSlots:this.selectedLabelSlots, //tab选中状态
626
+					taskData:JSON.stringify(this.taskData)
627
+				}
628
+				uni.setStorageSync("admStore",data)
629
+				let setDeptConfg = uni.getStorageSync("setDeptConfg") || {};
630
+				uni.navigateTo({
631
+				  url: `../search/search?type=takeOrder&id=${this.id}&changedept=${this.changedept}&quickCombinationId=${setDeptConfg.id || ''}`,
632
+				});
633
+			},
591 634
       goTobloodEnd(order){
592 635
         uni.navigateTo({
593 636
           url: `/pages/newBlood/endOrderSignBlood/endOrderSignBlood?orderIds=${order.id}&deptName=${order.endDepts[0].dept}&deptId=${order.endDepts[0].id}&type=delivery`,
@@ -1056,8 +1099,34 @@
1056 1099
       //   this.selectedLabelSlots = "执行中";
1057 1100
       //   this.executingOrders(0);
1058 1101
       // },
1102
+			// 获取任务类型
1103
+			getTaskData(){
1104
+				let data = {
1105
+				  idx:0,
1106
+				  sum: 9999,
1107
+				};
1108
+				let url = null
1109
+				if(this.selectedLabelSlots=='待接单'){
1110
+					url = '/workerOrder/waitingOrdersByTaskType'
1111
+				}else{
1112
+					url = '/workerOrder/executingOrdersByTaskType'
1113
+				}
1114
+				post(url, data).then(res => {
1115
+				  this.taskData = res.data.map(i=>{
1116
+						return {
1117
+							text:i.name+'('+i.count+')',
1118
+							value:i.id
1119
+						}
1120
+					})
1121
+				});
1122
+			},
1123
+			closeDrawer() {
1124
+				this.execFilterReset()
1125
+				this.isShowExecFilter = false;
1126
+			},
1059 1127
       // 执行中筛选
1060 1128
       execFilter() {
1129
+				this.getTaskData()
1061 1130
         this.isShowExecFilter = true;
1062 1131
       },
1063 1132
       // 执行中确定
@@ -1066,13 +1135,21 @@
1066 1135
         this.zxzData = [];
1067 1136
         this.totalNum = -1;
1068 1137
         this.idx = 0;
1069
-        this.selectedLabelSlots = "执行中";
1070
-        this.executingOrders(0);
1138
+        // this.selectedLabelSlots = "执行中";
1139
+        // this.executingOrders(0);
1140
+				if (this.selectedLabelSlots == "待接单") {
1141
+				  this.waitingOrders(0,'submit');
1142
+				} else if (this.selectedLabelSlots == "执行中") {
1143
+				  this.executingOrders(0,'submit');
1144
+				}
1071 1145
       },
1072 1146
       // 执行中重置
1073 1147
       execFilterReset() {
1074 1148
         this.currentId = 0;
1075 1149
         this.deptName = '';
1150
+				this.deptId = ''//科室id
1151
+				this.taskTypeId = '' //任务类型
1152
+				uni.setStorageSync("admStore",{})
1076 1153
       },
1077 1154
       // 大扫描筛选
1078 1155
       execFilterBigScreen({
@@ -2040,8 +2117,8 @@
2040 2117
         this.selectedLabelSlots = key;
2041 2118
         this.idx = 0;
2042 2119
         this.totalNum = -1;
2043
-        // this.zxzData = [];
2044 2120
         this.scroll_top = Math.random(); //回到顶部
2121
+				this.execFilterReset()
2045 2122
         if (key === "待接单") {
2046 2123
           this.waitingOrders(0);
2047 2124
         } else if (key === "执行中") {
@@ -2104,7 +2181,7 @@
2104 2181
         };
2105 2182
       },
2106 2183
       //执行中列表数据获取
2107
-      executingOrders(idx) {
2184
+      executingOrders(idx,type) {
2108 2185
         console.log(this.zxzData.length, this.totalNum);
2109 2186
         if (this.zxzData.length == this.totalNum) {
2110 2187
           uni.showToast({
@@ -2119,23 +2196,24 @@
2119 2196
           sum: 20,
2120 2197
         };
2121 2198
         
2122
-        // if (this.arrayKey) {
2123
-        //   data.keyWord = this.arrayKey;
2124
-        // } else {
2125
-        //   delete data.keyWord;
2126
-        // }
2127 2199
         if (this.currentId) {
2128 2200
           data.keyWord = this.currentId;
2129 2201
         } else {
2130 2202
           delete data.keyWord;
2131 2203
         }
2132 2204
         
2133
-        if (this.deptName) {
2134
-          data.deptName = this.deptName;
2205
+        if (this.deptId) {
2206
+          data.deptId = this.deptId;
2135 2207
         } else {
2136
-          delete data.deptName;
2208
+          delete data.deptId;
2137 2209
         }
2138 2210
         
2211
+				if (this.taskTypeId) {
2212
+				  data.taskTypeId = this.taskTypeId;
2213
+				} else {
2214
+				  delete data.taskTypeId;
2215
+				}
2216
+				
2139 2217
         uni.showLoading({
2140 2218
           title: "加载中",
2141 2219
           mask: true,
@@ -2162,10 +2240,13 @@
2162 2240
               title: res.msg || "接口获取数据失败!",
2163 2241
             });
2164 2242
           }
2243
+					if(type=='submit'){
2244
+						this.execFilterReset()
2245
+					}
2165 2246
         });
2166 2247
       },
2167 2248
       //待抢单列表数据获取
2168
-      waitingOrders(idx) {
2249
+      waitingOrders(idx,type) {
2169 2250
         if (this.zxzData.length == this.totalNum) {
2170 2251
           uni.showToast({
2171 2252
             icon: "none",
@@ -2178,6 +2259,19 @@
2178 2259
           idx,
2179 2260
           sum: 20,
2180 2261
         };
2262
+				
2263
+				if (this.deptId) {
2264
+				  data.deptId = this.deptId;
2265
+				} else {
2266
+				  delete data.deptId;
2267
+				}
2268
+				
2269
+				if (this.taskTypeId) {
2270
+				  data.taskTypeId = this.taskTypeId;
2271
+				} else {
2272
+				  delete data.taskTypeId;
2273
+				}
2274
+				
2181 2275
         uni.showLoading({
2182 2276
           title: "加载中",
2183 2277
           mask: true,
@@ -2201,6 +2295,9 @@
2201 2295
               title: res.msg || "接口获取数据失败!",
2202 2296
             });
2203 2297
           }
2298
+					if(type=='submit'){
2299
+						this.execFilterReset()
2300
+					}
2204 2301
         });
2205 2302
       },
2206 2303
       //刷新
@@ -2330,8 +2427,20 @@
2330 2427
       },
2331 2428
     },
2332 2429
     onLoad(options) {
2333
-      console.log(uni.getStorageSync('userData').user);
2334
-      console.log(options, 'options');
2430
+			if(options.type=='searchAdm'){
2431
+				let admStore = uni.getStorageSync("admStore");
2432
+				if(Object.keys(admStore).length != 0){
2433
+					this.deptName = options.dept //科室名称
2434
+					this.deptId = options.deptId //科室id
2435
+					this.isShowExecFilter = true
2436
+					this.$nextTick(_=>{
2437
+						this.currentId = admStore.currentId //工单状态
2438
+						this.taskTypeId = admStore.taskType //任务类型
2439
+						this.selectedLabelSlots = admStore.selectedLabelSlots //tab选中状态
2440
+						this.taskData = JSON.parse(admStore.taskData) //任务类型数据
2441
+					})
2442
+				}
2443
+			}
2335 2444
       this.workState = uni.getStorageSync('userData').user.workState ? uni.getStorageSync('userData').user.workState.value : '1';
2336 2445
       // 获取菜单权限
2337 2446
       this.getMenu();
@@ -2400,31 +2509,38 @@
2400 2509
   };
2401 2510
 </script>
2402 2511
 <style lang="less">
2512
+	/deep/ .uni-drawer__content{
2513
+		width: 600rpx !important;
2514
+	}
2515
+	/deep/ .selected-item-active{
2516
+		border-bottom: 4rpx solid #49b856;
2517
+	}
2518
+	
2403 2519
   .Receiptpage {
2404 2520
     width: 100%;
2405 2521
     height: 100%;
2406 2522
     position: relative;
2407 2523
     
2408 2524
     .execFilterMask{
2409
-      position: fixed;
2410
-      top: 0;
2411
-      right: 0;
2412
-      bottom: 0;
2413
-      left: 0;
2414
-      z-index: 9999;
2415
-      background-color: rgba(0, 0, 0, 0.5);
2416
-      display: flex;
2417
-      flex-direction: column;
2418
-      justify-content: flex-end;      
2525
+      // position: fixed;
2526
+      // top: 0;
2527
+      // right: 0;
2528
+      // bottom: 0;
2529
+      // left: 0;
2530
+      // z-index: 9999;
2531
+      // background-color: rgba(0, 0, 0, 0.5);
2532
+      // display: flex;
2533
+      // flex-direction: column;
2534
+      // justify-content: flex-end;      
2419 2535
       
2420 2536
       .execFilter{
2421 2537
         position: relative;
2422 2538
         background-color: #fff;
2423
-        height: 90vh;
2539
+        height: 100vh;
2424 2540
         border-radius: 100rpx 100rpx 0 0;
2425 2541
         
2426 2542
         .execFilterHeader{
2427
-          height: 100rpx;
2543
+          height: 70rpx;
2428 2544
           display: flex;
2429 2545
           justify-content: center;
2430 2546
           align-items: center;
@@ -2433,7 +2549,7 @@
2433 2549
         
2434 2550
         .execFilterBody{
2435 2551
           .execFilterItem{
2436
-            padding: 40rpx;
2552
+            padding: 32rpx;
2437 2553
             border-bottom: 2rpx dashed #ccc;
2438 2554
             &:last-of-type{
2439 2555
               border-bottom: none;
@@ -2442,7 +2558,7 @@
2442 2558
             .execFilterItemBody{
2443 2559
               display: flex;
2444 2560
               flex-wrap: wrap;
2445
-              padding: 40rpx 0 0;
2561
+              padding: 32rpx 0 0;
2446 2562
               justify-content: space-between;
2447 2563
               text-align: left;
2448 2564
               
@@ -2465,6 +2581,7 @@
2465 2581
                 background-color: #f6f6f6;
2466 2582
                 border-radius: 20rpx;
2467 2583
                 padding: 0 20rpx;
2584
+								width: 100%;
2468 2585
               }
2469 2586
             }
2470 2587
           }

+ 5 - 1
pages/search/search.vue

@@ -479,7 +479,11 @@
479 479
                 url: `../settingCode/settingCode?qrId=${arr[0].qrId || ''}&targetId=${arr[0].id}&targetDept=${arr[0].dept}&uniName=${this.uniName}&qrCode=${this.qrCode}`,
480 480
               });
481 481
             }
482
-          }
482
+          } else if (this.type == "takeOrder") { //接单
483
+					  uni.navigateTo({
484
+					    url: `../receiptpage/receiptpage?deptId=${arr[0].id}&dept=${arr[0].dept}&type=searchAdm`,
485
+					  });
486
+					}
483 487
         }
484 488
       },
485 489
       //保存关键字到历史记录

+ 77 - 0
uni_modules/uni-data-picker/changelog.md

@@ -0,0 +1,77 @@
1
+## 2.0.0(2023-12-14)
2
+- 新增 支持 uni-app-x
3
+## 1.1.2(2023-04-11)
4
+- 修复 更改 modelValue 报错的 bug
5
+- 修复 v-for 未使用 key 值控制台 warning
6
+## 1.1.1(2023-02-21)
7
+- 修复代码合并时引发 value 属性为空时不渲染数据的问题
8
+## 1.1.0(2023-02-15)
9
+- 修复 localdata 不支持动态更新的bug
10
+## 1.0.9(2023-02-15)
11
+- 修复 localdata 不支持动态更新的bug
12
+## 1.0.8(2022-09-16)
13
+- 可以使用 uni-scss 控制主题色
14
+## 1.0.7(2022-07-06)
15
+- 优化 pc端图标位置不正确的问题
16
+## 1.0.6(2022-07-05)
17
+- 优化 显示样式
18
+## 1.0.5(2022-07-04)
19
+- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug
20
+## 1.0.4(2022-04-19)
21
+- 修复 字节小程序 本地数据无法选择下一级的Bug
22
+## 1.0.3(2022-02-25)
23
+- 修复 nvue 不支持的 v-show 的 bug
24
+## 1.0.2(2022-02-25)
25
+- 修复 条件编译 nvue 不支持的 css 样式
26
+## 1.0.1(2021-11-23)
27
+- 修复 由上个版本引发的map、v-model等属性不生效的bug
28
+## 1.0.0(2021-11-19)
29
+- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
30
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-data-picker](https://uniapp.dcloud.io/component/uniui/uni-data-picker)
31
+## 0.4.9(2021-10-28)
32
+- 修复 VUE2 v-model 概率无效的 bug
33
+## 0.4.8(2021-10-27)
34
+- 修复 v-model 概率无效的 bug
35
+## 0.4.7(2021-10-25)
36
+- 新增 属性 spaceInfo 服务空间配置 HBuilderX 3.2.11+
37
+- 修复 树型 uniCloud 数据类型为 int 时报错的 bug
38
+## 0.4.6(2021-10-19)
39
+- 修复 非 VUE3 v-model 为 0 时无法选中的 bug
40
+## 0.4.5(2021-09-26)
41
+- 新增 清除已选项的功能(通过 clearIcon 属性配置是否显示按钮),同时提供 clear 方法以供调用,二者等效
42
+- 修复 readonly 为 true 时报错的 bug
43
+## 0.4.4(2021-09-26)
44
+- 修复 上一版本造成的 map 属性失效的 bug
45
+- 新增 ellipsis 属性,支持配置 tab 选项长度过长时是否自动省略
46
+## 0.4.3(2021-09-24)
47
+- 修复 某些情况下级联未触发的 bug
48
+## 0.4.2(2021-09-23)
49
+- 新增 提供 show 和 hide 方法,开发者可以通过 ref 调用
50
+- 新增 选项内容过长自动添加省略号
51
+## 0.4.1(2021-09-15)
52
+- 新增 map 属性 字段映射,将 text/value 映射到数据中的其他字段
53
+## 0.4.0(2021-07-13)
54
+- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
55
+## 0.3.5(2021-06-04)
56
+- 修复 无法加载云端数据的问题
57
+## 0.3.4(2021-05-28)
58
+- 修复 v-model 无效问题
59
+- 修复 loaddata 为空数据组时加载时间过长问题
60
+- 修复 上个版本引出的本地数据无法选择带有 children 的 2 级节点
61
+## 0.3.3(2021-05-12)
62
+- 新增 组件示例地址
63
+## 0.3.2(2021-04-22)
64
+- 修复 非树形数据有 where 属性查询报错的问题
65
+## 0.3.1(2021-04-15)
66
+- 修复 本地数据概率无法回显时问题
67
+## 0.3.0(2021-04-07)
68
+- 新增 支持云端非树形表结构数据
69
+- 修复 根节点 parent_field 字段等于 null 时选择界面错乱问题
70
+## 0.2.0(2021-03-15)
71
+- 修复 nodeclick、popupopened、popupclosed 事件无法触发的问题
72
+## 0.1.9(2021-03-09)
73
+- 修复 微信小程序某些情况下无法选择的问题
74
+## 0.1.8(2021-02-05)
75
+- 优化 部分样式在 nvue 上的兼容表现
76
+## 0.1.7(2021-02-05)
77
+- 调整为 uni_modules 目录规范

+ 45 - 0
uni_modules/uni-data-picker/components/uni-data-picker/keypress.js

@@ -0,0 +1,45 @@
1
+// #ifdef H5
2
+export default {
3
+  name: 'Keypress',
4
+  props: {
5
+    disable: {
6
+      type: Boolean,
7
+      default: false
8
+    }
9
+  },
10
+  mounted () {
11
+    const keyNames = {
12
+      esc: ['Esc', 'Escape'],
13
+      tab: 'Tab',
14
+      enter: 'Enter',
15
+      space: [' ', 'Spacebar'],
16
+      up: ['Up', 'ArrowUp'],
17
+      left: ['Left', 'ArrowLeft'],
18
+      right: ['Right', 'ArrowRight'],
19
+      down: ['Down', 'ArrowDown'],
20
+      delete: ['Backspace', 'Delete', 'Del']
21
+    }
22
+    const listener = ($event) => {
23
+      if (this.disable) {
24
+        return
25
+      }
26
+      const keyName = Object.keys(keyNames).find(key => {
27
+        const keyName = $event.key
28
+        const value = keyNames[key]
29
+        return value === keyName || (Array.isArray(value) && value.includes(keyName))
30
+      })
31
+      if (keyName) {
32
+        // 避免和其他按键事件冲突
33
+        setTimeout(() => {
34
+          this.$emit(keyName, {})
35
+        }, 0)
36
+      }
37
+    }
38
+    document.addEventListener('keyup', listener)
39
+    this.$once('hook:beforeDestroy', () => {
40
+      document.removeEventListener('keyup', listener)
41
+    })
42
+  },
43
+	render: () => {}
44
+}
45
+// #endif

+ 380 - 0
uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.uvue

@@ -0,0 +1,380 @@
1
+<template>
2
+  <view class="uni-data-tree">
3
+    <view class="uni-data-tree-input" @click="handleInput">
4
+      <slot :data="selectedPaths" :error="error">
5
+        <view class="input-value" :class="{'input-value-border': border}">
6
+          <text v-if="error!=null" class="error-text">{{error!.errMsg}}</text>
7
+          <scroll-view v-if="selectedPaths.length" class="selected-path" scroll-x="true">
8
+            <view class="selected-list">
9
+              <template v-for="(item, index) in selectedPaths">
10
+                <text class="text-color">{{item[mappingTextName]}}</text>
11
+                <text v-if="index<selectedPaths.length-1" class="input-split-line">{{split}}</text>
12
+              </template>
13
+            </view>
14
+          </scroll-view>
15
+          <text v-else-if="error==null&&!loading" class="placeholder">{{placeholder}}</text>
16
+          <view v-if="!readonly" class="arrow-area">
17
+            <view class="input-arrow"></view>
18
+          </view>
19
+        </view>
20
+      </slot>
21
+      <view v-if="loading && !isOpened" class="selected-loading">
22
+        <slot name="picker-loading" :loading="loading"></slot>
23
+      </view>
24
+    </view>
25
+    <view class="uni-data-tree-cover" v-if="isOpened" @click="handleClose"></view>
26
+    <view class="uni-data-tree-dialog" v-if="isOpened">
27
+      <view class="uni-popper__arrow"></view>
28
+      <view class="dialog-caption">
29
+        <view class="dialog-title-view">
30
+          <text class="dialog-title">{{popupTitle}}</text>
31
+        </view>
32
+        <view class="dialog-close" @click="handleClose">
33
+          <view class="dialog-close-plus" data-id="close"></view>
34
+          <view class="dialog-close-plus dialog-close-rotate" data-id="close"></view>
35
+        </view>
36
+      </view>
37
+      <view ref="pickerView" class="uni-data-pickerview">
38
+        <view v-if="error!=null" class="error">
39
+          <text class="error-text">{{error!.errMsg}}</text>
40
+        </view>
41
+        <scroll-view v-if="!isCloudDataList" :scroll-x="true">
42
+          <view class="selected-node-list">
43
+            <template v-for="(item, index) in selectedNodes">
44
+              <text class="selected-node-item" :class="{'selected-node-item-active':index==selectedIndex}"
45
+                @click="onTabSelect(index)">
46
+                {{item[mappingTextName]}}
47
+              </text>
48
+            </template>
49
+          </view>
50
+        </scroll-view>
51
+        <list-view class="list-view" :scroll-y="true">
52
+          <list-item class="list-item" v-for="(item, _) in currentDataList" @click="onNodeClick(item)">
53
+            <text class="item-text" :class="{'item-text-disabled': item['disable']}">{{item[mappingTextName]}}</text>
54
+            <text class="check" v-if="item[mappingValueName] == selectedNodes[selectedIndex][mappingValueName]"></text>
55
+          </list-item>
56
+        </list-view>
57
+        <view class="loading-cover" v-if="loading">
58
+          <slot name="pickerview-loading" :loading="loading"></slot>
59
+        </view>
60
+      </view>
61
+    </view>
62
+  </view>
63
+</template>
64
+
65
+<script>
66
+  import { dataPicker } from "../uni-data-pickerview/uni-data-picker.uts"
67
+
68
+  /**
69
+   * DataPicker 级联选择
70
+   * @description 支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。
71
+   * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
72
+   * @property {String} popup-title 弹出窗口标题
73
+   * @property {Array} localdata 本地数据,参考
74
+   * @property {Boolean} border = [true|false] 是否有边框
75
+   * @property {Boolean} readonly = [true|false] 是否仅读
76
+   * @property {Boolean} preload = [true|false] 是否预加载数据
77
+   * @value true 开启预加载数据,点击弹出窗口后显示已加载数据
78
+   * @value false 关闭预加载数据,点击弹出窗口后开始加载数据
79
+   * @property {Boolean} step-searh = [true|false] 是否分布查询
80
+   * @value true 启用分布查询,仅查询当前选中节点
81
+   * @value false 关闭分布查询,一次查询出所有数据
82
+   * @property {String|DBFieldString} self-field 分布查询当前字段名称
83
+   * @property {String|DBFieldString} parent-field 分布查询父字段名称
84
+   * @property {String|DBCollectionString} collection 表名
85
+   * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
86
+   * @property {String} orderby 排序字段及正序倒叙设置
87
+   * @property {String|JQLString} where 查询条件
88
+   * @event {Function} popupshow 弹出的选择窗口打开时触发此事件
89
+   * @event {Function} popuphide 弹出的选择窗口关闭时触发此事件
90
+   */
91
+  export default {
92
+    name: 'UniDataPicker',
93
+    emits: ['popupopened', 'popupclosed', 'nodeclick', 'change', 'input', 'update:modelValue', 'inputclick'],
94
+    mixins: [dataPicker],
95
+    props: {
96
+      popupTitle: {
97
+        type: String,
98
+        default: '请选择'
99
+      },
100
+      placeholder: {
101
+        type: String,
102
+        default: '请选择'
103
+      },
104
+      heightMobile: {
105
+        type: String,
106
+        default: ''
107
+      },
108
+      readonly: {
109
+        type: Boolean,
110
+        default: false
111
+      },
112
+      clearIcon: {
113
+        type: Boolean,
114
+        default: true
115
+      },
116
+      border: {
117
+        type: Boolean,
118
+        default: true
119
+      },
120
+      split: {
121
+        type: String,
122
+        default: '/'
123
+      },
124
+      ellipsis: {
125
+        type: Boolean,
126
+        default: true
127
+      }
128
+    },
129
+    data() {
130
+      return {
131
+        isOpened: false
132
+      }
133
+    },
134
+    computed: {
135
+      isShowClearIcon() : boolean {
136
+        if (this.readonly) {
137
+          return false
138
+        }
139
+
140
+        if (this.clearIcon && this.selectedPaths.length > 0) {
141
+          return true
142
+        }
143
+
144
+        return false
145
+      }
146
+    },
147
+    created() {
148
+      this.load()
149
+    },
150
+    methods: {
151
+      clear() {
152
+      },
153
+      load() {
154
+        if (this.isLocalData) {
155
+          this.loadLocalData()
156
+        } else if (this.isCloudDataList || this.isCloudDataTree) {
157
+          this.loadCloudDataPath()
158
+        }
159
+      },
160
+      show() {
161
+        this.isOpened = true
162
+        this.$emit('popupopened')
163
+        if (!this.hasCloudTreeData) {
164
+          this.loadData()
165
+        }
166
+      },
167
+      hide() {
168
+        this.isOpened = false
169
+        this.$emit('popupclosed')
170
+      },
171
+      handleInput() {
172
+        if (this.readonly) {
173
+          this.$emit('inputclick')
174
+        } else {
175
+          this.show()
176
+        }
177
+      },
178
+      handleClose() {
179
+        this.hide()
180
+      },
181
+      onFinish() {
182
+        this.selectedPaths = this.getChangeNodes()
183
+        this.$emit('change', this.selectedPaths)
184
+        this.hide()
185
+      }
186
+    }
187
+  }
188
+</script>
189
+
190
+<style>
191
+  @import url("../uni-data-pickerview/uni-data-pickerview.css");
192
+
193
+  .uni-data-tree {
194
+    position: relative;
195
+  }
196
+
197
+  .uni-data-tree-input {
198
+    position: relative;
199
+  }
200
+
201
+  .selected-loading {
202
+    display: flex;
203
+    justify-content: center;
204
+    position: absolute;
205
+    left: 0;
206
+    top: 0;
207
+    right: 0;
208
+    bottom: 0;
209
+  }
210
+
211
+  .error-text {
212
+    flex: 1;
213
+    font-size: 12px;
214
+    color: #DD524D;
215
+  }
216
+
217
+  .input-value {
218
+    flex-direction: row;
219
+    align-items: center;
220
+    flex-wrap: nowrap;
221
+    padding: 5px 5px;
222
+    padding-right: 5px;
223
+    overflow: hidden;
224
+    min-height: 28px;
225
+  }
226
+
227
+  .input-value-border {
228
+    border: 1px solid #e5e5e5;
229
+    border-radius: 5px;
230
+  }
231
+
232
+  .selected-path {
233
+    flex: 1;
234
+    flex-direction: row;
235
+    overflow: hidden;
236
+  }
237
+
238
+  .load-more {
239
+    width: 40px;
240
+  }
241
+
242
+  .selected-list {
243
+    flex-direction: row;
244
+    flex-wrap: nowrap;
245
+  }
246
+
247
+  .selected-item {
248
+    flex-direction: row;
249
+    flex-wrap: nowrap;
250
+  }
251
+
252
+  .text-color {
253
+    font-size: 14px;
254
+    color: #333;
255
+  }
256
+
257
+  .placeholder {
258
+    color: grey;
259
+    font-size: 14px;
260
+  }
261
+
262
+  .input-split-line {
263
+    opacity: .5;
264
+    margin-left: 1px;
265
+    margin-right: 1px;
266
+  }
267
+
268
+  .arrow-area {
269
+    position: relative;
270
+    padding: 0 12px;
271
+    margin-left: auto;
272
+    justify-content: center;
273
+    transform: rotate(-45deg);
274
+    transform-origin: center;
275
+  }
276
+
277
+  .input-arrow {
278
+    width: 8px;
279
+    height: 8px;
280
+    border-left: 2px solid #999;
281
+    border-bottom: 2px solid #999;
282
+  }
283
+
284
+  .uni-data-tree-cover {
285
+    position: fixed;
286
+    left: 0;
287
+    top: 0;
288
+    right: 0;
289
+    bottom: 0;
290
+    background-color: rgba(0, 0, 0, .4);
291
+    flex-direction: column;
292
+    z-index: 100;
293
+  }
294
+
295
+  .uni-data-tree-dialog {
296
+    position: fixed;
297
+    left: 0;
298
+    top: 20%;
299
+    right: 0;
300
+    bottom: 0;
301
+    background-color: #FFFFFF;
302
+    border-top-left-radius: 10px;
303
+    border-top-right-radius: 10px;
304
+    flex-direction: column;
305
+    z-index: 102;
306
+    overflow: hidden;
307
+  }
308
+
309
+  .dialog-caption {
310
+    position: relative;
311
+    flex-direction: row;
312
+  }
313
+
314
+  .dialog-title-view {
315
+    flex: 1;
316
+  }
317
+
318
+  .dialog-title {
319
+    align-self: center;
320
+    padding: 0 10px;
321
+    line-height: 44px;
322
+  }
323
+
324
+  .dialog-close {
325
+    position: absolute;
326
+    top: 0;
327
+    right: 0;
328
+    bottom: 0;
329
+    flex-direction: row;
330
+    align-items: center;
331
+    padding: 0 15px;
332
+  }
333
+
334
+  .dialog-close-plus {
335
+    width: 16px;
336
+    height: 2px;
337
+    background-color: #666;
338
+    border-radius: 2px;
339
+    transform: rotate(45deg);
340
+  }
341
+
342
+  .dialog-close-rotate {
343
+    position: absolute;
344
+    transform: rotate(-45deg);
345
+  }
346
+
347
+  .uni-data-pickerview {
348
+    flex: 1;
349
+  }
350
+
351
+  .icon-clear {
352
+    display: flex;
353
+    align-items: center;
354
+  }
355
+
356
+  /* #ifdef H5 */
357
+  @media all and (min-width: 768px) {
358
+    .uni-data-tree-cover {
359
+      background-color: transparent;
360
+    }
361
+
362
+    .uni-data-tree-dialog {
363
+      position: absolute;
364
+      top: 55px;
365
+      height: auto;
366
+      min-height: 400px;
367
+      max-height: 50vh;
368
+      background-color: #fff;
369
+      border: 1px solid #EBEEF5;
370
+      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
371
+      border-radius: 4px;
372
+      overflow: unset;
373
+    }
374
+
375
+    .dialog-caption {
376
+      display: none;
377
+    }
378
+  }
379
+  /* #endif */
380
+</style>

+ 551 - 0
uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue

@@ -0,0 +1,551 @@
1
+<template>
2
+  <view class="uni-data-tree">
3
+    <view class="uni-data-tree-input" @click="handleInput">
4
+      <slot :options="options" :data="inputSelected" :error="errorMessage">
5
+        <view class="input-value" :class="{'input-value-border': border}">
6
+          <text v-if="errorMessage" class="selected-area error-text">{{errorMessage}}</text>
7
+          <view v-else-if="loading && !isOpened" class="selected-area">
8
+            <uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more>
9
+          </view>
10
+          <scroll-view v-else-if="inputSelected.length" class="selected-area" scroll-x="true">
11
+            <view class="selected-list">
12
+              <view class="selected-item" v-for="(item,index) in inputSelected" :key="index">
13
+                <text class="text-color">{{item.text}}</text><text v-if="index<inputSelected.length-1"
14
+                  class="input-split-line">{{split}}</text>
15
+              </view>
16
+            </view>
17
+          </scroll-view>
18
+          <text v-else class="selected-area placeholder">{{placeholder}}</text>
19
+          <view v-if="clearIcon && !readonly && inputSelected.length" class="icon-clear" @click.stop="clear">
20
+            <uni-icons type="clear" color="#c0c4cc" size="24"></uni-icons>
21
+          </view>
22
+          <view class="arrow-area" v-if="(!clearIcon || !inputSelected.length) && !readonly ">
23
+            <view class="input-arrow"></view>
24
+          </view>
25
+        </view>
26
+      </slot>
27
+    </view>
28
+    <view class="uni-data-tree-cover" v-if="isOpened" @click="handleClose"></view>
29
+    <view class="uni-data-tree-dialog" v-if="isOpened">
30
+      <view class="uni-popper__arrow"></view>
31
+      <view class="dialog-caption">
32
+        <view class="title-area">
33
+          <text class="dialog-title">{{popupTitle}}</text>
34
+        </view>
35
+        <view class="dialog-close" @click="handleClose">
36
+          <view class="dialog-close-plus" data-id="close"></view>
37
+          <view class="dialog-close-plus dialog-close-rotate" data-id="close"></view>
38
+        </view>
39
+      </view>
40
+      <data-picker-view class="picker-view" ref="pickerView" v-model="dataValue" :localdata="localdata"
41
+        :preload="preload" :collection="collection" :field="field" :orderby="orderby" :where="where"
42
+        :step-searh="stepSearh" :self-field="selfField" :parent-field="parentField" :managed-mode="true" :map="map"
43
+        :ellipsis="ellipsis" @change="onchange" @datachange="ondatachange" @nodeclick="onnodeclick">
44
+      </data-picker-view>
45
+    </view>
46
+  </view>
47
+</template>
48
+
49
+<script>
50
+  import dataPicker from "../uni-data-pickerview/uni-data-picker.js"
51
+  import DataPickerView from "../uni-data-pickerview/uni-data-pickerview.vue"
52
+
53
+  /**
54
+   * DataPicker 级联选择
55
+   * @description 支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。
56
+   * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
57
+   * @property {String} popup-title 弹出窗口标题
58
+   * @property {Array} localdata 本地数据,参考
59
+   * @property {Boolean} border = [true|false] 是否有边框
60
+   * @property {Boolean} readonly = [true|false] 是否仅读
61
+   * @property {Boolean} preload = [true|false] 是否预加载数据
62
+   * @value true 开启预加载数据,点击弹出窗口后显示已加载数据
63
+   * @value false 关闭预加载数据,点击弹出窗口后开始加载数据
64
+   * @property {Boolean} step-searh = [true|false] 是否分布查询
65
+   * @value true 启用分布查询,仅查询当前选中节点
66
+   * @value false 关闭分布查询,一次查询出所有数据
67
+   * @property {String|DBFieldString} self-field 分布查询当前字段名称
68
+   * @property {String|DBFieldString} parent-field 分布查询父字段名称
69
+   * @property {String|DBCollectionString} collection 表名
70
+   * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
71
+   * @property {String} orderby 排序字段及正序倒叙设置
72
+   * @property {String|JQLString} where 查询条件
73
+   * @event {Function} popupshow 弹出的选择窗口打开时触发此事件
74
+   * @event {Function} popuphide 弹出的选择窗口关闭时触发此事件
75
+   */
76
+  export default {
77
+    name: 'UniDataPicker',
78
+    emits: ['popupopened', 'popupclosed', 'nodeclick', 'input', 'change', 'update:modelValue','inputclick'],
79
+    mixins: [dataPicker],
80
+    components: {
81
+      DataPickerView
82
+    },
83
+    props: {
84
+      options: {
85
+        type: [Object, Array],
86
+        default () {
87
+          return {}
88
+        }
89
+      },
90
+      popupTitle: {
91
+        type: String,
92
+        default: '请选择'
93
+      },
94
+      placeholder: {
95
+        type: String,
96
+        default: '请选择'
97
+      },
98
+      heightMobile: {
99
+        type: String,
100
+        default: ''
101
+      },
102
+      readonly: {
103
+        type: Boolean,
104
+        default: false
105
+      },
106
+      clearIcon: {
107
+        type: Boolean,
108
+        default: true
109
+      },
110
+      border: {
111
+        type: Boolean,
112
+        default: true
113
+      },
114
+      split: {
115
+        type: String,
116
+        default: '/'
117
+      },
118
+      ellipsis: {
119
+        type: Boolean,
120
+        default: true
121
+      }
122
+    },
123
+    data() {
124
+      return {
125
+        isOpened: false,
126
+        inputSelected: []
127
+      }
128
+    },
129
+    created() {
130
+      this.$nextTick(() => {
131
+        this.load();
132
+      })
133
+    },
134
+    watch: {
135
+			localdata: {
136
+				handler() {
137
+					this.load()
138
+				},
139
+        deep: true
140
+			},
141
+    },
142
+    methods: {
143
+      clear() {
144
+        this._dispatchEvent([]);
145
+      },
146
+      onPropsChange() {
147
+        this._treeData = [];
148
+        this.selectedIndex = 0;
149
+
150
+        this.load();
151
+      },
152
+      load() {
153
+        if (this.readonly) {
154
+          this._processReadonly(this.localdata, this.dataValue);
155
+          return;
156
+        }
157
+
158
+        // 回显本地数据
159
+        if (this.isLocalData) {
160
+          this.loadData();
161
+          this.inputSelected = this.selected.slice(0);
162
+        } else if (this.isCloudDataList || this.isCloudDataTree) { // 回显 Cloud 数据
163
+          this.loading = true;
164
+          this.getCloudDataValue().then((res) => {
165
+            this.loading = false;
166
+            this.inputSelected = res;
167
+          }).catch((err) => {
168
+            this.loading = false;
169
+            this.errorMessage = err;
170
+          })
171
+        }
172
+      },
173
+      show() {
174
+        this.isOpened = true
175
+        setTimeout(() => {
176
+          this.$refs.pickerView.updateData({
177
+            treeData: this._treeData,
178
+            selected: this.selected,
179
+            selectedIndex: this.selectedIndex
180
+          })
181
+        }, 200)
182
+        this.$emit('popupopened')
183
+      },
184
+      hide() {
185
+        this.isOpened = false
186
+        this.$emit('popupclosed')
187
+      },
188
+      handleInput() {
189
+        if (this.readonly) {
190
+					this.$emit('inputclick')
191
+          return
192
+        }
193
+        this.show()
194
+      },
195
+      handleClose(e) {
196
+        this.hide()
197
+      },
198
+      onnodeclick(e) {
199
+        this.$emit('nodeclick', e)
200
+      },
201
+      ondatachange(e) {
202
+        this._treeData = this.$refs.pickerView._treeData
203
+      },
204
+      onchange(e) {
205
+        this.hide()
206
+        this.$nextTick(() => {
207
+          this.inputSelected = e;
208
+        })
209
+        this._dispatchEvent(e)
210
+      },
211
+      _processReadonly(dataList, value) {
212
+        var isTree = dataList.findIndex((item) => {
213
+          return item.children
214
+        })
215
+        if (isTree > -1) {
216
+          let inputValue
217
+          if (Array.isArray(value)) {
218
+            inputValue = value[value.length - 1]
219
+            if (typeof inputValue === 'object' && inputValue.value) {
220
+              inputValue = inputValue.value
221
+            }
222
+          } else {
223
+            inputValue = value
224
+          }
225
+          this.inputSelected = this._findNodePath(inputValue, this.localdata)
226
+          return
227
+        }
228
+
229
+        if (!this.hasValue) {
230
+          this.inputSelected = []
231
+          return
232
+        }
233
+
234
+        let result = []
235
+        for (let i = 0; i < value.length; i++) {
236
+          var val = value[i]
237
+          var item = dataList.find((v) => {
238
+            return v.value == val
239
+          })
240
+          if (item) {
241
+            result.push(item)
242
+          }
243
+        }
244
+        if (result.length) {
245
+          this.inputSelected = result
246
+        }
247
+      },
248
+      _filterForArray(data, valueArray) {
249
+        var result = []
250
+        for (let i = 0; i < valueArray.length; i++) {
251
+          var value = valueArray[i]
252
+          var found = data.find((item) => {
253
+            return item.value == value
254
+          })
255
+          if (found) {
256
+            result.push(found)
257
+          }
258
+        }
259
+        return result
260
+      },
261
+      _dispatchEvent(selected) {
262
+        let item = {}
263
+        if (selected.length) {
264
+          var value = new Array(selected.length)
265
+          for (var i = 0; i < selected.length; i++) {
266
+            value[i] = selected[i].value
267
+          }
268
+          item = selected[selected.length - 1]
269
+        } else {
270
+          item.value = ''
271
+        }
272
+        if (this.formItem) {
273
+          this.formItem.setValue(item.value)
274
+        }
275
+
276
+        this.$emit('input', item.value)
277
+        this.$emit('update:modelValue', item.value)
278
+        this.$emit('change', {
279
+          detail: {
280
+            value: selected
281
+          }
282
+        })
283
+      }
284
+    }
285
+  }
286
+</script>
287
+
288
+<style>
289
+  .uni-data-tree {
290
+    flex: 1;
291
+    position: relative;
292
+    font-size: 14px;
293
+  }
294
+
295
+  .error-text {
296
+    color: #DD524D;
297
+  }
298
+
299
+  .input-value {
300
+    /* #ifndef APP-NVUE */
301
+    display: flex;
302
+    /* #endif */
303
+    flex-direction: row;
304
+    align-items: center;
305
+    flex-wrap: nowrap;
306
+    font-size: 14px;
307
+    /* line-height: 35px; */
308
+    padding: 0 10px;
309
+    padding-right: 5px;
310
+    overflow: hidden;
311
+    height: 35px;
312
+    /* #ifndef APP-NVUE */
313
+    box-sizing: border-box;
314
+    /* #endif */
315
+  }
316
+
317
+  .input-value-border {
318
+    border: 1px solid #e5e5e5;
319
+    border-radius: 5px;
320
+  }
321
+
322
+  .selected-area {
323
+    flex: 1;
324
+    overflow: hidden;
325
+    /* #ifndef APP-NVUE */
326
+    display: flex;
327
+    /* #endif */
328
+    flex-direction: row;
329
+  }
330
+
331
+  .load-more {
332
+    /* #ifndef APP-NVUE */
333
+    margin-right: auto;
334
+    /* #endif */
335
+    /* #ifdef APP-NVUE */
336
+    width: 40px;
337
+    /* #endif */
338
+  }
339
+
340
+  .selected-list {
341
+    /* #ifndef APP-NVUE */
342
+    display: flex;
343
+    /* #endif */
344
+    flex-direction: row;
345
+    flex-wrap: nowrap;
346
+    /* padding: 0 5px; */
347
+  }
348
+
349
+  .selected-item {
350
+    flex-direction: row;
351
+    /* padding: 0 1px; */
352
+    /* #ifndef APP-NVUE */
353
+    white-space: nowrap;
354
+    /* #endif */
355
+  }
356
+
357
+  .text-color {
358
+    color: #333;
359
+  }
360
+
361
+  .placeholder {
362
+    color: grey;
363
+    font-size: 12px;
364
+  }
365
+
366
+  .input-split-line {
367
+    opacity: .5;
368
+  }
369
+
370
+  .arrow-area {
371
+    position: relative;
372
+    width: 20px;
373
+    /* #ifndef APP-NVUE */
374
+    margin-bottom: 5px;
375
+    margin-left: auto;
376
+    display: flex;
377
+    /* #endif */
378
+    justify-content: center;
379
+    transform: rotate(-45deg);
380
+    transform-origin: center;
381
+  }
382
+
383
+  .input-arrow {
384
+    width: 7px;
385
+    height: 7px;
386
+    border-left: 1px solid #999;
387
+    border-bottom: 1px solid #999;
388
+  }
389
+
390
+  .uni-data-tree-cover {
391
+    position: fixed;
392
+    left: 0;
393
+    top: 0;
394
+    right: 0;
395
+    bottom: 0;
396
+    background-color: rgba(0, 0, 0, .4);
397
+    /* #ifndef APP-NVUE */
398
+    display: flex;
399
+    /* #endif */
400
+    flex-direction: column;
401
+    z-index: 100;
402
+  }
403
+
404
+  .uni-data-tree-dialog {
405
+    position: fixed;
406
+    left: 0;
407
+    /* #ifndef APP-NVUE */
408
+    top: 20%;
409
+    /* #endif */
410
+    /* #ifdef APP-NVUE */
411
+    top: 200px;
412
+    /* #endif */
413
+    right: 0;
414
+    bottom: 0;
415
+    background-color: #FFFFFF;
416
+    border-top-left-radius: 10px;
417
+    border-top-right-radius: 10px;
418
+    /* #ifndef APP-NVUE */
419
+    display: flex;
420
+    /* #endif */
421
+    flex-direction: column;
422
+    z-index: 102;
423
+    overflow: hidden;
424
+    /* #ifdef APP-NVUE */
425
+    width: 750rpx;
426
+    /* #endif */
427
+  }
428
+
429
+  .dialog-caption {
430
+    position: relative;
431
+    /* #ifndef APP-NVUE */
432
+    display: flex;
433
+    /* #endif */
434
+    flex-direction: row;
435
+    /* border-bottom: 1px solid #f0f0f0; */
436
+  }
437
+
438
+  .title-area {
439
+    /* #ifndef APP-NVUE */
440
+    display: flex;
441
+    /* #endif */
442
+    align-items: center;
443
+    /* #ifndef APP-NVUE */
444
+    margin: auto;
445
+    /* #endif */
446
+    padding: 0 10px;
447
+  }
448
+
449
+  .dialog-title {
450
+    /* font-weight: bold; */
451
+    line-height: 44px;
452
+  }
453
+
454
+  .dialog-close {
455
+    position: absolute;
456
+    top: 0;
457
+    right: 0;
458
+    bottom: 0;
459
+    /* #ifndef APP-NVUE */
460
+    display: flex;
461
+    /* #endif */
462
+    flex-direction: row;
463
+    align-items: center;
464
+    padding: 0 15px;
465
+  }
466
+
467
+  .dialog-close-plus {
468
+    width: 16px;
469
+    height: 2px;
470
+    background-color: #666;
471
+    border-radius: 2px;
472
+    transform: rotate(45deg);
473
+  }
474
+
475
+  .dialog-close-rotate {
476
+    position: absolute;
477
+    transform: rotate(-45deg);
478
+  }
479
+
480
+  .picker-view {
481
+    flex: 1;
482
+    overflow: hidden;
483
+  }
484
+
485
+  .icon-clear {
486
+    display: flex;
487
+    align-items: center;
488
+  }
489
+
490
+  /* #ifdef H5 */
491
+  @media all and (min-width: 768px) {
492
+    .uni-data-tree-cover {
493
+      background-color: transparent;
494
+    }
495
+
496
+    .uni-data-tree-dialog {
497
+      position: absolute;
498
+      top: 55px;
499
+      height: auto;
500
+      min-height: 400px;
501
+      max-height: 50vh;
502
+      background-color: #fff;
503
+      border: 1px solid #EBEEF5;
504
+      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
505
+      border-radius: 4px;
506
+      overflow: unset;
507
+    }
508
+
509
+    .dialog-caption {
510
+      display: none;
511
+    }
512
+
513
+    .icon-clear {
514
+      /* margin-right: 5px; */
515
+    }
516
+  }
517
+
518
+  /* #endif */
519
+
520
+  /* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */
521
+  /* #ifndef APP-NVUE */
522
+  .uni-popper__arrow,
523
+  .uni-popper__arrow::after {
524
+    position: absolute;
525
+    display: block;
526
+    width: 0;
527
+    height: 0;
528
+    border-color: transparent;
529
+    border-style: solid;
530
+    border-width: 6px;
531
+  }
532
+
533
+  .uni-popper__arrow {
534
+    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
535
+    top: -6px;
536
+    left: 10%;
537
+    margin-right: 3px;
538
+    border-top-width: 0;
539
+    border-bottom-color: #EBEEF5;
540
+  }
541
+
542
+  .uni-popper__arrow::after {
543
+    content: " ";
544
+    top: 1px;
545
+    margin-left: -6px;
546
+    border-top-width: 0;
547
+    border-bottom-color: #fff;
548
+  }
549
+
550
+  /* #endif */
551
+</style>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/loading.uts


+ 622 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js

@@ -0,0 +1,622 @@
1
+export default {
2
+  props: {
3
+    localdata: {
4
+      type: [Array, Object],
5
+      default () {
6
+        return []
7
+      }
8
+    },
9
+    spaceInfo: {
10
+      type: Object,
11
+      default () {
12
+        return {}
13
+      }
14
+    },
15
+    collection: {
16
+      type: String,
17
+      default: ''
18
+    },
19
+    action: {
20
+      type: String,
21
+      default: ''
22
+    },
23
+    field: {
24
+      type: String,
25
+      default: ''
26
+    },
27
+    orderby: {
28
+      type: String,
29
+      default: ''
30
+    },
31
+    where: {
32
+      type: [String, Object],
33
+      default: ''
34
+    },
35
+    pageData: {
36
+      type: String,
37
+      default: 'add'
38
+    },
39
+    pageCurrent: {
40
+      type: Number,
41
+      default: 1
42
+    },
43
+    pageSize: {
44
+      type: Number,
45
+      default: 500
46
+    },
47
+    getcount: {
48
+      type: [Boolean, String],
49
+      default: false
50
+    },
51
+    getone: {
52
+      type: [Boolean, String],
53
+      default: false
54
+    },
55
+    gettree: {
56
+      type: [Boolean, String],
57
+      default: false
58
+    },
59
+    manual: {
60
+      type: Boolean,
61
+      default: false
62
+    },
63
+    value: {
64
+      type: [Array, String, Number],
65
+      default () {
66
+        return []
67
+      }
68
+    },
69
+    modelValue: {
70
+      type: [Array, String, Number],
71
+      default () {
72
+        return []
73
+      }
74
+    },
75
+    preload: {
76
+      type: Boolean,
77
+      default: false
78
+    },
79
+    stepSearh: {
80
+      type: Boolean,
81
+      default: true
82
+    },
83
+    selfField: {
84
+      type: String,
85
+      default: ''
86
+    },
87
+    parentField: {
88
+      type: String,
89
+      default: ''
90
+    },
91
+    multiple: {
92
+      type: Boolean,
93
+      default: false
94
+    },
95
+    map: {
96
+      type: Object,
97
+      default () {
98
+        return {
99
+          text: "text",
100
+          value: "value"
101
+        }
102
+      }
103
+    }
104
+  },
105
+  data() {
106
+    return {
107
+      loading: false,
108
+      errorMessage: '',
109
+      loadMore: {
110
+        contentdown: '',
111
+        contentrefresh: '',
112
+        contentnomore: ''
113
+      },
114
+      dataList: [],
115
+      selected: [],
116
+      selectedIndex: 0,
117
+      page: {
118
+        current: this.pageCurrent,
119
+        size: this.pageSize,
120
+        count: 0
121
+      }
122
+    }
123
+  },
124
+  computed: {
125
+    isLocalData() {
126
+      return !this.collection.length;
127
+    },
128
+    isCloudData() {
129
+      return this.collection.length > 0;
130
+    },
131
+    isCloudDataList() {
132
+      return (this.isCloudData && (!this.parentField && !this.selfField));
133
+    },
134
+    isCloudDataTree() {
135
+      return (this.isCloudData && this.parentField && this.selfField);
136
+    },
137
+    dataValue() {
138
+      let isModelValue = Array.isArray(this.modelValue) ? (this.modelValue.length > 0) : (this.modelValue !== null ||
139
+        this.modelValue !== undefined);
140
+      return isModelValue ? this.modelValue : this.value;
141
+    },
142
+    hasValue() {
143
+      if (typeof this.dataValue === 'number') {
144
+        return true
145
+      }
146
+      return (this.dataValue != null) && (this.dataValue.length > 0)
147
+    }
148
+  },
149
+  created() {
150
+    this.$watch(() => {
151
+      var al = [];
152
+      ['pageCurrent',
153
+        'pageSize',
154
+        'spaceInfo',
155
+        'value',
156
+        'modelValue',
157
+        'localdata',
158
+        'collection',
159
+        'action',
160
+        'field',
161
+        'orderby',
162
+        'where',
163
+        'getont',
164
+        'getcount',
165
+        'gettree'
166
+      ].forEach(key => {
167
+        al.push(this[key])
168
+      });
169
+      return al
170
+    }, (newValue, oldValue) => {
171
+      let needReset = false
172
+      for (let i = 2; i < newValue.length; i++) {
173
+        if (newValue[i] != oldValue[i]) {
174
+          needReset = true
175
+          break
176
+        }
177
+      }
178
+      if (newValue[0] != oldValue[0]) {
179
+        this.page.current = this.pageCurrent
180
+      }
181
+      this.page.size = this.pageSize
182
+
183
+      this.onPropsChange()
184
+    })
185
+    this._treeData = []
186
+  },
187
+  methods: {
188
+    onPropsChange() {
189
+      this._treeData = [];
190
+    },
191
+
192
+    // 填充 pickview 数据
193
+    async loadData() {
194
+      if (this.isLocalData) {
195
+        this.loadLocalData();
196
+      } else if (this.isCloudDataList) {
197
+        this.loadCloudDataList();
198
+      } else if (this.isCloudDataTree) {
199
+        this.loadCloudDataTree();
200
+      }
201
+    },
202
+
203
+    // 加载本地数据
204
+    async loadLocalData() {
205
+      this._treeData = [];
206
+      this._extractTree(this.localdata, this._treeData);
207
+
208
+      let inputValue = this.dataValue;
209
+      if (inputValue === undefined) {
210
+        return;
211
+      }
212
+
213
+      if (Array.isArray(inputValue)) {
214
+        inputValue = inputValue[inputValue.length - 1];
215
+        if (typeof inputValue === 'object' && inputValue[this.map.value]) {
216
+          inputValue = inputValue[this.map.value];
217
+        }
218
+      }
219
+
220
+      this.selected = this._findNodePath(inputValue, this.localdata);
221
+    },
222
+
223
+    // 加载 Cloud 数据 (单列)
224
+    async loadCloudDataList() {
225
+      if (this.loading) {
226
+        return;
227
+      }
228
+      this.loading = true;
229
+
230
+      try {
231
+        let response = await this.getCommand();
232
+        let responseData = response.result.data;
233
+
234
+        this._treeData = responseData;
235
+
236
+        this._updateBindData();
237
+        this._updateSelected();
238
+
239
+        this.onDataChange();
240
+      } catch (e) {
241
+        this.errorMessage = e;
242
+      } finally {
243
+        this.loading = false;
244
+      }
245
+    },
246
+
247
+    // 加载 Cloud 数据 (树形)
248
+    async loadCloudDataTree() {
249
+      if (this.loading) {
250
+        return;
251
+      }
252
+      this.loading = true;
253
+
254
+      try {
255
+        let commandOptions = {
256
+          field: this._cloudDataPostField(),
257
+          where: this._cloudDataTreeWhere()
258
+        };
259
+        if (this.gettree) {
260
+          commandOptions.startwith = `${this.selfField}=='${this.dataValue}'`;
261
+        }
262
+
263
+        let response = await this.getCommand(commandOptions);
264
+        let responseData = response.result.data;
265
+
266
+        this._treeData = responseData;
267
+        this._updateBindData();
268
+        this._updateSelected();
269
+
270
+        this.onDataChange();
271
+      } catch (e) {
272
+        this.errorMessage = e;
273
+      } finally {
274
+        this.loading = false;
275
+      }
276
+    },
277
+
278
+    // 加载 Cloud 数据 (节点)
279
+    async loadCloudDataNode(callback) {
280
+      if (this.loading) {
281
+        return;
282
+      }
283
+      this.loading = true;
284
+
285
+      try {
286
+        let commandOptions = {
287
+          field: this._cloudDataPostField(),
288
+          where: this._cloudDataNodeWhere()
289
+        };
290
+
291
+        let response = await this.getCommand(commandOptions);
292
+        let responseData = response.result.data;
293
+
294
+        callback(responseData);
295
+      } catch (e) {
296
+        this.errorMessage = e;
297
+      } finally {
298
+        this.loading = false;
299
+      }
300
+    },
301
+
302
+    // 回显 Cloud 数据
303
+    getCloudDataValue() {
304
+      if (this.isCloudDataList) {
305
+        return this.getCloudDataListValue();
306
+      }
307
+
308
+      if (this.isCloudDataTree) {
309
+        return this.getCloudDataTreeValue();
310
+      }
311
+    },
312
+
313
+    // 回显 Cloud 数据 (单列)
314
+    getCloudDataListValue() {
315
+      // 根据 field's as value标识匹配 where 条件
316
+      let where = [];
317
+      let whereField = this._getForeignKeyByField();
318
+      if (whereField) {
319
+        where.push(`${whereField} == '${this.dataValue}'`)
320
+      }
321
+
322
+      where = where.join(' || ');
323
+
324
+      if (this.where) {
325
+        where = `(${this.where}) && (${where})`
326
+      }
327
+
328
+      return this.getCommand({
329
+        field: this._cloudDataPostField(),
330
+        where
331
+      }).then((res) => {
332
+        this.selected = res.result.data;
333
+        return res.result.data;
334
+      });
335
+    },
336
+
337
+    // 回显 Cloud 数据 (树形)
338
+    getCloudDataTreeValue() {
339
+      return this.getCommand({
340
+        field: this._cloudDataPostField(),
341
+        getTreePath: {
342
+          startWith: `${this.selfField}=='${this.dataValue}'`
343
+        }
344
+      }).then((res) => {
345
+        let treePath = [];
346
+        this._extractTreePath(res.result.data, treePath);
347
+        this.selected = treePath;
348
+        return treePath;
349
+      });
350
+    },
351
+
352
+    getCommand(options = {}) {
353
+      /* eslint-disable no-undef */
354
+      let db = uniCloud.database(this.spaceInfo)
355
+
356
+      const action = options.action || this.action
357
+      if (action) {
358
+        db = db.action(action)
359
+      }
360
+
361
+      const collection = options.collection || this.collection
362
+      db = db.collection(collection)
363
+
364
+      const where = options.where || this.where
365
+      if (!(!where || !Object.keys(where).length)) {
366
+        db = db.where(where)
367
+      }
368
+
369
+      const field = options.field || this.field
370
+      if (field) {
371
+        db = db.field(field)
372
+      }
373
+
374
+      const orderby = options.orderby || this.orderby
375
+      if (orderby) {
376
+        db = db.orderBy(orderby)
377
+      }
378
+
379
+      const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current
380
+      const size = options.pageSize !== undefined ? options.pageSize : this.page.size
381
+      const getCount = options.getcount !== undefined ? options.getcount : this.getcount
382
+      const getTree = options.gettree !== undefined ? options.gettree : this.gettree
383
+
384
+      const getOptions = {
385
+        getCount,
386
+        getTree
387
+      }
388
+      if (options.getTreePath) {
389
+        getOptions.getTreePath = options.getTreePath
390
+      }
391
+
392
+      db = db.skip(size * (current - 1)).limit(size).get(getOptions)
393
+
394
+      return db
395
+    },
396
+
397
+    _cloudDataPostField() {
398
+      let fields = [this.field];
399
+      if (this.parentField) {
400
+        fields.push(`${this.parentField} as parent_value`);
401
+      }
402
+      return fields.join(',');
403
+    },
404
+
405
+    _cloudDataTreeWhere() {
406
+      let result = []
407
+      let selected = this.selected
408
+      let parentField = this.parentField
409
+      if (parentField) {
410
+        result.push(`${parentField} == null || ${parentField} == ""`)
411
+      }
412
+      if (selected.length) {
413
+        for (var i = 0; i < selected.length - 1; i++) {
414
+          result.push(`${parentField} == '${selected[i].value}'`)
415
+        }
416
+      }
417
+
418
+      let where = []
419
+      if (this.where) {
420
+        where.push(`(${this.where})`)
421
+      }
422
+
423
+      if (result.length) {
424
+        where.push(`(${result.join(' || ')})`)
425
+      }
426
+
427
+      return where.join(' && ')
428
+    },
429
+
430
+    _cloudDataNodeWhere() {
431
+      let where = []
432
+      let selected = this.selected;
433
+      if (selected.length) {
434
+        where.push(`${this.parentField} == '${selected[selected.length - 1].value}'`);
435
+      }
436
+
437
+      where = where.join(' || ');
438
+
439
+      if (this.where) {
440
+        return `(${this.where}) && (${where})`
441
+      }
442
+
443
+      return where
444
+    },
445
+
446
+    _getWhereByForeignKey() {
447
+      let result = []
448
+      let whereField = this._getForeignKeyByField();
449
+      if (whereField) {
450
+        result.push(`${whereField} == '${this.dataValue}'`)
451
+      }
452
+
453
+      if (this.where) {
454
+        return `(${this.where}) && (${result.join(' || ')})`
455
+      }
456
+
457
+      return result.join(' || ')
458
+    },
459
+
460
+    _getForeignKeyByField() {
461
+      let fields = this.field.split(',');
462
+      let whereField = null;
463
+      for (let i = 0; i < fields.length; i++) {
464
+        const items = fields[i].split('as');
465
+        if (items.length < 2) {
466
+          continue;
467
+        }
468
+        if (items[1].trim() === 'value') {
469
+          whereField = items[0].trim();
470
+          break;
471
+        }
472
+      }
473
+      return whereField;
474
+    },
475
+
476
+    _updateBindData(node) {
477
+      const {
478
+        dataList,
479
+        hasNodes
480
+      } = this._filterData(this._treeData, this.selected)
481
+
482
+      let isleaf = this._stepSearh === false && !hasNodes
483
+
484
+      if (node) {
485
+        node.isleaf = isleaf
486
+      }
487
+
488
+      this.dataList = dataList
489
+      this.selectedIndex = dataList.length - 1
490
+
491
+      if (!isleaf && this.selected.length < dataList.length) {
492
+        this.selected.push({
493
+          value: null,
494
+          text: "请选择"
495
+        })
496
+      }
497
+
498
+      return {
499
+        isleaf,
500
+        hasNodes
501
+      }
502
+    },
503
+
504
+    _updateSelected() {
505
+      let dl = this.dataList
506
+      let sl = this.selected
507
+      let textField = this.map.text
508
+      let valueField = this.map.value
509
+      for (let i = 0; i < sl.length; i++) {
510
+        let value = sl[i].value
511
+        let dl2 = dl[i]
512
+        for (let j = 0; j < dl2.length; j++) {
513
+          let item2 = dl2[j]
514
+          if (item2[valueField] === value) {
515
+            sl[i].text = item2[textField]
516
+            break
517
+          }
518
+        }
519
+      }
520
+    },
521
+
522
+    _filterData(data, paths) {
523
+      let dataList = []
524
+      let hasNodes = true
525
+
526
+      dataList.push(data.filter((item) => {
527
+        return (item.parent_value === null || item.parent_value === undefined || item.parent_value === '')
528
+      }))
529
+      for (let i = 0; i < paths.length; i++) {
530
+        let value = paths[i].value
531
+        let nodes = data.filter((item) => {
532
+          return item.parent_value === value
533
+        })
534
+
535
+        if (nodes.length) {
536
+          dataList.push(nodes)
537
+        } else {
538
+          hasNodes = false
539
+        }
540
+      }
541
+
542
+      return {
543
+        dataList,
544
+        hasNodes
545
+      }
546
+    },
547
+
548
+    _extractTree(nodes, result, parent_value) {
549
+      let list = result || []
550
+      let valueField = this.map.value
551
+      for (let i = 0; i < nodes.length; i++) {
552
+        let node = nodes[i]
553
+
554
+        let child = {}
555
+        for (let key in node) {
556
+          if (key !== 'children') {
557
+            child[key] = node[key]
558
+          }
559
+        }
560
+        if (parent_value !== null && parent_value !== undefined && parent_value !== '') {
561
+          child.parent_value = parent_value
562
+        }
563
+        result.push(child)
564
+
565
+        let children = node.children
566
+        if (children) {
567
+          this._extractTree(children, result, node[valueField])
568
+        }
569
+      }
570
+    },
571
+
572
+    _extractTreePath(nodes, result) {
573
+      let list = result || []
574
+      for (let i = 0; i < nodes.length; i++) {
575
+        let node = nodes[i]
576
+
577
+        let child = {}
578
+        for (let key in node) {
579
+          if (key !== 'children') {
580
+            child[key] = node[key]
581
+          }
582
+        }
583
+        result.push(child)
584
+
585
+        let children = node.children
586
+        if (children) {
587
+          this._extractTreePath(children, result)
588
+        }
589
+      }
590
+    },
591
+
592
+    _findNodePath(key, nodes, path = []) {
593
+      let textField = this.map.text
594
+      let valueField = this.map.value
595
+      for (let i = 0; i < nodes.length; i++) {
596
+        let node = nodes[i]
597
+        let children = node.children
598
+        let text = node[textField]
599
+        let value = node[valueField]
600
+
601
+        path.push({
602
+          value,
603
+          text
604
+        })
605
+
606
+        if (value === key) {
607
+          return path
608
+        }
609
+
610
+        if (children) {
611
+          const p = this._findNodePath(key, children, path)
612
+          if (p.length) {
613
+            return p
614
+          }
615
+        }
616
+
617
+        path.pop()
618
+      }
619
+      return []
620
+    }
621
+  }
622
+}

+ 693 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.uts

@@ -0,0 +1,693 @@
1
+export type PaginationType = {
2
+  current : number,
3
+  size : number,
4
+  count : number
5
+}
6
+
7
+export type LoadMoreType = {
8
+  contentdown : string,
9
+  contentrefresh : string,
10
+  contentnomore : string
11
+}
12
+
13
+export type SelectedItemType = {
14
+  name : string,
15
+  value : string,
16
+}
17
+
18
+export type GetCommandOptions = {
19
+  collection ?: UTSJSONObject,
20
+  field ?: string,
21
+  orderby ?: string,
22
+  where ?: any,
23
+  pageData ?: string,
24
+  pageCurrent ?: number,
25
+  pageSize ?: number,
26
+  getCount ?: boolean,
27
+  getTree ?: any,
28
+  getTreePath ?: UTSJSONObject,
29
+  startwith ?: string,
30
+  limitlevel ?: number,
31
+  groupby ?: string,
32
+  groupField ?: string,
33
+  distinct ?: boolean,
34
+  pageIndistinct ?: boolean,
35
+  foreignKey ?: string,
36
+  loadtime ?: string,
37
+  manual ?: boolean
38
+}
39
+
40
+const DefaultSelectedNode = {
41
+  text: '请选择',
42
+  value: ''
43
+}
44
+
45
+export const dataPicker = defineMixin({
46
+  props: {
47
+    localdata: {
48
+      type: Array as PropType<Array<UTSJSONObject>>,
49
+      default: [] as Array<UTSJSONObject>
50
+    },
51
+    collection: {
52
+      type: Object,
53
+      default: ''
54
+    },
55
+    field: {
56
+      type: String,
57
+      default: ''
58
+    },
59
+    orderby: {
60
+      type: String,
61
+      default: ''
62
+    },
63
+    where: {
64
+      type: Object,
65
+      default: ''
66
+    },
67
+    pageData: {
68
+      type: String,
69
+      default: 'add'
70
+    },
71
+    pageCurrent: {
72
+      type: Number,
73
+      default: 1
74
+    },
75
+    pageSize: {
76
+      type: Number,
77
+      default: 20
78
+    },
79
+    getcount: {
80
+      type: Boolean,
81
+      default: false
82
+    },
83
+    gettree: {
84
+      type: Object,
85
+      default: ''
86
+    },
87
+    gettreepath: {
88
+      type: Object,
89
+      default: ''
90
+    },
91
+    startwith: {
92
+      type: String,
93
+      default: ''
94
+    },
95
+    limitlevel: {
96
+      type: Number,
97
+      default: 10
98
+    },
99
+    groupby: {
100
+      type: String,
101
+      default: ''
102
+    },
103
+    groupField: {
104
+      type: String,
105
+      default: ''
106
+    },
107
+    distinct: {
108
+      type: Boolean,
109
+      default: false
110
+    },
111
+    pageIndistinct: {
112
+      type: Boolean,
113
+      default: false
114
+    },
115
+    foreignKey: {
116
+      type: String,
117
+      default: ''
118
+    },
119
+    loadtime: {
120
+      type: String,
121
+      default: 'auto'
122
+    },
123
+    manual: {
124
+      type: Boolean,
125
+      default: false
126
+    },
127
+    preload: {
128
+      type: Boolean,
129
+      default: false
130
+    },
131
+    stepSearh: {
132
+      type: Boolean,
133
+      default: true
134
+    },
135
+    selfField: {
136
+      type: String,
137
+      default: ''
138
+    },
139
+    parentField: {
140
+      type: String,
141
+      default: ''
142
+    },
143
+    multiple: {
144
+      type: Boolean,
145
+      default: false
146
+    },
147
+    value: {
148
+      type: Object,
149
+      default: ''
150
+    },
151
+    modelValue: {
152
+      type: Object,
153
+      default: ''
154
+    },
155
+    defaultProps: {
156
+      type: Object as PropType<UTSJSONObject>,
157
+    }
158
+  },
159
+  data() {
160
+    return {
161
+      loading: false,
162
+      error: null as UniCloudError | null,
163
+      treeData: [] as Array<UTSJSONObject>,
164
+      selectedIndex: 0,
165
+      selectedNodes: [] as Array<UTSJSONObject>,
166
+      selectedPages: [] as Array<UTSJSONObject>[],
167
+      selectedValue: '',
168
+      selectedPaths: [] as Array<UTSJSONObject>,
169
+      pagination: {
170
+        current: 1,
171
+        size: 20,
172
+        count: 0
173
+      } as PaginationType
174
+    }
175
+  },
176
+  computed: {
177
+    mappingTextName() : string {
178
+      // TODO
179
+      return (this.defaultProps != null) ? this.defaultProps!.getString('text', 'text') : 'text'
180
+    },
181
+    mappingValueName() : string {
182
+      // TODO
183
+      return (this.defaultProps != null) ? this.defaultProps!.getString('value', 'value') : 'value'
184
+    },
185
+    currentDataList() : Array<UTSJSONObject> {
186
+      if (this.selectedIndex > this.selectedPages.length - 1) {
187
+        return [] as Array<UTSJSONObject>
188
+      }
189
+      return this.selectedPages[this.selectedIndex]
190
+    },
191
+    isLocalData() : boolean {
192
+      return this.localdata.length > 0
193
+    },
194
+    isCloudData() : boolean {
195
+      return this._checkIsNotNull(this.collection)
196
+    },
197
+    isCloudDataList() : boolean {
198
+      return (this.isCloudData && (this.parentField.length == 0 && this.selfField.length == 0))
199
+    },
200
+    isCloudDataTree() : boolean {
201
+      return (this.isCloudData && this.parentField.length > 0 && this.selfField.length > 0)
202
+    },
203
+    dataValue() : any {
204
+      return this.hasModelValue ? this.modelValue : this.value
205
+    },
206
+    hasCloudTreeData() : boolean {
207
+      return this.treeData.length > 0
208
+    },
209
+    hasModelValue() : boolean {
210
+      if (typeof this.modelValue == 'string') {
211
+        const valueString = this.modelValue as string
212
+        return (valueString.length > 0)
213
+      } else if (Array.isArray(this.modelValue)) {
214
+        const valueArray = this.modelValue as Array<string>
215
+        return (valueArray.length > 0)
216
+      }
217
+      return false
218
+    },
219
+    hasCloudDataValue() : boolean {
220
+      if (typeof this.dataValue == 'string') {
221
+        const valueString = this.dataValue as string
222
+        return (valueString.length > 0)
223
+      }
224
+      return false
225
+    }
226
+  },
227
+  created() {
228
+    this.pagination.current = this.pageCurrent
229
+    this.pagination.size = this.pageSize
230
+
231
+    this.$watch(
232
+      () : any => [
233
+        this.pageCurrent,
234
+        this.pageSize,
235
+        this.localdata,
236
+        this.value,
237
+        this.collection,
238
+        this.field,
239
+        this.getcount,
240
+        this.orderby,
241
+        this.where,
242
+        this.groupby,
243
+        this.groupField,
244
+        this.distinct
245
+      ],
246
+      (newValue : Array<any>, oldValue : Array<any>) => {
247
+        this.pagination.size = this.pageSize
248
+        if (newValue[0] !== oldValue[0]) {
249
+          this.pagination.current = this.pageCurrent
250
+        }
251
+
252
+        this.onPropsChange()
253
+      }
254
+    )
255
+  },
256
+  methods: {
257
+    onPropsChange() {
258
+      this.selectedIndex = 0
259
+      this.treeData.length = 0
260
+      this.selectedNodes.length = 0
261
+      this.selectedPages.length = 0
262
+      this.selectedPaths.length = 0
263
+
264
+      // 加载数据
265
+      this.$nextTick(() => {
266
+        this.loadData()
267
+      })
268
+    },
269
+
270
+    onTabSelect(index : number) {
271
+      this.selectedIndex = index
272
+    },
273
+
274
+    onNodeClick(nodeData : UTSJSONObject) {
275
+      if (nodeData.getBoolean('disable', false)) {
276
+        return
277
+      }
278
+
279
+      const isLeaf = this._checkIsLeafNode(nodeData)
280
+
281
+      this._trimSelectedNodes(nodeData)
282
+
283
+      this.$emit('nodeclick', nodeData)
284
+
285
+      if (this.isLocalData) {
286
+        if (isLeaf || !this._checkHasChildren(nodeData)) {
287
+          this.onFinish()
288
+        }
289
+      } else if (this.isCloudDataList) {
290
+        this.onFinish()
291
+      } else if (this.isCloudDataTree) {
292
+        if (isLeaf) {
293
+          this.onFinish()
294
+        } else if (!this._checkHasChildren(nodeData)) {
295
+          // 尝试请求一次,如果没有返回数据标记为叶子节点
296
+          this.loadCloudDataNode(nodeData)
297
+        }
298
+      }
299
+    },
300
+
301
+    getChangeNodes(): Array<UTSJSONObject> {
302
+      const nodes: Array<UTSJSONObject> = []
303
+      this.selectedNodes.forEach((node : UTSJSONObject) => {
304
+        const newNode: UTSJSONObject = {}
305
+        newNode[this.mappingTextName] = node.getString(this.mappingTextName)
306
+        newNode[this.mappingValueName] = node.getString(this.mappingValueName)
307
+        nodes.push(newNode)
308
+      })
309
+      return nodes
310
+    },
311
+
312
+    onFinish() { },
313
+
314
+    // 加载数据(自动判定环境)
315
+    loadData() {
316
+      if (this.isLocalData) {
317
+        this.loadLocalData()
318
+      } else if (this.isCloudDataList) {
319
+        this.loadCloudDataList()
320
+      } else if (this.isCloudDataTree) {
321
+        this.loadCloudDataTree()
322
+      }
323
+    },
324
+
325
+    // 加载本地数据
326
+    loadLocalData() {
327
+      this.treeData = this.localdata
328
+      if (Array.isArray(this.dataValue)) {
329
+        const value = this.dataValue as Array<UTSJSONObject>
330
+        this.selectedPaths = value.slice(0)
331
+        this._pushSelectedTreeNodes(value, this.localdata)
332
+      } else {
333
+        this._pushSelectedNodes(this.localdata)
334
+      }
335
+    },
336
+
337
+    // 加载 Cloud 数据 (单列)
338
+    loadCloudDataList() {
339
+      this._loadCloudData(null, (data : Array<UTSJSONObject>) => {
340
+        this.treeData = data
341
+        this._pushSelectedNodes(data)
342
+      })
343
+    },
344
+
345
+    // 加载 Cloud 数据 (树形)
346
+    loadCloudDataTree() {
347
+      let commandOptions = {
348
+        field: this._cloudDataPostField(),
349
+        where: this._cloudDataTreeWhere(),
350
+        getTree: true
351
+      } as GetCommandOptions
352
+      if (this._checkIsNotNull(this.gettree)) {
353
+        commandOptions.startwith = `${this.selfField}=='${this.dataValue as string}'`
354
+      }
355
+      this._loadCloudData(commandOptions, (data : Array<UTSJSONObject>) => {
356
+        this.treeData = data
357
+        if (this.selectedPaths.length > 0) {
358
+          this._pushSelectedTreeNodes(this.selectedPaths, data)
359
+        } else {
360
+          this._pushSelectedNodes(data)
361
+        }
362
+      })
363
+    },
364
+
365
+    // 加载 Cloud 数据 (节点)
366
+    loadCloudDataNode(nodeData : UTSJSONObject) {
367
+      const commandOptions = {
368
+        field: this._cloudDataPostField(),
369
+        where: this._cloudDataNodeWhere()
370
+      } as GetCommandOptions
371
+      this._loadCloudData(commandOptions, (data : Array<UTSJSONObject>) => {
372
+        nodeData['children'] = data
373
+        if (data.length == 0) {
374
+          nodeData['isleaf'] = true
375
+          this.onFinish()
376
+        } else {
377
+          this._pushSelectedNodes(data)
378
+        }
379
+      })
380
+    },
381
+
382
+    // 回显 Cloud Tree Path
383
+    loadCloudDataPath() {
384
+      if (!this.hasCloudDataValue) {
385
+        return
386
+      }
387
+
388
+      const command : GetCommandOptions = {}
389
+
390
+      // 单列
391
+      if (this.isCloudDataList) {
392
+        // 根据 field's as value标识匹配 where 条件
393
+        let where : Array<string> = [];
394
+        let whereField = this._getForeignKeyByField();
395
+        if (whereField.length > 0) {
396
+          where.push(`${whereField} == '${this.dataValue as string}'`)
397
+        }
398
+
399
+        let whereString = where.join(' || ')
400
+        if (this._checkIsNotNull(this.where)) {
401
+          whereString = `(${this.where}) && (${whereString})`
402
+        }
403
+
404
+        command.field = this._cloudDataPostField()
405
+        command.where = whereString
406
+      }
407
+
408
+      // 树形
409
+      if (this.isCloudDataTree) {
410
+        command.field = this._cloudDataPostField()
411
+        command.getTreePath = {
412
+          startWith: `${this.selfField}=='${this.dataValue as string}'`
413
+        }
414
+      }
415
+
416
+      this._loadCloudData(command, (data : Array<UTSJSONObject>) => {
417
+        this._extractTreePath(data, this.selectedPaths)
418
+      })
419
+    },
420
+
421
+    _loadCloudData(options ?: GetCommandOptions, callback ?: ((data : Array<UTSJSONObject>) => void)) {
422
+      if (this.loading) {
423
+        return
424
+      }
425
+      this.loading = true
426
+
427
+      this.error = null
428
+
429
+      this._getCommand(options).then((response : UniCloudDBGetResult) => {
430
+        callback?.(response.data)
431
+      }).catch((err : any | null) => {
432
+        this.error = err as UniCloudError
433
+      }).finally(() => {
434
+        this.loading = false
435
+      })
436
+    },
437
+
438
+    _cloudDataPostField() : string {
439
+      let fields = [this.field];
440
+      if (this.parentField.length > 0) {
441
+        fields.push(`${this.parentField} as parent_value`)
442
+      }
443
+      return fields.join(',')
444
+    },
445
+
446
+    _cloudDataTreeWhere() : string {
447
+      let result : Array<string> = []
448
+      let selectedNodes = this.selectedNodes.length > 0 ? this.selectedNodes : this.selectedPaths
449
+      let parentField = this.parentField
450
+      if (parentField.length > 0) {
451
+        result.push(`${parentField} == null || ${parentField} == ""`)
452
+      }
453
+      if (selectedNodes.length > 0) {
454
+        for (var i = 0; i < selectedNodes.length - 1; i++) {
455
+          const parentFieldValue = selectedNodes[i].getString('value', '')
456
+          result.push(`${parentField} == '${parentFieldValue}'`)
457
+        }
458
+      }
459
+
460
+      let where : Array<string> = []
461
+      if (this._checkIsNotNull(this.where)) {
462
+        where.push(`(${this.where as string})`)
463
+      }
464
+
465
+      if (result.length > 0) {
466
+        where.push(`(${result.join(' || ')})`)
467
+      }
468
+
469
+      return where.join(' && ')
470
+    },
471
+
472
+    _cloudDataNodeWhere() : string {
473
+      const where : Array<string> = []
474
+      if (this.selectedNodes.length > 0) {
475
+        const value = this.selectedNodes[this.selectedNodes.length - 1].getString('value', '')
476
+        where.push(`${this.parentField} == '${value}'`)
477
+      }
478
+
479
+      let whereString = where.join(' || ')
480
+      if (this._checkIsNotNull(this.where)) {
481
+        return `(${this.where as string}) && (${whereString})`
482
+      }
483
+
484
+      return whereString
485
+    },
486
+
487
+    _getWhereByForeignKey() : string {
488
+      let result : Array<string> = []
489
+      let whereField = this._getForeignKeyByField();
490
+      if (whereField.length > 0) {
491
+        result.push(`${whereField} == '${this.dataValue as string}'`)
492
+      }
493
+
494
+      if (this._checkIsNotNull(this.where)) {
495
+        return `(${this.where}) && (${result.join(' || ')})`
496
+      }
497
+
498
+      return result.join(' || ')
499
+    },
500
+
501
+    _getForeignKeyByField() : string {
502
+      const fields = this.field.split(',')
503
+      let whereField = ''
504
+      for (let i = 0; i < fields.length; i++) {
505
+        const items = fields[i].split('as')
506
+        if (items.length < 2) {
507
+          continue
508
+        }
509
+        if (items[1].trim() === 'value') {
510
+          whereField = items[0].trim()
511
+          break
512
+        }
513
+      }
514
+      return whereField
515
+    },
516
+
517
+    _getCommand(options ?: GetCommandOptions) : Promise<UniCloudDBGetResult> {
518
+      let db = uniCloud.databaseForJQL()
519
+
520
+      let collection = Array.isArray(this.collection) ? db.collection(...(this.collection as Array<any>)) : db.collection(this.collection)
521
+
522
+      let filter : UniCloudDBFilter | null = null
523
+      if (this.foreignKey.length > 0) {
524
+        filter = collection.foreignKey(this.foreignKey)
525
+      }
526
+
527
+      const where : any = options?.where ?? this.where
528
+      if (typeof where == 'string') {
529
+        const whereString = where as string
530
+        if (whereString.length > 0) {
531
+          filter = (filter != null) ? filter.where(where) : collection.where(where)
532
+        }
533
+      } else {
534
+        filter = (filter != null) ? filter.where(where) : collection.where(where)
535
+      }
536
+
537
+      let query : UniCloudDBQuery | null = null
538
+      if (this.field.length > 0) {
539
+        query = (filter != null) ? filter.field(this.field) : collection.field(this.field)
540
+      }
541
+      if (this.groupby.length > 0) {
542
+        if (query != null) {
543
+          query = query.groupBy(this.groupby)
544
+        } else if (filter != null) {
545
+          query = filter.groupBy(this.groupby)
546
+        }
547
+      }
548
+      if (this.groupField.length > 0) {
549
+        if (query != null) {
550
+          query = query.groupField(this.groupField)
551
+        } else if (filter != null) {
552
+          query = filter.groupField(this.groupField)
553
+        }
554
+      }
555
+      if (this.distinct == true) {
556
+        if (query != null) {
557
+          query = query.distinct(this.field)
558
+        } else if (filter != null) {
559
+          query = filter.distinct(this.field)
560
+        }
561
+      }
562
+      if (this.orderby.length > 0) {
563
+        if (query != null) {
564
+          query = query.orderBy(this.orderby)
565
+        } else if (filter != null) {
566
+          query = filter.orderBy(this.orderby)
567
+        }
568
+      }
569
+
570
+      const size = this.pagination.size
571
+      const current = this.pagination.current
572
+      if (query != null) {
573
+        query = query.skip(size * (current - 1)).limit(size)
574
+      } else if (filter != null) {
575
+        query = filter.skip(size * (current - 1)).limit(size)
576
+      } else {
577
+        query = collection.skip(size * (current - 1)).limit(size)
578
+      }
579
+
580
+      const getOptions = {}
581
+      const treeOptions = {
582
+        limitLevel: this.limitlevel,
583
+        startWith: this.startwith
584
+      }
585
+      if (this.getcount == true) {
586
+        getOptions['getCount'] = this.getcount
587
+      }
588
+
589
+      const getTree : any = options?.getTree ?? this.gettree
590
+      if (typeof getTree == 'string') {
591
+        const getTreeString = getTree as string
592
+        if (getTreeString.length > 0) {
593
+          getOptions['getTree'] = treeOptions
594
+        }
595
+      } else if (typeof getTree == 'object') {
596
+        getOptions['getTree'] = treeOptions
597
+      } else {
598
+        getOptions['getTree'] = getTree
599
+      }
600
+
601
+      const getTreePath = options?.getTreePath ?? this.gettreepath
602
+      if (typeof getTreePath == 'string') {
603
+        const getTreePathString = getTreePath as string
604
+        if (getTreePathString.length > 0) {
605
+          getOptions['getTreePath'] = getTreePath
606
+        }
607
+      } else {
608
+        getOptions['getTreePath'] = getTreePath
609
+      }
610
+
611
+      return query.get(getOptions)
612
+    },
613
+
614
+    _checkIsNotNull(value : any) : boolean {
615
+      if (typeof value == 'string') {
616
+        const valueString = value as string
617
+        return (valueString.length > 0)
618
+      } else if (value instanceof UTSJSONObject) {
619
+        return true
620
+      }
621
+      return false
622
+    },
623
+
624
+    _checkIsLeafNode(nodeData : UTSJSONObject) : boolean {
625
+      if (this.selectedIndex >= this.limitlevel) {
626
+        return true
627
+      }
628
+
629
+      if (nodeData.getBoolean('isleaf', false)) {
630
+        return true
631
+      }
632
+
633
+      return false
634
+    },
635
+
636
+    _checkHasChildren(nodeData : UTSJSONObject) : boolean {
637
+      const children = nodeData.getArray('children') ?? ([] as Array<any>)
638
+      return children.length > 0
639
+    },
640
+
641
+    _pushSelectedNodes(nodes : Array<UTSJSONObject>) {
642
+      this.selectedNodes.push(DefaultSelectedNode)
643
+      this.selectedPages.push(nodes)
644
+      this.selectedIndex = this.selectedPages.length - 1
645
+    },
646
+
647
+    _trimSelectedNodes(nodeData : UTSJSONObject) {
648
+      this.selectedNodes.splice(this.selectedIndex)
649
+      this.selectedNodes.push(nodeData)
650
+
651
+      if (this.selectedPages.length > 0) {
652
+        this.selectedPages.splice(this.selectedIndex + 1)
653
+      }
654
+
655
+      const children = nodeData.getArray<UTSJSONObject>('children') ?? ([] as Array<UTSJSONObject>)
656
+      if (children.length > 0) {
657
+        this.selectedNodes.push(DefaultSelectedNode)
658
+        this.selectedPages.push(children)
659
+      }
660
+
661
+      this.selectedIndex = this.selectedPages.length - 1
662
+    },
663
+
664
+    _pushSelectedTreeNodes(paths : Array<UTSJSONObject>, nodes : Array<UTSJSONObject>) {
665
+      let children : Array<UTSJSONObject> = nodes
666
+      paths.forEach((node : UTSJSONObject) => {
667
+        const findNode = children.find((item : UTSJSONObject) : boolean => {
668
+          return (item.getString(this.mappingValueName) == node.getString(this.mappingValueName))
669
+        })
670
+        if (findNode != null) {
671
+          this.selectedPages.push(children)
672
+          this.selectedNodes.push(node)
673
+          children = findNode.getArray<UTSJSONObject>('children') ?? ([] as Array<UTSJSONObject>)
674
+        }
675
+      })
676
+      this.selectedIndex = this.selectedPages.length - 1
677
+    },
678
+
679
+    _extractTreePath(nodes : Array<UTSJSONObject>, result : Array<UTSJSONObject>) {
680
+      if (nodes.length == 0) {
681
+        return
682
+      }
683
+
684
+      const node = nodes[0]
685
+      result.push(node)
686
+
687
+      const children = node.getArray<UTSJSONObject>('children')
688
+      if (Array.isArray(children) && children!.length > 0) {
689
+        this._extractTreePath(children, result)
690
+      }
691
+    }
692
+  }
693
+})

+ 76 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.css

@@ -0,0 +1,76 @@
1
+.uni-data-pickerview {
2
+  position: relative;
3
+  flex-direction: column;
4
+  overflow: hidden;
5
+}
6
+
7
+.loading-cover {
8
+  position: absolute;
9
+  left: 0;
10
+  top: 0;
11
+  right: 0;
12
+  bottom: 0;
13
+  align-items: center;
14
+  justify-content: center;
15
+  background-color: rgba(150, 150, 150, .1);
16
+}
17
+
18
+.error {
19
+  background-color: #fff;
20
+  padding: 15px;
21
+}
22
+
23
+.error-text {
24
+  color: #DD524D;
25
+}
26
+
27
+.selected-node-list {
28
+  flex-direction: row;
29
+  flex-wrap: nowrap;
30
+}
31
+
32
+.selected-node-item {
33
+  margin-left: 10px;
34
+  margin-right: 10px;
35
+  padding: 8px 10px 8px 10px;
36
+  border-bottom: 2px solid transparent;
37
+}
38
+
39
+.selected-node-item-active {
40
+  color: #007aff;
41
+  border-bottom-color: #007aff;
42
+}
43
+
44
+.list-view {
45
+  flex: 1;
46
+}
47
+
48
+.list-item {
49
+  flex-direction: row;
50
+  justify-content: space-between;
51
+  padding: 12px 15px;
52
+  border-bottom: 1px solid #f0f0f0;
53
+}
54
+
55
+.item-text {
56
+  color: #333333;
57
+}
58
+
59
+.item-text-disabled {
60
+  opacity: .5;
61
+}
62
+
63
+.item-text-overflow {
64
+  overflow: hidden;
65
+}
66
+
67
+.check {
68
+  margin-right: 5px;
69
+  border: 2px solid #007aff;
70
+  border-left: 0;
71
+  border-top: 0;
72
+  height: 12px;
73
+  width: 6px;
74
+  transform-origin: center;
75
+  transform: rotate(45deg);
76
+}

+ 69 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.uvue

@@ -0,0 +1,69 @@
1
+<template>
2
+  <view class="uni-data-pickerview">
3
+    <view v-if="error!=null" class="error">
4
+      <text class="error-text">{{error!.errMsg}}</text>
5
+    </view>
6
+    <scroll-view v-if="!isCloudDataList" :scroll-x="true">
7
+      <view class="selected-node-list">
8
+        <template v-for="(item, index) in selectedNodes">
9
+          <text class="selected-node-item" :class="{'selected-node-item-active':index==selectedIndex}"
10
+            @click="onTabSelect(index)">
11
+            {{item[mappingTextName]}}
12
+          </text>
13
+        </template>
14
+      </view>
15
+    </scroll-view>
16
+    <list-view class="list-view" :scroll-y="true">
17
+      <list-item class="list-item" v-for="(item, _) in currentDataList" @click="onNodeClick(item)">
18
+        <text class="item-text" :class="{'item-text-disabled': item['disable']}">{{item[mappingTextName]}}</text>
19
+        <text class="check" v-if="item[mappingValueName] == selectedNodes[selectedIndex][mappingValueName]"></text>
20
+      </list-item>
21
+    </list-view>
22
+    <view class="loading-cover" v-if="loading">
23
+      <slot name="pickerview-loading" :loading="loading"></slot>
24
+    </view>
25
+  </view>
26
+</template>
27
+
28
+<script>
29
+  import { dataPicker } from "./uni-data-picker.uts"
30
+
31
+  /**
32
+   * DataPickerview
33
+   * @description uni-data-pickerview
34
+   * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
35
+   * @property {Array} localdata 本地数据,参考
36
+   * @property {Boolean} step-searh = [true|false] 是否分布查询
37
+   * @value true 启用分布查询,仅查询当前选中节点
38
+   * @value false 关闭分布查询,一次查询出所有数据
39
+   * @property {String|DBFieldString} self-field 分布查询当前字段名称
40
+   * @property {String|DBFieldString} parent-field 分布查询父字段名称
41
+   * @property {String|DBCollectionString} collection 表名
42
+   * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
43
+   * @property {String} orderby 排序字段及正序倒叙设置
44
+   * @property {String|JQLString} where 查询条件
45
+   */
46
+  export default {
47
+    name: 'UniDataPickerView',
48
+    emits: ['nodeclick', 'change', 'update:modelValue'],
49
+    mixins: [dataPicker],
50
+    props: {
51
+      ellipsis: {
52
+        type: Boolean,
53
+        default: true
54
+      }
55
+    },
56
+    created() {
57
+      this.loadData()
58
+    },
59
+    methods: {
60
+      onFinish() {
61
+        this.$emit('change', this.getChangeNodes())
62
+      }
63
+    }
64
+  }
65
+</script>
66
+
67
+<style>
68
+  @import url("uni-data-pickerview.css");
69
+</style>

+ 323 - 0
uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue

@@ -0,0 +1,323 @@
1
+<template>
2
+  <view class="uni-data-pickerview">
3
+    <scroll-view v-if="!isCloudDataList" class="selected-area" scroll-x="true">
4
+      <view class="selected-list">
5
+          <view 
6
+            class="selected-item"
7
+            v-for="(item,index) in selected"
8
+            :key="index"
9
+            :class="{
10
+              'selected-item-active':index == selectedIndex
11
+            }"
12
+            @click="handleSelect(index)"
13
+          >
14
+            <text>{{item.text || ''}}</text>
15
+          </view>
16
+      </view>
17
+    </scroll-view>
18
+    <view class="tab-c">
19
+      <scroll-view class="list" :scroll-y="true">
20
+        <view class="item" :class="{'is-disabled': !!item.disable}" v-for="(item, j) in dataList[selectedIndex]" :key="j"
21
+          @click="handleNodeClick(item, selectedIndex, j)">
22
+          <text class="item-text">{{item[map.text]}}</text>
23
+          <view class="check" v-if="selected.length > selectedIndex && item[map.value] == selected[selectedIndex].value"></view>
24
+        </view>
25
+      </scroll-view>
26
+
27
+      <view class="loading-cover" v-if="loading">
28
+        <uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more>
29
+      </view>
30
+      <view class="error-message" v-if="errorMessage">
31
+        <text class="error-text">{{errorMessage}}</text>
32
+      </view>
33
+    </view>
34
+  </view>
35
+</template>
36
+
37
+<script>
38
+  import dataPicker from "./uni-data-picker.js"
39
+
40
+  /**
41
+   * DataPickerview
42
+   * @description uni-data-pickerview
43
+   * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
44
+   * @property {Array} localdata 本地数据,参考
45
+   * @property {Boolean} step-searh = [true|false] 是否分布查询
46
+   * @value true 启用分布查询,仅查询当前选中节点
47
+   * @value false 关闭分布查询,一次查询出所有数据
48
+   * @property {String|DBFieldString} self-field 分布查询当前字段名称
49
+   * @property {String|DBFieldString} parent-field 分布查询父字段名称
50
+   * @property {String|DBCollectionString} collection 表名
51
+   * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
52
+   * @property {String} orderby 排序字段及正序倒叙设置
53
+   * @property {String|JQLString} where 查询条件
54
+   */
55
+  export default {
56
+    name: 'UniDataPickerView',
57
+    emits: ['nodeclick', 'change', 'datachange', 'update:modelValue'],
58
+    mixins: [dataPicker],
59
+    props: {
60
+      managedMode: {
61
+        type: Boolean,
62
+        default: false
63
+      },
64
+      ellipsis: {
65
+        type: Boolean,
66
+        default: true
67
+      }
68
+    },
69
+    created() {
70
+      if (!this.managedMode) {
71
+        this.$nextTick(() => {
72
+          this.loadData();
73
+        })
74
+      }
75
+    },
76
+    methods: {
77
+      onPropsChange() {
78
+        this._treeData = [];
79
+        this.selectedIndex = 0;
80
+        this.$nextTick(() => {
81
+          this.loadData();
82
+        })
83
+      },
84
+      handleSelect(index) {
85
+        this.selectedIndex = index;
86
+      },
87
+      handleNodeClick(item, i, j) {
88
+        if (item.disable) {
89
+          return;
90
+        }
91
+
92
+        const node = this.dataList[i][j];
93
+        const text = node[this.map.text];
94
+        const value = node[this.map.value];
95
+
96
+        if (i < this.selected.length - 1) {
97
+          this.selected.splice(i, this.selected.length - i)
98
+          this.selected.push({
99
+            text,
100
+            value
101
+          })
102
+        } else if (i === this.selected.length - 1) {
103
+          this.selected.splice(i, 1, {
104
+            text,
105
+            value
106
+          })
107
+        }
108
+
109
+        if (node.isleaf) {
110
+          this.onSelectedChange(node, node.isleaf)
111
+          return
112
+        }
113
+
114
+        const {
115
+          isleaf,
116
+          hasNodes
117
+        } = this._updateBindData()
118
+
119
+        // 本地数据
120
+        if (this.isLocalData) {
121
+          this.onSelectedChange(node, (!hasNodes || isleaf))
122
+        } else if (this.isCloudDataList) { // Cloud 数据 (单列)
123
+          this.onSelectedChange(node, true)
124
+        } else if (this.isCloudDataTree) { // Cloud 数据 (树形)
125
+          if (isleaf) {
126
+            this.onSelectedChange(node, node.isleaf)
127
+          } else if (!hasNodes) { // 请求一次服务器以确定是否为叶子节点
128
+            this.loadCloudDataNode((data) => {
129
+              if (!data.length) {
130
+                node.isleaf = true
131
+              } else {
132
+                this._treeData.push(...data)
133
+                this._updateBindData(node)
134
+              }
135
+              this.onSelectedChange(node, node.isleaf)
136
+            })
137
+          }
138
+        }
139
+      },
140
+      updateData(data) {
141
+        this._treeData = data.treeData
142
+        this.selected = data.selected
143
+        if (!this._treeData.length) {
144
+          this.loadData()
145
+        } else {
146
+          //this.selected = data.selected
147
+          this._updateBindData()
148
+        }
149
+      },
150
+      onDataChange() {
151
+        this.$emit('datachange');
152
+      },
153
+      onSelectedChange(node, isleaf) {
154
+        if (isleaf) {
155
+          this._dispatchEvent()
156
+        }
157
+
158
+        if (node) {
159
+          this.$emit('nodeclick', node)
160
+        }
161
+      },
162
+      _dispatchEvent() {
163
+        this.$emit('change', this.selected.slice(0))
164
+      }
165
+    }
166
+  }
167
+</script>
168
+
169
+<style lang="scss">
170
+	$uni-primary: #007aff !default;
171
+
172
+	.uni-data-pickerview {
173
+		flex: 1;
174
+		/* #ifndef APP-NVUE */
175
+		display: flex;
176
+		/* #endif */
177
+		flex-direction: column;
178
+		overflow: hidden;
179
+		height: 100%;
180
+	}
181
+
182
+  .error-text {
183
+    color: #DD524D;
184
+  }
185
+
186
+  .loading-cover {
187
+    position: absolute;
188
+    left: 0;
189
+    top: 0;
190
+    right: 0;
191
+    bottom: 0;
192
+    background-color: rgba(255, 255, 255, .5);
193
+    /* #ifndef APP-NVUE */
194
+    display: flex;
195
+    /* #endif */
196
+    flex-direction: column;
197
+    align-items: center;
198
+    z-index: 1001;
199
+  }
200
+
201
+  .load-more {
202
+    /* #ifndef APP-NVUE */
203
+    margin: auto;
204
+    /* #endif */
205
+  }
206
+
207
+  .error-message {
208
+    background-color: #fff;
209
+    position: absolute;
210
+    left: 0;
211
+    top: 0;
212
+    right: 0;
213
+    bottom: 0;
214
+    padding: 15px;
215
+    opacity: .9;
216
+    z-index: 102;
217
+  }
218
+
219
+  /* #ifdef APP-NVUE */
220
+  .selected-area {
221
+    width: 750rpx;
222
+  }
223
+  /* #endif */
224
+
225
+  .selected-list {
226
+    /* #ifndef APP-NVUE */
227
+    display: flex;
228
+    flex-wrap: nowrap;
229
+    /* #endif */
230
+    flex-direction: row;
231
+    padding: 0 5px;
232
+    border-bottom: 1px solid #f8f8f8;
233
+  }
234
+
235
+  .selected-item {
236
+    margin-left: 10px;
237
+    margin-right: 10px;
238
+    padding: 12px 0;
239
+    text-align: center;
240
+    /* #ifndef APP-NVUE */
241
+    white-space: nowrap;
242
+    /* #endif */
243
+  }
244
+
245
+  .selected-item-text-overflow {
246
+    width: 168px;
247
+    /* fix nvue */
248
+    overflow: hidden;
249
+    /* #ifndef APP-NVUE */
250
+    width: 6em;
251
+    white-space: nowrap;
252
+    text-overflow: ellipsis;
253
+    -o-text-overflow: ellipsis;
254
+    /* #endif */
255
+  }
256
+
257
+	.selected-item-active {
258
+		border-bottom: 2px solid $uni-primary;
259
+	}
260
+
261
+	.selected-item-text {
262
+		color: $uni-primary;
263
+	}
264
+
265
+  .tab-c {
266
+    position: relative;
267
+    flex: 1;
268
+    /* #ifndef APP-NVUE */
269
+    display: flex;
270
+    /* #endif */
271
+    flex-direction: row;
272
+    overflow: hidden;
273
+  }
274
+
275
+  .list {
276
+    flex: 1;
277
+  }
278
+
279
+  .item {
280
+    padding: 12px 15px;
281
+    /* border-bottom: 1px solid #f0f0f0; */
282
+    /* #ifndef APP-NVUE */
283
+    display: flex;
284
+    /* #endif */
285
+    flex-direction: row;
286
+    justify-content: space-between;
287
+  }
288
+
289
+  .is-disabled {
290
+    opacity: .5;
291
+  }
292
+
293
+  .item-text {
294
+    /* flex: 1; */
295
+    color: #333333;
296
+  }
297
+
298
+  .item-text-overflow {
299
+    width: 280px;
300
+    /* fix nvue */
301
+    overflow: hidden;
302
+    /* #ifndef APP-NVUE */
303
+    width: 20em;
304
+    white-space: nowrap;
305
+    text-overflow: ellipsis;
306
+    -o-text-overflow: ellipsis;
307
+    /* #endif */
308
+  }
309
+
310
+	.check {
311
+		margin-right: 5px;
312
+		border: 2px solid $uni-primary;
313
+		border-left: 0;
314
+		border-top: 0;
315
+		height: 12px;
316
+		width: 6px;
317
+		transform-origin: center;
318
+		/* #ifndef APP-NVUE */
319
+		transition: all 0.3s;
320
+		/* #endif */
321
+		transform: rotate(45deg);
322
+	}
323
+</style>

+ 91 - 0
uni_modules/uni-data-picker/package.json

@@ -0,0 +1,91 @@
1
+{
2
+  "id": "uni-data-picker",
3
+  "displayName": "uni-data-picker 数据驱动的picker选择器",
4
+  "version": "2.0.0",
5
+  "description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景",
6
+  "keywords": [
7
+    "uni-ui",
8
+    "uniui",
9
+    "picker",
10
+    "级联",
11
+    "省市区",
12
+    ""
13
+],
14
+  "repository": "https://github.com/dcloudio/uni-ui",
15
+  "engines": {
16
+    "HBuilderX": ""
17
+  },
18
+  "directories": {
19
+    "example": "../../temps/example_temps"
20
+  },
21
+"dcloudext": {
22
+    "sale": {
23
+      "regular": {
24
+        "price": "0.00"
25
+      },
26
+      "sourcecode": {
27
+        "price": "0.00"
28
+      }
29
+    },
30
+    "contact": {
31
+      "qq": ""
32
+    },
33
+    "declaration": {
34
+      "ads": "无",
35
+      "data": "无",
36
+      "permissions": "无"
37
+    },
38
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
39
+    "type": "component-vue"
40
+  },
41
+  "uni_modules": {
42
+    "dependencies": [
43
+      "uni-load-more",
44
+			"uni-icons",
45
+			"uni-scss"
46
+    ],
47
+    "encrypt": [],
48
+    "platforms": {
49
+      "cloud": {
50
+        "tcb": "y",
51
+        "aliyun": "y"
52
+      },
53
+      "client": {
54
+        "App": {
55
+          "app-vue": "y",
56
+          "app-nvue": "y",
57
+          "app-uvue": "y"
58
+        },
59
+        "H5-mobile": {
60
+          "Safari": "y",
61
+          "Android Browser": "y",
62
+          "微信浏览器(Android)": "y",
63
+          "QQ浏览器(Android)": "y"
64
+        },
65
+        "H5-pc": {
66
+          "Chrome": "y",
67
+          "IE": "y",
68
+          "Edge": "y",
69
+          "Firefox": "y",
70
+          "Safari": "y"
71
+        },
72
+        "小程序": {
73
+          "微信": "y",
74
+          "阿里": "y",
75
+          "百度": "y",
76
+          "字节跳动": "y",
77
+        "QQ": "y",
78
+        "京东": "u"
79
+        },
80
+        "快应用": {
81
+          "华为": "u",
82
+          "联盟": "u"
83
+        },
84
+        "Vue": {
85
+            "vue2": "y",
86
+            "vue3": "y"
87
+        }
88
+      }
89
+    }
90
+  }
91
+}

+ 22 - 0
uni_modules/uni-data-picker/readme.md

@@ -0,0 +1,22 @@
1
+## DataPicker 级联选择
2
+> **组件名:uni-data-picker**
3
+> 代码块: `uDataPicker`
4
+> 关联组件:`uni-data-pickerview`、`uni-load-more`。
5
+
6
+
7
+`<uni-data-picker>` 是一个选择类[datacom组件](https://uniapp.dcloud.net.cn/component/datacom)。
8
+
9
+支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。
10
+
11
+候选数据支持一次性加载完毕,也支持懒加载,比如示例图中,选择了“北京”后,动态加载北京的区县数据。
12
+
13
+`<uni-data-picker>` 组件尤其适用于地址选择、分类选择等选择类。
14
+
15
+`<uni-data-picker>` 支持本地数据、云端静态数据(json),uniCloud云数据库数据。
16
+
17
+`<uni-data-picker>` 可以通过JQL直连uniCloud云数据库,配套[DB Schema](https://uniapp.dcloud.net.cn/uniCloud/schema),可在schema2code中自动生成前端页面,还支持服务器端校验。
18
+
19
+在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。
20
+
21
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-picker)
22
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839

+ 42 - 0
uni_modules/uni-icons/changelog.md

@@ -0,0 +1,42 @@
1
+## 2.0.10(2024-06-07)
2
+- 优化 uni-app x 中,size 属性的类型
3
+## 2.0.9(2024-01-12)
4
+fix: 修复图标大小默认值错误的问题
5
+## 2.0.8(2023-12-14)
6
+- 修复 项目未使用 ts 情况下,打包报错的bug
7
+## 2.0.7(2023-12-14)
8
+- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
9
+## 2.0.6(2023-12-11)
10
+- 优化 兼容老版本icon类型,如 top ,bottom 等
11
+## 2.0.5(2023-12-11)
12
+- 优化 兼容老版本icon类型,如 top ,bottom 等
13
+## 2.0.4(2023-12-06)
14
+- 优化 uni-app x 下示例项目图标排序
15
+## 2.0.3(2023-12-06)
16
+- 修复 nvue下引入组件报错的bug
17
+## 2.0.2(2023-12-05)
18
+-优化 size 属性支持单位
19
+## 2.0.1(2023-12-05)
20
+- 新增 uni-app x 支持定义图标
21
+## 1.3.5(2022-01-24)
22
+- 优化 size 属性可以传入不带单位的字符串数值
23
+## 1.3.4(2022-01-24)
24
+- 优化 size 支持其他单位
25
+## 1.3.3(2022-01-17)
26
+- 修复 nvue 有些图标不显示的bug,兼容老版本图标
27
+## 1.3.2(2021-12-01)
28
+- 优化 示例可复制图标名称
29
+## 1.3.1(2021-11-23)
30
+- 优化 兼容旧组件 type 值
31
+## 1.3.0(2021-11-19)
32
+- 新增 更多图标
33
+- 优化 自定义图标使用方式
34
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
35
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-icons](https://uniapp.dcloud.io/component/uniui/uni-icons)
36
+## 1.1.7(2021-11-08)
37
+## 1.2.0(2021-07-30)
38
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
39
+## 1.1.5(2021-05-12)
40
+- 新增 组件示例地址
41
+## 1.1.4(2021-02-05)
42
+- 调整为uni_modules目录规范

+ 91 - 0
uni_modules/uni-icons/components/uni-icons/uni-icons.uvue

@@ -0,0 +1,91 @@
1
+<template>
2
+  <text class="uni-icons" :style="styleObj">
3
+    <slot>{{unicode}}</slot>
4
+  </text>
5
+</template>
6
+
7
+<script>
8
+  import { fontData, IconsDataItem } from './uniicons_file'
9
+
10
+  /**
11
+   * Icons 图标
12
+   * @description 用于展示 icon 图标
13
+   * @tutorial https://ext.dcloud.net.cn/plugin?id=28
14
+   * @property {Number,String} size 图标大小
15
+   * @property {String} type 图标图案,参考示例
16
+   * @property {String} color 图标颜色
17
+   * @property {String} customPrefix 自定义图标
18
+   * @event {Function} click 点击 Icon 触发事件
19
+   */
20
+  export default {
21
+    name: "uni-icons",
22
+    props: {
23
+      type: {
24
+        type: String,
25
+        default: ''
26
+      },
27
+      color: {
28
+        type: String,
29
+        default: '#333333'
30
+      },
31
+      size: {
32
+        type: [Number, String],
33
+        default: 16
34
+      },
35
+      fontFamily: {
36
+        type: String,
37
+        default: ''
38
+      }
39
+    },
40
+    data() {
41
+      return {};
42
+    },
43
+    computed: {
44
+      unicode() : string {
45
+        let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
46
+        if (codes !== null) {
47
+          return codes.unicode
48
+        }
49
+        return ''
50
+      },
51
+      iconSize() : string {
52
+        const size = this.size
53
+        if (typeof size == 'string') {
54
+          const reg = /^[0-9]*$/g
55
+          return reg.test(size as string) ? '' + size + 'px' : '' + size;
56
+          // return '' + this.size
57
+        }
58
+        return this.getFontSize(size as number)
59
+      },
60
+      styleObj() : UTSJSONObject {
61
+        if (this.fontFamily !== '') {
62
+          return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
63
+        }
64
+        return { color: this.color, fontSize: this.iconSize }
65
+      }
66
+    },
67
+    created() { },
68
+    methods: {
69
+      /**
70
+       * 字体大小
71
+       */
72
+      getFontSize(size : number) : string {
73
+        return size + 'px';
74
+      },
75
+    },
76
+  }
77
+</script>
78
+
79
+<style scoped>
80
+  @font-face {
81
+    font-family: UniIconsFontFamily;
82
+    src: url('./uniicons.ttf');
83
+  }
84
+
85
+  .uni-icons {
86
+    font-family: UniIconsFontFamily;
87
+    font-size: 18px;
88
+    font-style: normal;
89
+    color: #333;
90
+  }
91
+</style>

+ 110 - 0
uni_modules/uni-icons/components/uni-icons/uni-icons.vue

@@ -0,0 +1,110 @@
1
+<template>
2
+	<!-- #ifdef APP-NVUE -->
3
+	<text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
4
+	<!-- #endif -->
5
+	<!-- #ifndef APP-NVUE -->
6
+	<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
7
+		<slot></slot>
8
+	</text>
9
+	<!-- #endif -->
10
+</template>
11
+
12
+<script>
13
+	import { fontData } from './uniicons_file_vue.js';
14
+
15
+	const getVal = (val) => {
16
+		const reg = /^[0-9]*$/g
17
+		return (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;
18
+	}
19
+
20
+	// #ifdef APP-NVUE
21
+	var domModule = weex.requireModule('dom');
22
+	import iconUrl from './uniicons.ttf'
23
+	domModule.addRule('fontFace', {
24
+		'fontFamily': "uniicons",
25
+		'src': "url('" + iconUrl + "')"
26
+	});
27
+	// #endif
28
+
29
+	/**
30
+	 * Icons 图标
31
+	 * @description 用于展示 icons 图标
32
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=28
33
+	 * @property {Number} size 图标大小
34
+	 * @property {String} type 图标图案,参考示例
35
+	 * @property {String} color 图标颜色
36
+	 * @property {String} customPrefix 自定义图标
37
+	 * @event {Function} click 点击 Icon 触发事件
38
+	 */
39
+	export default {
40
+		name: 'UniIcons',
41
+		emits: ['click'],
42
+		props: {
43
+			type: {
44
+				type: String,
45
+				default: ''
46
+			},
47
+			color: {
48
+				type: String,
49
+				default: '#333333'
50
+			},
51
+			size: {
52
+				type: [Number, String],
53
+				default: 16
54
+			},
55
+			customPrefix: {
56
+				type: String,
57
+				default: ''
58
+			},
59
+			fontFamily: {
60
+				type: String,
61
+				default: ''
62
+			}
63
+		},
64
+		data() {
65
+			return {
66
+				icons: fontData
67
+			}
68
+		},
69
+		computed: {
70
+			unicode() {
71
+				let code = this.icons.find(v => v.font_class === this.type)
72
+				if (code) {
73
+					return code.unicode
74
+				}
75
+				return ''
76
+			},
77
+			iconSize() {
78
+				return getVal(this.size)
79
+			},
80
+			styleObj() {
81
+				if (this.fontFamily !== '') {
82
+					return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`
83
+				}
84
+				return `color: ${this.color}; font-size: ${this.iconSize};`
85
+			}
86
+		},
87
+		methods: {
88
+			_onClick() {
89
+				this.$emit('click')
90
+			}
91
+		}
92
+	}
93
+</script>
94
+
95
+<style lang="scss">
96
+	/* #ifndef APP-NVUE */
97
+	@import './uniicons.css';
98
+
99
+	@font-face {
100
+		font-family: uniicons;
101
+		src: url('./uniicons.ttf');
102
+	}
103
+
104
+	/* #endif */
105
+	.uni-icons {
106
+		font-family: uniicons;
107
+		text-decoration: none;
108
+		text-align: center;
109
+	}
110
+</style>

+ 664 - 0
uni_modules/uni-icons/components/uni-icons/uniicons.css

@@ -0,0 +1,664 @@
1
+
2
+.uniui-cart-filled:before {
3
+  content: "\e6d0";
4
+}
5
+
6
+.uniui-gift-filled:before {
7
+  content: "\e6c4";
8
+}
9
+
10
+.uniui-color:before {
11
+  content: "\e6cf";
12
+}
13
+
14
+.uniui-wallet:before {
15
+  content: "\e6b1";
16
+}
17
+
18
+.uniui-settings-filled:before {
19
+  content: "\e6ce";
20
+}
21
+
22
+.uniui-auth-filled:before {
23
+  content: "\e6cc";
24
+}
25
+
26
+.uniui-shop-filled:before {
27
+  content: "\e6cd";
28
+}
29
+
30
+.uniui-staff-filled:before {
31
+  content: "\e6cb";
32
+}
33
+
34
+.uniui-vip-filled:before {
35
+  content: "\e6c6";
36
+}
37
+
38
+.uniui-plus-filled:before {
39
+  content: "\e6c7";
40
+}
41
+
42
+.uniui-folder-add-filled:before {
43
+  content: "\e6c8";
44
+}
45
+
46
+.uniui-color-filled:before {
47
+  content: "\e6c9";
48
+}
49
+
50
+.uniui-tune-filled:before {
51
+  content: "\e6ca";
52
+}
53
+
54
+.uniui-calendar-filled:before {
55
+  content: "\e6c0";
56
+}
57
+
58
+.uniui-notification-filled:before {
59
+  content: "\e6c1";
60
+}
61
+
62
+.uniui-wallet-filled:before {
63
+  content: "\e6c2";
64
+}
65
+
66
+.uniui-medal-filled:before {
67
+  content: "\e6c3";
68
+}
69
+
70
+.uniui-fire-filled:before {
71
+  content: "\e6c5";
72
+}
73
+
74
+.uniui-refreshempty:before {
75
+  content: "\e6bf";
76
+}
77
+
78
+.uniui-location-filled:before {
79
+  content: "\e6af";
80
+}
81
+
82
+.uniui-person-filled:before {
83
+  content: "\e69d";
84
+}
85
+
86
+.uniui-personadd-filled:before {
87
+  content: "\e698";
88
+}
89
+
90
+.uniui-arrowthinleft:before {
91
+  content: "\e6d2";
92
+}
93
+
94
+.uniui-arrowthinup:before {
95
+  content: "\e6d3";
96
+}
97
+
98
+.uniui-arrowthindown:before {
99
+  content: "\e6d4";
100
+}
101
+
102
+.uniui-back:before {
103
+  content: "\e6b9";
104
+}
105
+
106
+.uniui-forward:before {
107
+  content: "\e6ba";
108
+}
109
+
110
+.uniui-arrow-right:before {
111
+  content: "\e6bb";
112
+}
113
+
114
+.uniui-arrow-left:before {
115
+  content: "\e6bc";
116
+}
117
+
118
+.uniui-arrow-up:before {
119
+  content: "\e6bd";
120
+}
121
+
122
+.uniui-arrow-down:before {
123
+  content: "\e6be";
124
+}
125
+
126
+.uniui-arrowthinright:before {
127
+  content: "\e6d1";
128
+}
129
+
130
+.uniui-down:before {
131
+  content: "\e6b8";
132
+}
133
+
134
+.uniui-bottom:before {
135
+  content: "\e6b8";
136
+}
137
+
138
+.uniui-arrowright:before {
139
+  content: "\e6d5";
140
+}
141
+
142
+.uniui-right:before {
143
+  content: "\e6b5";
144
+}
145
+
146
+.uniui-up:before {
147
+  content: "\e6b6";
148
+}
149
+
150
+.uniui-top:before {
151
+  content: "\e6b6";
152
+}
153
+
154
+.uniui-left:before {
155
+  content: "\e6b7";
156
+}
157
+
158
+.uniui-arrowup:before {
159
+  content: "\e6d6";
160
+}
161
+
162
+.uniui-eye:before {
163
+  content: "\e651";
164
+}
165
+
166
+.uniui-eye-filled:before {
167
+  content: "\e66a";
168
+}
169
+
170
+.uniui-eye-slash:before {
171
+  content: "\e6b3";
172
+}
173
+
174
+.uniui-eye-slash-filled:before {
175
+  content: "\e6b4";
176
+}
177
+
178
+.uniui-info-filled:before {
179
+  content: "\e649";
180
+}
181
+
182
+.uniui-reload:before {
183
+  content: "\e6b2";
184
+}
185
+
186
+.uniui-micoff-filled:before {
187
+  content: "\e6b0";
188
+}
189
+
190
+.uniui-map-pin-ellipse:before {
191
+  content: "\e6ac";
192
+}
193
+
194
+.uniui-map-pin:before {
195
+  content: "\e6ad";
196
+}
197
+
198
+.uniui-location:before {
199
+  content: "\e6ae";
200
+}
201
+
202
+.uniui-starhalf:before {
203
+  content: "\e683";
204
+}
205
+
206
+.uniui-star:before {
207
+  content: "\e688";
208
+}
209
+
210
+.uniui-star-filled:before {
211
+  content: "\e68f";
212
+}
213
+
214
+.uniui-calendar:before {
215
+  content: "\e6a0";
216
+}
217
+
218
+.uniui-fire:before {
219
+  content: "\e6a1";
220
+}
221
+
222
+.uniui-medal:before {
223
+  content: "\e6a2";
224
+}
225
+
226
+.uniui-font:before {
227
+  content: "\e6a3";
228
+}
229
+
230
+.uniui-gift:before {
231
+  content: "\e6a4";
232
+}
233
+
234
+.uniui-link:before {
235
+  content: "\e6a5";
236
+}
237
+
238
+.uniui-notification:before {
239
+  content: "\e6a6";
240
+}
241
+
242
+.uniui-staff:before {
243
+  content: "\e6a7";
244
+}
245
+
246
+.uniui-vip:before {
247
+  content: "\e6a8";
248
+}
249
+
250
+.uniui-folder-add:before {
251
+  content: "\e6a9";
252
+}
253
+
254
+.uniui-tune:before {
255
+  content: "\e6aa";
256
+}
257
+
258
+.uniui-auth:before {
259
+  content: "\e6ab";
260
+}
261
+
262
+.uniui-person:before {
263
+  content: "\e699";
264
+}
265
+
266
+.uniui-email-filled:before {
267
+  content: "\e69a";
268
+}
269
+
270
+.uniui-phone-filled:before {
271
+  content: "\e69b";
272
+}
273
+
274
+.uniui-phone:before {
275
+  content: "\e69c";
276
+}
277
+
278
+.uniui-email:before {
279
+  content: "\e69e";
280
+}
281
+
282
+.uniui-personadd:before {
283
+  content: "\e69f";
284
+}
285
+
286
+.uniui-chatboxes-filled:before {
287
+  content: "\e692";
288
+}
289
+
290
+.uniui-contact:before {
291
+  content: "\e693";
292
+}
293
+
294
+.uniui-chatbubble-filled:before {
295
+  content: "\e694";
296
+}
297
+
298
+.uniui-contact-filled:before {
299
+  content: "\e695";
300
+}
301
+
302
+.uniui-chatboxes:before {
303
+  content: "\e696";
304
+}
305
+
306
+.uniui-chatbubble:before {
307
+  content: "\e697";
308
+}
309
+
310
+.uniui-upload-filled:before {
311
+  content: "\e68e";
312
+}
313
+
314
+.uniui-upload:before {
315
+  content: "\e690";
316
+}
317
+
318
+.uniui-weixin:before {
319
+  content: "\e691";
320
+}
321
+
322
+.uniui-compose:before {
323
+  content: "\e67f";
324
+}
325
+
326
+.uniui-qq:before {
327
+  content: "\e680";
328
+}
329
+
330
+.uniui-download-filled:before {
331
+  content: "\e681";
332
+}
333
+
334
+.uniui-pyq:before {
335
+  content: "\e682";
336
+}
337
+
338
+.uniui-sound:before {
339
+  content: "\e684";
340
+}
341
+
342
+.uniui-trash-filled:before {
343
+  content: "\e685";
344
+}
345
+
346
+.uniui-sound-filled:before {
347
+  content: "\e686";
348
+}
349
+
350
+.uniui-trash:before {
351
+  content: "\e687";
352
+}
353
+
354
+.uniui-videocam-filled:before {
355
+  content: "\e689";
356
+}
357
+
358
+.uniui-spinner-cycle:before {
359
+  content: "\e68a";
360
+}
361
+
362
+.uniui-weibo:before {
363
+  content: "\e68b";
364
+}
365
+
366
+.uniui-videocam:before {
367
+  content: "\e68c";
368
+}
369
+
370
+.uniui-download:before {
371
+  content: "\e68d";
372
+}
373
+
374
+.uniui-help:before {
375
+  content: "\e679";
376
+}
377
+
378
+.uniui-navigate-filled:before {
379
+  content: "\e67a";
380
+}
381
+
382
+.uniui-plusempty:before {
383
+  content: "\e67b";
384
+}
385
+
386
+.uniui-smallcircle:before {
387
+  content: "\e67c";
388
+}
389
+
390
+.uniui-minus-filled:before {
391
+  content: "\e67d";
392
+}
393
+
394
+.uniui-micoff:before {
395
+  content: "\e67e";
396
+}
397
+
398
+.uniui-closeempty:before {
399
+  content: "\e66c";
400
+}
401
+
402
+.uniui-clear:before {
403
+  content: "\e66d";
404
+}
405
+
406
+.uniui-navigate:before {
407
+  content: "\e66e";
408
+}
409
+
410
+.uniui-minus:before {
411
+  content: "\e66f";
412
+}
413
+
414
+.uniui-image:before {
415
+  content: "\e670";
416
+}
417
+
418
+.uniui-mic:before {
419
+  content: "\e671";
420
+}
421
+
422
+.uniui-paperplane:before {
423
+  content: "\e672";
424
+}
425
+
426
+.uniui-close:before {
427
+  content: "\e673";
428
+}
429
+
430
+.uniui-help-filled:before {
431
+  content: "\e674";
432
+}
433
+
434
+.uniui-paperplane-filled:before {
435
+  content: "\e675";
436
+}
437
+
438
+.uniui-plus:before {
439
+  content: "\e676";
440
+}
441
+
442
+.uniui-mic-filled:before {
443
+  content: "\e677";
444
+}
445
+
446
+.uniui-image-filled:before {
447
+  content: "\e678";
448
+}
449
+
450
+.uniui-locked-filled:before {
451
+  content: "\e668";
452
+}
453
+
454
+.uniui-info:before {
455
+  content: "\e669";
456
+}
457
+
458
+.uniui-locked:before {
459
+  content: "\e66b";
460
+}
461
+
462
+.uniui-camera-filled:before {
463
+  content: "\e658";
464
+}
465
+
466
+.uniui-chat-filled:before {
467
+  content: "\e659";
468
+}
469
+
470
+.uniui-camera:before {
471
+  content: "\e65a";
472
+}
473
+
474
+.uniui-circle:before {
475
+  content: "\e65b";
476
+}
477
+
478
+.uniui-checkmarkempty:before {
479
+  content: "\e65c";
480
+}
481
+
482
+.uniui-chat:before {
483
+  content: "\e65d";
484
+}
485
+
486
+.uniui-circle-filled:before {
487
+  content: "\e65e";
488
+}
489
+
490
+.uniui-flag:before {
491
+  content: "\e65f";
492
+}
493
+
494
+.uniui-flag-filled:before {
495
+  content: "\e660";
496
+}
497
+
498
+.uniui-gear-filled:before {
499
+  content: "\e661";
500
+}
501
+
502
+.uniui-home:before {
503
+  content: "\e662";
504
+}
505
+
506
+.uniui-home-filled:before {
507
+  content: "\e663";
508
+}
509
+
510
+.uniui-gear:before {
511
+  content: "\e664";
512
+}
513
+
514
+.uniui-smallcircle-filled:before {
515
+  content: "\e665";
516
+}
517
+
518
+.uniui-map-filled:before {
519
+  content: "\e666";
520
+}
521
+
522
+.uniui-map:before {
523
+  content: "\e667";
524
+}
525
+
526
+.uniui-refresh-filled:before {
527
+  content: "\e656";
528
+}
529
+
530
+.uniui-refresh:before {
531
+  content: "\e657";
532
+}
533
+
534
+.uniui-cloud-upload:before {
535
+  content: "\e645";
536
+}
537
+
538
+.uniui-cloud-download-filled:before {
539
+  content: "\e646";
540
+}
541
+
542
+.uniui-cloud-download:before {
543
+  content: "\e647";
544
+}
545
+
546
+.uniui-cloud-upload-filled:before {
547
+  content: "\e648";
548
+}
549
+
550
+.uniui-redo:before {
551
+  content: "\e64a";
552
+}
553
+
554
+.uniui-images-filled:before {
555
+  content: "\e64b";
556
+}
557
+
558
+.uniui-undo-filled:before {
559
+  content: "\e64c";
560
+}
561
+
562
+.uniui-more:before {
563
+  content: "\e64d";
564
+}
565
+
566
+.uniui-more-filled:before {
567
+  content: "\e64e";
568
+}
569
+
570
+.uniui-undo:before {
571
+  content: "\e64f";
572
+}
573
+
574
+.uniui-images:before {
575
+  content: "\e650";
576
+}
577
+
578
+.uniui-paperclip:before {
579
+  content: "\e652";
580
+}
581
+
582
+.uniui-settings:before {
583
+  content: "\e653";
584
+}
585
+
586
+.uniui-search:before {
587
+  content: "\e654";
588
+}
589
+
590
+.uniui-redo-filled:before {
591
+  content: "\e655";
592
+}
593
+
594
+.uniui-list:before {
595
+  content: "\e644";
596
+}
597
+
598
+.uniui-mail-open-filled:before {
599
+  content: "\e63a";
600
+}
601
+
602
+.uniui-hand-down-filled:before {
603
+  content: "\e63c";
604
+}
605
+
606
+.uniui-hand-down:before {
607
+  content: "\e63d";
608
+}
609
+
610
+.uniui-hand-up-filled:before {
611
+  content: "\e63e";
612
+}
613
+
614
+.uniui-hand-up:before {
615
+  content: "\e63f";
616
+}
617
+
618
+.uniui-heart-filled:before {
619
+  content: "\e641";
620
+}
621
+
622
+.uniui-mail-open:before {
623
+  content: "\e643";
624
+}
625
+
626
+.uniui-heart:before {
627
+  content: "\e639";
628
+}
629
+
630
+.uniui-loop:before {
631
+  content: "\e633";
632
+}
633
+
634
+.uniui-pulldown:before {
635
+  content: "\e632";
636
+}
637
+
638
+.uniui-scan:before {
639
+  content: "\e62a";
640
+}
641
+
642
+.uniui-bars:before {
643
+  content: "\e627";
644
+}
645
+
646
+.uniui-checkbox:before {
647
+  content: "\e62b";
648
+}
649
+
650
+.uniui-checkbox-filled:before {
651
+  content: "\e62c";
652
+}
653
+
654
+.uniui-shop:before {
655
+  content: "\e62f";
656
+}
657
+
658
+.uniui-headphones:before {
659
+  content: "\e630";
660
+}
661
+
662
+.uniui-cart:before {
663
+  content: "\e631";
664
+}

BIN
uni_modules/uni-icons/components/uni-icons/uniicons.ttf


+ 664 - 0
uni_modules/uni-icons/components/uni-icons/uniicons_file.ts

@@ -0,0 +1,664 @@
1
+
2
+export type IconsData = {
3
+	id : string
4
+	name : string
5
+	font_family : string
6
+	css_prefix_text : string
7
+	description : string
8
+	glyphs : Array<IconsDataItem>
9
+}
10
+
11
+export type IconsDataItem = {
12
+	font_class : string
13
+	unicode : string
14
+}
15
+
16
+
17
+export const fontData = [
18
+  {
19
+    "font_class": "arrow-down",
20
+    "unicode": "\ue6be"
21
+  },
22
+  {
23
+    "font_class": "arrow-left",
24
+    "unicode": "\ue6bc"
25
+  },
26
+  {
27
+    "font_class": "arrow-right",
28
+    "unicode": "\ue6bb"
29
+  },
30
+  {
31
+    "font_class": "arrow-up",
32
+    "unicode": "\ue6bd"
33
+  },
34
+  {
35
+    "font_class": "auth",
36
+    "unicode": "\ue6ab"
37
+  },
38
+  {
39
+    "font_class": "auth-filled",
40
+    "unicode": "\ue6cc"
41
+  },
42
+  {
43
+    "font_class": "back",
44
+    "unicode": "\ue6b9"
45
+  },
46
+  {
47
+    "font_class": "bars",
48
+    "unicode": "\ue627"
49
+  },
50
+  {
51
+    "font_class": "calendar",
52
+    "unicode": "\ue6a0"
53
+  },
54
+  {
55
+    "font_class": "calendar-filled",
56
+    "unicode": "\ue6c0"
57
+  },
58
+  {
59
+    "font_class": "camera",
60
+    "unicode": "\ue65a"
61
+  },
62
+  {
63
+    "font_class": "camera-filled",
64
+    "unicode": "\ue658"
65
+  },
66
+  {
67
+    "font_class": "cart",
68
+    "unicode": "\ue631"
69
+  },
70
+  {
71
+    "font_class": "cart-filled",
72
+    "unicode": "\ue6d0"
73
+  },
74
+  {
75
+    "font_class": "chat",
76
+    "unicode": "\ue65d"
77
+  },
78
+  {
79
+    "font_class": "chat-filled",
80
+    "unicode": "\ue659"
81
+  },
82
+  {
83
+    "font_class": "chatboxes",
84
+    "unicode": "\ue696"
85
+  },
86
+  {
87
+    "font_class": "chatboxes-filled",
88
+    "unicode": "\ue692"
89
+  },
90
+  {
91
+    "font_class": "chatbubble",
92
+    "unicode": "\ue697"
93
+  },
94
+  {
95
+    "font_class": "chatbubble-filled",
96
+    "unicode": "\ue694"
97
+  },
98
+  {
99
+    "font_class": "checkbox",
100
+    "unicode": "\ue62b"
101
+  },
102
+  {
103
+    "font_class": "checkbox-filled",
104
+    "unicode": "\ue62c"
105
+  },
106
+  {
107
+    "font_class": "checkmarkempty",
108
+    "unicode": "\ue65c"
109
+  },
110
+  {
111
+    "font_class": "circle",
112
+    "unicode": "\ue65b"
113
+  },
114
+  {
115
+    "font_class": "circle-filled",
116
+    "unicode": "\ue65e"
117
+  },
118
+  {
119
+    "font_class": "clear",
120
+    "unicode": "\ue66d"
121
+  },
122
+  {
123
+    "font_class": "close",
124
+    "unicode": "\ue673"
125
+  },
126
+  {
127
+    "font_class": "closeempty",
128
+    "unicode": "\ue66c"
129
+  },
130
+  {
131
+    "font_class": "cloud-download",
132
+    "unicode": "\ue647"
133
+  },
134
+  {
135
+    "font_class": "cloud-download-filled",
136
+    "unicode": "\ue646"
137
+  },
138
+  {
139
+    "font_class": "cloud-upload",
140
+    "unicode": "\ue645"
141
+  },
142
+  {
143
+    "font_class": "cloud-upload-filled",
144
+    "unicode": "\ue648"
145
+  },
146
+  {
147
+    "font_class": "color",
148
+    "unicode": "\ue6cf"
149
+  },
150
+  {
151
+    "font_class": "color-filled",
152
+    "unicode": "\ue6c9"
153
+  },
154
+  {
155
+    "font_class": "compose",
156
+    "unicode": "\ue67f"
157
+  },
158
+  {
159
+    "font_class": "contact",
160
+    "unicode": "\ue693"
161
+  },
162
+  {
163
+    "font_class": "contact-filled",
164
+    "unicode": "\ue695"
165
+  },
166
+  {
167
+    "font_class": "down",
168
+    "unicode": "\ue6b8"
169
+  },
170
+	{
171
+	  "font_class": "bottom",
172
+	  "unicode": "\ue6b8"
173
+	},
174
+  {
175
+    "font_class": "download",
176
+    "unicode": "\ue68d"
177
+  },
178
+  {
179
+    "font_class": "download-filled",
180
+    "unicode": "\ue681"
181
+  },
182
+  {
183
+    "font_class": "email",
184
+    "unicode": "\ue69e"
185
+  },
186
+  {
187
+    "font_class": "email-filled",
188
+    "unicode": "\ue69a"
189
+  },
190
+  {
191
+    "font_class": "eye",
192
+    "unicode": "\ue651"
193
+  },
194
+  {
195
+    "font_class": "eye-filled",
196
+    "unicode": "\ue66a"
197
+  },
198
+  {
199
+    "font_class": "eye-slash",
200
+    "unicode": "\ue6b3"
201
+  },
202
+  {
203
+    "font_class": "eye-slash-filled",
204
+    "unicode": "\ue6b4"
205
+  },
206
+  {
207
+    "font_class": "fire",
208
+    "unicode": "\ue6a1"
209
+  },
210
+  {
211
+    "font_class": "fire-filled",
212
+    "unicode": "\ue6c5"
213
+  },
214
+  {
215
+    "font_class": "flag",
216
+    "unicode": "\ue65f"
217
+  },
218
+  {
219
+    "font_class": "flag-filled",
220
+    "unicode": "\ue660"
221
+  },
222
+  {
223
+    "font_class": "folder-add",
224
+    "unicode": "\ue6a9"
225
+  },
226
+  {
227
+    "font_class": "folder-add-filled",
228
+    "unicode": "\ue6c8"
229
+  },
230
+  {
231
+    "font_class": "font",
232
+    "unicode": "\ue6a3"
233
+  },
234
+  {
235
+    "font_class": "forward",
236
+    "unicode": "\ue6ba"
237
+  },
238
+  {
239
+    "font_class": "gear",
240
+    "unicode": "\ue664"
241
+  },
242
+  {
243
+    "font_class": "gear-filled",
244
+    "unicode": "\ue661"
245
+  },
246
+  {
247
+    "font_class": "gift",
248
+    "unicode": "\ue6a4"
249
+  },
250
+  {
251
+    "font_class": "gift-filled",
252
+    "unicode": "\ue6c4"
253
+  },
254
+  {
255
+    "font_class": "hand-down",
256
+    "unicode": "\ue63d"
257
+  },
258
+  {
259
+    "font_class": "hand-down-filled",
260
+    "unicode": "\ue63c"
261
+  },
262
+  {
263
+    "font_class": "hand-up",
264
+    "unicode": "\ue63f"
265
+  },
266
+  {
267
+    "font_class": "hand-up-filled",
268
+    "unicode": "\ue63e"
269
+  },
270
+  {
271
+    "font_class": "headphones",
272
+    "unicode": "\ue630"
273
+  },
274
+  {
275
+    "font_class": "heart",
276
+    "unicode": "\ue639"
277
+  },
278
+  {
279
+    "font_class": "heart-filled",
280
+    "unicode": "\ue641"
281
+  },
282
+  {
283
+    "font_class": "help",
284
+    "unicode": "\ue679"
285
+  },
286
+  {
287
+    "font_class": "help-filled",
288
+    "unicode": "\ue674"
289
+  },
290
+  {
291
+    "font_class": "home",
292
+    "unicode": "\ue662"
293
+  },
294
+  {
295
+    "font_class": "home-filled",
296
+    "unicode": "\ue663"
297
+  },
298
+  {
299
+    "font_class": "image",
300
+    "unicode": "\ue670"
301
+  },
302
+  {
303
+    "font_class": "image-filled",
304
+    "unicode": "\ue678"
305
+  },
306
+  {
307
+    "font_class": "images",
308
+    "unicode": "\ue650"
309
+  },
310
+  {
311
+    "font_class": "images-filled",
312
+    "unicode": "\ue64b"
313
+  },
314
+  {
315
+    "font_class": "info",
316
+    "unicode": "\ue669"
317
+  },
318
+  {
319
+    "font_class": "info-filled",
320
+    "unicode": "\ue649"
321
+  },
322
+  {
323
+    "font_class": "left",
324
+    "unicode": "\ue6b7"
325
+  },
326
+  {
327
+    "font_class": "link",
328
+    "unicode": "\ue6a5"
329
+  },
330
+  {
331
+    "font_class": "list",
332
+    "unicode": "\ue644"
333
+  },
334
+  {
335
+    "font_class": "location",
336
+    "unicode": "\ue6ae"
337
+  },
338
+  {
339
+    "font_class": "location-filled",
340
+    "unicode": "\ue6af"
341
+  },
342
+  {
343
+    "font_class": "locked",
344
+    "unicode": "\ue66b"
345
+  },
346
+  {
347
+    "font_class": "locked-filled",
348
+    "unicode": "\ue668"
349
+  },
350
+  {
351
+    "font_class": "loop",
352
+    "unicode": "\ue633"
353
+  },
354
+  {
355
+    "font_class": "mail-open",
356
+    "unicode": "\ue643"
357
+  },
358
+  {
359
+    "font_class": "mail-open-filled",
360
+    "unicode": "\ue63a"
361
+  },
362
+  {
363
+    "font_class": "map",
364
+    "unicode": "\ue667"
365
+  },
366
+  {
367
+    "font_class": "map-filled",
368
+    "unicode": "\ue666"
369
+  },
370
+  {
371
+    "font_class": "map-pin",
372
+    "unicode": "\ue6ad"
373
+  },
374
+  {
375
+    "font_class": "map-pin-ellipse",
376
+    "unicode": "\ue6ac"
377
+  },
378
+  {
379
+    "font_class": "medal",
380
+    "unicode": "\ue6a2"
381
+  },
382
+  {
383
+    "font_class": "medal-filled",
384
+    "unicode": "\ue6c3"
385
+  },
386
+  {
387
+    "font_class": "mic",
388
+    "unicode": "\ue671"
389
+  },
390
+  {
391
+    "font_class": "mic-filled",
392
+    "unicode": "\ue677"
393
+  },
394
+  {
395
+    "font_class": "micoff",
396
+    "unicode": "\ue67e"
397
+  },
398
+  {
399
+    "font_class": "micoff-filled",
400
+    "unicode": "\ue6b0"
401
+  },
402
+  {
403
+    "font_class": "minus",
404
+    "unicode": "\ue66f"
405
+  },
406
+  {
407
+    "font_class": "minus-filled",
408
+    "unicode": "\ue67d"
409
+  },
410
+  {
411
+    "font_class": "more",
412
+    "unicode": "\ue64d"
413
+  },
414
+  {
415
+    "font_class": "more-filled",
416
+    "unicode": "\ue64e"
417
+  },
418
+  {
419
+    "font_class": "navigate",
420
+    "unicode": "\ue66e"
421
+  },
422
+  {
423
+    "font_class": "navigate-filled",
424
+    "unicode": "\ue67a"
425
+  },
426
+  {
427
+    "font_class": "notification",
428
+    "unicode": "\ue6a6"
429
+  },
430
+  {
431
+    "font_class": "notification-filled",
432
+    "unicode": "\ue6c1"
433
+  },
434
+  {
435
+    "font_class": "paperclip",
436
+    "unicode": "\ue652"
437
+  },
438
+  {
439
+    "font_class": "paperplane",
440
+    "unicode": "\ue672"
441
+  },
442
+  {
443
+    "font_class": "paperplane-filled",
444
+    "unicode": "\ue675"
445
+  },
446
+  {
447
+    "font_class": "person",
448
+    "unicode": "\ue699"
449
+  },
450
+  {
451
+    "font_class": "person-filled",
452
+    "unicode": "\ue69d"
453
+  },
454
+  {
455
+    "font_class": "personadd",
456
+    "unicode": "\ue69f"
457
+  },
458
+  {
459
+    "font_class": "personadd-filled",
460
+    "unicode": "\ue698"
461
+  },
462
+  {
463
+    "font_class": "personadd-filled-copy",
464
+    "unicode": "\ue6d1"
465
+  },
466
+  {
467
+    "font_class": "phone",
468
+    "unicode": "\ue69c"
469
+  },
470
+  {
471
+    "font_class": "phone-filled",
472
+    "unicode": "\ue69b"
473
+  },
474
+  {
475
+    "font_class": "plus",
476
+    "unicode": "\ue676"
477
+  },
478
+  {
479
+    "font_class": "plus-filled",
480
+    "unicode": "\ue6c7"
481
+  },
482
+  {
483
+    "font_class": "plusempty",
484
+    "unicode": "\ue67b"
485
+  },
486
+  {
487
+    "font_class": "pulldown",
488
+    "unicode": "\ue632"
489
+  },
490
+  {
491
+    "font_class": "pyq",
492
+    "unicode": "\ue682"
493
+  },
494
+  {
495
+    "font_class": "qq",
496
+    "unicode": "\ue680"
497
+  },
498
+  {
499
+    "font_class": "redo",
500
+    "unicode": "\ue64a"
501
+  },
502
+  {
503
+    "font_class": "redo-filled",
504
+    "unicode": "\ue655"
505
+  },
506
+  {
507
+    "font_class": "refresh",
508
+    "unicode": "\ue657"
509
+  },
510
+  {
511
+    "font_class": "refresh-filled",
512
+    "unicode": "\ue656"
513
+  },
514
+  {
515
+    "font_class": "refreshempty",
516
+    "unicode": "\ue6bf"
517
+  },
518
+  {
519
+    "font_class": "reload",
520
+    "unicode": "\ue6b2"
521
+  },
522
+  {
523
+    "font_class": "right",
524
+    "unicode": "\ue6b5"
525
+  },
526
+  {
527
+    "font_class": "scan",
528
+    "unicode": "\ue62a"
529
+  },
530
+  {
531
+    "font_class": "search",
532
+    "unicode": "\ue654"
533
+  },
534
+  {
535
+    "font_class": "settings",
536
+    "unicode": "\ue653"
537
+  },
538
+  {
539
+    "font_class": "settings-filled",
540
+    "unicode": "\ue6ce"
541
+  },
542
+  {
543
+    "font_class": "shop",
544
+    "unicode": "\ue62f"
545
+  },
546
+  {
547
+    "font_class": "shop-filled",
548
+    "unicode": "\ue6cd"
549
+  },
550
+  {
551
+    "font_class": "smallcircle",
552
+    "unicode": "\ue67c"
553
+  },
554
+  {
555
+    "font_class": "smallcircle-filled",
556
+    "unicode": "\ue665"
557
+  },
558
+  {
559
+    "font_class": "sound",
560
+    "unicode": "\ue684"
561
+  },
562
+  {
563
+    "font_class": "sound-filled",
564
+    "unicode": "\ue686"
565
+  },
566
+  {
567
+    "font_class": "spinner-cycle",
568
+    "unicode": "\ue68a"
569
+  },
570
+  {
571
+    "font_class": "staff",
572
+    "unicode": "\ue6a7"
573
+  },
574
+  {
575
+    "font_class": "staff-filled",
576
+    "unicode": "\ue6cb"
577
+  },
578
+  {
579
+    "font_class": "star",
580
+    "unicode": "\ue688"
581
+  },
582
+  {
583
+    "font_class": "star-filled",
584
+    "unicode": "\ue68f"
585
+  },
586
+  {
587
+    "font_class": "starhalf",
588
+    "unicode": "\ue683"
589
+  },
590
+  {
591
+    "font_class": "trash",
592
+    "unicode": "\ue687"
593
+  },
594
+  {
595
+    "font_class": "trash-filled",
596
+    "unicode": "\ue685"
597
+  },
598
+  {
599
+    "font_class": "tune",
600
+    "unicode": "\ue6aa"
601
+  },
602
+  {
603
+    "font_class": "tune-filled",
604
+    "unicode": "\ue6ca"
605
+  },
606
+  {
607
+    "font_class": "undo",
608
+    "unicode": "\ue64f"
609
+  },
610
+  {
611
+    "font_class": "undo-filled",
612
+    "unicode": "\ue64c"
613
+  },
614
+  {
615
+    "font_class": "up",
616
+    "unicode": "\ue6b6"
617
+  },
618
+	{
619
+	  "font_class": "top",
620
+	  "unicode": "\ue6b6"
621
+	},
622
+  {
623
+    "font_class": "upload",
624
+    "unicode": "\ue690"
625
+  },
626
+  {
627
+    "font_class": "upload-filled",
628
+    "unicode": "\ue68e"
629
+  },
630
+  {
631
+    "font_class": "videocam",
632
+    "unicode": "\ue68c"
633
+  },
634
+  {
635
+    "font_class": "videocam-filled",
636
+    "unicode": "\ue689"
637
+  },
638
+  {
639
+    "font_class": "vip",
640
+    "unicode": "\ue6a8"
641
+  },
642
+  {
643
+    "font_class": "vip-filled",
644
+    "unicode": "\ue6c6"
645
+  },
646
+  {
647
+    "font_class": "wallet",
648
+    "unicode": "\ue6b1"
649
+  },
650
+  {
651
+    "font_class": "wallet-filled",
652
+    "unicode": "\ue6c2"
653
+  },
654
+  {
655
+    "font_class": "weibo",
656
+    "unicode": "\ue68b"
657
+  },
658
+  {
659
+    "font_class": "weixin",
660
+    "unicode": "\ue691"
661
+  }
662
+] as IconsDataItem[]
663
+
664
+// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)

+ 649 - 0
uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js

@@ -0,0 +1,649 @@
1
+
2
+export const fontData = [
3
+  {
4
+    "font_class": "arrow-down",
5
+    "unicode": "\ue6be"
6
+  },
7
+  {
8
+    "font_class": "arrow-left",
9
+    "unicode": "\ue6bc"
10
+  },
11
+  {
12
+    "font_class": "arrow-right",
13
+    "unicode": "\ue6bb"
14
+  },
15
+  {
16
+    "font_class": "arrow-up",
17
+    "unicode": "\ue6bd"
18
+  },
19
+  {
20
+    "font_class": "auth",
21
+    "unicode": "\ue6ab"
22
+  },
23
+  {
24
+    "font_class": "auth-filled",
25
+    "unicode": "\ue6cc"
26
+  },
27
+  {
28
+    "font_class": "back",
29
+    "unicode": "\ue6b9"
30
+  },
31
+  {
32
+    "font_class": "bars",
33
+    "unicode": "\ue627"
34
+  },
35
+  {
36
+    "font_class": "calendar",
37
+    "unicode": "\ue6a0"
38
+  },
39
+  {
40
+    "font_class": "calendar-filled",
41
+    "unicode": "\ue6c0"
42
+  },
43
+  {
44
+    "font_class": "camera",
45
+    "unicode": "\ue65a"
46
+  },
47
+  {
48
+    "font_class": "camera-filled",
49
+    "unicode": "\ue658"
50
+  },
51
+  {
52
+    "font_class": "cart",
53
+    "unicode": "\ue631"
54
+  },
55
+  {
56
+    "font_class": "cart-filled",
57
+    "unicode": "\ue6d0"
58
+  },
59
+  {
60
+    "font_class": "chat",
61
+    "unicode": "\ue65d"
62
+  },
63
+  {
64
+    "font_class": "chat-filled",
65
+    "unicode": "\ue659"
66
+  },
67
+  {
68
+    "font_class": "chatboxes",
69
+    "unicode": "\ue696"
70
+  },
71
+  {
72
+    "font_class": "chatboxes-filled",
73
+    "unicode": "\ue692"
74
+  },
75
+  {
76
+    "font_class": "chatbubble",
77
+    "unicode": "\ue697"
78
+  },
79
+  {
80
+    "font_class": "chatbubble-filled",
81
+    "unicode": "\ue694"
82
+  },
83
+  {
84
+    "font_class": "checkbox",
85
+    "unicode": "\ue62b"
86
+  },
87
+  {
88
+    "font_class": "checkbox-filled",
89
+    "unicode": "\ue62c"
90
+  },
91
+  {
92
+    "font_class": "checkmarkempty",
93
+    "unicode": "\ue65c"
94
+  },
95
+  {
96
+    "font_class": "circle",
97
+    "unicode": "\ue65b"
98
+  },
99
+  {
100
+    "font_class": "circle-filled",
101
+    "unicode": "\ue65e"
102
+  },
103
+  {
104
+    "font_class": "clear",
105
+    "unicode": "\ue66d"
106
+  },
107
+  {
108
+    "font_class": "close",
109
+    "unicode": "\ue673"
110
+  },
111
+  {
112
+    "font_class": "closeempty",
113
+    "unicode": "\ue66c"
114
+  },
115
+  {
116
+    "font_class": "cloud-download",
117
+    "unicode": "\ue647"
118
+  },
119
+  {
120
+    "font_class": "cloud-download-filled",
121
+    "unicode": "\ue646"
122
+  },
123
+  {
124
+    "font_class": "cloud-upload",
125
+    "unicode": "\ue645"
126
+  },
127
+  {
128
+    "font_class": "cloud-upload-filled",
129
+    "unicode": "\ue648"
130
+  },
131
+  {
132
+    "font_class": "color",
133
+    "unicode": "\ue6cf"
134
+  },
135
+  {
136
+    "font_class": "color-filled",
137
+    "unicode": "\ue6c9"
138
+  },
139
+  {
140
+    "font_class": "compose",
141
+    "unicode": "\ue67f"
142
+  },
143
+  {
144
+    "font_class": "contact",
145
+    "unicode": "\ue693"
146
+  },
147
+  {
148
+    "font_class": "contact-filled",
149
+    "unicode": "\ue695"
150
+  },
151
+  {
152
+    "font_class": "down",
153
+    "unicode": "\ue6b8"
154
+  },
155
+	{
156
+	  "font_class": "bottom",
157
+	  "unicode": "\ue6b8"
158
+	},
159
+  {
160
+    "font_class": "download",
161
+    "unicode": "\ue68d"
162
+  },
163
+  {
164
+    "font_class": "download-filled",
165
+    "unicode": "\ue681"
166
+  },
167
+  {
168
+    "font_class": "email",
169
+    "unicode": "\ue69e"
170
+  },
171
+  {
172
+    "font_class": "email-filled",
173
+    "unicode": "\ue69a"
174
+  },
175
+  {
176
+    "font_class": "eye",
177
+    "unicode": "\ue651"
178
+  },
179
+  {
180
+    "font_class": "eye-filled",
181
+    "unicode": "\ue66a"
182
+  },
183
+  {
184
+    "font_class": "eye-slash",
185
+    "unicode": "\ue6b3"
186
+  },
187
+  {
188
+    "font_class": "eye-slash-filled",
189
+    "unicode": "\ue6b4"
190
+  },
191
+  {
192
+    "font_class": "fire",
193
+    "unicode": "\ue6a1"
194
+  },
195
+  {
196
+    "font_class": "fire-filled",
197
+    "unicode": "\ue6c5"
198
+  },
199
+  {
200
+    "font_class": "flag",
201
+    "unicode": "\ue65f"
202
+  },
203
+  {
204
+    "font_class": "flag-filled",
205
+    "unicode": "\ue660"
206
+  },
207
+  {
208
+    "font_class": "folder-add",
209
+    "unicode": "\ue6a9"
210
+  },
211
+  {
212
+    "font_class": "folder-add-filled",
213
+    "unicode": "\ue6c8"
214
+  },
215
+  {
216
+    "font_class": "font",
217
+    "unicode": "\ue6a3"
218
+  },
219
+  {
220
+    "font_class": "forward",
221
+    "unicode": "\ue6ba"
222
+  },
223
+  {
224
+    "font_class": "gear",
225
+    "unicode": "\ue664"
226
+  },
227
+  {
228
+    "font_class": "gear-filled",
229
+    "unicode": "\ue661"
230
+  },
231
+  {
232
+    "font_class": "gift",
233
+    "unicode": "\ue6a4"
234
+  },
235
+  {
236
+    "font_class": "gift-filled",
237
+    "unicode": "\ue6c4"
238
+  },
239
+  {
240
+    "font_class": "hand-down",
241
+    "unicode": "\ue63d"
242
+  },
243
+  {
244
+    "font_class": "hand-down-filled",
245
+    "unicode": "\ue63c"
246
+  },
247
+  {
248
+    "font_class": "hand-up",
249
+    "unicode": "\ue63f"
250
+  },
251
+  {
252
+    "font_class": "hand-up-filled",
253
+    "unicode": "\ue63e"
254
+  },
255
+  {
256
+    "font_class": "headphones",
257
+    "unicode": "\ue630"
258
+  },
259
+  {
260
+    "font_class": "heart",
261
+    "unicode": "\ue639"
262
+  },
263
+  {
264
+    "font_class": "heart-filled",
265
+    "unicode": "\ue641"
266
+  },
267
+  {
268
+    "font_class": "help",
269
+    "unicode": "\ue679"
270
+  },
271
+  {
272
+    "font_class": "help-filled",
273
+    "unicode": "\ue674"
274
+  },
275
+  {
276
+    "font_class": "home",
277
+    "unicode": "\ue662"
278
+  },
279
+  {
280
+    "font_class": "home-filled",
281
+    "unicode": "\ue663"
282
+  },
283
+  {
284
+    "font_class": "image",
285
+    "unicode": "\ue670"
286
+  },
287
+  {
288
+    "font_class": "image-filled",
289
+    "unicode": "\ue678"
290
+  },
291
+  {
292
+    "font_class": "images",
293
+    "unicode": "\ue650"
294
+  },
295
+  {
296
+    "font_class": "images-filled",
297
+    "unicode": "\ue64b"
298
+  },
299
+  {
300
+    "font_class": "info",
301
+    "unicode": "\ue669"
302
+  },
303
+  {
304
+    "font_class": "info-filled",
305
+    "unicode": "\ue649"
306
+  },
307
+  {
308
+    "font_class": "left",
309
+    "unicode": "\ue6b7"
310
+  },
311
+  {
312
+    "font_class": "link",
313
+    "unicode": "\ue6a5"
314
+  },
315
+  {
316
+    "font_class": "list",
317
+    "unicode": "\ue644"
318
+  },
319
+  {
320
+    "font_class": "location",
321
+    "unicode": "\ue6ae"
322
+  },
323
+  {
324
+    "font_class": "location-filled",
325
+    "unicode": "\ue6af"
326
+  },
327
+  {
328
+    "font_class": "locked",
329
+    "unicode": "\ue66b"
330
+  },
331
+  {
332
+    "font_class": "locked-filled",
333
+    "unicode": "\ue668"
334
+  },
335
+  {
336
+    "font_class": "loop",
337
+    "unicode": "\ue633"
338
+  },
339
+  {
340
+    "font_class": "mail-open",
341
+    "unicode": "\ue643"
342
+  },
343
+  {
344
+    "font_class": "mail-open-filled",
345
+    "unicode": "\ue63a"
346
+  },
347
+  {
348
+    "font_class": "map",
349
+    "unicode": "\ue667"
350
+  },
351
+  {
352
+    "font_class": "map-filled",
353
+    "unicode": "\ue666"
354
+  },
355
+  {
356
+    "font_class": "map-pin",
357
+    "unicode": "\ue6ad"
358
+  },
359
+  {
360
+    "font_class": "map-pin-ellipse",
361
+    "unicode": "\ue6ac"
362
+  },
363
+  {
364
+    "font_class": "medal",
365
+    "unicode": "\ue6a2"
366
+  },
367
+  {
368
+    "font_class": "medal-filled",
369
+    "unicode": "\ue6c3"
370
+  },
371
+  {
372
+    "font_class": "mic",
373
+    "unicode": "\ue671"
374
+  },
375
+  {
376
+    "font_class": "mic-filled",
377
+    "unicode": "\ue677"
378
+  },
379
+  {
380
+    "font_class": "micoff",
381
+    "unicode": "\ue67e"
382
+  },
383
+  {
384
+    "font_class": "micoff-filled",
385
+    "unicode": "\ue6b0"
386
+  },
387
+  {
388
+    "font_class": "minus",
389
+    "unicode": "\ue66f"
390
+  },
391
+  {
392
+    "font_class": "minus-filled",
393
+    "unicode": "\ue67d"
394
+  },
395
+  {
396
+    "font_class": "more",
397
+    "unicode": "\ue64d"
398
+  },
399
+  {
400
+    "font_class": "more-filled",
401
+    "unicode": "\ue64e"
402
+  },
403
+  {
404
+    "font_class": "navigate",
405
+    "unicode": "\ue66e"
406
+  },
407
+  {
408
+    "font_class": "navigate-filled",
409
+    "unicode": "\ue67a"
410
+  },
411
+  {
412
+    "font_class": "notification",
413
+    "unicode": "\ue6a6"
414
+  },
415
+  {
416
+    "font_class": "notification-filled",
417
+    "unicode": "\ue6c1"
418
+  },
419
+  {
420
+    "font_class": "paperclip",
421
+    "unicode": "\ue652"
422
+  },
423
+  {
424
+    "font_class": "paperplane",
425
+    "unicode": "\ue672"
426
+  },
427
+  {
428
+    "font_class": "paperplane-filled",
429
+    "unicode": "\ue675"
430
+  },
431
+  {
432
+    "font_class": "person",
433
+    "unicode": "\ue699"
434
+  },
435
+  {
436
+    "font_class": "person-filled",
437
+    "unicode": "\ue69d"
438
+  },
439
+  {
440
+    "font_class": "personadd",
441
+    "unicode": "\ue69f"
442
+  },
443
+  {
444
+    "font_class": "personadd-filled",
445
+    "unicode": "\ue698"
446
+  },
447
+  {
448
+    "font_class": "personadd-filled-copy",
449
+    "unicode": "\ue6d1"
450
+  },
451
+  {
452
+    "font_class": "phone",
453
+    "unicode": "\ue69c"
454
+  },
455
+  {
456
+    "font_class": "phone-filled",
457
+    "unicode": "\ue69b"
458
+  },
459
+  {
460
+    "font_class": "plus",
461
+    "unicode": "\ue676"
462
+  },
463
+  {
464
+    "font_class": "plus-filled",
465
+    "unicode": "\ue6c7"
466
+  },
467
+  {
468
+    "font_class": "plusempty",
469
+    "unicode": "\ue67b"
470
+  },
471
+  {
472
+    "font_class": "pulldown",
473
+    "unicode": "\ue632"
474
+  },
475
+  {
476
+    "font_class": "pyq",
477
+    "unicode": "\ue682"
478
+  },
479
+  {
480
+    "font_class": "qq",
481
+    "unicode": "\ue680"
482
+  },
483
+  {
484
+    "font_class": "redo",
485
+    "unicode": "\ue64a"
486
+  },
487
+  {
488
+    "font_class": "redo-filled",
489
+    "unicode": "\ue655"
490
+  },
491
+  {
492
+    "font_class": "refresh",
493
+    "unicode": "\ue657"
494
+  },
495
+  {
496
+    "font_class": "refresh-filled",
497
+    "unicode": "\ue656"
498
+  },
499
+  {
500
+    "font_class": "refreshempty",
501
+    "unicode": "\ue6bf"
502
+  },
503
+  {
504
+    "font_class": "reload",
505
+    "unicode": "\ue6b2"
506
+  },
507
+  {
508
+    "font_class": "right",
509
+    "unicode": "\ue6b5"
510
+  },
511
+  {
512
+    "font_class": "scan",
513
+    "unicode": "\ue62a"
514
+  },
515
+  {
516
+    "font_class": "search",
517
+    "unicode": "\ue654"
518
+  },
519
+  {
520
+    "font_class": "settings",
521
+    "unicode": "\ue653"
522
+  },
523
+  {
524
+    "font_class": "settings-filled",
525
+    "unicode": "\ue6ce"
526
+  },
527
+  {
528
+    "font_class": "shop",
529
+    "unicode": "\ue62f"
530
+  },
531
+  {
532
+    "font_class": "shop-filled",
533
+    "unicode": "\ue6cd"
534
+  },
535
+  {
536
+    "font_class": "smallcircle",
537
+    "unicode": "\ue67c"
538
+  },
539
+  {
540
+    "font_class": "smallcircle-filled",
541
+    "unicode": "\ue665"
542
+  },
543
+  {
544
+    "font_class": "sound",
545
+    "unicode": "\ue684"
546
+  },
547
+  {
548
+    "font_class": "sound-filled",
549
+    "unicode": "\ue686"
550
+  },
551
+  {
552
+    "font_class": "spinner-cycle",
553
+    "unicode": "\ue68a"
554
+  },
555
+  {
556
+    "font_class": "staff",
557
+    "unicode": "\ue6a7"
558
+  },
559
+  {
560
+    "font_class": "staff-filled",
561
+    "unicode": "\ue6cb"
562
+  },
563
+  {
564
+    "font_class": "star",
565
+    "unicode": "\ue688"
566
+  },
567
+  {
568
+    "font_class": "star-filled",
569
+    "unicode": "\ue68f"
570
+  },
571
+  {
572
+    "font_class": "starhalf",
573
+    "unicode": "\ue683"
574
+  },
575
+  {
576
+    "font_class": "trash",
577
+    "unicode": "\ue687"
578
+  },
579
+  {
580
+    "font_class": "trash-filled",
581
+    "unicode": "\ue685"
582
+  },
583
+  {
584
+    "font_class": "tune",
585
+    "unicode": "\ue6aa"
586
+  },
587
+  {
588
+    "font_class": "tune-filled",
589
+    "unicode": "\ue6ca"
590
+  },
591
+  {
592
+    "font_class": "undo",
593
+    "unicode": "\ue64f"
594
+  },
595
+  {
596
+    "font_class": "undo-filled",
597
+    "unicode": "\ue64c"
598
+  },
599
+  {
600
+    "font_class": "up",
601
+    "unicode": "\ue6b6"
602
+  },
603
+	{
604
+	  "font_class": "top",
605
+	  "unicode": "\ue6b6"
606
+	},
607
+  {
608
+    "font_class": "upload",
609
+    "unicode": "\ue690"
610
+  },
611
+  {
612
+    "font_class": "upload-filled",
613
+    "unicode": "\ue68e"
614
+  },
615
+  {
616
+    "font_class": "videocam",
617
+    "unicode": "\ue68c"
618
+  },
619
+  {
620
+    "font_class": "videocam-filled",
621
+    "unicode": "\ue689"
622
+  },
623
+  {
624
+    "font_class": "vip",
625
+    "unicode": "\ue6a8"
626
+  },
627
+  {
628
+    "font_class": "vip-filled",
629
+    "unicode": "\ue6c6"
630
+  },
631
+  {
632
+    "font_class": "wallet",
633
+    "unicode": "\ue6b1"
634
+  },
635
+  {
636
+    "font_class": "wallet-filled",
637
+    "unicode": "\ue6c2"
638
+  },
639
+  {
640
+    "font_class": "weibo",
641
+    "unicode": "\ue68b"
642
+  },
643
+  {
644
+    "font_class": "weixin",
645
+    "unicode": "\ue691"
646
+  }
647
+]
648
+
649
+// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)

+ 89 - 0
uni_modules/uni-icons/package.json

@@ -0,0 +1,89 @@
1
+{
2
+  "id": "uni-icons",
3
+  "displayName": "uni-icons 图标",
4
+  "version": "2.0.10",
5
+  "description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
6
+  "keywords": [
7
+    "uni-ui",
8
+    "uniui",
9
+    "icon",
10
+    "图标"
11
+],
12
+  "repository": "https://github.com/dcloudio/uni-ui",
13
+  "engines": {
14
+    "HBuilderX": "^3.2.14"
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": ["uni-scss"],
41
+    "encrypt": [],
42
+    "platforms": {
43
+      "cloud": {
44
+        "tcb": "y",
45
+        "aliyun": "y",
46
+        "alipay": "n"
47
+      },
48
+      "client": {
49
+        "App": {
50
+          "app-vue": "y",
51
+          "app-nvue": "y",
52
+          "app-uvue": "y"
53
+        },
54
+        "H5-mobile": {
55
+          "Safari": "y",
56
+          "Android Browser": "y",
57
+          "微信浏览器(Android)": "y",
58
+          "QQ浏览器(Android)": "y"
59
+        },
60
+        "H5-pc": {
61
+          "Chrome": "y",
62
+          "IE": "y",
63
+          "Edge": "y",
64
+          "Firefox": "y",
65
+          "Safari": "y"
66
+        },
67
+        "小程序": {
68
+          "微信": "y",
69
+          "阿里": "y",
70
+          "百度": "y",
71
+          "字节跳动": "y",
72
+          "QQ": "y",
73
+					"钉钉": "y",
74
+					"快手": "y",
75
+					"飞书": "y",
76
+					"京东": "y"
77
+        },
78
+        "快应用": {
79
+          "华为": "y",
80
+          "联盟": "y"
81
+        },
82
+        "Vue": {
83
+            "vue2": "y",
84
+            "vue3": "y"
85
+        }
86
+      }
87
+    }
88
+  }
89
+}

+ 8 - 0
uni_modules/uni-icons/readme.md

@@ -0,0 +1,8 @@
1
+## Icons 图标
2
+> **组件名:uni-icons**
3
+> 代码块: `uIcons`
4
+
5
+用于展示 icons 图标 。
6
+
7
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons)
8
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 

+ 19 - 0
uni_modules/uni-load-more/changelog.md

@@ -0,0 +1,19 @@
1
+## 1.3.3(2022-01-20)
2
+- 新增 showText属性 ,是否显示文本
3
+## 1.3.2(2022-01-19)
4
+- 修复 nvue 平台下不显示文本的bug
5
+## 1.3.1(2022-01-19)
6
+- 修复 微信小程序平台样式选择器报警告的问题
7
+## 1.3.0(2021-11-19)
8
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
9
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-load-more](https://uniapp.dcloud.io/component/uniui/uni-load-more)
10
+## 1.2.1(2021-08-24)
11
+- 新增 支持国际化
12
+## 1.2.0(2021-07-30)
13
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
14
+## 1.1.8(2021-05-12)
15
+- 新增 组件示例地址
16
+## 1.1.7(2021-03-30)
17
+- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug
18
+## 1.1.6(2021-02-05)
19
+- 调整为uni_modules目录规范

+ 5 - 0
uni_modules/uni-load-more/components/uni-load-more/i18n/en.json

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-load-more.contentdown": "Pull up to show more",
3
+	"uni-load-more.contentrefresh": "loading...",
4
+	"uni-load-more.contentnomore": "No more data"
5
+}

+ 8 - 0
uni_modules/uni-load-more/components/uni-load-more/i18n/index.js

@@ -0,0 +1,8 @@
1
+import en from './en.json'
2
+import zhHans from './zh-Hans.json'
3
+import zhHant from './zh-Hant.json'
4
+export default {
5
+	en,
6
+	'zh-Hans': zhHans,
7
+	'zh-Hant': zhHant
8
+}

+ 5 - 0
uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-load-more.contentdown": "上拉显示更多",
3
+	"uni-load-more.contentrefresh": "正在加载...",
4
+	"uni-load-more.contentnomore": "没有更多数据了"
5
+}

+ 5 - 0
uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-load-more.contentdown": "上拉顯示更多",
3
+	"uni-load-more.contentrefresh": "正在加載...",
4
+	"uni-load-more.contentnomore": "沒有更多數據了"
5
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 399 - 0
uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue


+ 86 - 0
uni_modules/uni-load-more/package.json

@@ -0,0 +1,86 @@
1
+{
2
+  "id": "uni-load-more",
3
+  "displayName": "uni-load-more 加载更多",
4
+  "version": "1.3.3",
5
+  "description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
6
+  "keywords": [
7
+    "uni-ui",
8
+    "uniui",
9
+    "加载更多",
10
+    "load-more"
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
+    "category": [
21
+      "前端组件",
22
+      "通用组件"
23
+    ],
24
+    "sale": {
25
+      "regular": {
26
+        "price": "0.00"
27
+      },
28
+      "sourcecode": {
29
+        "price": "0.00"
30
+      }
31
+    },
32
+    "contact": {
33
+      "qq": ""
34
+    },
35
+    "declaration": {
36
+      "ads": "无",
37
+      "data": "无",
38
+      "permissions": "无"
39
+    },
40
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
41
+  },
42
+  "uni_modules": {
43
+    "dependencies": ["uni-scss"],
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
+}

+ 14 - 0
uni_modules/uni-load-more/readme.md

@@ -0,0 +1,14 @@
1
+
2
+
3
+### LoadMore 加载更多
4
+> **组件名:uni-load-more**
5
+> 代码块: `uLoadMore`
6
+
7
+
8
+用于列表中,做滚动加载使用,展示 loading 的各种状态。
9
+
10
+
11
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more)
12
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 
13
+
14
+

+ 8 - 0
uni_modules/uni-scss/changelog.md

@@ -0,0 +1,8 @@
1
+## 1.0.3(2022-01-21)
2
+- 优化 组件示例
3
+## 1.0.2(2021-11-22)
4
+- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
5
+## 1.0.1(2021-11-22)
6
+- 修复 vue3中scss语法兼容问题
7
+## 1.0.0(2021-11-18)
8
+- init

+ 1 - 0
uni_modules/uni-scss/index.scss

@@ -0,0 +1 @@
1
+@import './styles/index.scss';

+ 82 - 0
uni_modules/uni-scss/package.json

@@ -0,0 +1,82 @@
1
+{
2
+  "id": "uni-scss",
3
+  "displayName": "uni-scss 辅助样式",
4
+  "version": "1.0.3",
5
+  "description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
6
+  "keywords": [
7
+    "uni-scss",
8
+    "uni-ui",
9
+    "辅助样式"
10
+],
11
+  "repository": "https://github.com/dcloudio/uni-ui",
12
+  "engines": {
13
+    "HBuilderX": "^3.1.0"
14
+  },
15
+  "dcloudext": {
16
+    "category": [
17
+        "JS SDK",
18
+        "通用 SDK"
19
+    ],
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
+  },
38
+  "uni_modules": {
39
+    "dependencies": [],
40
+    "encrypt": [],
41
+    "platforms": {
42
+      "cloud": {
43
+        "tcb": "y",
44
+        "aliyun": "y"
45
+      },
46
+      "client": {
47
+        "App": {
48
+          "app-vue": "y",
49
+          "app-nvue": "u"
50
+        },
51
+        "H5-mobile": {
52
+          "Safari": "y",
53
+          "Android Browser": "y",
54
+          "微信浏览器(Android)": "y",
55
+          "QQ浏览器(Android)": "y"
56
+        },
57
+        "H5-pc": {
58
+          "Chrome": "y",
59
+          "IE": "y",
60
+          "Edge": "y",
61
+          "Firefox": "y",
62
+          "Safari": "y"
63
+        },
64
+        "小程序": {
65
+          "微信": "y",
66
+          "阿里": "y",
67
+          "百度": "y",
68
+          "字节跳动": "y",
69
+          "QQ": "y"
70
+        },
71
+        "快应用": {
72
+          "华为": "n",
73
+          "联盟": "n"
74
+        },
75
+        "Vue": {
76
+            "vue2": "y",
77
+            "vue3": "y"
78
+        }
79
+      }
80
+    }
81
+  }
82
+}

+ 4 - 0
uni_modules/uni-scss/readme.md

@@ -0,0 +1,4 @@
1
+`uni-sass` 是 `uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。
2
+
3
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass)
4
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 

+ 7 - 0
uni_modules/uni-scss/styles/index.scss

@@ -0,0 +1,7 @@
1
+@import './setting/_variables.scss';
2
+@import './setting/_border.scss';
3
+@import './setting/_color.scss';
4
+@import './setting/_space.scss';
5
+@import './setting/_radius.scss';
6
+@import './setting/_text.scss';
7
+@import './setting/_styles.scss';

+ 3 - 0
uni_modules/uni-scss/styles/setting/_border.scss

@@ -0,0 +1,3 @@
1
+.uni-border {
2
+	border: 1px $uni-border-1 solid;
3
+}

+ 66 - 0
uni_modules/uni-scss/styles/setting/_color.scss

@@ -0,0 +1,66 @@
1
+
2
+// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐
3
+// @mixin get-styles($k,$c) {
4
+// 	@if $k == size or $k == weight{
5
+// 		font-#{$k}:#{$c}
6
+// 	}@else{
7
+// 		#{$k}:#{$c}
8
+// 	}
9
+// }
10
+$uni-ui-color:(
11
+	// 主色
12
+	primary: $uni-primary,
13
+	primary-disable: $uni-primary-disable,
14
+	primary-light: $uni-primary-light,
15
+	// 辅助色
16
+	success: $uni-success,
17
+	success-disable: $uni-success-disable,
18
+	success-light: $uni-success-light,
19
+	warning: $uni-warning,
20
+	warning-disable: $uni-warning-disable,
21
+	warning-light: $uni-warning-light,
22
+	error: $uni-error,
23
+	error-disable: $uni-error-disable,
24
+	error-light: $uni-error-light,
25
+	info: $uni-info,
26
+	info-disable: $uni-info-disable,
27
+	info-light: $uni-info-light,
28
+	// 中性色
29
+	main-color: $uni-main-color,
30
+	base-color: $uni-base-color,
31
+	secondary-color: $uni-secondary-color,
32
+	extra-color: $uni-extra-color,
33
+	// 背景色
34
+	bg-color: $uni-bg-color,
35
+	// 边框颜色
36
+	border-1: $uni-border-1,
37
+	border-2: $uni-border-2,
38
+	border-3: $uni-border-3,
39
+	border-4: $uni-border-4,
40
+	// 黑色
41
+	black:$uni-black,
42
+	// 白色
43
+	white:$uni-white,
44
+	// 透明
45
+	transparent:$uni-transparent
46
+) !default;
47
+@each $key, $child in $uni-ui-color {
48
+	.uni-#{"" + $key} {
49
+		color: $child;
50
+	}
51
+	.uni-#{"" + $key}-bg {
52
+		background-color: $child;
53
+	}
54
+}
55
+.uni-shadow-sm {
56
+	box-shadow: $uni-shadow-sm;
57
+}
58
+.uni-shadow-base {
59
+	box-shadow: $uni-shadow-base;
60
+}
61
+.uni-shadow-lg {
62
+	box-shadow: $uni-shadow-lg;
63
+}
64
+.uni-mask {
65
+	background-color:$uni-mask;
66
+}

+ 55 - 0
uni_modules/uni-scss/styles/setting/_radius.scss

@@ -0,0 +1,55 @@
1
+@mixin radius($r,$d:null ,$important: false){
2
+  $radius-value:map-get($uni-radius, $r) if($important, !important, null);
3
+  // Key exists within the $uni-radius variable
4
+  @if (map-has-key($uni-radius, $r) and  $d){
5
+		@if $d == t {
6
+				border-top-left-radius:$radius-value;
7
+				border-top-right-radius:$radius-value;
8
+		}@else if $d == r {
9
+				border-top-right-radius:$radius-value;
10
+				border-bottom-right-radius:$radius-value;
11
+		}@else if $d == b {
12
+				border-bottom-left-radius:$radius-value;
13
+				border-bottom-right-radius:$radius-value;
14
+		}@else if $d == l {
15
+				border-top-left-radius:$radius-value;
16
+				border-bottom-left-radius:$radius-value;
17
+		}@else if $d == tl {
18
+				border-top-left-radius:$radius-value;
19
+		}@else if $d == tr {
20
+				border-top-right-radius:$radius-value;
21
+		}@else if $d == br {
22
+				border-bottom-right-radius:$radius-value;
23
+		}@else if $d == bl {
24
+				border-bottom-left-radius:$radius-value;
25
+		}
26
+  }@else{
27
+		border-radius:$radius-value;
28
+  }
29
+}
30
+
31
+@each $key, $child in $uni-radius {
32
+	@if($key){
33
+		.uni-radius-#{"" + $key} {
34
+				@include radius($key)
35
+		}
36
+	}@else{
37
+		.uni-radius {
38
+				@include radius($key)
39
+		}
40
+	}
41
+}
42
+
43
+@each $direction in t, r, b, l,tl, tr, br, bl {
44
+	@each $key, $child in $uni-radius {
45
+		@if($key){
46
+			.uni-radius-#{"" + $direction}-#{"" + $key} {
47
+				@include radius($key,$direction,false)
48
+			}
49
+		}@else{
50
+			.uni-radius-#{$direction} {
51
+				@include radius($key,$direction,false)
52
+			}
53
+		}
54
+	}
55
+}

+ 56 - 0
uni_modules/uni-scss/styles/setting/_space.scss

@@ -0,0 +1,56 @@
1
+
2
+@mixin fn($space,$direction,$size,$n) {
3
+	@if $n {
4
+		#{$space}-#{$direction}: #{$size*$uni-space-root}px
5
+	} @else {
6
+		 #{$space}-#{$direction}: #{-$size*$uni-space-root}px
7
+	}
8
+}
9
+@mixin get-styles($direction,$i,$space,$n){
10
+	@if $direction == t {
11
+		@include fn($space, top,$i,$n);
12
+	} 
13
+	@if $direction == r {
14
+		@include fn($space, right,$i,$n);
15
+	} 
16
+	@if $direction == b {
17
+		@include fn($space, bottom,$i,$n);
18
+	} 
19
+	@if $direction == l {
20
+	 @include fn($space, left,$i,$n);
21
+	} 
22
+	@if $direction == x {
23
+		@include fn($space, left,$i,$n);
24
+		@include fn($space, right,$i,$n);
25
+	} 
26
+	@if $direction == y {
27
+		@include fn($space, top,$i,$n);
28
+		@include fn($space, bottom,$i,$n);
29
+	} 
30
+	@if $direction == a {
31
+		@if $n {
32
+			#{$space}:#{$i*$uni-space-root}px;
33
+		} @else {
34
+			#{$space}:#{-$i*$uni-space-root}px;
35
+		}
36
+	} 
37
+}
38
+
39
+@each $orientation in m,p {
40
+	$space: margin;
41
+	@if $orientation == m {
42
+		$space: margin;
43
+	} @else {
44
+		$space: padding;
45
+	}
46
+	@for $i from 0 through 16 {
47
+		@each $direction in t, r, b, l, x, y, a {
48
+			.uni-#{$orientation}#{$direction}-#{$i} { 
49
+				@include  get-styles($direction,$i,$space,true);
50
+			} 
51
+			.uni-#{$orientation}#{$direction}-n#{$i} { 
52
+				@include  get-styles($direction,$i,$space,false);
53
+			}
54
+		}
55
+	}
56
+}

+ 167 - 0
uni_modules/uni-scss/styles/setting/_styles.scss

@@ -0,0 +1,167 @@
1
+/* #ifndef APP-NVUE */
2
+
3
+$-color-white:#fff;
4
+$-color-black:#000;
5
+@mixin base-style($color) {
6
+	color: #fff;
7
+	background-color: $color;
8
+	border-color: mix($-color-black, $color, 8%);
9
+	&:not([hover-class]):active {
10
+		background: mix($-color-black, $color, 10%);
11
+		border-color: mix($-color-black, $color, 20%);
12
+		color: $-color-white;
13
+		outline: none;
14
+	}
15
+}
16
+@mixin is-color($color) {
17
+	@include base-style($color);
18
+	&[loading] {
19
+		@include base-style($color);
20
+		&::before {
21
+			margin-right:5px;
22
+		}
23
+	}
24
+	&[disabled] {
25
+	  &,
26
+		&[loading],
27
+	  &:not([hover-class]):active {
28
+	    color: $-color-white;
29
+			border-color: mix(darken($color,10%), $-color-white);
30
+	    background-color: mix($color, $-color-white);
31
+	  }
32
+	}
33
+
34
+}
35
+@mixin base-plain-style($color) {
36
+	color:$color;
37
+	background-color: mix($-color-white, $color, 90%);
38
+	border-color: mix($-color-white, $color, 70%);
39
+	&:not([hover-class]):active {
40
+	  background: mix($-color-white, $color, 80%);
41
+	  color: $color;
42
+	  outline: none;
43
+		border-color: mix($-color-white, $color, 50%);
44
+	}
45
+}
46
+@mixin is-plain($color){
47
+	&[plain] {
48
+		@include base-plain-style($color);
49
+		&[loading] {
50
+			@include base-plain-style($color);
51
+			&::before {
52
+				margin-right:5px;
53
+			}
54
+		}
55
+		&[disabled] {
56
+		  &,
57
+		  &:active {
58
+		    color: mix($-color-white, $color, 40%);
59
+		    background-color: mix($-color-white, $color, 90%);
60
+				border-color: mix($-color-white, $color, 80%);
61
+		  }
62
+		}
63
+	}
64
+}
65
+
66
+
67
+.uni-btn {
68
+	margin: 5px;
69
+	color: #393939;
70
+	border:1px solid #ccc;
71
+	font-size: 16px;
72
+	font-weight: 200;
73
+	background-color: #F9F9F9;
74
+	// TODO 暂时处理边框隐藏一边的问题
75
+	overflow: visible;
76
+	&::after{
77
+		border: none;
78
+	}
79
+
80
+	&:not([type]),&[type=default] {
81
+		color: #999;
82
+		&[loading] {
83
+			background: none;
84
+			&::before {
85
+				margin-right:5px;
86
+			}
87
+		}
88
+
89
+
90
+
91
+		&[disabled]{
92
+			color: mix($-color-white, #999, 60%);
93
+		  &,
94
+			&[loading],
95
+		  &:active {
96
+				color: mix($-color-white, #999, 60%);
97
+		    background-color: mix($-color-white,$-color-black , 98%);
98
+				border-color: mix($-color-white,  #999, 85%);
99
+		  }
100
+		}
101
+
102
+		&[plain] {
103
+			color: #999;
104
+			background: none;
105
+			border-color: $uni-border-1;
106
+			&:not([hover-class]):active {
107
+				background: none;
108
+			  color: mix($-color-white, $-color-black, 80%);
109
+				border-color: mix($-color-white, $-color-black, 90%);
110
+			  outline: none;
111
+			}
112
+			&[disabled]{
113
+			  &,
114
+				&[loading],
115
+			  &:active {
116
+			    background: none;
117
+					color: mix($-color-white, #999, 60%);
118
+					border-color: mix($-color-white,  #999, 85%);
119
+			  }
120
+			}
121
+		}
122
+	}
123
+
124
+	&:not([hover-class]):active {
125
+	  color: mix($-color-white, $-color-black, 50%);
126
+	}
127
+
128
+	&[size=mini] {
129
+		font-size: 16px;
130
+		font-weight: 200;
131
+		border-radius: 8px;
132
+	}
133
+
134
+
135
+
136
+	&.uni-btn-small {
137
+		font-size: 14px;
138
+	}
139
+	&.uni-btn-mini {
140
+		font-size: 12px;
141
+	}
142
+
143
+	&.uni-btn-radius {
144
+		border-radius: 999px;
145
+	}
146
+	&[type=primary] {
147
+		@include is-color($uni-primary);
148
+		@include is-plain($uni-primary)
149
+	}
150
+	&[type=success] {
151
+		@include is-color($uni-success);
152
+		@include is-plain($uni-success)
153
+	}
154
+	&[type=error] {
155
+		@include is-color($uni-error);
156
+		@include is-plain($uni-error)
157
+	}
158
+	&[type=warning] {
159
+		@include is-color($uni-warning);
160
+		@include is-plain($uni-warning)
161
+	}
162
+	&[type=info] {
163
+		@include is-color($uni-info);
164
+		@include is-plain($uni-info)
165
+	}
166
+}
167
+/* #endif */

+ 24 - 0
uni_modules/uni-scss/styles/setting/_text.scss

@@ -0,0 +1,24 @@
1
+@mixin get-styles($k,$c) {
2
+	@if $k == size or $k == weight{
3
+		font-#{$k}:#{$c}
4
+	}@else{
5
+		#{$k}:#{$c}
6
+	}
7
+}
8
+
9
+@each $key, $child in $uni-headings {
10
+	/* #ifndef APP-NVUE */
11
+	.uni-#{$key} {
12
+		@each $k, $c in $child {
13
+			@include get-styles($k,$c)
14
+		}
15
+	}
16
+	/* #endif */
17
+	/* #ifdef APP-NVUE */
18
+	.container .uni-#{$key} {
19
+		@each $k, $c in $child {
20
+			@include get-styles($k,$c)
21
+		}
22
+	}
23
+	/* #endif */
24
+}

+ 146 - 0
uni_modules/uni-scss/styles/setting/_variables.scss

@@ -0,0 +1,146 @@
1
+// @use "sass:math";
2
+@import  '../tools/functions.scss';
3
+// 间距基础倍数
4
+$uni-space-root: 2 !default;
5
+// 边框半径默认值
6
+$uni-radius-root:5px !default;
7
+$uni-radius: () !default;
8
+// 边框半径断点
9
+$uni-radius: map-deep-merge(
10
+  (
11
+    0: 0,
12
+		// TODO 当前版本暂时不支持 sm 属性
13
+    // 'sm': math.div($uni-radius-root, 2),
14
+    null: $uni-radius-root,
15
+    'lg': $uni-radius-root * 2,
16
+    'xl': $uni-radius-root * 6,
17
+    'pill': 9999px,
18
+    'circle': 50%
19
+  ),
20
+  $uni-radius
21
+);
22
+// 字体家族
23
+$body-font-family: 'Roboto', sans-serif !default;
24
+// 文本
25
+$heading-font-family: $body-font-family !default;
26
+$uni-headings: () !default;
27
+$letterSpacing: -0.01562em;
28
+$uni-headings: map-deep-merge(
29
+  (
30
+    'h1': (
31
+      size: 32px,
32
+			weight: 300,
33
+			line-height: 50px,
34
+			// letter-spacing:-0.01562em
35
+    ),
36
+    'h2': (
37
+      size: 28px,
38
+      weight: 300,
39
+      line-height: 40px,
40
+      // letter-spacing: -0.00833em
41
+    ),
42
+    'h3': (
43
+      size: 24px,
44
+      weight: 400,
45
+      line-height: 32px,
46
+      // letter-spacing: normal
47
+    ),
48
+    'h4': (
49
+      size: 20px,
50
+      weight: 400,
51
+      line-height: 30px,
52
+      // letter-spacing: 0.00735em
53
+    ),
54
+    'h5': (
55
+      size: 16px,
56
+      weight: 400,
57
+      line-height: 24px,
58
+      // letter-spacing: normal
59
+    ),
60
+    'h6': (
61
+      size: 14px,
62
+      weight: 500,
63
+      line-height: 18px,
64
+      // letter-spacing: 0.0125em
65
+    ),
66
+    'subtitle': (
67
+      size: 12px,
68
+      weight: 400,
69
+      line-height: 20px,
70
+      // letter-spacing: 0.00937em
71
+    ),
72
+    'body': (
73
+      font-size: 14px,
74
+			font-weight: 400,
75
+			line-height: 22px,
76
+			// letter-spacing: 0.03125em
77
+    ),
78
+    'caption': (
79
+      'size': 12px,
80
+      'weight': 400,
81
+      'line-height': 20px,
82
+      // 'letter-spacing': 0.03333em,
83
+      // 'text-transform': false
84
+    )
85
+  ),
86
+  $uni-headings
87
+);
88
+
89
+
90
+
91
+// 主色
92
+$uni-primary: #2979ff !default;
93
+$uni-primary-disable:lighten($uni-primary,20%) !default;
94
+$uni-primary-light: lighten($uni-primary,25%) !default;
95
+
96
+// 辅助色
97
+// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
98
+$uni-success: #18bc37 !default;
99
+$uni-success-disable:lighten($uni-success,20%) !default;
100
+$uni-success-light: lighten($uni-success,25%) !default;
101
+
102
+$uni-warning: #f3a73f !default;
103
+$uni-warning-disable:lighten($uni-warning,20%) !default;
104
+$uni-warning-light: lighten($uni-warning,25%) !default;
105
+
106
+$uni-error: #e43d33 !default;
107
+$uni-error-disable:lighten($uni-error,20%) !default;
108
+$uni-error-light: lighten($uni-error,25%) !default;
109
+
110
+$uni-info: #8f939c !default;
111
+$uni-info-disable:lighten($uni-info,20%) !default;
112
+$uni-info-light: lighten($uni-info,25%) !default;
113
+
114
+// 中性色
115
+// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
116
+$uni-main-color: #3a3a3a !default; 			// 主要文字
117
+$uni-base-color: #6a6a6a !default;			// 常规文字
118
+$uni-secondary-color: #909399 !default;	// 次要文字
119
+$uni-extra-color: #c7c7c7 !default;			// 辅助说明
120
+
121
+// 边框颜色
122
+$uni-border-1: #F0F0F0 !default;
123
+$uni-border-2: #EDEDED !default;
124
+$uni-border-3: #DCDCDC !default;
125
+$uni-border-4: #B9B9B9 !default;
126
+
127
+// 常规色
128
+$uni-black: #000000 !default;
129
+$uni-white: #ffffff !default;
130
+$uni-transparent: rgba($color: #000000, $alpha: 0) !default;
131
+
132
+// 背景色
133
+$uni-bg-color: #f7f7f7 !default;
134
+
135
+/* 水平间距 */
136
+$uni-spacing-sm: 8px !default;
137
+$uni-spacing-base: 15px !default;
138
+$uni-spacing-lg: 30px !default;
139
+
140
+// 阴影
141
+$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default;
142
+$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default;
143
+$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default;
144
+
145
+// 蒙版
146
+$uni-mask: rgba($color: #000000, $alpha: 0.4) !default;

+ 19 - 0
uni_modules/uni-scss/styles/tools/functions.scss

@@ -0,0 +1,19 @@
1
+// 合并 map
2
+@function map-deep-merge($parent-map, $child-map){
3
+	$result: $parent-map;
4
+	@each $key, $child in $child-map {
5
+		$parent-has-key: map-has-key($result, $key);
6
+		$parent-value: map-get($result, $key);
7
+		$parent-type: type-of($parent-value);
8
+		$child-type: type-of($child);
9
+		$parent-is-map: $parent-type == map;
10
+		$child-is-map: $child-type == map;
11
+			
12
+		@if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){
13
+			$result: map-merge($result, ( $key: $child ));
14
+		}@else {
15
+			$result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) ));
16
+		}
17
+	}
18
+	@return $result;
19
+};

+ 31 - 0
uni_modules/uni-scss/theme.scss

@@ -0,0 +1,31 @@
1
+// 间距基础倍数
2
+$uni-space-root: 2;
3
+// 边框半径默认值
4
+$uni-radius-root:5px;
5
+// 主色
6
+$uni-primary: #2979ff;
7
+// 辅助色
8
+$uni-success: #4cd964;
9
+// 警告色
10
+$uni-warning: #f0ad4e;
11
+// 错误色
12
+$uni-error: #dd524d;
13
+// 描述色
14
+$uni-info: #909399;
15
+// 中性色
16
+$uni-main-color: #303133;
17
+$uni-base-color: #606266;
18
+$uni-secondary-color: #909399;
19
+$uni-extra-color: #C0C4CC;
20
+// 背景色
21
+$uni-bg-color: #f5f5f5;
22
+// 边框颜色
23
+$uni-border-1: #DCDFE6;
24
+$uni-border-2: #E4E7ED;
25
+$uni-border-3: #EBEEF5;
26
+$uni-border-4: #F2F6FC;
27
+
28
+// 常规色
29
+$uni-black: #000000;
30
+$uni-white: #ffffff;
31
+$uni-transparent: rgba($color: #000000, $alpha: 0);

+ 62 - 0
uni_modules/uni-scss/variables.scss

@@ -0,0 +1,62 @@
1
+@import './styles/setting/_variables.scss';
2
+// 间距基础倍数
3
+$uni-space-root: 2;
4
+// 边框半径默认值
5
+$uni-radius-root:5px;
6
+
7
+// 主色
8
+$uni-primary: #2979ff;
9
+$uni-primary-disable:mix(#fff,$uni-primary,50%);
10
+$uni-primary-light: mix(#fff,$uni-primary,80%);
11
+
12
+// 辅助色
13
+// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
14
+$uni-success: #18bc37;
15
+$uni-success-disable:mix(#fff,$uni-success,50%);
16
+$uni-success-light: mix(#fff,$uni-success,80%);
17
+
18
+$uni-warning: #f3a73f;
19
+$uni-warning-disable:mix(#fff,$uni-warning,50%);
20
+$uni-warning-light: mix(#fff,$uni-warning,80%);
21
+
22
+$uni-error: #e43d33;
23
+$uni-error-disable:mix(#fff,$uni-error,50%);
24
+$uni-error-light: mix(#fff,$uni-error,80%);
25
+
26
+$uni-info: #8f939c;
27
+$uni-info-disable:mix(#fff,$uni-info,50%);
28
+$uni-info-light: mix(#fff,$uni-info,80%);
29
+
30
+// 中性色
31
+// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
32
+$uni-main-color: #3a3a3a; 			// 主要文字
33
+$uni-base-color: #6a6a6a;			// 常规文字
34
+$uni-secondary-color: #909399;	// 次要文字
35
+$uni-extra-color: #c7c7c7;			// 辅助说明
36
+
37
+// 边框颜色
38
+$uni-border-1: #F0F0F0;
39
+$uni-border-2: #EDEDED;
40
+$uni-border-3: #DCDCDC;
41
+$uni-border-4: #B9B9B9;
42
+
43
+// 常规色
44
+$uni-black: #000000;
45
+$uni-white: #ffffff;
46
+$uni-transparent: rgba($color: #000000, $alpha: 0);
47
+
48
+// 背景色
49
+$uni-bg-color: #f7f7f7;
50
+
51
+/* 水平间距 */
52
+$uni-spacing-sm: 8px;
53
+$uni-spacing-base: 15px;
54
+$uni-spacing-lg: 30px;
55
+
56
+// 阴影
57
+$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5);
58
+$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2);
59
+$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5);
60
+
61
+// 蒙版
62
+$uni-mask: rgba($color: #000000, $alpha: 0.4);