af-mobile-client-vue3 1.3.27 → 1.3.29
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 +6 -1
- package/src/views/component/XCellListView/index.vue +93 -15
- package/src/views/component/XFormGroupView/index.vue +2 -10
- package/src/views/component/XFormView/index.vue +0 -15
- package/vite.config.ts +2 -2
- package/src/views/component/XFormView/oldindex.vue +0 -70
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ const props = defineProps({
|
|
|
16
16
|
attr: { type: Object as () => { addOrEdit?: string, acceptCount?: number, uploadImage?: boolean }, default: () => ({}) },
|
|
17
17
|
mode: { default: '新增' }, // 预览
|
|
18
18
|
})
|
|
19
|
-
const emit = defineEmits(['updateFileList'])
|
|
19
|
+
const emit = defineEmits(['updateFileList', 'updateAllFileList'])
|
|
20
20
|
|
|
21
21
|
const imageList = ref<Array<any>>(props.imageList ?? [])
|
|
22
22
|
|
|
@@ -97,6 +97,8 @@ function handlePhotoUpload(photoData: any) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
emit('updateAllFileList', imageList.value.filter(item => item.status === 'done').map(item => item)) // 新增
|
|
101
|
+
|
|
100
102
|
const doneIds = Object.values(imageList.value)
|
|
101
103
|
.filter(item => item.status === 'done')
|
|
102
104
|
.map(item => item.id)
|
|
@@ -117,6 +119,9 @@ function deleteFileFunction(file: any) {
|
|
|
117
119
|
const targetIndex = imageList.value.findIndex(item => item.id === file.id)
|
|
118
120
|
if (targetIndex !== -1) {
|
|
119
121
|
imageList.value.splice(targetIndex, 1)
|
|
122
|
+
|
|
123
|
+
emit('updateAllFileList', imageList.value.filter(item => item.status === 'done').map(item => item)) // 新增
|
|
124
|
+
|
|
120
125
|
const doneIds = Object.values(imageList.value)
|
|
121
126
|
.filter(item => item.status === 'done')
|
|
122
127
|
.map(item => item.id)
|
|
@@ -1,29 +1,107 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
3
4
|
import { defineEmits, ref } from 'vue'
|
|
4
5
|
import { useRouter } from 'vue-router'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
// 定义事件
|
|
8
|
+
const emit = defineEmits(['deleteRow'])
|
|
9
|
+
// 访问路由
|
|
7
10
|
const router = useRouter()
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
// 获取默认值
|
|
12
|
+
const idKey = ref('o_id')
|
|
13
|
+
|
|
14
|
+
// 简易crud表单测试
|
|
15
|
+
const configName = ref('lngChargeAuditMobileCRUD')
|
|
16
|
+
const serviceName = ref('af-gaslink')
|
|
17
|
+
|
|
18
|
+
// 资源权限测试
|
|
19
|
+
// const configName = ref('crud_sources_test')
|
|
20
|
+
// const serviceName = ref('af-system')
|
|
21
|
+
|
|
22
|
+
// 实际业务测试
|
|
23
|
+
// const configName = ref('lngChargeAuditMobileCRUD')
|
|
24
|
+
// const serviceName = ref('af-gaslink')
|
|
25
|
+
|
|
26
|
+
// 跳转到详情页面
|
|
27
|
+
// function toDetail(item) {
|
|
28
|
+
// router.push({
|
|
29
|
+
// name: 'XCellDetailView',
|
|
30
|
+
// params: { id: item[idKey.value] }, // 如果使用命名路由,推荐使用路由参数而不是直接构建 URL
|
|
31
|
+
// query: {
|
|
32
|
+
// operName: item[operNameKey.value],
|
|
33
|
+
// method:item[methodKey.value],
|
|
34
|
+
// requestMethod:item[requestMethodKey.value],
|
|
35
|
+
// operatorType:item[operatorTypeKey.value],
|
|
36
|
+
// operUrl:item[operUrlKey.value],
|
|
37
|
+
// operIp:item[operIpKey.value],
|
|
38
|
+
// costTime:item[costTimeKey.value],
|
|
39
|
+
// operTime:item[operTimeKey.value],
|
|
40
|
+
//
|
|
41
|
+
// title: item[titleKey.value],
|
|
42
|
+
// businessType: item[businessTypeKey.value],
|
|
43
|
+
// status:item[statusKey.value]
|
|
44
|
+
// }
|
|
45
|
+
// })
|
|
46
|
+
// }
|
|
47
|
+
|
|
48
|
+
// 跳转到表单——以表单组来渲染纯表单
|
|
49
|
+
function toDetail(item) {
|
|
50
|
+
router.push({
|
|
51
|
+
name: 'XFormGroupView',
|
|
52
|
+
query: {
|
|
53
|
+
id: item[idKey.value],
|
|
54
|
+
// id: item.rr_id,
|
|
55
|
+
// o_id: item.o_id,
|
|
56
|
+
},
|
|
15
57
|
})
|
|
16
58
|
}
|
|
59
|
+
|
|
60
|
+
// 新增功能
|
|
61
|
+
// function addOption(totalCount) {
|
|
62
|
+
// router.push({
|
|
63
|
+
// name: 'XFormView',
|
|
64
|
+
// params: { id: totalCount, openid: totalCount },
|
|
65
|
+
// query: {
|
|
66
|
+
// configName: configName.value,
|
|
67
|
+
// serviceName: serviceName.value,
|
|
68
|
+
// mode: '新增',
|
|
69
|
+
// },
|
|
70
|
+
// })
|
|
71
|
+
// }
|
|
72
|
+
|
|
73
|
+
// 修改功能
|
|
74
|
+
// function updateRow(result) {
|
|
75
|
+
// router.push({
|
|
76
|
+
// name: 'XFormView',
|
|
77
|
+
// params: { id: result.o_id, openid: result.o_id },
|
|
78
|
+
// query: {
|
|
79
|
+
// configName: configName.value,
|
|
80
|
+
// serviceName: serviceName.value,
|
|
81
|
+
// mode: '修改',
|
|
82
|
+
// },
|
|
83
|
+
// })
|
|
84
|
+
// }
|
|
85
|
+
|
|
86
|
+
// 删除功能
|
|
87
|
+
function deleteRow(result) {
|
|
88
|
+
emit('deleteRow', result.o_id)
|
|
89
|
+
}
|
|
17
90
|
</script>
|
|
18
91
|
|
|
19
92
|
<template>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
93
|
+
<NormalDataLayout id="XCellListView" title="工作计划">
|
|
94
|
+
<template #layout_content>
|
|
95
|
+
<XCellList
|
|
96
|
+
:config-name="configName"
|
|
97
|
+
:service-name="serviceName"
|
|
98
|
+
:fix-query-form="{ o_f_oper_name: 'edu_test' }"
|
|
99
|
+
:id-key="idKey"
|
|
100
|
+
@to-detail="toDetail"
|
|
101
|
+
@delete-row="deleteRow"
|
|
102
|
+
/>
|
|
103
|
+
</template>
|
|
104
|
+
</NormalDataLayout>
|
|
27
105
|
</template>
|
|
28
106
|
|
|
29
107
|
<style scoped lang="less">
|
|
@@ -6,8 +6,8 @@ import { ref } from 'vue'
|
|
|
6
6
|
import { useRoute } from 'vue-router'
|
|
7
7
|
|
|
8
8
|
// 纯表单
|
|
9
|
-
const configName = ref('
|
|
10
|
-
const serviceName = ref('af-
|
|
9
|
+
const configName = ref('form_check_test')
|
|
10
|
+
const serviceName = ref('af-system')
|
|
11
11
|
|
|
12
12
|
// const configName = ref("计划下发Form")
|
|
13
13
|
// const serviceName = ref("af-linepatrol")
|
|
@@ -20,12 +20,6 @@ const formData = ref({})
|
|
|
20
20
|
const formGroup = ref(null)
|
|
21
21
|
const route = useRoute()
|
|
22
22
|
const isInit = ref(false)
|
|
23
|
-
|
|
24
|
-
const formShow = {
|
|
25
|
-
showt_userinfo: true,
|
|
26
|
-
showdevices: true,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
23
|
function submit(_result) {
|
|
30
24
|
showDialog({ message: '提交成功' }).then(() => {
|
|
31
25
|
history.back()
|
|
@@ -72,9 +66,7 @@ function submit(_result) {
|
|
|
72
66
|
:config-name="configName"
|
|
73
67
|
:service-name="serviceName"
|
|
74
68
|
:group-form-data="formData"
|
|
75
|
-
:form-show="formShow"
|
|
76
69
|
mode="新增"
|
|
77
|
-
:is-scrollspy="true"
|
|
78
70
|
@submit="submit"
|
|
79
71
|
/>
|
|
80
72
|
</template>
|
|
@@ -7,19 +7,8 @@ const configName = ref('AddConstructionForm')
|
|
|
7
7
|
const serviceName = ref('af-linepatrol')
|
|
8
8
|
|
|
9
9
|
const formGroupAddConstruction = ref(null)
|
|
10
|
-
function emitFunc(func, data) {
|
|
11
|
-
if (func === 'selectAddress') {
|
|
12
|
-
const add = 'ccss'
|
|
13
|
-
// 设置单个字段
|
|
14
|
-
formGroupAddConstruction.value?.setForm({ address: '你的字符串' })
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function submit(data) {
|
|
18
|
-
console.log('>>>> data: ', JSON.stringify(data))
|
|
19
|
-
}
|
|
20
10
|
</script>
|
|
21
11
|
|
|
22
|
-
<!-- workflowId -->
|
|
23
12
|
<template>
|
|
24
13
|
<NormalDataLayout id="XFormGroupView" title="纯表单">
|
|
25
14
|
<template #layout_content>
|
|
@@ -28,10 +17,6 @@ function submit(data) {
|
|
|
28
17
|
mode="新增"
|
|
29
18
|
:config-name="configName"
|
|
30
19
|
:service-name="serviceName"
|
|
31
|
-
:param-logic-name-param="{ aa: 123 }"
|
|
32
|
-
:form-data="{ f_project_name: 333 }"
|
|
33
|
-
@x-form-item-emit-func="emitFunc"
|
|
34
|
-
@on-submit="submit"
|
|
35
20
|
/>
|
|
36
21
|
</template>
|
|
37
22
|
</NormalDataLayout>
|
package/vite.config.ts
CHANGED
|
@@ -11,8 +11,8 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|
|
11
11
|
|
|
12
12
|
const appProxys = {}
|
|
13
13
|
|
|
14
|
-
const v4Server = 'http://192.168.50.67:
|
|
15
|
-
const v3Server = 'http://192.168.50.67:
|
|
14
|
+
const v4Server = 'http://192.168.50.67:31567'
|
|
15
|
+
const v3Server = 'http://192.168.50.67:31567'
|
|
16
16
|
const OSSServerDev = 'http://192.168.50.67:30351'
|
|
17
17
|
const geoserver = 'http://39.104.49.8:30372'
|
|
18
18
|
// const OSSServerProd = 'http://192.168.50.67:31351'
|
|
@@ -1,70 +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 { 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>
|