af-mobile-client-vue3 1.3.26 → 1.3.28
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 +1 -1
- package/src/components/data/XForm/index.vue +1 -1
- package/src/utils/queryFormDefaultRangePicker.ts +57 -57
- package/src/views/component/XCellListView/index.vue +7 -28
- package/src/views/component/XFormGroupView/index.vue +7 -11
- package/src/views/user/my/index.vue +33 -16
- package/vite.config.ts +7 -0
package/package.json
CHANGED
|
@@ -208,7 +208,7 @@ async function initWithGroupFormItems() {
|
|
|
208
208
|
function setupFormConfig(config: GroupFormItems) {
|
|
209
209
|
loadParamLogicNameData(config.paramLogicName)
|
|
210
210
|
formConfig.value = config
|
|
211
|
-
myServiceName.value = props.serviceName
|
|
211
|
+
myServiceName.value = props.serviceName
|
|
212
212
|
formGroupName.value = config.groupName || 'default'
|
|
213
213
|
form.value = props.formData || {}
|
|
214
214
|
// 清理并重新设置验证规则
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 根据类型获取日期区间字符串
|
|
3
|
-
* @param type '当年' | 'curMonth' | '当日'
|
|
4
|
-
* @param show 区分实际值还是显示值, true为实际值, false为显示值
|
|
5
|
-
* @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
|
|
6
|
-
*/
|
|
7
|
-
export function getRangeByType(type: string, show: boolean): [string, string] {
|
|
8
|
-
const now = new Date()
|
|
9
|
-
const year = now.getFullYear()
|
|
10
|
-
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
|
11
|
-
const day = now.getDate().toString().padStart(2, '0')
|
|
12
|
-
|
|
13
|
-
if (!show) {
|
|
14
|
-
if (type === 'curYear') {
|
|
15
|
-
return [
|
|
16
|
-
`${year}-01-01 00:00:00`,
|
|
17
|
-
`${year}-12-31 23:59:59`,
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
if (type === 'curMonth') {
|
|
21
|
-
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
22
|
-
return [
|
|
23
|
-
`${year}-${month}-01 00:00:00`,
|
|
24
|
-
`${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
if (type === 'curDay') {
|
|
28
|
-
return [
|
|
29
|
-
`${year}-${month}-${day} 00:00:00`,
|
|
30
|
-
`${year}-${month}-${day} 23:59:59`,
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (show) {
|
|
35
|
-
if (type === 'curYear') {
|
|
36
|
-
return [
|
|
37
|
-
`${year}-01-01`,
|
|
38
|
-
`${year}-12-31`,
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
if (type === 'curMonth') {
|
|
42
|
-
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
43
|
-
return [
|
|
44
|
-
`${year}-${month}-01`,
|
|
45
|
-
`${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
if (type === 'curDay') {
|
|
49
|
-
return [
|
|
50
|
-
`${year}-${month}-${day}`,
|
|
51
|
-
`${year}-${month}-${day}`,
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// 兜底返回空字符串数组
|
|
56
|
-
return ['', '']
|
|
57
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 根据类型获取日期区间字符串
|
|
3
|
+
* @param type '当年' | 'curMonth' | '当日'
|
|
4
|
+
* @param show 区分实际值还是显示值, true为实际值, false为显示值
|
|
5
|
+
* @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
|
|
6
|
+
*/
|
|
7
|
+
export function getRangeByType(type: string, show: boolean): [string, string] {
|
|
8
|
+
const now = new Date()
|
|
9
|
+
const year = now.getFullYear()
|
|
10
|
+
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
|
11
|
+
const day = now.getDate().toString().padStart(2, '0')
|
|
12
|
+
|
|
13
|
+
if (!show) {
|
|
14
|
+
if (type === 'curYear') {
|
|
15
|
+
return [
|
|
16
|
+
`${year}-01-01 00:00:00`,
|
|
17
|
+
`${year}-12-31 23:59:59`,
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
if (type === 'curMonth') {
|
|
21
|
+
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
22
|
+
return [
|
|
23
|
+
`${year}-${month}-01 00:00:00`,
|
|
24
|
+
`${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
if (type === 'curDay') {
|
|
28
|
+
return [
|
|
29
|
+
`${year}-${month}-${day} 00:00:00`,
|
|
30
|
+
`${year}-${month}-${day} 23:59:59`,
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (show) {
|
|
35
|
+
if (type === 'curYear') {
|
|
36
|
+
return [
|
|
37
|
+
`${year}-01-01`,
|
|
38
|
+
`${year}-12-31`,
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
if (type === 'curMonth') {
|
|
42
|
+
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
43
|
+
return [
|
|
44
|
+
`${year}-${month}-01`,
|
|
45
|
+
`${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
if (type === 'curDay') {
|
|
49
|
+
return [
|
|
50
|
+
`${year}-${month}-${day}`,
|
|
51
|
+
`${year}-${month}-${day}`,
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// 兜底返回空字符串数组
|
|
56
|
+
return ['', '']
|
|
57
|
+
}
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
3
3
|
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
-
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
5
4
|
import { defineEmits, ref } from 'vue'
|
|
6
5
|
import { useRouter } from 'vue-router'
|
|
7
6
|
|
|
8
7
|
// 定义事件
|
|
9
8
|
const emit = defineEmits(['deleteRow'])
|
|
10
|
-
|
|
11
|
-
// 多选操作配置
|
|
12
|
-
const multiSelectActions = ref([
|
|
13
|
-
{ name: '批量审核', key: 'batchAudit', color: '#000000', icon: 'passed' },
|
|
14
|
-
])
|
|
15
|
-
|
|
16
|
-
const userInfo = useUserStore().getUserInfo()
|
|
17
9
|
// 访问路由
|
|
18
10
|
const router = useRouter()
|
|
19
11
|
// 获取默认值
|
|
20
12
|
const idKey = ref('o_id')
|
|
21
13
|
|
|
22
14
|
// 简易crud表单测试
|
|
23
|
-
const configName = ref('
|
|
24
|
-
const serviceName = ref('af-
|
|
15
|
+
const configName = ref('mobile_meterInfoManageCRUD')
|
|
16
|
+
const serviceName = ref('af-revenue')
|
|
25
17
|
|
|
26
18
|
// 资源权限测试
|
|
27
19
|
// const configName = ref('crud_sources_test')
|
|
@@ -95,31 +87,18 @@ function toDetail(item) {
|
|
|
95
87
|
function deleteRow(result) {
|
|
96
88
|
emit('deleteRow', result.o_id)
|
|
97
89
|
}
|
|
98
|
-
|
|
99
|
-
// 多选操作处理
|
|
100
|
-
function handleMultiSelectAction(action: string, selectedItems: any[], selectedItemsArray: any[]) {
|
|
101
|
-
console.log('多选操作:', action, selectedItems, selectedItemsArray)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// 选择变化处理
|
|
105
|
-
function handleSelectionChange(selectedItems: any[]) {
|
|
106
|
-
console.log('选择变化,当前选中:', selectedItems.length, '个项目')
|
|
107
|
-
// 可以在这里更新UI状态,比如显示选中数量等
|
|
108
|
-
}
|
|
109
90
|
</script>
|
|
110
91
|
|
|
111
92
|
<template>
|
|
112
93
|
<NormalDataLayout id="XCellListView" title="工作计划">
|
|
113
94
|
<template #layout_content>
|
|
114
95
|
<XCellList
|
|
115
|
-
config-name="
|
|
116
|
-
service-name="
|
|
117
|
-
:
|
|
118
|
-
id-key="
|
|
119
|
-
:multi-select-actions="multiSelectActions"
|
|
96
|
+
:config-name="configName"
|
|
97
|
+
:service-name="serviceName"
|
|
98
|
+
:fix-query-form="{ o_f_oper_name: 'edu_test' }"
|
|
99
|
+
:id-key="idKey"
|
|
120
100
|
@to-detail="toDetail"
|
|
121
|
-
@
|
|
122
|
-
@selection-change="handleSelectionChange"
|
|
101
|
+
@delete-row="deleteRow"
|
|
123
102
|
/>
|
|
124
103
|
</template>
|
|
125
104
|
</NormalDataLayout>
|
|
@@ -5,19 +5,16 @@ import { showDialog } from 'vant'
|
|
|
5
5
|
import { ref } from 'vue'
|
|
6
6
|
import { useRoute } from 'vue-router'
|
|
7
7
|
|
|
8
|
-
// const configName = ref('reviewFormGroup')
|
|
9
|
-
// const serviceName = ref('af-revenue')
|
|
10
|
-
|
|
11
8
|
// 纯表单
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const configName = ref('form_check_test')
|
|
10
|
+
const serviceName = ref('af-system')
|
|
14
11
|
|
|
15
12
|
// const configName = ref("计划下发Form")
|
|
16
13
|
// const serviceName = ref("af-linepatrol")
|
|
17
14
|
|
|
18
15
|
// 表单组
|
|
19
|
-
const configName = ref('lngChargeAuditMobileFormGroup')
|
|
20
|
-
const serviceName = ref('af-gaslink')
|
|
16
|
+
// const configName = ref('lngChargeAuditMobileFormGroup')
|
|
17
|
+
// const serviceName = ref('af-gaslink')
|
|
21
18
|
|
|
22
19
|
const formData = ref({})
|
|
23
20
|
const formGroup = ref(null)
|
|
@@ -25,8 +22,7 @@ const route = useRoute()
|
|
|
25
22
|
const isInit = ref(false)
|
|
26
23
|
function submit(_result) {
|
|
27
24
|
showDialog({ message: '提交成功' }).then(() => {
|
|
28
|
-
|
|
29
|
-
// history.back()
|
|
25
|
+
history.back()
|
|
30
26
|
})
|
|
31
27
|
}
|
|
32
28
|
|
|
@@ -67,8 +63,8 @@ function submit(_result) {
|
|
|
67
63
|
<!-- v-if="isInit" -->
|
|
68
64
|
<XFormGroup
|
|
69
65
|
ref="formGroup"
|
|
70
|
-
config-name="
|
|
71
|
-
service-name="
|
|
66
|
+
:config-name="configName"
|
|
67
|
+
:service-name="serviceName"
|
|
72
68
|
:group-form-data="formData"
|
|
73
69
|
mode="新增"
|
|
74
70
|
@submit="submit"
|
|
@@ -107,29 +107,46 @@ const uploadStatusTag = computed(() => {
|
|
|
107
107
|
|
|
108
108
|
onMounted(() => {
|
|
109
109
|
if (roleName.includes('需要定位人员')) {
|
|
110
|
-
|
|
111
|
-
mobileUtil.execute({
|
|
112
|
-
param: {},
|
|
113
|
-
funcName: 'getLastRealtimeUploadResult',
|
|
114
|
-
callbackFunc: (result: PhoneLocationStatus) => {
|
|
115
|
-
if (result.status === 'success') {
|
|
116
|
-
lastUploadResult.value = result.data
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
// 设置每5秒执行一次的定时器
|
|
122
|
-
intervalId = setInterval(() => {
|
|
110
|
+
try {
|
|
123
111
|
mobileUtil.execute({
|
|
124
112
|
param: {},
|
|
125
113
|
funcName: 'getLastRealtimeUploadResult',
|
|
126
114
|
callbackFunc: (result: PhoneLocationStatus) => {
|
|
127
|
-
|
|
128
|
-
|
|
115
|
+
try {
|
|
116
|
+
if (result.status === 'success') {
|
|
117
|
+
lastUploadResult.value = result.data
|
|
118
|
+
|
|
119
|
+
// 首次成功才启动定时器
|
|
120
|
+
intervalId = setInterval(() => {
|
|
121
|
+
try {
|
|
122
|
+
mobileUtil.execute({
|
|
123
|
+
param: {},
|
|
124
|
+
funcName: 'getLastRealtimeUploadResult',
|
|
125
|
+
callbackFunc: (res: PhoneLocationStatus) => {
|
|
126
|
+
if (res.status === 'success') {
|
|
127
|
+
lastUploadResult.value = res.data
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
console.error('定时获取定位信息异常:', err)
|
|
134
|
+
}
|
|
135
|
+
}, 10000)
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
console.warn('首次定位获取失败,不启动定时器:', result)
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
console.error('处理首次定位结果异常:', err)
|
|
129
143
|
}
|
|
130
144
|
},
|
|
131
145
|
})
|
|
132
|
-
}
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
console.error('首次获取定位信息异常:', err)
|
|
149
|
+
}
|
|
133
150
|
}
|
|
134
151
|
})
|
|
135
152
|
|
package/vite.config.ts
CHANGED
|
@@ -68,6 +68,13 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|
|
68
68
|
changeOrigin: true,
|
|
69
69
|
rewrite: path => path.replace(/^\/linepatrol\/geoserver/, '/geoserver'),
|
|
70
70
|
},
|
|
71
|
+
'/api/af-revenue': {
|
|
72
|
+
// target: v4Server,
|
|
73
|
+
rewrite: (path: string) => path.replace(/^\/api\/af-revenue\//, '/'),
|
|
74
|
+
target: 'http://127.0.0.1:9026',
|
|
75
|
+
ws: false,
|
|
76
|
+
changeOrigin: true,
|
|
77
|
+
},
|
|
71
78
|
'/api': {
|
|
72
79
|
// v3用
|
|
73
80
|
// rewrite: (path: string) => path.replace(/^\/api\/af-system\//, '/rs/'),
|