af-mobile-client-vue3 1.3.10 → 1.3.12
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
package/src/App.vue
CHANGED
|
@@ -53,7 +53,7 @@ const themeVars: ConfigProviderThemeVars = reactive({
|
|
|
53
53
|
<router-view v-slot="{ Component }">
|
|
54
54
|
<section class="app-wrapper">
|
|
55
55
|
<keep-alive :include="keepAliveRouteNames">
|
|
56
|
-
<component :is="Component" />
|
|
56
|
+
<component :is="Component" :key="$route.fullPath" />
|
|
57
57
|
</keep-alive>
|
|
58
58
|
</section>
|
|
59
59
|
</router-view>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
3
3
|
import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
|
|
4
4
|
import { Button as VanButton, Tab as VanTab, Tabs as VanTabs } from 'vant'
|
|
5
|
-
import { computed, defineEmits, defineProps, onBeforeMount, onMounted, ref, useSlots
|
|
5
|
+
import { computed, defineEmits, defineProps, onBeforeMount, onMounted, ref, useSlots } from 'vue'
|
|
6
6
|
|
|
7
7
|
const props = withDefaults(defineProps<{
|
|
8
8
|
configName?: string
|
|
@@ -11,6 +11,7 @@ const props = withDefaults(defineProps<{
|
|
|
11
11
|
mode?: string
|
|
12
12
|
isScrollspy?: boolean
|
|
13
13
|
formShow?: any
|
|
14
|
+
showTabHeader?: boolean
|
|
14
15
|
}>(), {
|
|
15
16
|
configName: '',
|
|
16
17
|
serviceName: undefined,
|
|
@@ -18,25 +19,15 @@ const props = withDefaults(defineProps<{
|
|
|
18
19
|
mode: '查询',
|
|
19
20
|
isScrollspy: true,
|
|
20
21
|
formShow: undefined,
|
|
22
|
+
showTabHeader: true,
|
|
21
23
|
})
|
|
22
24
|
const emit = defineEmits(['submit', 'xFormItemEmitFunc'])
|
|
23
25
|
|
|
24
|
-
interface Form {
|
|
25
|
-
configName?: string
|
|
26
|
-
serviceName?: string
|
|
27
|
-
groupFormData?: object
|
|
28
|
-
mode?: string
|
|
29
|
-
isScrollspy?: boolean
|
|
30
|
-
formShow?: any
|
|
31
|
-
}
|
|
32
|
-
|
|
33
26
|
const groupItems = ref([])
|
|
34
27
|
const formData = ref({})
|
|
35
28
|
const submitGroup = ref(false)
|
|
36
29
|
const submitSimple = ref(false)
|
|
37
30
|
const isInit = ref(false)
|
|
38
|
-
const initStatus = ref(false)
|
|
39
|
-
const propsData = ref<Partial<Form>>({})
|
|
40
31
|
|
|
41
32
|
const slots = useSlots()
|
|
42
33
|
const renderableGroupItems = computed(() => {
|
|
@@ -55,18 +46,9 @@ const renderableGroupItems = computed(() => {
|
|
|
55
46
|
})
|
|
56
47
|
|
|
57
48
|
// 组件初始化函数
|
|
58
|
-
function init(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
configName: props.configName,
|
|
62
|
-
serviceName: props.serviceName,
|
|
63
|
-
groupFormData: props.groupFormData,
|
|
64
|
-
mode: props.mode,
|
|
65
|
-
formShow: props.formShow,
|
|
66
|
-
...params,
|
|
67
|
-
}
|
|
68
|
-
formData.value = propsData.value.groupFormData
|
|
69
|
-
getConfigByName(propsData.value.configName, (result) => {
|
|
49
|
+
function init() {
|
|
50
|
+
formData.value = props.groupFormData
|
|
51
|
+
getConfigByName(props.configName, (result) => {
|
|
70
52
|
if (result?.groups) {
|
|
71
53
|
groupItems.value = result.groups
|
|
72
54
|
result.groups.forEach((group) => {
|
|
@@ -81,14 +63,13 @@ function init(params: Form) {
|
|
|
81
63
|
groupItems.value = [{ ...result }]
|
|
82
64
|
}
|
|
83
65
|
isInit.value = true
|
|
84
|
-
},
|
|
66
|
+
}, props.serviceName)
|
|
85
67
|
}
|
|
86
|
-
watch(() => props.groupFormData, (_val) => {
|
|
87
|
-
|
|
88
|
-
})
|
|
68
|
+
// watch(() => props.groupFormData, (_val) => {
|
|
69
|
+
// formData.value = { ...formData.value, ...props.groupFormData }
|
|
70
|
+
// })
|
|
89
71
|
onBeforeMount(() => {
|
|
90
|
-
|
|
91
|
-
init(props)
|
|
72
|
+
init()
|
|
92
73
|
})
|
|
93
74
|
interface XFormLike {
|
|
94
75
|
validate: () => Promise<void>
|
|
@@ -112,6 +93,7 @@ function removeRef(refValue: XFormLike) {
|
|
|
112
93
|
}
|
|
113
94
|
|
|
114
95
|
async function submit() {
|
|
96
|
+
console.log(props.groupFormData)
|
|
115
97
|
for (const res of xFormListRef.value) {
|
|
116
98
|
try {
|
|
117
99
|
await res.validate()
|
|
@@ -143,7 +125,7 @@ defineExpose({ init, removeRef, xFormListRef })
|
|
|
143
125
|
|
|
144
126
|
<template>
|
|
145
127
|
<div v-if="isInit" id="x-form-group">
|
|
146
|
-
<VanTabs :scrollspy="
|
|
128
|
+
<VanTabs :scrollspy="props.isScrollspy" sticky :offset-top="offsetTop" :show-header="props.showTabHeader">
|
|
147
129
|
<VanTab
|
|
148
130
|
v-for="(item, index) in renderableGroupItems"
|
|
149
131
|
:key="item.groupName ? (item.groupName + index) : index"
|
|
@@ -153,7 +135,7 @@ defineExpose({ init, removeRef, xFormListRef })
|
|
|
153
135
|
class="x-form-group-item"
|
|
154
136
|
:class="{ 'is-last': index === renderableGroupItems.length - 1 }"
|
|
155
137
|
>
|
|
156
|
-
<div v-if="item.describe &&
|
|
138
|
+
<div v-if="item.describe && props.isScrollspy && (item.groupName || item.slotName)" class="form-group-title">
|
|
157
139
|
<span class="form-group-bar" />
|
|
158
140
|
<span class="form-group-text">{{ item.describe }}</span>
|
|
159
141
|
</div>
|
|
@@ -193,7 +175,6 @@ defineExpose({ init, removeRef, xFormListRef })
|
|
|
193
175
|
|
|
194
176
|
<style scoped lang="less">
|
|
195
177
|
#x-form-group {
|
|
196
|
-
padding: 12px;
|
|
197
178
|
display: flex;
|
|
198
179
|
flex-direction: column;
|
|
199
180
|
background-color: rgb(247, 248, 250);
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
|
|
3
|
-
import { runLogic } from '@af-mobile-client-vue3/services/api/common'
|
|
4
|
-
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
5
|
-
import dayjs from 'dayjs/esm/index'
|
|
6
|
-
import { showToast } from 'vant'
|
|
7
|
-
import { onMounted, ref } from 'vue'
|
|
8
|
-
import { useRoute } from 'vue-router'
|
|
9
|
-
|
|
10
|
-
const configName = ref('appapplyuserinfoFormGroup')
|
|
11
|
-
const serviceName = ref('af-apply')
|
|
12
|
-
const route = useRoute()
|
|
13
|
-
const userInfo = useUserStore().getUserInfo()
|
|
14
|
-
const workflowId = ref('3045')
|
|
15
|
-
const userinfoid = ref('93116')
|
|
16
|
-
const model = ref('编辑')
|
|
17
|
-
const groupFormData = ref({})
|
|
18
|
-
|
|
19
|
-
function submit(res) {
|
|
20
|
-
if (model.value === '新增') {
|
|
21
|
-
res.t_userinfo.f_operate_date = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
22
|
-
res.t_userinfo.f_orgid = userInfo.f_orgid
|
|
23
|
-
res.t_userinfo.f_orgname = userInfo.f_orgname
|
|
24
|
-
res.t_userinfo.f_depid = userInfo.f_depid
|
|
25
|
-
res.t_userinfo.f_depname = userInfo.f_depname
|
|
26
|
-
res.t_userinfo.f_operatorid = userInfo.f_operatorid
|
|
27
|
-
res.t_userinfo.f_operator = userInfo.f_operator
|
|
28
|
-
res.t_userinfo.f_workflow_id = this.f_workflow_id
|
|
29
|
-
res.t_userinfo.f_user_state = '预备'
|
|
30
|
-
|
|
31
|
-
res.t_userfiles.f_operate_date = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
32
|
-
res.t_userfiles.f_orgid = userInfo.f_orgid
|
|
33
|
-
res.t_userfiles.f_orgname = userInfo.f_orgname
|
|
34
|
-
res.t_userfiles.f_depid = userInfo.f_depid
|
|
35
|
-
res.t_userfiles.f_depname = userInfo.f_depname
|
|
36
|
-
res.t_userfiles.f_operatorid = userInfo.f_operatorid
|
|
37
|
-
res.t_userfiles.f_operator = userInfo.f_operator
|
|
38
|
-
res.t_userfiles.f_workflow_id = this.f_workflow_id
|
|
39
|
-
res.t_userfiles.f_table_state = '待开通'
|
|
40
|
-
}
|
|
41
|
-
let saveData = res
|
|
42
|
-
if (saveData.t_userfiles.f_gasbrand_id.length > 0) {
|
|
43
|
-
saveData.t_userfiles.f_gasbrand_id = saveData.t_userfiles.f_gasbrand_id[0]
|
|
44
|
-
}
|
|
45
|
-
if (saveData.t_userfiles.f_price_id.length > 0) {
|
|
46
|
-
saveData.t_userfiles.f_price_id = saveData.t_userfiles.f_price_id[0]
|
|
47
|
-
}
|
|
48
|
-
if (model.value === '编辑') {
|
|
49
|
-
saveData = Object.assign(saveData, {
|
|
50
|
-
f_operator_record: userInfo.f_operator,
|
|
51
|
-
f_operatorid_record: userInfo.f_operatorid,
|
|
52
|
-
f_orgid_record: userInfo.f_orgid,
|
|
53
|
-
f_orgname_record: userInfo.f_orgname,
|
|
54
|
-
f_depid_record: userInfo.f_depid,
|
|
55
|
-
f_depname_record: userInfo.f_depname,
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
runLogic('userFIleSaveLogic', saveData, 'af-revenue').then((res) => {
|
|
59
|
-
showToast('操作成功!')
|
|
60
|
-
history.back()
|
|
61
|
-
})
|
|
62
|
-
}
|
|
63
|
-
const isInit = ref(false)
|
|
64
|
-
function init() {
|
|
65
|
-
if (model.value === '编辑') {
|
|
66
|
-
runLogic('getFileDetailForEdit', { f_userinfo_id: userinfoid.value }, 'af-revenue').then((res) => {
|
|
67
|
-
// if (res.t_userfiles.f_gasmodel_id) {
|
|
68
|
-
// res.t_userfiles.f_gasmodel_id = 76
|
|
69
|
-
// }
|
|
70
|
-
// if (res.t_userfiles.f_price_id) {
|
|
71
|
-
// res.t_userfiles.f_price_id = [res.t_userfiles.f_price_id]
|
|
72
|
-
// }
|
|
73
|
-
console.log('1111111----,', res)
|
|
74
|
-
groupFormData.value = res
|
|
75
|
-
isInit.value = true
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
onMounted(() => {
|
|
80
|
-
init()
|
|
81
|
-
})
|
|
82
|
-
</script>
|
|
83
|
-
|
|
84
|
-
<template>
|
|
85
|
-
<XFormGroup
|
|
86
|
-
v-if="isInit"
|
|
87
|
-
mode="修改"
|
|
88
|
-
:config-name="configName"
|
|
89
|
-
:service-name="serviceName"
|
|
90
|
-
:group-form-data="groupFormData"
|
|
91
|
-
@submit="submit"
|
|
92
|
-
/>
|
|
93
|
-
</template>
|
|
94
|
-
|
|
95
|
-
<style scoped lang="less">
|
|
96
|
-
|
|
97
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
|
|
3
|
+
import { runLogic } from '@af-mobile-client-vue3/services/api/common'
|
|
4
|
+
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
5
|
+
import dayjs from 'dayjs/esm/index'
|
|
6
|
+
import { showToast } from 'vant'
|
|
7
|
+
import { onMounted, ref } from 'vue'
|
|
8
|
+
import { useRoute } from 'vue-router'
|
|
9
|
+
|
|
10
|
+
const configName = ref('appapplyuserinfoFormGroup')
|
|
11
|
+
const serviceName = ref('af-apply')
|
|
12
|
+
const route = useRoute()
|
|
13
|
+
const userInfo = useUserStore().getUserInfo()
|
|
14
|
+
const workflowId = ref('3045')
|
|
15
|
+
const userinfoid = ref('93116')
|
|
16
|
+
const model = ref('编辑')
|
|
17
|
+
const groupFormData = ref({})
|
|
18
|
+
|
|
19
|
+
function submit(res) {
|
|
20
|
+
if (model.value === '新增') {
|
|
21
|
+
res.t_userinfo.f_operate_date = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
22
|
+
res.t_userinfo.f_orgid = userInfo.f_orgid
|
|
23
|
+
res.t_userinfo.f_orgname = userInfo.f_orgname
|
|
24
|
+
res.t_userinfo.f_depid = userInfo.f_depid
|
|
25
|
+
res.t_userinfo.f_depname = userInfo.f_depname
|
|
26
|
+
res.t_userinfo.f_operatorid = userInfo.f_operatorid
|
|
27
|
+
res.t_userinfo.f_operator = userInfo.f_operator
|
|
28
|
+
res.t_userinfo.f_workflow_id = this.f_workflow_id
|
|
29
|
+
res.t_userinfo.f_user_state = '预备'
|
|
30
|
+
|
|
31
|
+
res.t_userfiles.f_operate_date = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
32
|
+
res.t_userfiles.f_orgid = userInfo.f_orgid
|
|
33
|
+
res.t_userfiles.f_orgname = userInfo.f_orgname
|
|
34
|
+
res.t_userfiles.f_depid = userInfo.f_depid
|
|
35
|
+
res.t_userfiles.f_depname = userInfo.f_depname
|
|
36
|
+
res.t_userfiles.f_operatorid = userInfo.f_operatorid
|
|
37
|
+
res.t_userfiles.f_operator = userInfo.f_operator
|
|
38
|
+
res.t_userfiles.f_workflow_id = this.f_workflow_id
|
|
39
|
+
res.t_userfiles.f_table_state = '待开通'
|
|
40
|
+
}
|
|
41
|
+
let saveData = res
|
|
42
|
+
if (saveData.t_userfiles.f_gasbrand_id.length > 0) {
|
|
43
|
+
saveData.t_userfiles.f_gasbrand_id = saveData.t_userfiles.f_gasbrand_id[0]
|
|
44
|
+
}
|
|
45
|
+
if (saveData.t_userfiles.f_price_id.length > 0) {
|
|
46
|
+
saveData.t_userfiles.f_price_id = saveData.t_userfiles.f_price_id[0]
|
|
47
|
+
}
|
|
48
|
+
if (model.value === '编辑') {
|
|
49
|
+
saveData = Object.assign(saveData, {
|
|
50
|
+
f_operator_record: userInfo.f_operator,
|
|
51
|
+
f_operatorid_record: userInfo.f_operatorid,
|
|
52
|
+
f_orgid_record: userInfo.f_orgid,
|
|
53
|
+
f_orgname_record: userInfo.f_orgname,
|
|
54
|
+
f_depid_record: userInfo.f_depid,
|
|
55
|
+
f_depname_record: userInfo.f_depname,
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
runLogic('userFIleSaveLogic', saveData, 'af-revenue').then((res) => {
|
|
59
|
+
showToast('操作成功!')
|
|
60
|
+
history.back()
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
const isInit = ref(false)
|
|
64
|
+
function init() {
|
|
65
|
+
if (model.value === '编辑') {
|
|
66
|
+
runLogic('getFileDetailForEdit', { f_userinfo_id: userinfoid.value }, 'af-revenue').then((res) => {
|
|
67
|
+
// if (res.t_userfiles.f_gasmodel_id) {
|
|
68
|
+
// res.t_userfiles.f_gasmodel_id = 76
|
|
69
|
+
// }
|
|
70
|
+
// if (res.t_userfiles.f_price_id) {
|
|
71
|
+
// res.t_userfiles.f_price_id = [res.t_userfiles.f_price_id]
|
|
72
|
+
// }
|
|
73
|
+
console.log('1111111----,', res)
|
|
74
|
+
groupFormData.value = res
|
|
75
|
+
isInit.value = true
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
init()
|
|
81
|
+
})
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<XFormGroup
|
|
86
|
+
v-if="isInit"
|
|
87
|
+
mode="修改"
|
|
88
|
+
:config-name="configName"
|
|
89
|
+
:service-name="serviceName"
|
|
90
|
+
:group-form-data="groupFormData"
|
|
91
|
+
@submit="submit"
|
|
92
|
+
/>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<style scoped lang="less">
|
|
96
|
+
|
|
97
|
+
</style>
|