af-mobile-client-vue3 1.1.36 → 1.1.37
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
|
@@ -726,13 +726,16 @@ defineExpose({
|
|
|
726
726
|
|
|
727
727
|
<style scoped lang="less">
|
|
728
728
|
#XCellList {
|
|
729
|
-
height: calc(
|
|
729
|
+
height: calc(100vh - var(--van-nav-bar-height) - 5px);
|
|
730
|
+
display: flex;
|
|
731
|
+
flex-direction: column;
|
|
730
732
|
--van-search-padding: 3px;
|
|
731
733
|
--van-dropdown-menu-title-padding: 3px;
|
|
732
734
|
--van-cell-vertical-padding: 0px;
|
|
733
735
|
.main {
|
|
736
|
+
flex: 1;
|
|
737
|
+
min-height: 0;
|
|
734
738
|
overflow-y: auto;
|
|
735
|
-
height: 100%;
|
|
736
739
|
background-color: var(--van-background);
|
|
737
740
|
padding: var(--van-padding-base) var(--van-padding-sm);
|
|
738
741
|
|
|
@@ -12,8 +12,8 @@ const router = useRouter()
|
|
|
12
12
|
const idKey = ref('o_id')
|
|
13
13
|
|
|
14
14
|
// 简易crud表单测试
|
|
15
|
-
const configName = ref('
|
|
16
|
-
const serviceName = ref('af-
|
|
15
|
+
const configName = ref('crud_patroltask_managePhoneCRUD')
|
|
16
|
+
const serviceName = ref('af-linepatrol')
|
|
17
17
|
|
|
18
18
|
// 资源权限测试
|
|
19
19
|
// const configName = ref('crud_sources_test')
|
|
@@ -2,132 +2,69 @@
|
|
|
2
2
|
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
3
3
|
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
4
|
import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
showDialog,
|
|
8
|
-
NavBar as VanNavBar,
|
|
9
|
-
Space as VanSpace,
|
|
10
|
-
} from 'vant'
|
|
11
|
-
import { defineEmits, getCurrentInstance, onBeforeMount, ref } from 'vue'
|
|
12
|
-
import { useRoute } from 'vue-router'
|
|
5
|
+
import { onBeforeMount, ref, toRaw } from 'vue'
|
|
13
6
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const route = useRoute()
|
|
21
|
-
const configName = route.query.configName as string
|
|
22
|
-
const serviceName = route.query.serviceName as string
|
|
23
|
-
const mode = route.query.mode as string
|
|
24
|
-
const updateData = ref({})
|
|
25
|
-
const title = ref('')
|
|
26
|
-
const groupFormItems = ref({})
|
|
27
|
-
const api = ref('/af-system/logic/commonQuery')
|
|
28
|
-
const updateId = {
|
|
29
|
-
queryParamsName: 'crud_oper_log_manage',
|
|
30
|
-
pageNo: 1,
|
|
31
|
-
pageSize: 20,
|
|
32
|
-
conditionParams: { o_id: route.params.id as string },
|
|
33
|
-
}
|
|
34
|
-
const loadUpdate = ref(false)
|
|
35
|
-
// const serviceName = ref('af-revenue')
|
|
36
|
-
const _currentEvaluate = {
|
|
37
|
-
id: null,
|
|
38
|
-
f_business_name: '',
|
|
39
|
-
f_evaluate_state: '',
|
|
40
|
-
}
|
|
7
|
+
const configName = ref('AddConstructionForm')
|
|
8
|
+
const serviceName = ref('af-linepatrol')
|
|
9
|
+
const formGroup = ref(null)
|
|
10
|
+
const formConfig = ref(null)
|
|
11
|
+
const submitSimple = ref(null)
|
|
12
|
+
const isLoading = ref(true)
|
|
41
13
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
async function formInit() {
|
|
53
|
-
getConfigByName(configName, (result) => {
|
|
54
|
-
groupFormItems.value = result
|
|
55
|
-
title.value = result.title
|
|
56
|
-
if (mode === '修改')
|
|
57
|
-
getUpdateData()
|
|
58
|
-
xFormInit.value = true
|
|
59
|
-
}, serviceName)
|
|
14
|
+
function safeStringify(obj) {
|
|
15
|
+
const seen = new WeakSet()
|
|
16
|
+
return JSON.stringify(toRaw(obj), (key, val) => {
|
|
17
|
+
if (typeof val === 'object' && val !== null) {
|
|
18
|
+
if (seen.has(val))
|
|
19
|
+
return
|
|
20
|
+
seen.add(val)
|
|
21
|
+
}
|
|
22
|
+
return val
|
|
23
|
+
}, 2)
|
|
60
24
|
}
|
|
61
25
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
26
|
+
function submit(result) {
|
|
27
|
+
console.log('>>>> result: ', safeStringify(result))
|
|
65
28
|
}
|
|
66
29
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// f_evaluate_userid: openid.value,
|
|
76
|
-
// }
|
|
77
|
-
// openApiLogic(data, 'saveEvaluate', formServiveName).then((_res: any) => {
|
|
78
|
-
// showDialog({ message: '评价成功了' }).then(() => {history.back()})
|
|
79
|
-
// }).catch(() => {
|
|
80
|
-
// showDialog({ message: '评价失败了' })
|
|
81
|
-
// })
|
|
82
|
-
if (params) {
|
|
83
|
-
emit('onSumbit', params)
|
|
84
|
-
showDialog({ message: '评价成功了' }).then(() => {
|
|
85
|
-
history.back()
|
|
86
|
-
})
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
showDialog({ message: '评价失败了' }).then(() => {
|
|
90
|
-
history.back()
|
|
91
|
-
})
|
|
92
|
-
}
|
|
30
|
+
function loadConfig() {
|
|
31
|
+
return new Promise((resolve) => {
|
|
32
|
+
getConfigByName(configName.value, (result) => {
|
|
33
|
+
submitSimple.value = result.showSubmitBtn
|
|
34
|
+
formConfig.value = result
|
|
35
|
+
resolve(result)
|
|
36
|
+
}, serviceName.value)
|
|
37
|
+
})
|
|
93
38
|
}
|
|
94
39
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const res = await post(api.value, updateId)
|
|
99
|
-
updateData.value = res.data[0]
|
|
40
|
+
onBeforeMount(async () => {
|
|
41
|
+
try {
|
|
42
|
+
await loadConfig()
|
|
100
43
|
}
|
|
101
|
-
|
|
44
|
+
finally {
|
|
45
|
+
isLoading.value = false
|
|
46
|
+
}
|
|
47
|
+
})
|
|
102
48
|
</script>
|
|
103
49
|
|
|
104
50
|
<template>
|
|
105
|
-
<NormalDataLayout id="
|
|
51
|
+
<NormalDataLayout id="XFormGroupView" title="纯表单">
|
|
106
52
|
<template #layout_content>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</VanSpace>
|
|
53
|
+
<van-loading v-if="isLoading" />
|
|
54
|
+
<XForm
|
|
55
|
+
v-else
|
|
56
|
+
ref="formGroup"
|
|
57
|
+
mode="查询"
|
|
58
|
+
:service-name="serviceName"
|
|
59
|
+
:group-form-items="formConfig"
|
|
60
|
+
:form-data="{}"
|
|
61
|
+
:form-name="formConfig?.groupName || '11111'"
|
|
62
|
+
:submit-button="submitSimple"
|
|
63
|
+
@on-submit="submit"
|
|
64
|
+
/>
|
|
120
65
|
</template>
|
|
121
66
|
</NormalDataLayout>
|
|
122
67
|
</template>
|
|
123
68
|
|
|
124
|
-
<style scoped>
|
|
125
|
-
.van-doc-demo-block__title {
|
|
126
|
-
margin: 0;
|
|
127
|
-
padding: 32px 16px 16px;
|
|
128
|
-
color: black;
|
|
129
|
-
font-weight: 400;
|
|
130
|
-
font-size: 14px;
|
|
131
|
-
line-height: 16px;
|
|
132
|
-
}
|
|
69
|
+
<style scoped lang="less">
|
|
133
70
|
</style>
|