af-mobile-client-vue3 1.1.18 → 1.1.19
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/core/ImageUploader/index.vue +163 -163
- package/src/components/data/XCellList/index.vue +1 -0
- package/src/components/data/XCellListFilter/index.vue +1 -1
- package/src/components/data/XFormItem/index.vue +1 -1
- package/src/components/data/XOlMap/utils/wgs84ToGcj02.js +154 -154
- package/src/components/data/XReportGrid/XReportDemo.vue +33 -33
- package/src/components/data/XReportGrid/print.js +184 -184
- package/src/views/component/XCellListView/index.vue +9 -4
- package/src/views/component/XFormGroupView/index.vue +37 -0
- package/src/views/component/XFormView/index.vue +120 -27
- package/src/views/component/XOlMapView/XLocationPicker/index.vue +118 -118
- package/src/views/component/XReportGridView/index.vue +41 -2
- package/src/views/component/test/index.vue +52 -0
- package/tsconfig.json +43 -43
- package/vite.config.ts +10 -10
- package/src/views/component/XFormView/oldindex.vue +0 -133
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { LocationResult } from '@af-mobile-client-vue3/components/data/XOlMap/types'
|
|
3
|
-
import LocationPicker from '@af-mobile-client-vue3/components/data/XOlMap/XLocationPicker/index.vue'
|
|
4
|
-
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
5
|
-
import { showNotify } from 'vant'
|
|
6
|
-
import { ref } from 'vue'
|
|
7
|
-
|
|
8
|
-
const selectedLocation = ref<LocationResult>()
|
|
9
|
-
|
|
10
|
-
// 处理位置选择
|
|
11
|
-
function handleLocationConfirm(location: LocationResult) {
|
|
12
|
-
// console.log('选择的位置:', location)
|
|
13
|
-
// selectedLocation.value = location
|
|
14
|
-
showNotify({ type: 'success', message: '位置已选择' })
|
|
15
|
-
}
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<template>
|
|
19
|
-
<NormalDataLayout id="XLocationPicker" title="XOlMap地址选择器">
|
|
20
|
-
<template #layout_content>
|
|
21
|
-
<div class="location-picker-demo">
|
|
22
|
-
<!-- 页面标题 -->
|
|
23
|
-
<div class="page-header">
|
|
24
|
-
<div class="title">
|
|
25
|
-
位置选择
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<!-- 选择结果展示 -->
|
|
30
|
-
<div v-if="selectedLocation" class="location-result">
|
|
31
|
-
<div class="label">
|
|
32
|
-
已选位置:
|
|
33
|
-
</div>
|
|
34
|
-
<div class="value">
|
|
35
|
-
{{ selectedLocation.address }}
|
|
36
|
-
</div>
|
|
37
|
-
<div class="coordinates">
|
|
38
|
-
经度: {{ selectedLocation.longitude.toFixed(6) }},
|
|
39
|
-
纬度: {{ selectedLocation.latitude.toFixed(6) }}
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<!-- 地图组件 -->
|
|
44
|
-
<div class="map-container">
|
|
45
|
-
<LocationPicker
|
|
46
|
-
v-model="selectedLocation"
|
|
47
|
-
:default-center="[108.948024, 34.263161]"
|
|
48
|
-
:default-zoom="12"
|
|
49
|
-
@confirm="handleLocationConfirm"
|
|
50
|
-
/>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
54
|
-
</NormalDataLayout>
|
|
55
|
-
</template>
|
|
56
|
-
|
|
57
|
-
<style scoped lang="less">
|
|
58
|
-
.location-picker-demo {
|
|
59
|
-
width: 100%;
|
|
60
|
-
height: 100%;
|
|
61
|
-
position: relative;
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
background-color: #f7f8fa;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.page-header {
|
|
68
|
-
height: 44px;
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
background: white;
|
|
73
|
-
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
|
74
|
-
position: relative;
|
|
75
|
-
z-index: 1;
|
|
76
|
-
|
|
77
|
-
.title {
|
|
78
|
-
font-size: 16px;
|
|
79
|
-
color: #333;
|
|
80
|
-
font-weight: 500;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.location-result {
|
|
85
|
-
background: white;
|
|
86
|
-
padding: 12px 16px;
|
|
87
|
-
margin: 10px;
|
|
88
|
-
border-radius: 8px;
|
|
89
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
90
|
-
|
|
91
|
-
.label {
|
|
92
|
-
font-size: 14px;
|
|
93
|
-
color: #666;
|
|
94
|
-
margin-bottom: 4px;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.value {
|
|
98
|
-
font-size: 16px;
|
|
99
|
-
color: #333;
|
|
100
|
-
margin-bottom: 8px;
|
|
101
|
-
word-break: break-all;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.coordinates {
|
|
105
|
-
font-size: 12px;
|
|
106
|
-
color: #999;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.map-container {
|
|
111
|
-
flex: 1;
|
|
112
|
-
position: relative;
|
|
113
|
-
margin: 0 10px 10px 10px;
|
|
114
|
-
border-radius: 8px;
|
|
115
|
-
overflow: hidden;
|
|
116
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
117
|
-
}
|
|
118
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { LocationResult } from '@af-mobile-client-vue3/components/data/XOlMap/types'
|
|
3
|
+
import LocationPicker from '@af-mobile-client-vue3/components/data/XOlMap/XLocationPicker/index.vue'
|
|
4
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
5
|
+
import { showNotify } from 'vant'
|
|
6
|
+
import { ref } from 'vue'
|
|
7
|
+
|
|
8
|
+
const selectedLocation = ref<LocationResult>()
|
|
9
|
+
|
|
10
|
+
// 处理位置选择
|
|
11
|
+
function handleLocationConfirm(location: LocationResult) {
|
|
12
|
+
// console.log('选择的位置:', location)
|
|
13
|
+
// selectedLocation.value = location
|
|
14
|
+
showNotify({ type: 'success', message: '位置已选择' })
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<NormalDataLayout id="XLocationPicker" title="XOlMap地址选择器">
|
|
20
|
+
<template #layout_content>
|
|
21
|
+
<div class="location-picker-demo">
|
|
22
|
+
<!-- 页面标题 -->
|
|
23
|
+
<div class="page-header">
|
|
24
|
+
<div class="title">
|
|
25
|
+
位置选择
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<!-- 选择结果展示 -->
|
|
30
|
+
<div v-if="selectedLocation" class="location-result">
|
|
31
|
+
<div class="label">
|
|
32
|
+
已选位置:
|
|
33
|
+
</div>
|
|
34
|
+
<div class="value">
|
|
35
|
+
{{ selectedLocation.address }}
|
|
36
|
+
</div>
|
|
37
|
+
<div class="coordinates">
|
|
38
|
+
经度: {{ selectedLocation.longitude.toFixed(6) }},
|
|
39
|
+
纬度: {{ selectedLocation.latitude.toFixed(6) }}
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<!-- 地图组件 -->
|
|
44
|
+
<div class="map-container">
|
|
45
|
+
<LocationPicker
|
|
46
|
+
v-model="selectedLocation"
|
|
47
|
+
:default-center="[108.948024, 34.263161]"
|
|
48
|
+
:default-zoom="12"
|
|
49
|
+
@confirm="handleLocationConfirm"
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
</NormalDataLayout>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<style scoped lang="less">
|
|
58
|
+
.location-picker-demo {
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
position: relative;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
background-color: #f7f8fa;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.page-header {
|
|
68
|
+
height: 44px;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
background: white;
|
|
73
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
|
74
|
+
position: relative;
|
|
75
|
+
z-index: 1;
|
|
76
|
+
|
|
77
|
+
.title {
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
color: #333;
|
|
80
|
+
font-weight: 500;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.location-result {
|
|
85
|
+
background: white;
|
|
86
|
+
padding: 12px 16px;
|
|
87
|
+
margin: 10px;
|
|
88
|
+
border-radius: 8px;
|
|
89
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
90
|
+
|
|
91
|
+
.label {
|
|
92
|
+
font-size: 14px;
|
|
93
|
+
color: #666;
|
|
94
|
+
margin-bottom: 4px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.value {
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
color: #333;
|
|
100
|
+
margin-bottom: 8px;
|
|
101
|
+
word-break: break-all;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.coordinates {
|
|
105
|
+
font-size: 12px;
|
|
106
|
+
color: #999;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.map-container {
|
|
111
|
+
flex: 1;
|
|
112
|
+
position: relative;
|
|
113
|
+
margin: 0 10px 10px 10px;
|
|
114
|
+
border-radius: 8px;
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
Button as VanButton,
|
|
4
|
+
DropdownItem as VanDropdownItem,
|
|
5
|
+
DropdownMenu as VanDropdownMenu,
|
|
6
|
+
} from 'vant'
|
|
3
7
|
import { ref } from 'vue'
|
|
4
8
|
import { useRoute } from 'vue-router'
|
|
5
9
|
|
|
@@ -7,10 +11,45 @@ const route = useRoute()
|
|
|
7
11
|
const serverName = ref('af-gaslink')
|
|
8
12
|
// const configName = ref('detailsaddChargesCover')
|
|
9
13
|
const configName = ref(route.query.configName ? route.query.configName : 'ReportGridTest')
|
|
14
|
+
const menuRef = ref(null)
|
|
15
|
+
const itemRef = ref(null)
|
|
16
|
+
const value = ref(0)
|
|
17
|
+
const switch1 = ref(false)
|
|
18
|
+
const switch2 = ref(false)
|
|
19
|
+
const options = [
|
|
20
|
+
{ text: '全部商品', value: 0 },
|
|
21
|
+
{ text: '新款商品', value: 1 },
|
|
22
|
+
{ text: '活动商品', value: 2 },
|
|
23
|
+
]
|
|
24
|
+
function onConfirm() {
|
|
25
|
+
itemRef.value.toggle()
|
|
26
|
+
// 或者
|
|
27
|
+
// menuRef.value.close();
|
|
28
|
+
}
|
|
10
29
|
</script>
|
|
11
30
|
|
|
12
31
|
<template>
|
|
13
|
-
<XReport :config-name="configName as string" :server-name="serverName" />
|
|
32
|
+
<!-- <XReport :config-name="configName as string" :server-name="serverName" /> -->
|
|
33
|
+
<VanDropdownMenu ref="menuRef" auto-locate>
|
|
34
|
+
<VanDropdownItem v-model="value" :options="options" />
|
|
35
|
+
<VanDropdownItem ref="itemRef" title="筛选" teleport="body">
|
|
36
|
+
<van-cell center title="包邮">
|
|
37
|
+
<template #right-icon>
|
|
38
|
+
<van-switch v-model="switch1" />
|
|
39
|
+
</template>
|
|
40
|
+
</van-cell>
|
|
41
|
+
<van-cell center title="团购">
|
|
42
|
+
<template #right-icon>
|
|
43
|
+
<van-switch v-model="switch2" />
|
|
44
|
+
</template>
|
|
45
|
+
</van-cell>
|
|
46
|
+
<div style="padding: 5px 16px;">
|
|
47
|
+
<VanButton type="primary" block round @click="onConfirm">
|
|
48
|
+
确认
|
|
49
|
+
</VanButton>
|
|
50
|
+
</div>
|
|
51
|
+
</VanDropdownItem>
|
|
52
|
+
</VanDropdownMenu>
|
|
14
53
|
</template>
|
|
15
54
|
|
|
16
55
|
<style scoped lang="less">
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Tabs as VanTabs,
|
|
4
|
+
Tab as VanTab,
|
|
5
|
+
Row as VanRow,
|
|
6
|
+
Button as VanButton
|
|
7
|
+
} from 'vant'
|
|
8
|
+
import { defineProps, watchEffect, onBeforeMount, ref, onMounted, watch, defineEmits } from 'vue'
|
|
9
|
+
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
10
|
+
import XFormView from '@af-mobile-client-vue3/views/component/XFormView/index.vue'
|
|
11
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
12
|
+
import { runLogic } from '@af-mobile-client-vue3/services/api/common'
|
|
13
|
+
import { useRoute } from 'vue-router'
|
|
14
|
+
import {getConfigByName, query} from '@af-mobile-client-vue3/services/api/common'
|
|
15
|
+
|
|
16
|
+
const router = useRoute()
|
|
17
|
+
const formData = ref({})
|
|
18
|
+
function initComponents () {
|
|
19
|
+
console.log('router.params=', router.params)
|
|
20
|
+
runLogic('getLngPurchaseOrderAuditGroupData', {id: router.params?.id}).then((res) => {
|
|
21
|
+
console.log('调用logic完成==',res)
|
|
22
|
+
formData.value = {...res}
|
|
23
|
+
console.log('赋值完成===', formData.value)
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
onBeforeMount(()=>{
|
|
27
|
+
initComponents()
|
|
28
|
+
})
|
|
29
|
+
const submit = (formData) => {
|
|
30
|
+
console.log('提交表单===', formData)
|
|
31
|
+
const param = {
|
|
32
|
+
type: formData.value.auditInfo.f_approval_status === '审核未通过' ? 0 : 1,
|
|
33
|
+
approval_date:'',
|
|
34
|
+
approval_remark:formData.value.auditInfo.f_approval_status,
|
|
35
|
+
approval_operator:useUserStore.getUserInfo?.name,
|
|
36
|
+
approval_operatorid: useUserStore.getUserInfo?.id,
|
|
37
|
+
record: {od_id:1}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
|
|
44
|
+
<NormalDataLayout id="XCellListView" title="采购审核">
|
|
45
|
+
<template #layout_content>
|
|
46
|
+
<XFormView :config-name="'lngPurchaseOrderFormGroup'" @submit="submit" :group-form-data="formData"/>
|
|
47
|
+
</template>
|
|
48
|
+
</NormalDataLayout>
|
|
49
|
+
</template>
|
|
50
|
+
<style scoped lang="less">
|
|
51
|
+
|
|
52
|
+
</style>
|
package/tsconfig.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
"lib": ["esnext", "dom", "dom.iterable", "scripthost"],
|
|
6
|
-
"experimentalDecorators": true,
|
|
7
|
-
"baseUrl": ".",
|
|
8
|
-
"module": "esnext",
|
|
9
|
-
"moduleResolution": "Bundler",
|
|
10
|
-
"paths": {
|
|
11
|
-
"@af-mobile-client-vue3/*": ["src/*"]
|
|
12
|
-
},
|
|
13
|
-
"types": [
|
|
14
|
-
"node",
|
|
15
|
-
"unplugin-vue-router/client",
|
|
16
|
-
"vite-plugin-vue-layouts/client",
|
|
17
|
-
"vite-plugin-pwa/client"
|
|
18
|
-
],
|
|
19
|
-
"allowJs": true,
|
|
20
|
-
"strictNullChecks": false,
|
|
21
|
-
"noImplicitAny": false,
|
|
22
|
-
"noUnusedLocals": false,
|
|
23
|
-
"noUnusedParameters": false,
|
|
24
|
-
"importHelpers": true,
|
|
25
|
-
"sourceMap": true,
|
|
26
|
-
"allowSyntheticDefaultImports": true,
|
|
27
|
-
"esModuleInterop": true,
|
|
28
|
-
"verbatimModuleSyntax": true,
|
|
29
|
-
"skipLibCheck": true
|
|
30
|
-
},
|
|
31
|
-
"include": [
|
|
32
|
-
"src/App.vue",
|
|
33
|
-
"src/**/*.ts",
|
|
34
|
-
"src/**/*.tsx",
|
|
35
|
-
"src/**/*.vue",
|
|
36
|
-
"tests/**/*.ts",
|
|
37
|
-
"tests/**/*.tsx",
|
|
38
|
-
"src/components.d.ts",
|
|
39
|
-
"src/auto-imports.d.ts",
|
|
40
|
-
"src/typed-router.d.ts",
|
|
41
|
-
"tests/*.ts"
|
|
42
|
-
]
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"jsx": "preserve",
|
|
5
|
+
"lib": ["esnext", "dom", "dom.iterable", "scripthost"],
|
|
6
|
+
"experimentalDecorators": true,
|
|
7
|
+
"baseUrl": ".",
|
|
8
|
+
"module": "esnext",
|
|
9
|
+
"moduleResolution": "Bundler",
|
|
10
|
+
"paths": {
|
|
11
|
+
"@af-mobile-client-vue3/*": ["src/*"]
|
|
12
|
+
},
|
|
13
|
+
"types": [
|
|
14
|
+
"node",
|
|
15
|
+
"unplugin-vue-router/client",
|
|
16
|
+
"vite-plugin-vue-layouts/client",
|
|
17
|
+
"vite-plugin-pwa/client"
|
|
18
|
+
],
|
|
19
|
+
"allowJs": true,
|
|
20
|
+
"strictNullChecks": false,
|
|
21
|
+
"noImplicitAny": false,
|
|
22
|
+
"noUnusedLocals": false,
|
|
23
|
+
"noUnusedParameters": false,
|
|
24
|
+
"importHelpers": true,
|
|
25
|
+
"sourceMap": true,
|
|
26
|
+
"allowSyntheticDefaultImports": true,
|
|
27
|
+
"esModuleInterop": true,
|
|
28
|
+
"verbatimModuleSyntax": true,
|
|
29
|
+
"skipLibCheck": true
|
|
30
|
+
},
|
|
31
|
+
"include": [
|
|
32
|
+
"src/App.vue",
|
|
33
|
+
"src/**/*.ts",
|
|
34
|
+
"src/**/*.tsx",
|
|
35
|
+
"src/**/*.vue",
|
|
36
|
+
"tests/**/*.ts",
|
|
37
|
+
"tests/**/*.tsx",
|
|
38
|
+
"src/components.d.ts",
|
|
39
|
+
"src/auto-imports.d.ts",
|
|
40
|
+
"src/typed-router.d.ts",
|
|
41
|
+
"tests/*.ts"
|
|
42
|
+
]
|
|
43
|
+
}
|
package/vite.config.ts
CHANGED
|
@@ -13,7 +13,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|
|
13
13
|
|
|
14
14
|
const appProxys = {}
|
|
15
15
|
|
|
16
|
-
const v4Server = 'http://aote-office.8866.org:
|
|
16
|
+
const v4Server = 'http://aote-office.8866.org:31577'
|
|
17
17
|
const v3Server = 'http://aote-office.8866.org:31567'
|
|
18
18
|
const OSSServerDev = 'http://192.168.50.67:30351'
|
|
19
19
|
const geoserver = 'http://39.104.49.8:30372'
|
|
@@ -95,15 +95,15 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|
|
95
95
|
postcss: {
|
|
96
96
|
plugins: [
|
|
97
97
|
// 自动获取浏览器的流行度和能够支持的属性,并为 CSS 规则添加前缀
|
|
98
|
-
autoprefixer(),
|
|
99
|
-
viewport({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}),
|
|
98
|
+
// autoprefixer(),
|
|
99
|
+
// viewport({
|
|
100
|
+
// appSelector: '#system-app',
|
|
101
|
+
// viewportWidth: 375,
|
|
102
|
+
// maxDisplayWidth: 800,
|
|
103
|
+
// appContainingBlock: 'auto',
|
|
104
|
+
// necessarySelectorWhenAuto: '.app-wrapper',
|
|
105
|
+
// rootContainingBlockSelectorList: ['van-tabbar', 'van-popup'],
|
|
106
|
+
// }),
|
|
107
107
|
],
|
|
108
108
|
},
|
|
109
109
|
},
|
|
@@ -1,133 +0,0 @@
|
|
|
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 { post } from '@af-mobile-client-vue3/services/restTools'
|
|
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'
|
|
13
|
-
|
|
14
|
-
const emit = defineEmits(['onSumbit'])
|
|
15
|
-
const xForm = ref(null)
|
|
16
|
-
const id = ref(-1)
|
|
17
|
-
const openid = ref('')
|
|
18
|
-
const instance = getCurrentInstance()
|
|
19
|
-
const xFormInit = ref(false)
|
|
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
|
-
}
|
|
41
|
-
|
|
42
|
-
// 组件挂载前获取数据
|
|
43
|
-
onBeforeMount(async () => {
|
|
44
|
-
if (instance) {
|
|
45
|
-
id.value = route.params.id as unknown as number
|
|
46
|
-
openid.value = route.params.openid as string
|
|
47
|
-
formInit()
|
|
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)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// 获取配置信息
|
|
63
|
-
function queryData() {
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// 提交操作
|
|
68
|
-
function onSubmit(params) {
|
|
69
|
-
// const data = {
|
|
70
|
-
// id: currentEvaluate.id,
|
|
71
|
-
// f_json: params,
|
|
72
|
-
// f_evaluate_date: formatDate(new Date()),
|
|
73
|
-
// f_evaluate_state: '已评价',
|
|
74
|
-
// f_evaluate_type: '用户评价',
|
|
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
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// 查询需要修改的数据
|
|
96
|
-
async function getUpdateData() {
|
|
97
|
-
if (api.value && updateId) {
|
|
98
|
-
const res = await post(api.value, updateId)
|
|
99
|
-
updateData.value = res.data[0]
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
</script>
|
|
103
|
-
|
|
104
|
-
<template>
|
|
105
|
-
<NormalDataLayout id="XFormView" title="XForm表单">
|
|
106
|
-
<template #layout_content>
|
|
107
|
-
<VanSpace direction="vertical" fill>
|
|
108
|
-
<VanNavBar :title="title ? mode.concat(title) : null" />
|
|
109
|
-
<XForm
|
|
110
|
-
v-if="xFormInit"
|
|
111
|
-
ref="xForm"
|
|
112
|
-
:group-form-items="JSON.parse(JSON.stringify(groupFormItems))"
|
|
113
|
-
:service-name="serviceName"
|
|
114
|
-
:form-data="updateData"
|
|
115
|
-
:mode="mode"
|
|
116
|
-
style="margin-bottom: 14px;"
|
|
117
|
-
@on-submit="onSubmit"
|
|
118
|
-
/>
|
|
119
|
-
</VanSpace>
|
|
120
|
-
</template>
|
|
121
|
-
</NormalDataLayout>
|
|
122
|
-
</template>
|
|
123
|
-
|
|
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
|
-
}
|
|
133
|
-
</style>
|