af-mobile-client-vue3 1.0.70 → 1.0.71
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/.cursorrules +61 -0
- package/package.json +1 -1
- package/src/components/core/XGridDropOption/index.vue +151 -132
- package/src/components/core/XMultiSelect/index.vue +183 -185
- package/src/components/core/XSelect/index.vue +122 -122
- package/src/components/data/XCellList/index.vue +116 -57
- package/src/components/data/XCellListFilter/index.vue +240 -230
- package/src/components/data/XForm/index.vue +27 -21
- package/src/components/data/XFormGroup/index.vue +96 -78
- package/src/components/data/XFormItem/index.vue +638 -595
- package/src/components/data/XReportForm/index.vue +19 -0
- package/src/components/data/XSignature/index.vue +285 -0
- package/src/router/routes.ts +12 -0
- package/src/utils/authority-utils.ts +0 -1
- package/src/utils/runEvalFunction.ts +13 -0
- package/src/views/component/XCellListView/index.vue +96 -57
- package/src/views/component/XFormGroupView/index.vue +54 -0
- package/src/views/component/XFormView/index.vue +170 -55
- package/src/views/component/XReportFormView/index.vue +2 -284
- package/src/views/component/XSignatureView/index.vue +50 -0
- package/src/views/component/index.vue +9 -1
- package/vite.config.ts +1 -1
|
@@ -1,78 +1,96 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Tab as VanTab,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from '
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Button as VanButton,
|
|
4
|
+
Tab as VanTab,
|
|
5
|
+
Tabs as VanTabs,
|
|
6
|
+
} from 'vant'
|
|
7
|
+
import { defineEmits, defineProps, onBeforeMount, ref, watch } from 'vue'
|
|
8
|
+
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
9
|
+
import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<{
|
|
12
|
+
configName?: string
|
|
13
|
+
serviceName?: string
|
|
14
|
+
groupFormData?: object
|
|
15
|
+
mode?: string
|
|
16
|
+
}>(), {
|
|
17
|
+
configName: '',
|
|
18
|
+
serviceName: undefined,
|
|
19
|
+
groupFormData: () => ({}),
|
|
20
|
+
mode: '查询',
|
|
21
|
+
})
|
|
22
|
+
const emit = defineEmits(['submit'])
|
|
23
|
+
const groupItems = ref([])
|
|
24
|
+
const formData = ref({})
|
|
25
|
+
const submitGroup = ref(false)
|
|
26
|
+
const submitSimple = ref(false)
|
|
27
|
+
function initComponents() {
|
|
28
|
+
getConfigByName(props.configName, (result) => {
|
|
29
|
+
formData.value = props.groupFormData
|
|
30
|
+
if (result.groups) {
|
|
31
|
+
submitGroup.value = true
|
|
32
|
+
groupItems.value = result.groups
|
|
33
|
+
result.groups.forEach((group) => {
|
|
34
|
+
if (!formData.value[group.groupName])
|
|
35
|
+
formData.value[group.groupName] = {}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
submitSimple.value = result.showSubmitBtn
|
|
40
|
+
groupItems.value = [{ ...result }]
|
|
41
|
+
}
|
|
42
|
+
}, props.serviceName)
|
|
43
|
+
}
|
|
44
|
+
watch(() => props.groupFormData, (_val) => {
|
|
45
|
+
formData.value = { ...formData.value, ...props.groupFormData }
|
|
46
|
+
})
|
|
47
|
+
onBeforeMount(() => {
|
|
48
|
+
initComponents()
|
|
49
|
+
})
|
|
50
|
+
const xFormListRef = ref([])
|
|
51
|
+
async function submit() {
|
|
52
|
+
for (const res of xFormListRef.value) {
|
|
53
|
+
await res.validate()
|
|
54
|
+
formData.value[res.formGroupName] = res.form
|
|
55
|
+
}
|
|
56
|
+
emit('submit', formData)
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<div id="x-form-group">
|
|
62
|
+
<VanTabs scrollspy sticky>
|
|
63
|
+
<VanTab
|
|
64
|
+
v-for="(item, index) in groupItems"
|
|
65
|
+
:key="item.groupName ? (item.groupName + index) : index"
|
|
66
|
+
:title="item.describe ? item.describe : null "
|
|
67
|
+
>
|
|
68
|
+
<div class="x-form-group-item">
|
|
69
|
+
<XForm
|
|
70
|
+
ref="xFormListRef"
|
|
71
|
+
:mode="props.mode"
|
|
72
|
+
:group-form-items="item"
|
|
73
|
+
:form-data="item.groupName ? formData[item.groupName] : formData"
|
|
74
|
+
:form-name="item.groupName"
|
|
75
|
+
:service-name="props.serviceName"
|
|
76
|
+
:submit-button="submitSimple"
|
|
77
|
+
@on-submit="submit"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
</VanTab>
|
|
81
|
+
</VanTabs>
|
|
82
|
+
<VanButton v-if="submitGroup" round block type="primary" @click="submit">
|
|
83
|
+
提交
|
|
84
|
+
</VanButton>
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<style scoped lang="less">
|
|
89
|
+
#x-form-group{
|
|
90
|
+
background-color: rgb(247,248,250);
|
|
91
|
+
padding-bottom: 10px;
|
|
92
|
+
.x-form-group-item{
|
|
93
|
+
margin:20px 0;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</style>
|