af-mobile-client-vue3 1.5.1 → 1.5.2

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.5.1",
4
+ "version": "1.5.2",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -3,7 +3,7 @@ import type { RecordEntry } from './recordEntries'
3
3
  import type { BaseUser, ConfigItem } from './types'
4
4
  import useLoading from '@af-mobile-client-vue3/hooks/useLoading'
5
5
  import { mobileUtil } from '@af-mobile-client-vue3/utils/mobileUtil'
6
- import { Button as VanButton, Empty as VanEmpty, Icon as VanIcon, Loading as VanLoading } from 'vant'
6
+ import { Button as VanButton, Empty as VanEmpty, Loading as VanLoading } from 'vant'
7
7
  import { computed, onActivated, ref, watch } from 'vue'
8
8
  import { useRouter } from 'vue-router'
9
9
  import InfoDisplay from '../InfoDisplay/index.vue'
@@ -12,6 +12,7 @@ import { defaultRecordEntries } from './recordEntries'
12
12
 
13
13
  interface Props {
14
14
  userInfoId: string // 用户ID(必传)
15
+ isRedirect?: boolean // 是否跳转业务办理页面,默认false
15
16
  showRecentTime?: boolean // 是否展示历史时间,默认false
16
17
  recordEntries?: RecordEntry[] // 记录入口配置(可选)
17
18
  businessButtonText?: string // 业务办理按钮文本,默认"业务办理"
@@ -30,6 +31,7 @@ interface Emits {
30
31
  }
31
32
 
32
33
  const props = withDefaults(defineProps<Props>(), {
34
+ isRedirect: false,
33
35
  showRecentTime: false,
34
36
  businessButtonText: '业务办理',
35
37
  showBottomButtons: false,
@@ -184,7 +186,15 @@ function viewRecordDetail(entry: RecordEntry) {
184
186
  function openBusinessHandler() {
185
187
  if (!user.value)
186
188
  return
187
- emit('businessClick', user.value)
189
+ console.log('openBusinessHandler', props.isRedirect)
190
+ if (props.isRedirect) {
191
+ router.push({
192
+ name: 'BusinessHandler',
193
+ })
194
+ }
195
+ else {
196
+ emit('businessClick', user.value)
197
+ }
188
198
  }
189
199
 
190
200
  // 打印档案
@@ -1,33 +1,33 @@
1
- <script setup lang="ts">
2
- import { onMounted, ref } from 'vue'
3
- import XReport from './XReport.vue'
4
-
5
- const mainRef = ref()
6
-
7
- onMounted(() => {
8
- // 初始化逻辑
9
- })
10
- </script>
11
-
12
- <template>
13
- <div id="test">
14
- <van-card :bordered="false">
15
- <XReport
16
- ref="mainRef"
17
- :use-oss-for-img="false"
18
- config-name="nurseWorkstationCover"
19
- server-name="af-his"
20
- :show-img-in-cell="true"
21
- :display-only="true"
22
- :edit-mode="false"
23
- :show-save-button="false"
24
- :no-padding="true"
25
- :dont-format="true"
26
- />
27
- </van-card>
28
- </div>
29
- </template>
30
-
31
- <style scoped>
32
-
33
- </style>
1
+ <script setup lang="ts">
2
+ import { onMounted, ref } from 'vue'
3
+ import XReport from './XReport.vue'
4
+
5
+ const mainRef = ref()
6
+
7
+ onMounted(() => {
8
+ // 初始化逻辑
9
+ })
10
+ </script>
11
+
12
+ <template>
13
+ <div id="test">
14
+ <van-card :bordered="false">
15
+ <XReport
16
+ ref="mainRef"
17
+ :use-oss-for-img="false"
18
+ config-name="nurseWorkstationCover"
19
+ server-name="af-his"
20
+ :show-img-in-cell="true"
21
+ :display-only="true"
22
+ :edit-mode="false"
23
+ :show-save-button="false"
24
+ :no-padding="true"
25
+ :dont-format="true"
26
+ />
27
+ </van-card>
28
+ </div>
29
+ </template>
30
+
31
+ <style scoped>
32
+
33
+ </style>
@@ -1,184 +1,184 @@
1
- // print.js
2
-
3
- export function printElement(elementToPrint) {
4
- // 创建一个新的浏览器窗口
5
- const printWindow = window.open('', '_blank', 'height=1024,width=768')
6
- // 设置新窗口的文档内容
7
- printWindow.document.write(`
8
- <html>
9
- <head>
10
- <title>Print</title>
11
- <style>
12
- @page {
13
- size: auto;
14
- margin: 0mm;
15
- }
16
- html, body {
17
- margin: 0;
18
- padding: 0;
19
- width: 100%;
20
- height: 100%;
21
- }
22
- #print-container {
23
- display: none
24
- }
25
- .img{
26
- width: 95%;
27
- height: 180px;
28
- object-fit: cover;
29
- }
30
- .reportMain {
31
- text-align: center;
32
- margin: 0 auto;
33
- font-size: 16px;
34
- color: #000;
35
- background-color: #fff;
36
- border-radius: 8px;
37
-
38
- .reportTitle {
39
- font-weight: bold;
40
- }
41
-
42
- .subTitle {
43
- display: flex;
44
- justify-content: space-between;
45
- margin-bottom: 1%;
46
-
47
- .subTitleItems {
48
- max-width: 30%;
49
- }
50
- }
51
-
52
- .inputsDiv {
53
- display: flex;
54
- justify-content: space-between;
55
- .inputsDivItem {
56
- display: flex;
57
- align-items: center;
58
- padding: 0 4px;
59
- white-space: nowrap;
60
- .inputsDivItemLabel {
61
- padding: 0 4px;
62
- }
63
- }
64
- }
65
-
66
- .reportTable {
67
- width: 100%;
68
- border-collapse: collapse;
69
- table-layout:fixed;
70
- word-break:break-all;
71
- text-align: center;
72
- }
73
- }
74
- .reportMainForDisplay {
75
- text-align: center;
76
- margin: 10% auto;
77
- font-size: 16px;
78
- color: #000;
79
- background-color: #fff;
80
- border-radius: 8px;
81
-
82
- .reportTitle {
83
- font-weight: bold;
84
- }
85
-
86
- .subTitle {
87
- display: flex;
88
- justify-content: space-between;
89
-
90
- .subTitleItems {
91
- max-width: 30%;
92
- }
93
- }
94
-
95
- .inputsDiv {
96
- display: flex;
97
- justify-content: space-around;
98
- .inputsDivItem {
99
- display: flex;
100
- align-items: center;
101
- padding: 0 4px;
102
- white-space: nowrap;
103
- .inputsDivItemLabel {
104
- padding: 0 4px;
105
- }
106
- }
107
- }
108
-
109
- .reportTable {
110
- width: 100%;
111
- border-collapse: collapse;
112
- table-layout:fixed;
113
- word-break:break-all;
114
- }
115
- }
116
- .reportMainNoPadding {
117
- text-align: center;
118
- margin: 0 auto;
119
- font-size: 16px;
120
- color: #000;
121
- background-color: #fff;
122
- border-radius: 8px;
123
-
124
- .reportTitle {
125
- font-weight: bold;
126
- }
127
-
128
- .subTitle {
129
- display: flex;
130
- justify-content: space-between;
131
-
132
- .subTitleItems {
133
- max-width: 30%;
134
- }
135
- }
136
-
137
- .inputsDiv {
138
- display: flex;
139
- justify-content: space-between;
140
- .inputsDivItem {
141
- display: flex;
142
- align-items: center;
143
- padding: 0 4px;
144
- white-space: nowrap;
145
- .inputsDivItemLabel {
146
- padding: 0 4px;
147
- }
148
- }
149
- }
150
-
151
- .reportTable {
152
- width: 100%;
153
- border-collapse: collapse;
154
- table-layout:fixed;
155
- word-break:break-all;
156
- }
157
- }
158
- .tools{
159
- position: fixed;
160
- right: 2%;
161
- text-align: right;
162
- width: 60%;
163
- cursor: pointer;
164
- .toolsItem{
165
- width: 15%;
166
- margin-right: 3%;
167
- display: inline-block;
168
- }
169
- }
170
- </style>
171
- </head>
172
- <body>
173
- <!-- 将需要打印的元素内容复制到新窗口中 -->
174
- ${elementToPrint.innerHTML}
175
- </body>
176
- </html>
177
- `)
178
- // 延迟执行打印,以确保新窗口的内容已加载完成
179
- printWindow.document.close() // 关闭文档流,确保内容完全加载
180
- setTimeout(() => {
181
- printWindow.print() // 调用打印方法
182
- printWindow.close()
183
- }, 500) // 延迟500毫秒后执行打印
184
- }
1
+ // print.js
2
+
3
+ export function printElement(elementToPrint) {
4
+ // 创建一个新的浏览器窗口
5
+ const printWindow = window.open('', '_blank', 'height=1024,width=768')
6
+ // 设置新窗口的文档内容
7
+ printWindow.document.write(`
8
+ <html>
9
+ <head>
10
+ <title>Print</title>
11
+ <style>
12
+ @page {
13
+ size: auto;
14
+ margin: 0mm;
15
+ }
16
+ html, body {
17
+ margin: 0;
18
+ padding: 0;
19
+ width: 100%;
20
+ height: 100%;
21
+ }
22
+ #print-container {
23
+ display: none
24
+ }
25
+ .img{
26
+ width: 95%;
27
+ height: 180px;
28
+ object-fit: cover;
29
+ }
30
+ .reportMain {
31
+ text-align: center;
32
+ margin: 0 auto;
33
+ font-size: 16px;
34
+ color: #000;
35
+ background-color: #fff;
36
+ border-radius: 8px;
37
+
38
+ .reportTitle {
39
+ font-weight: bold;
40
+ }
41
+
42
+ .subTitle {
43
+ display: flex;
44
+ justify-content: space-between;
45
+ margin-bottom: 1%;
46
+
47
+ .subTitleItems {
48
+ max-width: 30%;
49
+ }
50
+ }
51
+
52
+ .inputsDiv {
53
+ display: flex;
54
+ justify-content: space-between;
55
+ .inputsDivItem {
56
+ display: flex;
57
+ align-items: center;
58
+ padding: 0 4px;
59
+ white-space: nowrap;
60
+ .inputsDivItemLabel {
61
+ padding: 0 4px;
62
+ }
63
+ }
64
+ }
65
+
66
+ .reportTable {
67
+ width: 100%;
68
+ border-collapse: collapse;
69
+ table-layout:fixed;
70
+ word-break:break-all;
71
+ text-align: center;
72
+ }
73
+ }
74
+ .reportMainForDisplay {
75
+ text-align: center;
76
+ margin: 10% auto;
77
+ font-size: 16px;
78
+ color: #000;
79
+ background-color: #fff;
80
+ border-radius: 8px;
81
+
82
+ .reportTitle {
83
+ font-weight: bold;
84
+ }
85
+
86
+ .subTitle {
87
+ display: flex;
88
+ justify-content: space-between;
89
+
90
+ .subTitleItems {
91
+ max-width: 30%;
92
+ }
93
+ }
94
+
95
+ .inputsDiv {
96
+ display: flex;
97
+ justify-content: space-around;
98
+ .inputsDivItem {
99
+ display: flex;
100
+ align-items: center;
101
+ padding: 0 4px;
102
+ white-space: nowrap;
103
+ .inputsDivItemLabel {
104
+ padding: 0 4px;
105
+ }
106
+ }
107
+ }
108
+
109
+ .reportTable {
110
+ width: 100%;
111
+ border-collapse: collapse;
112
+ table-layout:fixed;
113
+ word-break:break-all;
114
+ }
115
+ }
116
+ .reportMainNoPadding {
117
+ text-align: center;
118
+ margin: 0 auto;
119
+ font-size: 16px;
120
+ color: #000;
121
+ background-color: #fff;
122
+ border-radius: 8px;
123
+
124
+ .reportTitle {
125
+ font-weight: bold;
126
+ }
127
+
128
+ .subTitle {
129
+ display: flex;
130
+ justify-content: space-between;
131
+
132
+ .subTitleItems {
133
+ max-width: 30%;
134
+ }
135
+ }
136
+
137
+ .inputsDiv {
138
+ display: flex;
139
+ justify-content: space-between;
140
+ .inputsDivItem {
141
+ display: flex;
142
+ align-items: center;
143
+ padding: 0 4px;
144
+ white-space: nowrap;
145
+ .inputsDivItemLabel {
146
+ padding: 0 4px;
147
+ }
148
+ }
149
+ }
150
+
151
+ .reportTable {
152
+ width: 100%;
153
+ border-collapse: collapse;
154
+ table-layout:fixed;
155
+ word-break:break-all;
156
+ }
157
+ }
158
+ .tools{
159
+ position: fixed;
160
+ right: 2%;
161
+ text-align: right;
162
+ width: 60%;
163
+ cursor: pointer;
164
+ .toolsItem{
165
+ width: 15%;
166
+ margin-right: 3%;
167
+ display: inline-block;
168
+ }
169
+ }
170
+ </style>
171
+ </head>
172
+ <body>
173
+ <!-- 将需要打印的元素内容复制到新窗口中 -->
174
+ ${elementToPrint.innerHTML}
175
+ </body>
176
+ </html>
177
+ `)
178
+ // 延迟执行打印,以确保新窗口的内容已加载完成
179
+ printWindow.document.close() // 关闭文档流,确保内容完全加载
180
+ setTimeout(() => {
181
+ printWindow.print() // 调用打印方法
182
+ printWindow.close()
183
+ }, 500) // 延迟500毫秒后执行打印
184
+ }
@@ -217,7 +217,7 @@ export const useUserStore = defineStore('app-user', () => {
217
217
  setToken(data.access_token)
218
218
  // 第三方教培系统鉴权兼容
219
219
  const LoginTicket = crypto.AESEncrypt(JSON.stringify(params), '3KMKqvgwR8ULbR8Z')
220
- if (data.session && useSettingStore().getSetting().requestEncrypt) {
220
+ if (data.session && useSettingStore().getSetting()?.requestEncrypt) {
221
221
  const k = encryptUtil.RSADecrypt(data.session as string)
222
222
  localStorage.setItem('v4-session-key', k)
223
223
  secureStorageWrite('v4-session-key', k)
@@ -1,27 +1,27 @@
1
- // 时间工具:提供简单的日期时间格式化
2
-
3
- export function pad2(num: number): string {
4
- return num < 10 ? `0${num}` : `${num}`
5
- }
6
-
7
- /**
8
- * 按照简单占位符格式化当前时间
9
- * 支持占位:YYYY MM DD HH mm ss
10
- * @param format 默认 'YYYY-MM-DD HH:mm:ss'
11
- */
12
- export function formatNow(format: string = 'YYYY-MM-DD HH:mm:ss'): string {
13
- const d = new Date()
14
- const map: Record<string, string> = {
15
- YYYY: `${d.getFullYear()}`,
16
- MM: pad2(d.getMonth() + 1),
17
- DD: pad2(d.getDate()),
18
- HH: pad2(d.getHours()),
19
- mm: pad2(d.getMinutes()),
20
- ss: pad2(d.getSeconds()),
21
- }
22
- let out = format
23
- Object.keys(map).forEach((k) => {
24
- out = out.replace(new RegExp(k, 'g'), map[k])
25
- })
26
- return out
27
- }
1
+ // 时间工具:提供简单的日期时间格式化
2
+
3
+ export function pad2(num: number): string {
4
+ return num < 10 ? `0${num}` : `${num}`
5
+ }
6
+
7
+ /**
8
+ * 按照简单占位符格式化当前时间
9
+ * 支持占位:YYYY MM DD HH mm ss
10
+ * @param format 默认 'YYYY-MM-DD HH:mm:ss'
11
+ */
12
+ export function formatNow(format: string = 'YYYY-MM-DD HH:mm:ss'): string {
13
+ const d = new Date()
14
+ const map: Record<string, string> = {
15
+ YYYY: `${d.getFullYear()}`,
16
+ MM: pad2(d.getMonth() + 1),
17
+ DD: pad2(d.getDate()),
18
+ HH: pad2(d.getHours()),
19
+ mm: pad2(d.getMinutes()),
20
+ ss: pad2(d.getSeconds()),
21
+ }
22
+ let out = format
23
+ Object.keys(map).forEach((k) => {
24
+ out = out.replace(new RegExp(k, 'g'), map[k])
25
+ })
26
+ return out
27
+ }
@@ -2,7 +2,7 @@
2
2
  import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
3
3
  import { runLogic } from '@af-mobile-client-vue3/services/api/common'
4
4
  import useUserStore from '@af-mobile-client-vue3/stores/modules/user'
5
- import {ref, onActivated, onMounted} from 'vue'
5
+ import { onActivated, ref } from 'vue'
6
6
  import { useRouter } from 'vue-router'
7
7
 
8
8
  defineOptions({
@@ -50,28 +50,23 @@ console.log('MeterReadingPending', currUser)
50
50
  async function meterRead(record: any) {
51
51
  console.log('meterRead', record)
52
52
  router.push({ name: 'MeterReadingForm', query: {
53
- f_userfiles_id: record.m_f_userfiles_id,
54
- f_userinfo_id: record.m_f_userinfo_id,
55
- f_user_id: record.m_f_user_id,
56
- id: record.m_id,
57
- source: 'todo',
58
- } })
53
+ f_userfiles_id: record.m_f_userfiles_id,
54
+ f_userinfo_id: record.m_f_userinfo_id,
55
+ f_user_id: record.m_f_user_id,
56
+ id: record.m_id,
57
+ source: 'todo',
58
+ } })
59
59
  }
60
60
  function getCardData() {
61
61
  // console.warn('>>> params', params)
62
62
  // 获取抄表信息汇总
63
63
  runLogic('mobile_getMeterReadingPendingCardResult', {
64
64
  f_inputtor: currUser.resources.name,
65
- }, 'af-revenue').then((res: any) => {
65
+ }).then((res: any) => {
66
66
  collect.value.f_todo_total_number = res.f_todo_total_number
67
67
  collect.value.f_today_hand_number = res.f_today_hand_number
68
68
  })
69
69
  }
70
- onMounted(() => {
71
- console.log('从其他页面返回当前缓存页面')
72
- // 这里可以执行刷新列表等操作
73
- meterReading.value?.onRefresh()
74
- })
75
70
  onActivated(() => {
76
71
  console.log('从其他页面返回当前缓存页面')
77
72
  // 这里可以执行刷新列表等操作
@@ -82,8 +77,8 @@ onActivated(() => {
82
77
  <template>
83
78
  <XCellList
84
79
  ref="meterReading"
85
- :config-name="configName"
86
80
  service-name="af-revenue"
81
+ :config-name="configName"
87
82
  :custom-delete="true"
88
83
  :fix-query-form="{
89
84
  m_f_inputtor: currUser.resources.name,
@@ -58,14 +58,19 @@ function submit(_result) {
58
58
  </script>
59
59
 
60
60
  <template>
61
- <XFormGroup
62
- ref="formGroup"
63
- :config-name="configName"
64
- :service-name="serviceName"
65
- :group-form-data="formData"
66
- mode="新增"
67
- @submit="submit"
68
- />
61
+ <NormalDataLayout id="XFormGroupView" title="纯表单">
62
+ <template #layout_content>
63
+ <!-- v-if="isInit" -->
64
+ <XFormGroup
65
+ ref="formGroup"
66
+ :config-name="configName"
67
+ :service-name="serviceName"
68
+ :group-form-data="formData"
69
+ mode="新增"
70
+ @submit="submit"
71
+ />
72
+ </template>
73
+ </NormalDataLayout>
69
74
  </template>
70
75
 
71
76
  <style scoped lang="less">
@@ -1,46 +1,39 @@
1
1
  <script setup lang="ts">
2
2
  import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
3
- import XOlMap from '@af-mobile-client-vue3/components/data/XOlMap/index.vue'
4
3
  import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
5
-
6
4
  import { ref } from 'vue'
7
5
 
8
- const configName = ref('AddPointForm')
9
- const serviceName = ref('af-linepatrol')
6
+ const configName = ref('mobile_meterReadingForm')
7
+ const serviceName = ref('af-revenue')
10
8
 
11
9
  const formGroupAddConstruction = ref(null)
10
+ const formData = ref({
11
+ 'YYYY': '2025-09-08 16:03:22',
12
+ 'YYYY-MM': '2025-09-08 16:03:22',
13
+ 'YYYY-MM-DD': '2025-09-08 16:03:22',
14
+ 'YYYY-MM-DDHH': '2025-09-08 16:03:22',
15
+ 'YYYY-MM-DDHHMM': '2025-09-08 16:03:22',
16
+ 'YYYY-MM-DDHHMMSS': '2025-09-08 16:03:22',
17
+ })
12
18
 
13
- // 地图预览相关
14
- const previewMapRef = ref(null)
15
19
  function onSubmit(data: any) {
16
20
  console.warn('提交表单', data)
17
21
  }
18
- function onAddressChange(data: any) {
19
- console.warn('表单新增数据变化', data)
20
- }
21
-
22
- function onRegionChange(data: any) {
23
- console.warn('表单新增数据变化', data)
24
- }
25
22
  </script>
26
23
 
27
24
  <template>
28
- <XForm
29
- ref="formGroupAddConstruction"
30
- mode="新增"
31
- :config-name="configName"
32
- :service-name="serviceName"
33
- @address-change="onAddressChange"
34
- @region-change="onRegionChange"
35
- @on-submit="onSubmit"
36
- >
37
- <template #extraCellGroup>
38
- <XOlMap
39
- ref="previewMapRef"
40
- :style="{ height: '200px' }"
25
+ <NormalDataLayout id="XFormGroupView" title="纯表单">
26
+ <template #layout_content>
27
+ <XForm
28
+ ref="formGroupAddConstruction"
29
+ mode="修改"
30
+ :config-name="configName"
31
+ :service-name="serviceName"
32
+ :form-data="formData"
33
+ @on-submit="onSubmit"
41
34
  />
42
35
  </template>
43
- </XForm>
36
+ </NormalDataLayout>
44
37
  </template>
45
38
 
46
39
  <style scoped lang="less">
package/vite.config.ts CHANGED
@@ -11,8 +11,8 @@ export default ({ mode }: ConfigEnv): UserConfig => {
11
11
 
12
12
  const appProxys = {}
13
13
 
14
- const v4Server = 'http://192.168.50.67:31467'
15
- const v3Server = 'http://192.168.50.67:31467'
14
+ const v4Server = 'http://192.168.50.67:31577'
15
+ const v3Server = 'http://192.168.50.67:31577'
16
16
  const OSSServerDev = 'http://192.168.50.67:30351'
17
17
  const geoserver = 'http://192.168.50.67:31567'
18
18
  const mockServer = 'http://127.0.0.1:8086'
@@ -71,6 +71,13 @@ export default ({ mode }: ConfigEnv): UserConfig => {
71
71
  ws: false,
72
72
  changeOrigin: true,
73
73
  },
74
+ // '/api/af-revenue': {
75
+ // // target: v4Server,
76
+ // rewrite: (path: string) => path.replace(/^\/api\/af-revenue\//, '/'),
77
+ // target: 'http://127.0.0.1:9026',
78
+ // ws: false,
79
+ // changeOrigin: true,
80
+ // },
74
81
  '/api': {
75
82
  // v3用
76
83
  // rewrite: (path: string) => path.replace(/^\/api\/af-system\//, '/rs/'),