af-mobile-client-vue3 1.3.90 → 1.3.91

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,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.3.90",
4
+ "version": "1.3.91",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -233,8 +233,22 @@ function initComponent() {
233
233
  }
234
234
  }
235
235
 
236
- if (item.btnIcon)
237
- btnList.value.push(item)
236
+ if (item.mobileColumnType === 'mobile_header_column') {
237
+ try {
238
+ // 只有在 item.btnIcon 是字符串时才尝试解析
239
+ if (typeof item.btnIcon === 'string') {
240
+ const parsed = JSON.parse(item.btnIcon)
241
+ // 只有解析结果是数组才赋值
242
+ if (Array.isArray(parsed)) {
243
+ btnList.value = parsed
244
+ }
245
+ }
246
+ }
247
+ catch (e) {
248
+ // 解析失败,不做任何处理(保留原来的值)
249
+ console.error('btnIcon JSON 解析失败:', e)
250
+ }
251
+ }
238
252
 
239
253
  if (result.showSortIcon && item.sortable) {
240
254
  orderList.value.push({
@@ -729,6 +743,30 @@ function handleTitleClick(item: any, event: any) {
729
743
  }
730
744
  }
731
745
 
746
+ // 主标题副标题点击 popover 展示
747
+ const showTitlePopoverKey = ref<string | null>(null)
748
+ const textPopoverLabel = ref('')
749
+ const textPopoverContent = ref('')
750
+
751
+ function openTextPopover(item: any, column: any, key: string, event: any) {
752
+ event.stopPropagation()
753
+
754
+ if (isMultiSelectMode.value) {
755
+ toggleItemSelection(item)
756
+ return
757
+ }
758
+
759
+ textPopoverLabel.value = column?.title || ''
760
+ const rawValue = item?.[column?.dataIndex]
761
+ textPopoverContent.value = rawValue === undefined || rawValue === null ? '' : String(rawValue)
762
+ showTitlePopoverKey.value = key
763
+ }
764
+
765
+ function handleTextPopoverShow(val: boolean, key: string) {
766
+ if (!val && showTitlePopoverKey.value === key)
767
+ showTitlePopoverKey.value = null
768
+ }
769
+
732
770
  function handleCheckboxChange(item: any, checked: boolean) {
733
771
  if (!isMultiSelectMode.value)
734
772
  return
@@ -865,41 +903,70 @@ function handleCheckboxChange(item: any, checked: boolean) {
865
903
  />
866
904
  </div>
867
905
  <div v-for="(column) in mainColumns" :key="`main_${column.dataIndex}`" class="main-title">
868
- <p
869
- class="card_item_title"
870
- :style="handleFunctionStyle(column.styleFunctionForTitle, item)"
871
- :class="{ 'selectable-title': isMultiSelectMode }"
872
- @click="handleTitleClick(item, $event)"
906
+ <VanPopover
907
+ :show="showTitlePopoverKey === `main_${index}_${column.dataIndex}`"
908
+ placement="bottom-start"
909
+ :overlay="false"
910
+ @update:show="(v) => handleTextPopoverShow(v, `main_${index}_${column.dataIndex}`)"
873
911
  >
874
- <XBadge
875
- :style="handleFunctionStyle(column.styleFunctionForValue, item)"
876
- :dict-name="column.dictName"
877
- :dict-value="item[column.dataIndex]"
878
- :dict-type="column.slotType"
879
- :service-name="serviceName"
880
- />
881
- </p>
912
+ <template #reference>
913
+ <p
914
+ class="card_item_title"
915
+ :style="handleFunctionStyle(column.styleFunctionForTitle, item)"
916
+ :class="{ 'selectable-title': isMultiSelectMode }"
917
+ @click="(e) => openTextPopover(item, column, `main_${index}_${column.dataIndex}`, e)"
918
+ >
919
+ <XBadge
920
+ :style="handleFunctionStyle(column.styleFunctionForValue, item)"
921
+ :dict-name="column.dictName"
922
+ :dict-value="item[column.dataIndex]"
923
+ :dict-type="column.slotType"
924
+ :service-name="serviceName"
925
+ />
926
+ </p>
927
+ </template>
928
+ <div style="max-width: 80vw; padding: 6px 8px; font-size: 14px; line-height: 1.5;">
929
+ <div style="white-space: normal; word-break: break-word;">
930
+ {{ textPopoverContent }}
931
+ </div>
932
+ </div>
933
+ </VanPopover>
882
934
  </div>
883
935
  <div v-for="(column) in subTitleColumns" :key="`subtitle_${column.dataIndex}`" class="sub-title">
884
- <p
885
- class="card_item_subtitle"
886
- :style="handleFunctionStyle(column.styleFunctionForTitle, item)"
936
+ <VanPopover
937
+ :show="showTitlePopoverKey === `sub_${index}_${column.dataIndex}`"
938
+ placement="bottom-start"
939
+ :overlay="false"
940
+ @update:show="(v) => handleTextPopoverShow(v, `sub_${index}_${column.dataIndex}`)"
887
941
  >
888
- <XBadge
889
- :style="handleFunctionStyle(column.styleFunctionForValue, item)"
890
- :dict-name="column.dictName"
891
- :dict-value="item[column.dataIndex]"
892
- :dict-type="column.slotType"
893
- :service-name="serviceName"
894
- />
895
- </p>
942
+ <template #reference>
943
+ <p
944
+ class="card_item_subtitle"
945
+ :style="handleFunctionStyle(column.styleFunctionForTitle, item)"
946
+ @click="(e) => openTextPopover(item, column, `sub_${index}_${column.dataIndex}`, e)"
947
+ >
948
+ <XBadge
949
+ :style="handleFunctionStyle(column.styleFunctionForValue, item)"
950
+ :dict-name="column.dictName"
951
+ :dict-value="item[column.dataIndex]"
952
+ :dict-type="column.slotType"
953
+ :service-name="serviceName"
954
+ />
955
+ </p>
956
+ </template>
957
+ <div style="max-width: 80vw; padding: 6px 8px; font-size: 14px; line-height: 1.5;">
958
+ <div style="white-space: normal; word-break: break-word;">
959
+ {{ textPopoverContent }}
960
+ </div>
961
+ </div>
962
+ </VanPopover>
896
963
  </div>
897
964
  <div v-if="!hideAllActions" class="action-buttons">
898
965
  <VanButton
899
966
  v-for="btn in btnList"
900
967
  :key="btn.dataIndex"
901
968
  class="action-button"
902
- :icon="btn.btnIcon"
969
+ :icon="btn"
903
970
  size="small"
904
971
  :disabled="isMultiSelectMode"
905
972
  @click.stop="handleButtonClick(btn, item)"
@@ -1099,6 +1166,8 @@ function handleCheckboxChange(item: any, checked: boolean) {
1099
1166
  align-items: center;
1100
1167
  margin-bottom: 2px;
1101
1168
  width: 100%;
1169
+ flex-wrap: nowrap; // 不换行,按钮保持同一行最右侧
1170
+ overflow: hidden; // 内容过长时在左侧截断
1102
1171
 
1103
1172
  &.multi-select-title-row {
1104
1173
  padding-left: 0;
@@ -1107,6 +1176,12 @@ function handleCheckboxChange(item: any, checked: boolean) {
1107
1176
  .main-title {
1108
1177
  display: inline-flex;
1109
1178
  align-items: center;
1179
+ min-width: 0; // 允许缩小以便省略号生效
1180
+ :deep(.van-popover__wrapper) {
1181
+ display: inline-flex;
1182
+ max-width: 100%;
1183
+ min-width: 0;
1184
+ }
1110
1185
  .card_item_title {
1111
1186
  font-size: var(--van-font-size-lg);
1112
1187
  font-weight: 700;
@@ -1134,6 +1209,13 @@ function handleCheckboxChange(item: any, checked: boolean) {
1134
1209
  display: inline-flex;
1135
1210
  align-items: center;
1136
1211
  margin-left: 8px;
1212
+ min-width: 0; // 允许缩小以便省略号生效
1213
+ max-width: 40%;
1214
+ :deep(.van-popover__wrapper) {
1215
+ display: inline-flex;
1216
+ max-width: 100%;
1217
+ min-width: 0;
1218
+ }
1137
1219
  .card_item_subtitle {
1138
1220
  font-size: var(--van-font-size-md);
1139
1221
  color: var(--van-text-color-2);
@@ -1143,7 +1225,8 @@ function handleCheckboxChange(item: any, checked: boolean) {
1143
1225
  .action-buttons {
1144
1226
  display: flex;
1145
1227
  align-items: center;
1146
- margin-left: auto;
1228
+ margin-left: auto; // 占据最右侧
1229
+ flex-shrink: 0; // 不被压缩,避免换行
1147
1230
  .action-button {
1148
1231
  margin-left: 6px;
1149
1232
  width: 32px;
@@ -188,4 +188,4 @@ export interface PolygonLayerConfig {
188
188
  onClick?: (polygon: PolygonData, event: any) => void
189
189
  /** 多边形数据提供者 */
190
190
  dataProvider?: () => PolygonData[] | Promise<PolygonData[]>
191
- }
191
+ }