af-mobile-client-vue3 1.3.1 → 1.3.2-2.1

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.
Files changed (107) hide show
  1. package/CLAUDE.md +5 -0
  2. package/README.md +2 -1
  3. package/compress.js +36 -36
  4. package/package.json +114 -114
  5. package/postcss.config.ts +1 -1
  6. package/src/App.vue +1 -1
  7. package/src/components/core/NavBar/index.vue +1 -1
  8. package/src/components/core/XGridDropOption/index.vue +7 -9
  9. package/src/components/core/XMultiSelect/index.vue +1 -1
  10. package/src/components/data/CardContainer/CardContainer.vue +118 -0
  11. package/src/components/data/CardContainer/CardHeader.vue +99 -0
  12. package/src/components/data/InfoDisplay/index.vue +132 -0
  13. package/src/components/data/UserDetail/api.ts +24 -0
  14. package/src/components/data/UserDetail/index.vue +620 -0
  15. package/src/components/data/UserDetail/recordEntries.ts +159 -0
  16. package/src/components/data/UserDetail/types.ts +26 -0
  17. package/src/components/data/XCellList/index.vue +66 -20
  18. package/src/components/data/XForm/index.vue +1 -1
  19. package/src/components/data/XFormGroup/doc/README.md +33 -20
  20. package/src/components/data/XFormGroup/index.vue +42 -36
  21. package/src/components/data/XFormItem/index.vue +11 -11
  22. package/src/components/data/XOlMap/README.md +61 -61
  23. package/src/components/data/XOlMap/XLocationPicker/index.vue +2 -1
  24. package/src/components/data/XReportGrid/XAddReport/index.md +17 -16
  25. package/src/components/data/XReportGrid/index.md +14 -10
  26. package/src/components/data/XSignature/index.vue +1 -2
  27. package/src/font-style/font.css +1 -1
  28. package/src/hooks/useBoolean.ts +26 -0
  29. package/src/hooks/useLoading.ts +16 -0
  30. package/src/plugins/collectIcons.ts +10 -0
  31. package/src/router/README.md +1 -1
  32. package/src/router/guards.ts +1 -1
  33. package/src/router/index.ts +1 -1
  34. package/src/router/routes.ts +176 -0
  35. package/src/services/api/user.ts +17 -0
  36. package/src/stores/modules/setting.ts +2 -1
  37. package/src/styles/var.less +9 -0
  38. package/src/views/component/IconifyView/index.vue +0 -3
  39. package/src/views/component/UserDetailView/UserDetailPage.vue +77 -0
  40. package/src/views/component/UserDetailView/index.vue +234 -0
  41. package/src/views/component/XCellListView/index.vue +2 -2
  42. package/src/views/component/XOlMapView/testData.ts +1 -1
  43. package/src/views/component/index.vue +4 -0
  44. package/src/views/component/menu.vue +1 -1
  45. package/src/views/user/login/ForgetPasswordForm.vue +1 -1
  46. package/src/views/user/login/LoginForm.vue +4 -3
  47. package/src/views/user/login/LoginWave.vue +1 -1
  48. package/src/views/user/my/comm/ModifyPassword.vue +346 -0
  49. package/src/views/user/my/index.vue +440 -183
  50. package/src/views/user/register/index.vue +952 -0
  51. package/src/views/userRecords/AbnormalAlarmRecords.vue +21 -0
  52. package/src/views/userRecords/CardReplacementRecords.vue +21 -0
  53. package/src/views/userRecords/ChangeRecords.vue +19 -0
  54. package/src/views/userRecords/CommandViewRecords.vue +20 -0
  55. package/src/views/userRecords/GasCompensationRecords.vue +20 -0
  56. package/src/views/userRecords/InstrumentCollectionRecords.vue +21 -0
  57. package/src/views/userRecords/MeterRecords.vue +20 -0
  58. package/src/views/userRecords/OperateRecords.vue +51 -0
  59. package/src/views/userRecords/OtherChargeRecords.vue +19 -0
  60. package/src/views/userRecords/PaymentRecords.vue +28 -0
  61. package/src/views/userRecords/PriceAdjustmentRecords.vue +19 -0
  62. package/src/views/userRecords/ReplacementRecords.vue +19 -0
  63. package/src/views/userRecords/SafetyRecords.vue +19 -0
  64. package/src/views/userRecords/TransactionRecords.vue +21 -0
  65. package/src/views/userRecords/TransferRecords.vue +19 -0
  66. package/src/views/userRecords/operateRecordDetail/index.vue +316 -0
  67. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/AddUserDetail.vue +124 -0
  68. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/AdvanceDeliveryDetail.vue +88 -0
  69. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/AutoAccountsCancelDetail.vue +205 -0
  70. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/AutoAccountsDetail.vue +192 -0
  71. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/BankDkDetail.vue +192 -0
  72. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/BankPayDetail.vue +192 -0
  73. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/BlacklistDetail.vue +153 -0
  74. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/CancellationDetail.vue +101 -0
  75. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/CardMeterCenterCancelDetail.vue +127 -0
  76. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/CardMeterCenterDetail.vue +153 -0
  77. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/CardOverUserDetail.vue +153 -0
  78. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ChangeMeterCancelDetail.vue +166 -0
  79. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ChangeMeterDetail.vue +205 -0
  80. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/DisableManageDetail.vue +127 -0
  81. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/EnableManageDetail.vue +114 -0
  82. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/FaZheChangeDetail.vue +124 -0
  83. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/FeeDeductionDetail.vue +153 -0
  84. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/GasPriceChangeDetail.vue +126 -0
  85. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/InputtorChangeDetail.vue +126 -0
  86. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/IotMeterCenterCancelDetail.vue +114 -0
  87. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/IotMeterCenterDetail.vue +127 -0
  88. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/IotOpenDetail.vue +88 -0
  89. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/MachineCardDetail.vue +101 -0
  90. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/MachineMeterCenterCancelDetail.vue +218 -0
  91. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/MachineMeterCenterDetail.vue +153 -0
  92. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/OffGasAddGasDetail.vue +140 -0
  93. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/OtherChargeCancelDetail.vue +127 -0
  94. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/OtherChargeDetail.vue +114 -0
  95. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/OverUserChangeDetail.vue +127 -0
  96. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ReBillDetail.vue +127 -0
  97. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/RefundDetail.vue +114 -0
  98. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ReplaceCardManageCancelDetail.vue +127 -0
  99. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ReplaceCardManageDetail.vue +114 -0
  100. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/SaleCardGasDetail.vue +140 -0
  101. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/TransferManageCancelDetail.vue +152 -0
  102. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/TransferManageDetail.vue +178 -0
  103. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/UserChangeDetail.vue +123 -0
  104. package/src/views/userRecords/operateRecordDetail/operateRecordDetails/WechatPayDetail.vue +192 -0
  105. package/src/views/userRecords/types.ts +66 -0
  106. package/uno.config.ts +5 -1
  107. package/vite.config.ts +9 -2
@@ -2,7 +2,7 @@
2
2
  import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
3
3
  import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
4
4
  import { Button as VanButton, Tab as VanTab, Tabs as VanTabs } from 'vant'
5
- import { computed, defineEmits, defineProps, onBeforeMount, onMounted, ref, useSlots, watch } from 'vue'
5
+ import { computed, defineEmits, defineProps, onBeforeMount, onMounted, ref, useSlots } from 'vue'
6
6
 
7
7
  const props = withDefaults(defineProps<{
8
8
  configName?: string
@@ -11,6 +11,7 @@ const props = withDefaults(defineProps<{
11
11
  mode?: string
12
12
  isScrollspy?: boolean
13
13
  formShow?: any
14
+ showTabHeader?: boolean
14
15
  }>(), {
15
16
  configName: '',
16
17
  serviceName: undefined,
@@ -18,25 +19,15 @@ const props = withDefaults(defineProps<{
18
19
  mode: '查询',
19
20
  isScrollspy: true,
20
21
  formShow: undefined,
22
+ showTabHeader: true,
21
23
  })
22
24
  const emit = defineEmits(['submit', 'xFormItemEmitFunc'])
23
25
 
24
- interface Form {
25
- configName?: string
26
- serviceName?: string
27
- groupFormData?: object
28
- mode?: string
29
- isScrollspy?: boolean
30
- formShow?: any
31
- }
32
-
33
26
  const groupItems = ref([])
34
27
  const formData = ref({})
35
28
  const submitGroup = ref(false)
36
29
  const submitSimple = ref(false)
37
30
  const isInit = ref(false)
38
- const initStatus = ref(false)
39
- const propsData = ref<Partial<Form>>({})
40
31
 
41
32
  const slots = useSlots()
42
33
  const renderableGroupItems = computed(() => {
@@ -55,18 +46,9 @@ const renderableGroupItems = computed(() => {
55
46
  })
56
47
 
57
48
  // 组件初始化函数
58
- function init(params: Form) {
59
- initStatus.value = true
60
- propsData.value = {
61
- configName: props.configName,
62
- serviceName: props.serviceName,
63
- groupFormData: props.groupFormData,
64
- mode: props.mode,
65
- formShow: props.formShow,
66
- ...params,
67
- }
68
- formData.value = propsData.value.groupFormData
69
- getConfigByName(propsData.value.configName, (result) => {
49
+ function init() {
50
+ formData.value = props.groupFormData
51
+ getConfigByName(props.configName, (result) => {
70
52
  if (result?.groups) {
71
53
  groupItems.value = result.groups
72
54
  result.groups.forEach((group) => {
@@ -81,14 +63,13 @@ function init(params: Form) {
81
63
  groupItems.value = [{ ...result }]
82
64
  }
83
65
  isInit.value = true
84
- }, propsData.value.serviceName)
66
+ }, props.serviceName)
85
67
  }
86
- watch(() => props.groupFormData, (_val) => {
87
- formData.value = { ...formData.value, ...props.groupFormData }
88
- })
68
+ // watch(() => props.groupFormData, (_val) => {
69
+ // formData.value = { ...formData.value, ...props.groupFormData }
70
+ // })
89
71
  onBeforeMount(() => {
90
- if (!initStatus.value)
91
- init(props)
72
+ init()
92
73
  })
93
74
  interface XFormLike {
94
75
  validate: () => Promise<void>
@@ -112,6 +93,7 @@ function removeRef(refValue: XFormLike) {
112
93
  }
113
94
 
114
95
  async function submit() {
96
+ console.log(props.groupFormData)
115
97
  for (const res of xFormListRef.value) {
116
98
  try {
117
99
  await res.validate()
@@ -143,7 +125,7 @@ defineExpose({ init, removeRef, xFormListRef })
143
125
 
144
126
  <template>
145
127
  <div v-if="isInit" id="x-form-group">
146
- <VanTabs :scrollspy="propsData.isScrollspy" sticky :offset-top="offsetTop">
128
+ <VanTabs :scrollspy="props.isScrollspy" sticky :offset-top="offsetTop" :show-header="props.showTabHeader">
147
129
  <VanTab
148
130
  v-for="(item, index) in renderableGroupItems"
149
131
  :key="item.groupName ? (item.groupName + index) : index"
@@ -153,7 +135,7 @@ defineExpose({ init, removeRef, xFormListRef })
153
135
  class="x-form-group-item"
154
136
  :class="{ 'is-last': index === renderableGroupItems.length - 1 }"
155
137
  >
156
- <div v-if="item.describe && propsData.isScrollspy && (item.groupName || item.slotName)" class="form-group-title">
138
+ <div v-if="item.describe && props.isScrollspy && (item.groupName || item.slotName)" class="form-group-title">
157
139
  <span class="form-group-bar" />
158
140
  <span class="form-group-text">{{ item.describe }}</span>
159
141
  </div>
@@ -183,9 +165,11 @@ defineExpose({ init, removeRef, xFormListRef })
183
165
  </div>
184
166
  </VanTab>
185
167
  </VanTabs>
186
- <VanButton v-if="submitGroup" round block type="primary" @click="submit">
187
- 提交
188
- </VanButton>
168
+ <div class="form-footer-fixed">
169
+ <VanButton v-if="submitGroup" round block type="primary" @click="submit">
170
+ 提交
171
+ </VanButton>
172
+ </div>
189
173
  </div>
190
174
  </template>
191
175
 
@@ -206,6 +190,28 @@ defineExpose({ init, removeRef, xFormListRef })
206
190
  .x-form-group-item {
207
191
  margin-bottom: 20px;
208
192
  }
193
+ .form-footer-fixed {
194
+ position: fixed;
195
+ bottom: 0;
196
+ left: 0;
197
+ width: 100%;
198
+
199
+ padding: 12px;
200
+ box-sizing: border-box;
201
+
202
+ /* 阴影效果 - 向上投射 */
203
+ box-shadow:
204
+ 0 -4px 12px rgba(0, 0, 0, 0.1),
205
+ 0 -2px 4px rgba(0, 0, 0, 0.06);
206
+
207
+ /* 毛玻璃背景 (移动端高级效果) */
208
+ background-color: rgba(255, 255, 255, 0.85);
209
+ -webkit-backdrop-filter: blur(10px);
210
+ backdrop-filter: blur(10px);
211
+
212
+ /* 边框增强立体感 */
213
+ border-top: 1px solid rgba(0, 0, 0, 0.05);
214
+ }
209
215
  }
210
216
  .x-form-group-item.is-last {
211
217
  min-height: calc(100vh - var(--van-nav-bar-height) - 40px);
@@ -215,7 +221,7 @@ defineExpose({ init, removeRef, xFormListRef })
215
221
  align-items: center;
216
222
  padding-top: 12px;
217
223
  background: none;
218
- margin: 0 0 4px 4px;
224
+ margin: 0 0 16px 4px;
219
225
  }
220
226
  .form-group-bar {
221
227
  width: 4px;
@@ -138,14 +138,14 @@ const showItem = ref(true)
138
138
  const currInst = getCurrentInstance()
139
139
 
140
140
  // 配置中心->表单项变更触发函数
141
- const dataChangeFunc = debounce(async () => {
141
+ async function dataChangeFunc() {
142
142
  if (attr.dataChangeFunc) {
143
- await executeStrFunctionByContext(currInst, attr.dataChangeFunc, [props.form, (formData: any) => emits('setForm', formData), attr, null, mode])
143
+ await executeStrFunctionByContext(currInst, attr.dataChangeFunc, [props.form, (formData: any) => emits('setForm', formData), attr, null, mode, runLogic, getConfigByNameAsync])
144
144
  }
145
- }, 500)
146
-
145
+ }
146
+ const dataChangeFuncdebounce = debounce(dataChangeFunc, 300)
147
147
  // 配置中心->表单项展示函数
148
- const showFormItemFunc = debounce(async () => {
148
+ async function showFormItemFunc() {
149
149
  if (attr.showFormItemFunc) {
150
150
  const obj = await executeStrFunctionByContext(currInst, attr.showFormItemFunc, [form, attr, null, mode])
151
151
  // 判断是 bool 还是 obj 兼容
@@ -157,8 +157,8 @@ const showFormItemFunc = debounce(async () => {
157
157
  showItem.value = obj?.show
158
158
  }
159
159
  }
160
- }, 500)
161
-
160
+ }
161
+ const showFormItemFuncdebounce = debounce(showFormItemFunc, 300)
162
162
  /**
163
163
  * 检测是否传入了有效的值
164
164
  * @returns any
@@ -328,7 +328,7 @@ watch(
328
328
  debouncedUpdateOptions()
329
329
  }
330
330
  if (props.attr.showFormItemFunc) {
331
- showFormItemFunc()
331
+ showFormItemFuncdebounce()
332
332
  }
333
333
  },
334
334
  { deep: true },
@@ -340,7 +340,7 @@ watch(
340
340
  (newVal, oldVal) => {
341
341
  // 避免初始化时的调用
342
342
  if (newVal !== oldVal) {
343
- dataChangeFunc()
343
+ dataChangeFuncdebounce()
344
344
  }
345
345
  },
346
346
  { deep: true },
@@ -1203,7 +1203,7 @@ function findOptionInTree(options, value) {
1203
1203
  :label-align="labelAlign"
1204
1204
  :input-align="attr.inputAlign ? attr.inputAlign : 'left'"
1205
1205
  :type="attr.type as FieldType"
1206
- :readonly="readonly || (attr.inputOnAfterName && attr.inputOnAfterFunc && !attr.inputOnAfterName.includes('|'))"
1206
+ :readonly="readonly"
1207
1207
  :disabled="attr.disabled"
1208
1208
  :placeholder="placeholder"
1209
1209
  :error-message="errorMessage"
@@ -1215,7 +1215,7 @@ function findOptionInTree(options, value) {
1215
1215
  <template #input>
1216
1216
  <input
1217
1217
  :value="modelData"
1218
- :readonly="readonly || (attr.inputOnAfterName && attr.inputOnAfterFunc && !attr.inputOnAfterName.includes('|'))"
1218
+ :readonly="readonly"
1219
1219
  class="van-field__control"
1220
1220
  :placeholder="placeholder"
1221
1221
  style="flex: 1; min-width: 0;"
@@ -35,32 +35,28 @@ npm install ol vant
35
35
  ## 使用示例
36
36
 
37
37
  ```vue
38
- <template>
39
- <XOlMap ref="mapRef" @centerChange="handleCenterChange" />
40
- </template>
41
-
42
38
  <script setup lang="ts">
43
- import { ref } from 'vue'
44
39
  import type { InitParams } from './types'
40
+ import { ref } from 'vue'
45
41
  import XOlMap from '@/components/data/XOlMap/index.vue'
46
42
 
47
43
  const mapRef = ref()
48
44
 
49
45
  // 初始化参数
50
46
  const initParams: InitParams = {
51
- center: [116.404, 39.915], // 初始中心点
52
- zoom: 12, // 初始缩放级别
53
- maxZoom: 18, // 最大缩放级别
54
- minZoom: 4, // 最小缩放级别
47
+ center: [116.404, 39.915], // 初始中心点
48
+ zoom: 12, // 初始缩放级别
49
+ maxZoom: 18, // 最大缩放级别
50
+ minZoom: 4, // 最小缩放级别
55
51
  }
56
52
 
57
53
  // 中心点变化回调
58
- const handleCenterChange = (center: [number, number]) => {
54
+ function handleCenterChange(center: [number, number]) {
59
55
  console.log('地图中心点变化:', center)
60
56
  }
61
57
 
62
58
  // 添加点位示例
63
- const addPoints = () => {
59
+ function addPoints() {
64
60
  mapRef.value?.addVectorPoints({
65
61
  id: 1,
66
62
  value: '测试点位',
@@ -77,47 +73,51 @@ const addPoints = () => {
77
73
  })
78
74
  }
79
75
  </script>
76
+
77
+ <template>
78
+ <XOlMap ref="mapRef" @center-change="handleCenterChange" />
79
+ </template>
80
80
  ```
81
81
 
82
82
  ## API
83
83
 
84
84
  ### Props
85
85
 
86
- | 参数 | 说明 | 类型 | 默认值 |
87
- | --- | --- | --- | --- |
88
- | initParams | 初始化参数 | InitParams | - |
86
+ | 参数 | 说明 | 类型 | 默认值 |
87
+ | ---------- | ---------- | ---------- | ------ |
88
+ | initParams | 初始化参数 | InitParams | - |
89
89
 
90
90
  ### InitParams 类型定义
91
91
 
92
92
  ```typescript
93
93
  interface InitParams {
94
- center?: [number, number] // 地图中心点坐标 [经度, 纬度]
95
- zoom?: number // 地图缩放级别
96
- maxZoom?: number // 最大缩放级别
97
- minZoom?: number // 最小缩放级别
98
- tianDiTuKey?: string // 天地图密钥
99
- amapKey?: string // 高德地图 API key
94
+ center?: [number, number] // 地图中心点坐标 [经度, 纬度]
95
+ zoom?: number // 地图缩放级别
96
+ maxZoom?: number // 最大缩放级别
97
+ minZoom?: number // 最小缩放级别
98
+ tianDiTuKey?: string // 天地图密钥
99
+ amapKey?: string // 高德地图 API key
100
100
  }
101
101
  ```
102
102
 
103
103
  ### 事件
104
104
 
105
- | 事件名 | 说明 | 回调参数 |
106
- | --- | --- | --- |
105
+ | 事件名 | 说明 | 回调参数 |
106
+ | ------------ | -------------------- | -------------------------- |
107
107
  | centerChange | 地图中心点变化时触发 | (center: [number, number]) |
108
108
 
109
109
  ### 方法
110
110
 
111
- | 方法名 | 说明 | 参数 | 返回值 |
112
- | --- | --- | --- | --- |
113
- | init | 初始化地图 | (params: InitParams) | void |
114
- | setCenter | 设置地图中心点 | (center: [number, number], animate?: boolean) | void |
115
- | setZoom | 设置缩放级别 | (zoom: number, animate?: boolean) | void |
116
- | getZoom | 获取当前缩放级别 | - | number |
117
- | setCenterAndZoom | 同时设置中心点和缩放级别 | (center: [number, number], zoom: number, animate?: boolean) | void |
118
- | addVectorPoints | 添加矢量点位 | (config: PointLayerConfig) | VectorLayer |
119
- | addWMSLayers | 添加 WMS 图层 | (options: WMSOptions) | void |
120
- | handleLocation | 触发定位功能 | - | Promise<void> |
111
+ | 方法名 | 说明 | 参数 | 返回值 |
112
+ | ---------------- | ------------------------ | ----------------------------------------------------------- | ------------- |
113
+ | init | 初始化地图 | (params: InitParams) | void |
114
+ | setCenter | 设置地图中心点 | (center: [number, number], animate?: boolean) | void |
115
+ | setZoom | 设置缩放级别 | (zoom: number, animate?: boolean) | void |
116
+ | getZoom | 获取当前缩放级别 | - | number |
117
+ | setCenterAndZoom | 同时设置中心点和缩放级别 | (center: [number, number], zoom: number, animate?: boolean) | void |
118
+ | addVectorPoints | 添加矢量点位 | (config: PointLayerConfig) | VectorLayer |
119
+ | addWMSLayers | 添加 WMS 图层 | (options: WMSOptions) | void |
120
+ | handleLocation | 触发定位功能 | - | Promise<void> |
121
121
 
122
122
  ## 注意事项
123
123
 
@@ -133,18 +133,9 @@ interface InitParams {
133
133
  ### 使用示例
134
134
 
135
135
  ```vue
136
- <template>
137
- <XLocationPicker
138
- v-model:visible="showPicker"
139
- :init-location="initLocation"
140
- @confirm="handleConfirm"
141
- @cancel="handleCancel"
142
- />
143
- </template>
144
-
145
136
  <script setup lang="ts">
146
- import { ref } from 'vue'
147
137
  import type { LocationResult } from './types'
138
+ import { ref } from 'vue'
148
139
  import { XLocationPicker } from '@/components/data/XOlMap'
149
140
 
150
141
  // 控制选择器显示
@@ -158,7 +149,7 @@ const initLocation = {
158
149
  }
159
150
 
160
151
  // 确认选择回调
161
- const handleConfirm = (location: LocationResult) => {
152
+ function handleConfirm(location: LocationResult) {
162
153
  console.log('选择的位置:', location)
163
154
  // location 包含:
164
155
  // - longitude: 经度
@@ -168,42 +159,51 @@ const handleConfirm = (location: LocationResult) => {
168
159
  }
169
160
 
170
161
  // 取消选择回调
171
- const handleCancel = () => {
162
+ function handleCancel() {
172
163
  showPicker.value = false
173
164
  }
174
165
 
175
166
  // 打开选择器
176
- const openPicker = () => {
167
+ function openPicker() {
177
168
  showPicker.value = true
178
169
  }
179
170
  </script>
171
+
172
+ <template>
173
+ <XLocationPicker
174
+ v-model:visible="showPicker"
175
+ :init-location="initLocation"
176
+ @confirm="handleConfirm"
177
+ @cancel="handleCancel"
178
+ />
179
+ </template>
180
180
  ```
181
181
 
182
182
  ### Props
183
183
 
184
- | 参数 | 说明 | 类型 | 默认值 |
185
- | --- | --- | --- | --- |
186
- | visible | 是否显示选择器 | boolean | false |
187
- | initLocation | 初始位置 | LocationResult | - |
188
- | title | 选择器标题 | string | '选择位置' |
189
- | confirmText | 确认按钮文字 | string | '确定' |
190
- | cancelText | 取消按钮文字 | string | '取消' |
184
+ | 参数 | 说明 | 类型 | 默认值 |
185
+ | ------------ | -------------- | -------------- | ---------- |
186
+ | visible | 是否显示选择器 | boolean | false |
187
+ | initLocation | 初始位置 | LocationResult | - |
188
+ | title | 选择器标题 | string | '选择位置' |
189
+ | confirmText | 确认按钮文字 | string | '确定' |
190
+ | cancelText | 取消按钮文字 | string | '取消' |
191
191
 
192
192
  ### 事件
193
193
 
194
- | 事件名 | 说明 | 回调参数 |
195
- | --- | --- | --- |
196
- | confirm | 点击确认按钮时触发 | (location: LocationResult) |
197
- | cancel | 点击取消按钮时触发 | - |
198
- | update:visible | 更新 visible 值 | (visible: boolean) |
194
+ | 事件名 | 说明 | 回调参数 |
195
+ | -------------- | ------------------ | -------------------------- |
196
+ | confirm | 点击确认按钮时触发 | (location: LocationResult) |
197
+ | cancel | 点击取消按钮时触发 | - |
198
+ | update:visible | 更新 visible 值 | (visible: boolean) |
199
199
 
200
200
  ### LocationResult 类型定义
201
201
 
202
202
  ```typescript
203
203
  interface LocationResult {
204
- longitude: number // 经度
205
- latitude: number // 纬度
206
- address: string // 地址描述
204
+ longitude: number // 经度
205
+ latitude: number // 纬度
206
+ address: string // 地址描述
207
207
  }
208
208
  ```
209
209
 
@@ -224,4 +224,4 @@ interface LocationResult {
224
224
 
225
225
  ## 贡献
226
226
 
227
- 如果你有任何问题或建议,欢迎提出 Issue 或 Pull Request。
227
+ 如果你有任何问题或建议,欢迎提出 Issue 或 Pull Request。
@@ -177,7 +177,8 @@ watch(() => props.modelValue, (newVal) => {
177
177
  .marker-icon {
178
178
  width: 24px;
179
179
  height: 24px;
180
- background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iIzE5ODlmYSIgZD0iTTEyIDJDOC4xMyAyIDUgNS4xMyA1IDljMCA1LjI1IDcgMTMgNyAxM3M3LTcuNzUgNy0xM2MwLTMuODctMy4xMy03LTctN3ptMCA5LjVjLTEuMzggMC0yLjUtMS4xMi0yLjUtMi41czEuMTItMi41IDIuNS0yLjUgMi41IDEuMTIgMi41IDIuNS0xLjEyIDIuNS0yLjUgMi41eiIvPjwvc3ZnPg==') no-repeat center;
180
+ background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iIzE5ODlmYSIgZD0iTTEyIDJDOC4xMyAyIDUgNS4xMyA1IDljMCA1LjI1IDcgMTMgNyAxM3M3LTcuNzUgNy0xM2MwLTMuODctMy4xMy03LTctN3ptMCA5LjVjLTEuMzggMC0yLjUtMS4xMi0yLjUtMi41czEuMTItMi41IDIuNS0yLjUgMi41IDEuMTIgMi41IDIuNS0xLjEyIDIuNS0yLjUgMi41eiIvPjwvc3ZnPg==')
181
+ no-repeat center;
181
182
  background-size: contain;
182
183
  }
183
184
  }
@@ -21,32 +21,33 @@ export default {
21
21
  ## 代码演示
22
22
 
23
23
  ```html
24
- <x-add-report
25
-
26
- >
27
- </x-add-report>
24
+ <x-add-report> </x-add-report>
28
25
  ```
29
26
 
30
27
  ## API
31
28
 
32
- | 参数 | 说明 | 类型 | 默认值 |
33
- |-----------------|--------------------------|---------|-------|
34
- | businessTitle | 业务标题 | String | '' |
35
- | businessType | 业务类型 | String | '' |
36
- | visible | 是否显示模态框 | Boolean | false |
37
- | jsonData | JSON配置,根据[工具>查询配置生成]功能生成 | Object | {} |
38
- | modifyModelData | 修改操作前查询出的业务数据 | Object | {} |
39
- | loading | 新增或修改业务是否执行中 | Boolean | false |
40
- | fixedAddForm | 固定新增表单,会和新增表单合并 | Object | {} |
41
- | getDataParams | 调用logic获取数据源的追加参数 | Object | - |
42
- | @onSubmit | 表单的提交事件 | event | - |
29
+ | 参数 | 说明 | 类型 | 默认值 |
30
+ | --------------- | ----------------------------------------- | ------- | ------ |
31
+ | businessTitle | 业务标题 | String | '' |
32
+ | businessType | 业务类型 | String | '' |
33
+ | visible | 是否显示模态框 | Boolean | false |
34
+ | jsonData | JSON配置,根据[工具>查询配置生成]功能生成 | Object | {} |
35
+ | modifyModelData | 修改操作前查询出的业务数据 | Object | {} |
36
+ | loading | 新增或修改业务是否执行中 | Boolean | false |
37
+ | fixedAddForm | 固定新增表单,会和新增表单合并 | Object | {} |
38
+ | getDataParams | 调用logic获取数据源的追加参数 | Object | - |
39
+ | @onSubmit | 表单的提交事件 | event | - |
43
40
 
44
41
  ## 例子1
45
- ----
42
+
43
+ ---
44
+
46
45
  参考XFormTable组件
46
+
47
47
  ```
48
48
 
49
49
  注意事项
50
50
  ----
51
51
 
52
52
  > 本组件已经实现了自适应布局,在不同分辨率下的设备均可得到基本理想的展示效果
53
+ ```
@@ -20,20 +20,24 @@ export default {
20
20
 
21
21
  ## API
22
22
 
23
- | 参数 | 说明 | 类型 | 默认值 |
24
- |-----------------|------|-------|-----------|
25
- | configName | 配置文件名 | String | 无(必填) |
26
- | activatedSlotName| 激活插槽名 | String | undefined |
27
- | files | 文件列表 | Array | [] |
28
- | authority | 权限控制 | String | user |
29
- | localConfig | 本地配置 | Object | undefined |
30
- | dontFormat | 禁止已经格式化后的配置格式化| Boolean | false|
31
- | configData | 配置中的Data | Object | undefined |
23
+ | 参数 | 说明 | 类型 | 默认值 |
24
+ | ----------------- | ---------------------------- | ------- | ---------- |
25
+ | configName | 配置文件名 | String | 无(必填) |
26
+ | activatedSlotName | 激活插槽名 | String | undefined |
27
+ | files | 文件列表 | Array | [] |
28
+ | authority | 权限控制 | String | user |
29
+ | localConfig | 本地配置 | Object | undefined |
30
+ | dontFormat | 禁止已经格式化后的配置格式化 | Boolean | false |
31
+ | configData | 配置中的Data | Object | undefined |
32
+
32
33
  ## 例子1
33
- ----
34
+
35
+ ---
36
+
34
37
  ```vue
35
38
  <XReport :config-name="'test_tableConfig'" :activated-slot-name="'test_tableConfig_slot'" />
36
39
  ```
40
+
37
41
  ## 注意事项
38
42
 
39
43
  > 在某些情况下,比如手机端,只需要输入表格中一部分的内容。
@@ -226,8 +226,7 @@ onBeforeUnmount(() => {
226
226
  display: flex;
227
227
  justify-content: center;
228
228
  align-items: center;
229
- padding: env(safe-area-inset-top) env(safe-area-inset-right)
230
- env(safe-area-inset-bottom) env(safe-area-inset-left);
229
+ padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
231
230
 
232
231
  :deep(.van-signature) {
233
232
  // 隐藏原有的底部按钮
@@ -1,4 +1,4 @@
1
1
  @font-face {
2
2
  font-family: 'PingFangSC-Regular-woff2';
3
3
  src: url('./PingFangSC-Regular.woff2') format('woff2');
4
- }
4
+ }
@@ -0,0 +1,26 @@
1
+ import { ref } from 'vue'
2
+
3
+ export default function useBoolean(initValue = false) {
4
+ const bool = ref(initValue)
5
+
6
+ function setBool(value: boolean) {
7
+ bool.value = value
8
+ }
9
+ function setTrue() {
10
+ setBool(true)
11
+ }
12
+ function setFalse() {
13
+ setBool(false)
14
+ }
15
+ function toggle() {
16
+ setBool(!bool.value)
17
+ }
18
+
19
+ return {
20
+ bool,
21
+ setBool,
22
+ setTrue,
23
+ setFalse,
24
+ toggle,
25
+ }
26
+ }
@@ -0,0 +1,16 @@
1
+ import useBoolean from './useBoolean'
2
+
3
+ /**
4
+ * 加载状态管理 Hook
5
+ * @param initValue 初始加载状态,默认为 false
6
+ * @returns {object} 包含 loading 状态和控制方法
7
+ */
8
+ export default function useLoading(initValue = false) {
9
+ const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(initValue)
10
+
11
+ return {
12
+ loading,
13
+ startLoading,
14
+ endLoading,
15
+ }
16
+ }
@@ -0,0 +1,10 @@
1
+ import { defaultRecordEntries } from '../components/data/UserDetail/recordEntries'
2
+
3
+ const collectUsedIcons = [
4
+ ...defaultRecordEntries.map(entry => entry.icon),
5
+ ...defaultRecordEntries.map(entry => entry.bgColor),
6
+ ...defaultRecordEntries.map(entry => entry.textColor),
7
+ ]
8
+
9
+ // 默认导出
10
+ export default collectUsedIcons
@@ -1,6 +1,6 @@
1
1
  # `File-based Routing`
2
2
 
3
- Routes will be auto-generated for Vue files in the **src/views** dir with the same file structure.
3
+ Routes will be auto-generated for Vue files in the **src/views** dir with the same file structure.
4
4
  Check out [`unplugin-vue-router`](https://github.com/posva/unplugin-vue-router) for more details.
5
5
 
6
6
  在 **src/views** 目录下的 Vue 文件会自动生成相同结构的路由。
@@ -5,7 +5,7 @@ import { showToast } from 'vant'
5
5
  // 不需要登录拦截的路由配置
6
6
  const loginIgnore = {
7
7
  names: ['404', '403', 'user-appointment', 'appointment-form', 'appointment-history'], // 根据路由名称匹配
8
- paths: ['/login', '/XReportFormIframeView', '/invoiceShow'], // 根据路由fullPath匹配
8
+ paths: ['/login', '/XReportFormIframeView', '/invoiceShow', '/register'], // 根据路由fullPath匹配
9
9
  /**
10
10
  * 判断路由是否包含在该配置中
11
11
  * @param route vue-router 的 route 对象
@@ -24,7 +24,7 @@ router.beforeEach((to: EnhancedRouteLocation) => {
24
24
  routeCacheStore.addRoute(to)
25
25
 
26
26
  // 页面 title
27
- setPageTitle(to.meta.title)
27
+ setPageTitle(to.meta.title as string)
28
28
  })
29
29
 
30
30
  router.afterEach(() => {