af-mobile-client-vue3 1.2.1 → 1.2.3
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/data/XCellList/XCellList.md +63 -25
- package/src/components/data/XCellList/index.vue +34 -56
- package/src/components/data/XForm/index.vue +37 -1
- package/src/utils/queryFormDefaultRangePicker.ts +57 -57
- package/src/views/component/XCellListView/index.vue +55 -18
- package/src/views/component/XFormAppraiseView/index.vue +2 -2
- package/src/views/component/XFormGroupView/index.vue +7 -4
- package/src/views/user/login/LoginForm.vue +1 -1
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
## 功能特性
|
|
14
14
|
|
|
15
15
|
### 列表功能
|
|
16
|
+
|
|
16
17
|
- ✅ 下拉刷新
|
|
17
18
|
- ✅ 上拉加载
|
|
18
19
|
- ✅ 搜索过滤
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
- ✅ 自定义操作按钮
|
|
24
25
|
|
|
25
26
|
### 表单功能
|
|
27
|
+
|
|
26
28
|
- ✅ 支持多种表单项类型
|
|
27
29
|
- ✅ 表单分组
|
|
28
30
|
- ✅ 表单验证
|
|
@@ -77,41 +79,71 @@ function handleSubmit(data) {
|
|
|
77
79
|
</template>
|
|
78
80
|
```
|
|
79
81
|
|
|
82
|
+
### 表单功能(琉璃配置中的需要勾选的新增和修改)
|
|
83
|
+
|
|
84
|
+
```vue
|
|
85
|
+
<script setup lang="ts">
|
|
86
|
+
const configName = 'searchForm'
|
|
87
|
+
const serviceName = 'userService'
|
|
88
|
+
|
|
89
|
+
function addOption() {
|
|
90
|
+
console.log('新增表单')
|
|
91
|
+
}
|
|
92
|
+
function updateRow(item) {
|
|
93
|
+
console.log('修改表单:', item)
|
|
94
|
+
}
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<template>
|
|
98
|
+
<XCellList
|
|
99
|
+
:config-name="configName"
|
|
100
|
+
:service-name="serviceName"
|
|
101
|
+
:custom-add="true"
|
|
102
|
+
:custom-edit="true"
|
|
103
|
+
@update="updateRow"
|
|
104
|
+
@add="addOption"
|
|
105
|
+
/>
|
|
106
|
+
</template>
|
|
107
|
+
```
|
|
108
|
+
|
|
80
109
|
## API 文档
|
|
81
110
|
|
|
82
111
|
### XCellList Props
|
|
83
112
|
|
|
84
|
-
| 参数
|
|
85
|
-
|
|
86
|
-
| configName
|
|
87
|
-
| serviceName
|
|
88
|
-
| fixQueryForm | 固定查询参数
|
|
89
|
-
| idKey
|
|
113
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
114
|
+
| ------------ | ---------------------- | ------- | ------ |
|
|
115
|
+
| configName | 配置名称 | string | - |
|
|
116
|
+
| serviceName | 服务名称 | string | - |
|
|
117
|
+
| fixQueryForm | 固定查询参数 | object | null |
|
|
118
|
+
| idKey | 主键字段 | string | 'o_id' |
|
|
119
|
+
| customAdd | 是否采用自定义新增按钮 | boolean | false |
|
|
120
|
+
| customEdit | 是否采用自定义修改按钮 | boolean | false |
|
|
90
121
|
|
|
91
122
|
### XCellList Events
|
|
92
123
|
|
|
93
|
-
| 事件名
|
|
94
|
-
|
|
95
|
-
| toDetail | 点击详情时触发
|
|
96
|
-
|
|
|
124
|
+
| 事件名 | 说明 | 回调参数 |
|
|
125
|
+
| -------- | ---------------------------------------------- | ---------------- |
|
|
126
|
+
| toDetail | 点击详情时触发 | item: 当前项数据 |
|
|
127
|
+
| add | 点击新增按钮时触发(customAdd为true才会触发) | - |
|
|
128
|
+
| update | 点击修改按钮时触发(customEdit为true才会触发) | item: 当前项数据 |
|
|
97
129
|
|
|
98
130
|
### XFormGroup Props
|
|
99
131
|
|
|
100
|
-
| 参数
|
|
101
|
-
|
|
102
|
-
| configName
|
|
103
|
-
| serviceName
|
|
104
|
-
| groupFormData | 表单数据 | object
|
|
105
|
-
| mode
|
|
132
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
133
|
+
| ------------- | -------- | -------------------------- | ------ |
|
|
134
|
+
| configName | 配置名称 | string | '' |
|
|
135
|
+
| serviceName | 服务名称 | string | - |
|
|
136
|
+
| groupFormData | 表单数据 | object | {} |
|
|
137
|
+
| mode | 表单模式 | '查询' \| '新增' \| '修改' | '查询' |
|
|
106
138
|
|
|
107
139
|
### XFormItem Props
|
|
108
140
|
|
|
109
|
-
| 参数
|
|
110
|
-
|
|
111
|
-
| attr
|
|
112
|
-
| form
|
|
113
|
-
| mode
|
|
114
|
-
| showLabel | 是否显示标签 | boolean
|
|
141
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
142
|
+
| --------- | ------------ | ------------ | ------ |
|
|
143
|
+
| attr | 表单项配置 | FormItemAttr | - |
|
|
144
|
+
| form | 表单数据对象 | object | - |
|
|
145
|
+
| mode | 表单模式 | string | '查询' |
|
|
146
|
+
| showLabel | 是否显示标签 | boolean | true |
|
|
115
147
|
|
|
116
148
|
## 配置说明
|
|
117
149
|
|
|
@@ -219,9 +251,13 @@ const styleFunctionForValue = `function(value) {
|
|
|
219
251
|
2. 表单验证规则需要按照规范配置
|
|
220
252
|
3. 自定义函数需要使用字符串形式
|
|
221
253
|
4. 数据源配置支持多种方式:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
254
|
+
|
|
255
|
+
- logic@: 逻辑处理
|
|
256
|
+
- config@: 配置数据
|
|
257
|
+
- search@: 搜索数据5.对于默认的新增和修改功能,单表已经实现(也可以自定义),多表关联及自定义sql请使用自定义按钮实现
|
|
258
|
+
- 配置按钮状态(customAdd、customEdit)为 true
|
|
259
|
+
- 监听 add 和 update 事件
|
|
260
|
+
- 实现自定义逻辑
|
|
225
261
|
|
|
226
262
|
## 最佳实践
|
|
227
263
|
|
|
@@ -245,11 +281,13 @@ const styleFunctionForValue = `function(value) {
|
|
|
245
281
|
## 更新日志
|
|
246
282
|
|
|
247
283
|
### v1.0.0
|
|
284
|
+
|
|
248
285
|
- 初始版本发布
|
|
249
286
|
- 支持基础列表功能
|
|
250
287
|
- 支持表单配置
|
|
251
288
|
|
|
252
289
|
### v1.1.0
|
|
290
|
+
|
|
253
291
|
- 添加表单联动
|
|
254
292
|
- 优化列表性能
|
|
255
293
|
- 修复已知问题
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import { computed, defineEmits, defineProps, getCurrentInstance, onBeforeMount, ref, useSlots, watch } from 'vue'
|
|
24
24
|
import { useRouter } from 'vue-router'
|
|
25
25
|
|
|
26
|
-
const { configName, serviceName, fixQueryForm } = withDefaults(defineProps<{
|
|
26
|
+
const { configName, serviceName, fixQueryForm, customAdd, customEdit } = withDefaults(defineProps<{
|
|
27
27
|
configName?: string
|
|
28
28
|
fixQueryForm?: object
|
|
29
29
|
idKey?: string
|
|
@@ -33,17 +33,22 @@ const { configName, serviceName, fixQueryForm } = withDefaults(defineProps<{
|
|
|
33
33
|
type?: string | string[] // 显示类型:可以是单个类型或类型数组 'nfc' / ['scan', 'nfc']
|
|
34
34
|
defaultMode?: string // 默认模式
|
|
35
35
|
}
|
|
36
|
+
// 是否自定义新增、编辑按钮
|
|
37
|
+
customAdd?: boolean
|
|
38
|
+
customEdit?: boolean
|
|
36
39
|
}>(), {
|
|
37
40
|
configName: '',
|
|
38
41
|
fixQueryForm: null,
|
|
39
42
|
idKey: 'o_id',
|
|
40
43
|
serviceName: undefined,
|
|
41
44
|
scanOptions: undefined,
|
|
45
|
+
customAdd: false,
|
|
46
|
+
customEdit: false,
|
|
42
47
|
})
|
|
43
48
|
|
|
44
49
|
const emit = defineEmits<{
|
|
45
50
|
(e: 'toDetail', item: any): void
|
|
46
|
-
(e: 'update', item: any
|
|
51
|
+
(e: 'update', item: any): void
|
|
47
52
|
(e: 'deleteRow', item: any): void
|
|
48
53
|
(e: 'add'): void
|
|
49
54
|
(e: string, item: any): void
|
|
@@ -406,35 +411,22 @@ function onSelectMenu(item: any, event: any) {
|
|
|
406
411
|
})
|
|
407
412
|
}
|
|
408
413
|
else if (event.text === '修改') {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
let isHandledByParent = false
|
|
412
|
-
|
|
413
|
-
// 使用一个自定义事件来获取父组件的处理结果
|
|
414
|
-
const handledByParent = (handled: boolean) => {
|
|
415
|
-
isHandledByParent = handled
|
|
414
|
+
if (customEdit) {
|
|
415
|
+
emit('update', item)
|
|
416
416
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
417
|
+
else {
|
|
418
|
+
// 默认行为 - 导航到XForm页面
|
|
419
|
+
router.push({
|
|
420
|
+
name: 'XForm',
|
|
421
|
+
// params: { id: item },
|
|
422
|
+
query: {
|
|
423
|
+
groupFormItems: JSON.stringify(groupFormItems.value),
|
|
424
|
+
serviceName,
|
|
425
|
+
formData: JSON.stringify(item),
|
|
426
|
+
mode: '修改',
|
|
427
|
+
},
|
|
428
|
+
})
|
|
424
429
|
}
|
|
425
|
-
|
|
426
|
-
// 默认行为 - 导航到XForm页面
|
|
427
|
-
router.push({
|
|
428
|
-
name: 'XForm',
|
|
429
|
-
// params: { id: item },
|
|
430
|
-
query: {
|
|
431
|
-
groupFormItems: JSON.stringify(groupFormItems.value),
|
|
432
|
-
serviceName,
|
|
433
|
-
formData: JSON.stringify(item),
|
|
434
|
-
mode: '修改',
|
|
435
|
-
},
|
|
436
|
-
})
|
|
437
|
-
// emit('addOption', totalCount.value)
|
|
438
430
|
}
|
|
439
431
|
else {
|
|
440
432
|
emit(event.func, item)
|
|
@@ -443,35 +435,21 @@ function onSelectMenu(item: any, event: any) {
|
|
|
443
435
|
|
|
444
436
|
// 抛出新增按钮的事件
|
|
445
437
|
function addOption() {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
let isHandledByParent = false
|
|
449
|
-
|
|
450
|
-
// 使用一个自定义事件来获取父组件的处理结果
|
|
451
|
-
const handledByParent = (handled: boolean) => {
|
|
452
|
-
isHandledByParent = handled
|
|
438
|
+
if (customAdd) {
|
|
439
|
+
emit('add')
|
|
453
440
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
441
|
+
else {
|
|
442
|
+
// 默认行为 - 导航到XForm页面
|
|
443
|
+
router.push({
|
|
444
|
+
name: 'XForm',
|
|
445
|
+
query: {
|
|
446
|
+
groupFormItems: JSON.stringify(groupFormItems.value),
|
|
447
|
+
serviceName,
|
|
448
|
+
formData: JSON.stringify({}),
|
|
449
|
+
mode: '新增',
|
|
450
|
+
},
|
|
451
|
+
})
|
|
461
452
|
}
|
|
462
|
-
|
|
463
|
-
// 默认行为 - 导航到XForm页面
|
|
464
|
-
router.push({
|
|
465
|
-
name: 'XForm',
|
|
466
|
-
// params: { id: totalCount.value },
|
|
467
|
-
query: {
|
|
468
|
-
groupFormItems: JSON.stringify(groupFormItems.value),
|
|
469
|
-
serviceName,
|
|
470
|
-
formData: JSON.stringify({}),
|
|
471
|
-
mode: '新增',
|
|
472
|
-
},
|
|
473
|
-
})
|
|
474
|
-
// emit('addOption', totalCount.value)
|
|
475
453
|
}
|
|
476
454
|
|
|
477
455
|
// 处理按钮点击
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { FormInstance } from 'vant'
|
|
3
3
|
import XFormItem from '@af-mobile-client-vue3/components/data/XFormItem/index.vue'
|
|
4
|
+
import { addOrModifyEntity } from '@af-mobile-client-vue3/services/api/common'
|
|
4
5
|
import { post } from '@af-mobile-client-vue3/services/restTools'
|
|
5
6
|
import {
|
|
7
|
+
showFailToast,
|
|
8
|
+
showSuccessToast,
|
|
6
9
|
Button as VanButton,
|
|
7
10
|
CellGroup as VanCellGroup,
|
|
8
11
|
Form as VanForm,
|
|
@@ -21,6 +24,7 @@ interface GroupFormItems {
|
|
|
21
24
|
formJson: any[] // 根据实际类型调整
|
|
22
25
|
showSubmitBtn?: boolean
|
|
23
26
|
groupName?: string
|
|
27
|
+
tableName?: string
|
|
24
28
|
}
|
|
25
29
|
const props = withDefaults(defineProps<{
|
|
26
30
|
configName?: string
|
|
@@ -48,6 +52,7 @@ const formGroupName = ref<string | null>(null)
|
|
|
48
52
|
const myServiceName = ref('')
|
|
49
53
|
const loaded = ref(false)
|
|
50
54
|
let myGetDataParams = reactive({})
|
|
55
|
+
const tableName = ref('')
|
|
51
56
|
|
|
52
57
|
const internalFormConfig = ref<GroupFormItems | null>(null)
|
|
53
58
|
const internalSubmitButton = ref<boolean | undefined>(undefined)
|
|
@@ -71,6 +76,9 @@ const resolvedSubmitButton = computed(() => {
|
|
|
71
76
|
|
|
72
77
|
onBeforeMount(() => {
|
|
73
78
|
if (!props.configName && props.groupFormItems) {
|
|
79
|
+
if (props.groupFormItems && props.groupFormItems.tableName) {
|
|
80
|
+
tableName.value = props.groupFormItems.tableName.split(' ')[0] || ''
|
|
81
|
+
}
|
|
74
82
|
init({ formItems: props.groupFormItems, serviceName: props.serviceName, formData: props.formData, formName: props.formName })
|
|
75
83
|
}
|
|
76
84
|
})
|
|
@@ -201,8 +209,36 @@ function setForm(obj) {
|
|
|
201
209
|
Object.assign(form.value, obj)
|
|
202
210
|
}
|
|
203
211
|
|
|
212
|
+
// 获取表单字段实际值
|
|
213
|
+
function getRealKey(form) {
|
|
214
|
+
const result = {}
|
|
215
|
+
for (const key in form) {
|
|
216
|
+
result[key.substring(key.indexOf('_') + 1)] = form[key]
|
|
217
|
+
}
|
|
218
|
+
return result
|
|
219
|
+
}
|
|
220
|
+
|
|
204
221
|
function onSubmit() {
|
|
205
|
-
|
|
222
|
+
if (!props.configName && props.groupFormItems) {
|
|
223
|
+
// 只有单表才可以成功,多表关联或者自定义sql不行
|
|
224
|
+
const params = getRealKey(form.value)
|
|
225
|
+
try {
|
|
226
|
+
addOrModifyEntity(params, tableName.value, 'af-gaslink').then(() => {
|
|
227
|
+
showSuccessToast('提交成功!')
|
|
228
|
+
})
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
showFailToast('提交失败!')
|
|
232
|
+
}
|
|
233
|
+
finally {
|
|
234
|
+
setTimeout(() => {
|
|
235
|
+
history.back()
|
|
236
|
+
}, 1000)
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
emits('onSubmit', form.value)
|
|
241
|
+
}
|
|
206
242
|
}
|
|
207
243
|
async function validate() {
|
|
208
244
|
await formRef.value?.validate()
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 根据类型获取日期区间字符串
|
|
3
|
-
* @param type '当年' | 'curMonth' | '当日'
|
|
4
|
-
* @param show 区分实际值还是显示值, true为实际值, false为显示值
|
|
5
|
-
* @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
|
|
6
|
-
*/
|
|
7
|
-
export function getRangeByType(type: string, show: boolean): [string, string] {
|
|
8
|
-
const now = new Date()
|
|
9
|
-
const year = now.getFullYear()
|
|
10
|
-
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
|
11
|
-
const day = now.getDate().toString().padStart(2, '0')
|
|
12
|
-
|
|
13
|
-
if (!show) {
|
|
14
|
-
if (type === 'curYear') {
|
|
15
|
-
return [
|
|
16
|
-
`${year}-01-01 00:00:00`,
|
|
17
|
-
`${year}-12-31 23:59:59`,
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
if (type === 'curMonth') {
|
|
21
|
-
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
22
|
-
return [
|
|
23
|
-
`${year}-${month}-01 00:00:00`,
|
|
24
|
-
`${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
if (type === 'curDay') {
|
|
28
|
-
return [
|
|
29
|
-
`${year}-${month}-${day} 00:00:00`,
|
|
30
|
-
`${year}-${month}-${day} 23:59:59`,
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (show) {
|
|
35
|
-
if (type === 'curYear') {
|
|
36
|
-
return [
|
|
37
|
-
`${year}-01-01`,
|
|
38
|
-
`${year}-12-31`,
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
if (type === 'curMonth') {
|
|
42
|
-
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
43
|
-
return [
|
|
44
|
-
`${year}-${month}-01`,
|
|
45
|
-
`${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
if (type === 'curDay') {
|
|
49
|
-
return [
|
|
50
|
-
`${year}-${month}-${day}`,
|
|
51
|
-
`${year}-${month}-${day}`,
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// 兜底返回空字符串数组
|
|
56
|
-
return ['', '']
|
|
57
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 根据类型获取日期区间字符串
|
|
3
|
+
* @param type '当年' | 'curMonth' | '当日'
|
|
4
|
+
* @param show 区分实际值还是显示值, true为实际值, false为显示值
|
|
5
|
+
* @returns [start, end] 例:['2024-01-01 00:00:00', '2024-12-31 23:59:59']
|
|
6
|
+
*/
|
|
7
|
+
export function getRangeByType(type: string, show: boolean): [string, string] {
|
|
8
|
+
const now = new Date()
|
|
9
|
+
const year = now.getFullYear()
|
|
10
|
+
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
|
11
|
+
const day = now.getDate().toString().padStart(2, '0')
|
|
12
|
+
|
|
13
|
+
if (!show) {
|
|
14
|
+
if (type === 'curYear') {
|
|
15
|
+
return [
|
|
16
|
+
`${year}-01-01 00:00:00`,
|
|
17
|
+
`${year}-12-31 23:59:59`,
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
if (type === 'curMonth') {
|
|
21
|
+
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
22
|
+
return [
|
|
23
|
+
`${year}-${month}-01 00:00:00`,
|
|
24
|
+
`${year}-${month}-${lastDay.toString().padStart(2, '0')} 23:59:59`,
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
if (type === 'curDay') {
|
|
28
|
+
return [
|
|
29
|
+
`${year}-${month}-${day} 00:00:00`,
|
|
30
|
+
`${year}-${month}-${day} 23:59:59`,
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (show) {
|
|
35
|
+
if (type === 'curYear') {
|
|
36
|
+
return [
|
|
37
|
+
`${year}-01-01`,
|
|
38
|
+
`${year}-12-31`,
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
if (type === 'curMonth') {
|
|
42
|
+
const lastDay = new Date(year, now.getMonth() + 1, 0).getDate()
|
|
43
|
+
return [
|
|
44
|
+
`${year}-${month}-01`,
|
|
45
|
+
`${year}-${month}-${lastDay.toString().padStart(2, '0')}`,
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
if (type === 'curDay') {
|
|
49
|
+
return [
|
|
50
|
+
`${year}-${month}-${day}`,
|
|
51
|
+
`${year}-${month}-${day}`,
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// 兜底返回空字符串数组
|
|
56
|
+
return ['', '']
|
|
57
|
+
}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import XCellList from '@af-mobile-client-vue3/components/data/XCellList/index.vue'
|
|
3
3
|
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { useUserStore } from '@af-mobile-client-vue3/stores/modules/user'
|
|
4
5
|
import { defineEmits, ref } from 'vue'
|
|
5
6
|
import { useRouter } from 'vue-router'
|
|
6
7
|
|
|
7
8
|
// 定义事件
|
|
8
9
|
const emit = defineEmits(['deleteRow'])
|
|
10
|
+
const userInfo = useUserStore().getUserInfo()
|
|
9
11
|
// 访问路由
|
|
10
12
|
const router = useRouter()
|
|
11
13
|
// 获取默认值
|
|
12
14
|
const idKey = ref('o_id')
|
|
13
15
|
|
|
14
16
|
// 简易crud表单测试
|
|
15
|
-
const configName = ref('
|
|
17
|
+
// const configName = ref('orderCarInMobileCRUD')
|
|
18
|
+
// const serviceName = ref('af-gaslink')
|
|
19
|
+
// const configName = ref('lngPriceManageMobileCRUD')
|
|
20
|
+
const configName = ref('测试2')
|
|
16
21
|
const serviceName = ref('af-gaslink')
|
|
22
|
+
// const configName = ref('mobile_liushuiQueryCRUD')
|
|
23
|
+
// const serviceName = ref('af-revenue')
|
|
17
24
|
|
|
18
25
|
// 资源权限测试
|
|
19
26
|
// const configName = ref('crud_sources_test')
|
|
@@ -49,11 +56,11 @@ const serviceName = ref('af-gaslink')
|
|
|
49
56
|
function toDetail(item) {
|
|
50
57
|
router.push({
|
|
51
58
|
name: 'XFormGroupView',
|
|
52
|
-
query: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
59
|
+
// query: {
|
|
60
|
+
// id: item[idKey.value],
|
|
61
|
+
// id: item.rr_id,
|
|
62
|
+
// o_id: item.o_id,
|
|
63
|
+
// },
|
|
57
64
|
})
|
|
58
65
|
}
|
|
59
66
|
|
|
@@ -69,19 +76,35 @@ function toDetail(item) {
|
|
|
69
76
|
// },
|
|
70
77
|
// })
|
|
71
78
|
// }
|
|
79
|
+
function addOption() {
|
|
80
|
+
router.push({
|
|
81
|
+
name: 'XFormGroupView',
|
|
82
|
+
// params: { id: totalCount.value },
|
|
83
|
+
// query: {
|
|
84
|
+
// configName: configName.value,
|
|
85
|
+
// serviceName: serviceName.value,
|
|
86
|
+
// mode: '新增',
|
|
87
|
+
// },
|
|
88
|
+
})
|
|
89
|
+
// 如果存在回调函数,调用它并传递true表示已处理
|
|
90
|
+
// if (typeof callback === 'function') {
|
|
91
|
+
// callback(true)
|
|
92
|
+
// }
|
|
93
|
+
}
|
|
72
94
|
|
|
73
95
|
// 修改功能
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
|
|
96
|
+
function updateRow(result) {
|
|
97
|
+
console.log('用户----', userInfo)
|
|
98
|
+
router.push({
|
|
99
|
+
name: 'XFormGroupView',
|
|
100
|
+
// params: { id: result.o_id, openid: result.o_id },
|
|
101
|
+
// query: {
|
|
102
|
+
// configName: configName.value,
|
|
103
|
+
// serviceName: serviceName.value,
|
|
104
|
+
// mode: '修改',
|
|
105
|
+
// },
|
|
106
|
+
})
|
|
107
|
+
}
|
|
85
108
|
|
|
86
109
|
// 删除功能
|
|
87
110
|
function deleteRow(result) {
|
|
@@ -95,11 +118,25 @@ function deleteRow(result) {
|
|
|
95
118
|
<XCellList
|
|
96
119
|
:config-name="configName"
|
|
97
120
|
:service-name="serviceName"
|
|
98
|
-
:
|
|
121
|
+
:custom-add="true"
|
|
122
|
+
:custom-edit="true"
|
|
99
123
|
:id-key="idKey"
|
|
100
124
|
@to-detail="toDetail"
|
|
101
125
|
@delete-row="deleteRow"
|
|
126
|
+
@update="updateRow"
|
|
127
|
+
@add="addOption"
|
|
102
128
|
/>
|
|
129
|
+
|
|
130
|
+
<!-- :fix-query-form="{ u_f_price_state: ['生效', '待生效'] }" -->
|
|
131
|
+
|
|
132
|
+
<!-- <XCellList -->
|
|
133
|
+
<!-- :config-name="configName" -->
|
|
134
|
+
<!-- :service-name="serviceName" -->
|
|
135
|
+
<!-- :fix-query-form="{ o_f_oper_name: 'edu_test' }" -->
|
|
136
|
+
<!-- :id-key="idKey" -->
|
|
137
|
+
<!-- @to-detail="toDetail" -->
|
|
138
|
+
<!-- @delete-row="deleteRow" -->
|
|
139
|
+
<!-- /> -->
|
|
103
140
|
</template>
|
|
104
141
|
</NormalDataLayout>
|
|
105
142
|
</template>
|
|
@@ -100,8 +100,8 @@ function onSubmit(params) {
|
|
|
100
100
|
}
|
|
101
101
|
function closeWindows() {
|
|
102
102
|
const ua = window.navigator.userAgent.toLowerCase()
|
|
103
|
-
if (ua.includes('micromessenger') && typeof WeixinJSBridge !== 'undefined') {
|
|
104
|
-
WeixinJSBridge.call('closeWindow')
|
|
103
|
+
if (ua.includes('micromessenger') && typeof (window as any).WeixinJSBridge !== 'undefined') {
|
|
104
|
+
(window as any).WeixinJSBridge.call('closeWindow')
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
107
|
// 关闭页面
|
|
@@ -5,16 +5,19 @@ import { showDialog } from 'vant'
|
|
|
5
5
|
import { ref } from 'vue'
|
|
6
6
|
import { useRoute } from 'vue-router'
|
|
7
7
|
|
|
8
|
+
// const configName = ref('reviewFormGroup')
|
|
9
|
+
// const serviceName = ref('af-revenue')
|
|
10
|
+
|
|
8
11
|
// 纯表单
|
|
9
|
-
const configName = ref('form_check_test')
|
|
10
|
-
const serviceName = ref('af-system')
|
|
12
|
+
// const configName = ref('form_check_test')
|
|
13
|
+
// const serviceName = ref('af-system')
|
|
11
14
|
|
|
12
15
|
// const configName = ref("计划下发Form")
|
|
13
16
|
// const serviceName = ref("af-linepatrol")
|
|
14
17
|
|
|
15
18
|
// 表单组
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const configName = ref('lngChargeAuditMobileFormGroup')
|
|
20
|
+
const serviceName = ref('af-gaslink')
|
|
18
21
|
|
|
19
22
|
const formData = ref({})
|
|
20
23
|
const formGroup = ref(null)
|