uni-oaview 1.0.30 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,11 @@
1
1
  <template>
2
2
  <view v-bind="$attrs" class="oa-area-select" @click="() => (popupShow = true)">
3
- <view class="oa-area-select-content">{{ currentLabel }}</view>
3
+ <view class="oa-area-select-content">
4
+ <text v-if="modelValue?.length">
5
+ {{ currentLabel }}
6
+ </text>
7
+ <text v-else class="oa-area-select-placeholder">{{ $attrs.placeholder ?? '请选择' }}</text>
8
+ </view>
4
9
  <uni-icons style="margin-left: 10px" type="forward" size="20" :color="'#ADB2B6'"></uni-icons>
5
10
  </view>
6
11
  <oa-area-select-popup
@@ -12,7 +17,7 @@
12
17
  ></oa-area-select-popup>
13
18
  </template>
14
19
  <script lang="ts" setup>
15
- import { ref, watchEffect, nextTick } from 'vue';
20
+ import { ref, watchEffect } from 'vue';
16
21
  import OaAreaSelectPopup from '../oa-area-select-popup/oa-area-select-popup.vue';
17
22
  import { getCascaderNameByIds } from './util';
18
23
  import regionData from '../oa-area-select-popup/region-data';
@@ -46,5 +51,10 @@
46
51
  justify-content: flex-end;
47
52
  font-size: 16px;
48
53
  }
54
+ .oa-area-select-placeholder {
55
+ font-size: 16px;
56
+ color: #c5cace;
57
+ font-weight: 300;
58
+ }
49
59
  }
50
60
  </style>
@@ -45,11 +45,13 @@
45
45
  if (props.modelValue?.length) {
46
46
  const [province, city, area] = props.modelValue;
47
47
  cityList.value = provinceList.value.find(({ value }) => value === province)?.children ?? [
48
- { value: 'city-empty', label: '' },
49
- ];
50
- areaList.value = cityList.value?.find(({ value }) => value === city)?.children ?? [
51
- { value: 'area-empty', label: '' },
48
+ { value: 'city-empty', label: '' },
52
49
  ];
50
+ areaList.value = [{ value: 'area-empty', label: '空' }];
51
+ const areas = cityList.value?.find(({ value }) => value === city)?.children;
52
+ if (areas?.length) {
53
+ areaList.value.push(...areas);
54
+ }
53
55
  state.value = [provinceList.value.findIndex((item) => item.value === province)];
54
56
  if (city) {
55
57
  state.value.push(cityList.value.findIndex((item) => item.value === city));
@@ -62,8 +64,12 @@
62
64
  state.value.push(0);
63
65
  }
64
66
  } else {
65
- cityList.value = provinceList.value?.[0]?.children ?? [{ value: 'city-empty', label: '' }];
66
- areaList.value = cityList.value?.[0]?.children ?? [{ value: 'area-empty', label: '' }];
67
+ cityList.value = provinceList.value?.[0]?.children ?? [{ value: 'city-empty', label: '' }];
68
+ areaList.value = [{ value: 'area-empty', label: '' }];
69
+ const areas = cityList.value?.[0]?.children;
70
+ if (areas?.length) {
71
+ areaList.value.push(...areas);
72
+ }
67
73
  }
68
74
  };
69
75
  const emit = defineEmits(['change', 'update:modelValue', 'colse', 'update:show']);
@@ -96,8 +102,11 @@
96
102
  state.value = e.detail.value; // 当前选中的省/市/区的索引值
97
103
  const selectedProvince = provinceList.value[state.value[0]]; // 获取当前选中的省数据
98
104
  const selectedCity = selectedProvince?.children?.[state.value[1]]; // 获取当前选中的市数据
99
- cityList.value = selectedProvince?.children || [{ value: 'city-empty', label: '' }]; // 根据新的省数据重新赋值市数据
100
- areaList.value = selectedCity?.children || [{ value: 'area-empty', label: '' }]; // 根据新的市数据重新赋值区数据
105
+ cityList.value = selectedProvince?.children || [{ value: 'city-empty', label: '' }]; // 根据新的省数据重新赋值市数据
106
+ areaList.value = [{ value: 'area-empty', label: '' }]; // 根据新的市数据重新赋值区数据
107
+ if (selectedCity?.children?.length) {
108
+ areaList.value.push(...selectedCity?.children); // 根据新的市数据重新赋值区数据
109
+ }
101
110
  }, 200);
102
111
  </script>
103
112
 
@@ -8,17 +8,19 @@
8
8
  <text v-if="innerModelValue?.length">({{ innerModelValue?.length }})</text>
9
9
  </view>
10
10
  </view>
11
- <view class="content-box">
12
- <view @click="clickHandler(item)" class="content-item" v-for="item in options" :key="item[valueKey ?? 'value']">
13
- <uni-icons
14
- class="content-item-icon"
15
- :type="innerModelValue?.includes(item[valueKey ?? 'value']) ? 'checkbox-filled' : 'circle'"
16
- size="25"
17
- :color="innerModelValue?.includes(item[valueKey ?? 'value']) ? '#259af5' : '#c5cace'"
18
- ></uni-icons>
19
- <text class="content-item-text" style="margin-left: 8px">{{ item[labelKey ?? 'label'] }}</text>
11
+ <scroll-view style="height: 300px" :scroll-y="true">
12
+ <view class="content-box">
13
+ <view @click="clickHandler(item)" class="content-item" v-for="item in options" :key="item[valueKey ?? 'value']">
14
+ <uni-icons
15
+ class="content-item-icon"
16
+ :type="innerModelValue?.includes(item[valueKey ?? 'value']) ? 'checkbox-filled' : 'circle'"
17
+ size="25"
18
+ :color="innerModelValue?.includes(item[valueKey ?? 'value']) ? '#259af5' : '#c5cace'"
19
+ ></uni-icons>
20
+ <text class="content-item-text" style="margin-left: 8px">{{ item[labelKey ?? 'label'] }}</text>
21
+ </view>
20
22
  </view>
21
- </view>
23
+ </scroll-view>
22
24
  </oa-popup>
23
25
  </template>
24
26
 
@@ -90,8 +92,7 @@
90
92
  }
91
93
  }
92
94
  .content-box {
93
- height: 300px;
94
- overflow-y: auto;
95
+ height: 100%;
95
96
  & > .content-item {
96
97
  height: 54px;
97
98
  display: flex;
package/dist/index.esm.js CHANGED
@@ -11,6 +11,7 @@ function sendLaunchAppParamsLog(params) {
11
11
  try {
12
12
  var outputData = JSON.parse(JSON.stringify((_a = params === null || params === void 0 ? void 0 : params.referrerInfo) === null || _a === void 0 ? void 0 : _a.extraData));
13
13
  outputData === null || outputData === void 0 ? true : delete outputData.token;
14
+ outputData === null || outputData === void 0 ? true : delete outputData.loginUserInfo;
14
15
  reportLog(outputData, '小程序启动入参');
15
16
  } catch (error) {
16
17
  console.log(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-oaview",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "uniapp小程序组件库",
5
5
  "main": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -10,6 +10,7 @@ export function sendLaunchAppParamsLog(params: any) {
10
10
  try {
11
11
  const outputData = JSON.parse(JSON.stringify(params?.referrerInfo?.extraData));
12
12
  delete outputData?.token;
13
+ delete outputData?.loginUserInfo;
13
14
  reportLog(outputData, '小程序启动入参');
14
15
  } catch (error) {
15
16
  console.log(error);