af-mobile-client-vue3 1.0.70 → 1.0.72
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 +144 -122
- package/src/components/data/XCellList/index.vue +540 -448
- package/src/components/data/XCellListFilter/index.vue +241 -230
- package/src/components/data/XForm/index.vue +30 -20
- package/src/components/data/XFormGroup/index.vue +96 -78
- package/src/components/data/XFormItem/index.vue +711 -595
- package/src/components/data/XReportForm/index.vue +19 -0
- package/src/components/data/XSignature/index.vue +285 -0
- package/src/router/routes.ts +37 -0
- package/src/services/v3Api.ts +136 -0
- package/src/utils/authority-utils.ts +0 -1
- package/src/utils/http/index.ts +34 -0
- package/src/utils/runEvalFunction.ts +13 -0
- package/src/views/component/XCellListView/index.vue +96 -57
- package/src/views/component/XFormGroupView/index.vue +56 -0
- package/src/views/component/XFormView/index.vue +134 -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,57 +1,96 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
4
|
-
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
5
|
-
import { useRouter } from 'vue-router'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
//
|
|
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
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineEmits, ref } from 'vue'
|
|
3
|
+
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
4
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
5
|
+
import { useRouter } from 'vue-router'
|
|
6
|
+
|
|
7
|
+
// 定义事件
|
|
8
|
+
const emit = defineEmits(['deleteRow'])
|
|
9
|
+
// 访问路由
|
|
10
|
+
const router = useRouter()
|
|
11
|
+
// 获取默认值
|
|
12
|
+
const idKey = ref('o_id')
|
|
13
|
+
// const configName = ref('crud_oper_log_manage')
|
|
14
|
+
// const serviceName = ref('af-system')
|
|
15
|
+
const configName = ref('crud_sources_test')
|
|
16
|
+
const serviceName = ref('af-system')
|
|
17
|
+
|
|
18
|
+
// 跳转到详情页面
|
|
19
|
+
// function toDetail(item) {
|
|
20
|
+
// router.push({
|
|
21
|
+
// name: 'XCellDetailView',
|
|
22
|
+
// params: { id: item[idKey.value] }, // 如果使用命名路由,推荐使用路由参数而不是直接构建 URL
|
|
23
|
+
// query: {
|
|
24
|
+
// operName: item[operNameKey.value],
|
|
25
|
+
// method:item[methodKey.value],
|
|
26
|
+
// requestMethod:item[requestMethodKey.value],
|
|
27
|
+
// operatorType:item[operatorTypeKey.value],
|
|
28
|
+
// operUrl:item[operUrlKey.value],
|
|
29
|
+
// operIp:item[operIpKey.value],
|
|
30
|
+
// costTime:item[costTimeKey.value],
|
|
31
|
+
// operTime:item[operTimeKey.value],
|
|
32
|
+
//
|
|
33
|
+
// title: item[titleKey.value],
|
|
34
|
+
// businessType: item[businessTypeKey.value],
|
|
35
|
+
// status:item[statusKey.value]
|
|
36
|
+
// }
|
|
37
|
+
// })
|
|
38
|
+
// }
|
|
39
|
+
|
|
40
|
+
// 跳转到表单——以表单组来渲染纯表单
|
|
41
|
+
function toDetail(item) {
|
|
42
|
+
router.push({
|
|
43
|
+
name: 'XFormGroupView',
|
|
44
|
+
query: {
|
|
45
|
+
id: item[idKey.value],
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 新增功能
|
|
51
|
+
function addOption(totalCount) {
|
|
52
|
+
router.push({
|
|
53
|
+
name: 'XFormView',
|
|
54
|
+
params: { id: totalCount, openid: totalCount },
|
|
55
|
+
query: {
|
|
56
|
+
configName: configName.value,
|
|
57
|
+
serviceName: serviceName.value,
|
|
58
|
+
mode: '新增',
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 修改功能
|
|
64
|
+
function updateRow(result) {
|
|
65
|
+
router.push({
|
|
66
|
+
name: 'XFormView',
|
|
67
|
+
params: { id: result.o_id, openid: result.o_id },
|
|
68
|
+
query: {
|
|
69
|
+
configName: configName.value,
|
|
70
|
+
serviceName: serviceName.value,
|
|
71
|
+
mode: '修改',
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 删除功能
|
|
77
|
+
function deleteRow(result) {
|
|
78
|
+
emit('deleteRow', result.o_id)
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<NormalDataLayout id="XCellListView" title="工作计划">
|
|
84
|
+
<template #layout_content>
|
|
85
|
+
<XCellList
|
|
86
|
+
:config-name="configName"
|
|
87
|
+
:id-key="idKey"
|
|
88
|
+
@to-detail="toDetail"
|
|
89
|
+
@delete-row="deleteRow"
|
|
90
|
+
/>
|
|
91
|
+
</template>
|
|
92
|
+
</NormalDataLayout>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<style scoped lang="less">
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import XFormGroup from '@af-mobile-client-vue3/components/data/XFormGroup/index.vue'
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { onBeforeMount, ref } from 'vue'
|
|
5
|
+
import { showDialog } from 'vant'
|
|
6
|
+
// import {runLogic} from "@af-mobile-client-vue3/services/api/common";
|
|
7
|
+
|
|
8
|
+
// 纯表单
|
|
9
|
+
// const configName = ref("计划下发Form")
|
|
10
|
+
// const serviceName = ref("af-linepatrol")
|
|
11
|
+
|
|
12
|
+
// 表单组
|
|
13
|
+
const configName = ref("lngChargeAuditMobileFormGroup")
|
|
14
|
+
const serviceName = ref("af-gaslink")
|
|
15
|
+
|
|
16
|
+
const formData = ref({})
|
|
17
|
+
function submit(_result) {
|
|
18
|
+
showDialog({ message: '提交成功' }).then(() => {
|
|
19
|
+
history.back()
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// 表单组——数据
|
|
24
|
+
// function initComponents () {
|
|
25
|
+
// runLogic('getlngChargeAuditMobileFormGroupData', {id: 29}, 'af-gaslink').then((res) => {
|
|
26
|
+
// formData.value = {...res}
|
|
27
|
+
// })
|
|
28
|
+
// }
|
|
29
|
+
|
|
30
|
+
// 纯表单——数据
|
|
31
|
+
// function initComponents() {
|
|
32
|
+
// formData.value = { plan_name: 'af-llllll', plan_point: '1号点位', plan_single: '1号点位', plan_range: '2024-12-12' }
|
|
33
|
+
// }
|
|
34
|
+
|
|
35
|
+
// onBeforeMount(() => {
|
|
36
|
+
// initComponents()
|
|
37
|
+
// })
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<NormalDataLayout id="XFormGroupView" title="纯表单">
|
|
42
|
+
<template #layout_content>
|
|
43
|
+
<XFormGroup
|
|
44
|
+
:config-name="configName"
|
|
45
|
+
:service-name="serviceName"
|
|
46
|
+
:group-form-data="formData"
|
|
47
|
+
mode="查询"
|
|
48
|
+
@submit="submit"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
</NormalDataLayout>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<style scoped lang="less">
|
|
55
|
+
|
|
56
|
+
</style>
|
|
@@ -1,55 +1,134 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
25
|
-
const
|
|
26
|
-
|
|
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
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
NavBar as VanNavBar,
|
|
4
|
+
Space as VanSpace,
|
|
5
|
+
showDialog,
|
|
6
|
+
} from 'vant'
|
|
7
|
+
import XForm from '@af-mobile-client-vue3/components/data/XForm/index.vue'
|
|
8
|
+
import { useRoute } from 'vue-router'
|
|
9
|
+
import { defineEmits, getCurrentInstance, onBeforeMount, ref } from 'vue'
|
|
10
|
+
import { getConfigByName } from '@af-mobile-client-vue3/services/api/common'
|
|
11
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
12
|
+
import { post } from '@af-mobile-client-vue3/services/restTools'
|
|
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
|
+
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<template>
|
|
106
|
+
<NormalDataLayout id="XFormView" title="XForm表单">
|
|
107
|
+
<template #layout_content>
|
|
108
|
+
<VanSpace direction="vertical" fill>
|
|
109
|
+
<VanNavBar :title="title ? mode.concat(title) : null" />
|
|
110
|
+
<XForm
|
|
111
|
+
v-if="xFormInit"
|
|
112
|
+
ref="xForm"
|
|
113
|
+
:group-form-items="JSON.parse(JSON.stringify(groupFormItems))"
|
|
114
|
+
:service-name="serviceName"
|
|
115
|
+
:form-data="updateData"
|
|
116
|
+
:mode="mode"
|
|
117
|
+
style="margin-bottom: 14px;"
|
|
118
|
+
@on-submit="onSubmit"
|
|
119
|
+
/>
|
|
120
|
+
</VanSpace>
|
|
121
|
+
</template>
|
|
122
|
+
</NormalDataLayout>
|
|
123
|
+
</template>
|
|
124
|
+
|
|
125
|
+
<style scoped>
|
|
126
|
+
.van-doc-demo-block__title {
|
|
127
|
+
margin: 0;
|
|
128
|
+
padding: 32px 16px 16px;
|
|
129
|
+
color: black;
|
|
130
|
+
font-weight: 400;
|
|
131
|
+
font-size: 14px;
|
|
132
|
+
line-height: 16px;
|
|
133
|
+
}
|
|
134
|
+
</style>
|