@yxhl/specter-pui-vtk 1.0.110 → 1.0.112

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yxhl/specter-pui-vtk",
3
- "version": "1.0.110",
3
+ "version": "1.0.112",
4
4
  "description": "雅心互联 Vue 3 + Vuetify3 组件库",
5
5
  "type": "module",
6
6
  "main": "./dist/specter-pui.umd.js",
@@ -10,6 +10,10 @@ console.log('window.VTK_CONFIG?.storageKeys?.user', window.VTK_CONFIG?.storageKe
10
10
  console.log('user', user)
11
11
  const pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
12
12
 
13
+ // 字段命名兼容:不同环境的用户信息 / 接口返回可能是 areacode 或 areaCode
14
+ const pickAreaCode = (obj) => obj?.areaCode || obj?.areacode || '';
15
+ const pickAreaName = (obj) => obj?.areaName || obj?.areaname || '';
16
+
13
17
  // 定义 props - 控制是否支持多选
14
18
  const props = defineProps({
15
19
  multiple: {
@@ -46,13 +50,13 @@ watch(areaSelectedData, (newVal, oldVal) => {
46
50
 
47
51
  // 获取地区列表
48
52
  const getAreaList = () => {
49
- if (user && user.areacode) {
50
- proxy.$vtk.request.getForm(`/dict/area/show/${user.areacode}`).then((res) => {
51
- console.log('res=', res);
53
+ const userAreaCode = pickAreaCode(user);
54
+ if (userAreaCode) {
55
+ proxy.$vtk.request.getForm(`/dict/area/show/${userAreaCode}`).then((res) => {
52
56
  if (res && res.data) {
53
57
  areaData.value = [{
54
- areaCode: res.data.areaCode,
55
- areaName: res.data.areaName,
58
+ areaCode: pickAreaCode(res.data),
59
+ areaName: pickAreaName(res.data),
56
60
  children: []
57
61
  }];
58
62
  }
@@ -63,10 +67,13 @@ const getAreaList = () => {
63
67
  // 获取下级地区列表
64
68
  const getAreaNextList = async (item) => {
65
69
  await pause(300);
66
- const parentCode = item.areaCode;
70
+ const parentCode = pickAreaCode(item);
67
71
  proxy.$vtk.request.getForm(`/dict/area/next/${parentCode}`).then((res) => {
68
72
  if (res && res.data) {
69
73
  res.data.forEach((it) => {
74
+ // 统一成 areaCode / areaName,避免后端返回 areacode 时树取值取不到
75
+ it.areaCode = pickAreaCode(it);
76
+ it.areaName = pickAreaName(it);
70
77
  it.areaLeve < 12 && (it.children = []);
71
78
  item.children.push(it);
72
79
  });
@@ -21,7 +21,7 @@
21
21
  @update:model-value="pageChange()"
22
22
  />
23
23
  </span>
24
- <span class="page-total ml-3 d-none d-md-flex align-center">到</span>
24
+ <span class="page-total ml-1 d-none d-md-flex align-center">到</span>
25
25
  <VTextField
26
26
  v-model="pagination.pageno"
27
27
  variant="outlined"
@@ -140,7 +140,7 @@ const pageChange = () => {
140
140
  }
141
141
  .page-select {
142
142
  padding-top: 4px;
143
- max-width: 115px;
143
+ max-width: 120px;
144
144
  :deep(.v-input__control) {
145
145
  min-height: 36px !important;
146
146
  height: 36px !important;
@@ -157,6 +157,7 @@ const pageChange = () => {
157
157
  }
158
158
  .page-go {
159
159
  max-width: 75px;
160
+ padding-top: 4px;
160
161
  :deep(.v-input__control) {
161
162
  min-height: 36px !important;
162
163
  height: 36px !important;
@@ -28,8 +28,8 @@
28
28
  size="small"
29
29
  @click.stop="search"
30
30
  >mdi-magnify</VIcon>
31
- <span class="search-divider"></span>
32
- <span class="search-advanced">
31
+ <span v-bind="props" class="search-advanced">
32
+ <span class="search-divider"></span>
33
33
  <VBadge
34
34
  dot
35
35
  :content="initialIndex"
@@ -38,7 +38,6 @@
38
38
  class="advanced-badge"
39
39
  >
40
40
  <span
41
- v-bind="props"
42
41
  class="pl-1 text-blue vtk-cursor-pointer d-inline-flex align-center text-body-2"
43
42
  >
44
43
  高级
@@ -271,12 +270,20 @@ defineExpose({ search, reset });
271
270
  }
272
271
 
273
272
  :deep(.advanced-badge .v-badge__badge) {
274
- transform: translate(10px, -2px);
273
+ transform: translate(8px, -2px);
275
274
  }
276
275
 
277
276
  .search-advanced {
278
277
  flex-shrink: 0;
279
278
  white-space: nowrap;
279
+ display: inline-flex;
280
+ align-items: center;
281
+ align-self: stretch;
282
+ /* 热区铺满「放大镜右侧 → 输入框右内缘」整段:左侧 4px 补图标外边距,右侧 12px 补
283
+ .v-field--appended 的 padding-inline-end;负外边距抵消 padding,视觉与布局保持原样 */
284
+ padding: 1px 12px 0 4px;
285
+ margin: 0 -12px 0 -4px;
286
+ cursor: pointer;
280
287
  }
281
288
 
282
289
  .search-divider {