af-mobile-client-vue3 1.1.52 → 1.1.53
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
|
@@ -87,7 +87,7 @@ watch(() => props.configName, (newConfigName) => {
|
|
|
87
87
|
async function loadFormConfig(name: string) {
|
|
88
88
|
loaded.value = false
|
|
89
89
|
try {
|
|
90
|
-
const result = await post(`/api/${props.serviceName ||
|
|
90
|
+
const result = await post(`/api/${props.serviceName || import.meta.env.VITE_APP_SYSTEM_NAME}/logic/openapi/getLiuliConfiguration`, { configName: name })
|
|
91
91
|
if (result) {
|
|
92
92
|
internalFormConfig.value = result
|
|
93
93
|
internalSubmitButton.value = result.showSubmitBtn
|
|
@@ -56,7 +56,7 @@ onMounted(async () => {
|
|
|
56
56
|
zoom: props.defaultZoom,
|
|
57
57
|
})
|
|
58
58
|
try {
|
|
59
|
-
const webConfig = await post(`/api/${props.serviceName ||
|
|
59
|
+
const webConfig = await post(`/api/${props.serviceName || import.meta.env.VITE_APP_SYSTEM_NAME}/logic/openapi/getLiuliConfiguration`, { configName: 'webConfig' })
|
|
60
60
|
const wms = webConfig.wms ?? {}
|
|
61
61
|
if (Array.isArray(wms.layers) && wms.layers.length > 0 && wms.wms?.url) {
|
|
62
62
|
await mapRef.value.addWMSLayers(wms)
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
3
|
-
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
-
import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
|
|
5
|
-
import { onBeforeMount, ref, toRaw } from 'vue'
|
|
6
|
-
|
|
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)
|
|
13
|
-
|
|
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)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function submit(result) {
|
|
27
|
-
console.log('>>>> result: ', safeStringify(result))
|
|
28
|
-
}
|
|
29
|
-
|
|
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
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
onBeforeMount(async () => {
|
|
41
|
-
try {
|
|
42
|
-
await loadConfig()
|
|
43
|
-
}
|
|
44
|
-
finally {
|
|
45
|
-
isLoading.value = false
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<template>
|
|
51
|
-
<NormalDataLayout id="XFormGroupView" title="纯表单">
|
|
52
|
-
<template #layout_content>
|
|
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
|
-
/>
|
|
65
|
-
</template>
|
|
66
|
-
</NormalDataLayout>
|
|
67
|
-
</template>
|
|
68
|
-
|
|
69
|
-
<style scoped lang="less">
|
|
70
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
|
|
5
|
+
import { onBeforeMount, ref, toRaw } from 'vue'
|
|
6
|
+
|
|
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)
|
|
13
|
+
|
|
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)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function submit(result) {
|
|
27
|
+
console.log('>>>> result: ', safeStringify(result))
|
|
28
|
+
}
|
|
29
|
+
|
|
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
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
onBeforeMount(async () => {
|
|
41
|
+
try {
|
|
42
|
+
await loadConfig()
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
isLoading.value = false
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<NormalDataLayout id="XFormGroupView" title="纯表单">
|
|
52
|
+
<template #layout_content>
|
|
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
|
+
/>
|
|
65
|
+
</template>
|
|
66
|
+
</NormalDataLayout>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<style scoped lang="less">
|
|
70
|
+
</style>
|